minimization handling for UEFI disk images

This commit is contained in:
Steve Langasek 2017-09-28 09:38:23 -04:00 committed by Balint Reczey
parent 1ca59f1c3a
commit b32298ede1

View File

@ -61,6 +61,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
# The modules below only make sense on non-Secure Boot UEFI systems.
@ -132,6 +140,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