[Merge] ~gjolly/livecd-rootfs:ubuntu-cpc/mount_esp_on_boot into livecd-rootfs:ubuntu/master

Steve Langasek mp+433639 at code.launchpad.net
Thu Feb 2 13:52:34 UTC 2023



Diff comments:

> 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 8ef4fca..a653b7c 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
> @@ -458,16 +475,34 @@ EOF
>  
>  disk_image=binary/boot/disk-uefi.ext4
>  
> +# create the disk
>  create_empty_disk_image "${disk_image}"
>  create_partitions "${disk_image}"
>  mount_image "${disk_image}" 1
>  
> -# Copy the chroot in to the disk
> +# create and mount the rootfs partition
>  make_ext4_partition "${rootfs_dev_mapper}"
>  mkdir mountpoint
>  mount "${rootfs_dev_mapper}" mountpoint
> -cp -a chroot/* mountpoint/
> -umount mountpoint
> +
> +# create and mount the ESP
> +create_and_mount_uefi_partition mountpoint
> +
> +# Copy the chroot in to the disk
> +# ...first copy the boot folder, this
> +# will return a non-0 exit code because boot
> +# contains symlinks that cannot be copied on
> +# the vfat partition
> +cp -a chroot/boot/* mountpoint/boot/ || true

We don't use the symlinks (/boot/initrd.img, /boot/vmlinuz) for boot from grub on any image; these are definitely legacy on everything other than s390x (and probably on s390x as well, I just can't speak authoritatively to the boot scripts there).  I think it is reasonable to evaluate their removal across all images as they're just cruft, and it's actually possible for them to be out of sync with grub's own idea of what is the current / previous kernel.

> +
> +# ...then copy everything else, we don't
> +# expect any error here
> +cp -a chroot/!(boot) mountpoint/
> +
> +configure_chroot mountpoint
> +
> +# cleanup the mount
> +umount -R mountpoint
>  rmdir mountpoint
>  
>  install_grub


-- 
https://code.launchpad.net/~gjolly/livecd-rootfs/+git/livecd-rootfs/+merge/433639
Your team Ubuntu Core Development Team is requested to review the proposed merge of ~gjolly/livecd-rootfs:ubuntu-cpc/mount_esp_on_boot into livecd-rootfs:ubuntu/master.




More information about the Ubuntu-reviews mailing list