#!/usr/bin/env bash # Vasile needs root privileges and a proper kernel to run kernelconfig checkroot export local mainarch="x86_64" export local isoname=""$releasename"-"$releasetarget"-"$releaseversion"-"$mainarch"" export local coremnt="/tmp/"$isoname"" export local livedir=""$isoname"/livecd" export local isoboot=""$isoname"/boot/grub" export local isoefiboot=""$isoname"/efi/boot" export local kernelname="kernel-genkernel-"$mainarch"-"$kernelver"" export local ramfsname="initramfs-genkernel-"$mainarch"-"$kernelver"" makeisox64 () { # ISO layout mkdir -p "$coremnt" mkdir -p "$isoboot" mkdir -p "$isoefiboot" # Mount && Sync squashed core (Kogaion stage4) into live environment mount -t squashfs "$chrootx64" "$coremnt" rsync -aHAXr --progress "$coremnt/" "$livedir/" # Put our kernel and initramfs in place cp -avx ""$livedir"/boot/"$kernelname"" ""$isoname"/boot/"$releasename"" cp -avx ""$livedir"/boot/"$ramfsname"" ""$isoname"/boot/"$releasename".igz" # Checksum the kernel && initramfs sha256sum ""$isoname"/boot/"$releasename"" | tee ""$isoname"/boot/"$releasename".sha256" sha256sum ""$isoname"/boot/"$releasename.igz"" | tee ""$isoname"/boot/"$releasename".igz.sha256" # Squash live environment mksquashfs "$livedir" ""$livedir".squashfs" -b 1048576 -comp xz -Xdict-size 100% # Checksum the live environment sha256sum ""$livedir".squashfs" | tee ""$livedir".squashfs.sha256" # Remove live environment directory (we have it squashed now, no longer needed) rm -rf "$livedir" # Enable liveboot touch "$livedir" # Umount squashed core (Kogaion stage4) umount "$coremnt" } main () { chrootchecksumx64 makeisox64 } main