From 0365171ce3e9f9e6279257271dae64b42d541eb3 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 26 Sep 2017 22:39:09 -0400 Subject: [PATCH] minimization handling for UEFI disk images --- live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary index dd48af3f..fa805bf6 100755 --- a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary @@ -62,6 +62,14 @@ install_grub() { efi_boot_dir="/boot/efi/EFI/BOOT" chroot mountpoint mkdir -p "${efi_boot_dir}" + if [ "$SUBPROJECT" = minimize ] && [ -n "$partuuid" ]; then + # FIXME: code duplicated between 032-disk-image.binary + # and 033-disk-image-uefi.binary. We want to fix this to not + # have initramfs-tools installed at all on these images. + echo "partuuid found for root device; omitting initrd" + echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub + fi + chroot mountpoint apt-get -y update # UEFI GRUB modules are meant to be used equally by Secure Boot and @@ -122,6 +130,8 @@ create_empty_disk_image "${disk_image}" create_partitions "${disk_image}" mount_image "${disk_image}" 1 +partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper") + # Copy the chroot in to the disk make_ext4_partition "${rootfs_dev_mapper}" mkdir mountpoint