[neon/neon/livecd-rootfs/Neon/release-lts] live-build/ubuntu-cpc/hooks.d/base: Boot with an initramfs by default in cloud images

Pat Viafore null at kde.org
Fri Mar 12 10:45:26 GMT 2021


Git commit 6a378339738aa4299653f24eb3b4dbc54a6892a9 by Pat Viafore, on behalf of David Krauser.
Committed on 18/02/2021 at 21:40.
Pushed by jriddell into branch 'Neon/release-lts'.

Boot with an initramfs by default in cloud images

Generic cloud images with the linux-generic kernel are not able to
boot without an initramfs. Previously, these images attempted to boot
without an initramfs, would fail, and then retry with an initramfs.
This slows the boot and is confusing behavior.

M  +0    -10   live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
M  +0    -11   live-build/ubuntu-cpc/hooks.d/base/disk-image.binary

https://invent.kde.org/neon/neon/livecd-rootfs/commit/6a378339738aa4299653f24eb3b4dbc54a6892a9

diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
index b9b5aa17..19f5e15f 100755
--- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
+++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
@@ -109,14 +109,6 @@ install_grub() {
     efi_boot_dir="/boot/efi/EFI/BOOT"
     chroot mountpoint mkdir -p "${efi_boot_dir}"
 
-    if [ -n "$partuuid" ]; then
-        # FIXME: code duplicated between disk-image.binary
-        # and 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.d/40-force-partuuid.cfg
-    fi
-
     chroot mountpoint apt-get -y update
 
     # UEFI GRUB modules are meant to be used equally by Secure Boot and
@@ -241,8 +233,6 @@ 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
diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary
index 502860e2..1b31b446 100755
--- a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary
+++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary
@@ -73,8 +73,6 @@ create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1 ext2 "$R
 
 mount_image "${disk_image}" "$ROOTPART"
 
-partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper")
-
 # Copy the chroot in to the disk
 make_ext4_partition "${rootfs_dev_mapper}"
 mkdir mountpoint
@@ -122,15 +120,6 @@ if [ "${should_install_grub}" -eq 1 ]; then
         ${loop_device}
 
     rm mountpoint/tmp/device.map
-
-	if [ -n "$partuuid" ]; then
-		echo "partuuid found for root device; forcing it in Grub"
-		mkdir -p mountpoint/etc/default/grub.d
-		echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub.d/40-force-partuuid.cfg
-		divert_grub mountpoint
-		chroot mountpoint update-grub
-		undivert_grub mountpoint
-	fi
 fi
 
 if [ "$ARCH" = "s390x" ]; then



More information about the Neon-commits mailing list