diff --git a/assemble_image.sh b/assemble_image.sh index 47c4958e7659339e3570724300cc5b30c3aa811a..836ae77d63e13b94d113039f5e8e984ad31e06b1 100755 --- a/assemble_image.sh +++ b/assemble_image.sh @@ -24,8 +24,14 @@ rsync -av /usr/share/grub/unicode.pf2 "$workspace/part_files"/grub/fonts/ mv "$workspace/part_files"/grub/* "$workspace/part_files"/boot/grub/ rm -rf "$workspace/part_files"/grub -cp "$kubuntu" "$workspace/part_files/kubuntu.iso" -cp "$xubuntu" "$workspace/part_files/xubuntu.iso" +rsync --size-only --checksum "$kubuntu" "$workspace/part_files/" +rsync --size-only --checksum "$xubuntu" "$workspace/part_files/" + +source ./grub_config.sh # functions to fill grub_template.cfg +cp grub_template.cfg "$workspace/part_files/boot/grub/grub.cfg" +fill_grub_config_template "$kubuntu" "KDE" "$workspace/part_files/boot/grub/grub.cfg" +fill_grub_config_template "$xubuntu" "XFCE" "$workspace/part_files/boot/grub/grub.cfg" + ./create_offlinerepo.sh "$workspace/part_files/archives" "$kubuntu" $(grep '^[^#]' packages | cut -d'|' -f 2) cp packages "$workspace/part_files/packages" diff --git a/grub_config.sh b/grub_config.sh index e51d12e36156dd80eaa8ab956f8e9b84e7e78cea..fdfce67b5f9b24ac28cfccf721b4b1ad2f35a17e 100755 --- a/grub_config.sh +++ b/grub_config.sh @@ -23,7 +23,7 @@ function extract_release() { echo "${flavor^} $number" # ^ capitalizes 1st letter } -function sed_grub_template() { +function fill_grub_config_template() { iso_file="$1" distribution_grep="$2" # KDE / XFCE sed_target="$3" @@ -33,12 +33,8 @@ function sed_grub_template() { sed "s|__${distribution_grep}_ISONAME__|$iso_file|g" -i "$sed_target" } - - -kubuntu=kubuntu-18.04.1-desktop-amd64.iso -xubuntu=xubuntu-18.04.1-desktop-amd64.iso -grub_template="grub_template.cfg" -grub_target="grub_target.cfg" -cp "$grub_template" "$grub_target" -sed_grub_template "$kubuntu" "KDE" "$grub_target" -sed_grub_template "$xubuntu" "XFCE" "$grub_target" +# image flavors to put in the grub config +# usage after sourcing (modifies grub_template_copy.cfg) +# cp grub_template.cfg grub_template_copy.cfg +# fill_grub_config_template "kubuntu-18.04.1-desktop-amd64.iso" "KDE" "grub_template_copy.cfg" +# fill_grub_config_template "xubuntu-18.04.1-desktop-amd64.iso" "XFCE" "grub_template_copy.cfg" diff --git a/grub_template.cfg b/grub_template.cfg index 7ee0b9d36ffb5357d28b6956ff659987b43823fd..980d76649b9697fda7cb92e5069adac2b7525436 100644 --- a/grub_template.cfg +++ b/grub_template.cfg @@ -16,7 +16,7 @@ set gfxpayload=keep function kde_LoadCasper { loopback loop ($root)/${kde_isoname} echo "Loading kernel" - linux (loop)__KDE_KERNEL__ boot=casper file=/isodevice/preseed/lip.seed ${cmdline} iso-scan/filename=/kubuntu.iso sysrq_always_enabled pstore.pstore_disable nosplash verbose -- + linux (loop)__KDE_KERNEL__ boot=casper file=/isodevice/preseed/lip.seed ${cmdline} iso-scan/filename=/__KDE_ISONAME__ sysrq_always_enabled pstore.pstore_disable nosplash verbose -- echo "Loading initrd" initrd (loop)__KDE_INITRD__ echo "Starting kernel" @@ -57,7 +57,7 @@ function kde_menu { function xfce_LoadCasper { loopback loop ($root)/${xfce_isoname} echo "Loading kernel" - linux (loop)__XFCE_KERNEL__ boot=casper file=/isodevice/preseed/lip.seed ${cmdline} iso-scan/filename=/kubuntu.iso sysrq_always_enabled pstore.pstore_disable nosplash verbose -- + linux (loop)__XFCE_KERNEL__ boot=casper file=/isodevice/preseed/lip.seed ${cmdline} iso-scan/filename=/__XFCE_ISONAME__ sysrq_always_enabled pstore.pstore_disable nosplash verbose -- echo "Loading initrd" initrd (loop)__XFCE_INITRD__ echo "Starting kernel"