mirror of
				https://git.launchpad.net/livecd-rootfs
				synced 2025-10-31 08:54:06 +00:00 
			
		
		
		
	Imported 2.664.18
No reason for CPC update specified.
This commit is contained in:
		
							parent
							
								
									5b523f35fb
								
							
						
					
					
						commit
						fe88b51b63
					
				
							
								
								
									
										8
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							| @ -1,3 +1,11 @@ | |||||||
|  | livecd-rootfs (2.664.18) focal; urgency=medium | ||||||
|  | 
 | ||||||
|  |   [ Patrick Viafore ] | ||||||
|  |   * Only try without initrd-less on replaced kernels, not all kernels | ||||||
|  |   * Provide a mechanism to detect initrd-less fallback (LP: #1870189) | ||||||
|  | 
 | ||||||
|  |  -- Robert C Jennings <robert.jennings@canonical.com>  Tue, 23 Feb 2021 14:45:23 -0600 | ||||||
|  | 
 | ||||||
| livecd-rootfs (2.664.17) focal; urgency=medium | livecd-rootfs (2.664.17) focal; urgency=medium | ||||||
| 
 | 
 | ||||||
|   [ David Krauser ] |   [ David Krauser ] | ||||||
|  | |||||||
| @ -987,4 +987,52 @@ replace_kernel () { | |||||||
|         install --assume-yes "${new_kernel}"  |         install --assume-yes "${new_kernel}"  | ||||||
|     env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \ |     env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \ | ||||||
|         autoremove --purge --assume-yes |         autoremove --purge --assume-yes | ||||||
|  | 
 | ||||||
|  |     # If running a custom kernel, we should try to boot without an initramfs | ||||||
|  |     # We do this by setting GRUB_FORCE_PARTUUID, which forces initramfs-less boot | ||||||
|  |     force_boot_without_initramfs ${mountpoint} | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | track_initramfs_boot_fallback() { | ||||||
|  |     mountpoint=$1 | ||||||
|  |     cat <<END > "${mountpoint}/etc/grub.d/01_track_initrdless_boot_fallback" | ||||||
|  | #! /bin/sh | ||||||
|  | # ${IMAGE_STR} | ||||||
|  | # This will detect if we attempt to boot with an initramfs and fail. | ||||||
|  | # In the case of a failure, initrdless_boot_fallback_triggered is set to | ||||||
|  | # a non-zero value in the grubenv. This value can be checked after boot | ||||||
|  | # by looking in /boot/grub/grubenv or by using the grub-editenv list command. | ||||||
|  | set -e | ||||||
|  | END | ||||||
|  |     cat <<"END" >> "${mountpoint}/etc/grub.d/01_track_initrdless_boot_fallback" | ||||||
|  | cat <<"EOF" | ||||||
|  | if [ -n "${have_grubenv}" ]; then | ||||||
|  |   if [ -n "${initrdfail}" ]; then | ||||||
|  |     set initrdless_boot_fallback_triggered="${initrdfail}" | ||||||
|  |   else | ||||||
|  |     set initrdless_boot_fallback_triggered=0 | ||||||
|  |   fi | ||||||
|  |   save_env initrdless_boot_fallback_triggered | ||||||
|  | fi | ||||||
|  | EOF | ||||||
|  | END | ||||||
|  |     chmod +x "${mountpoint}/etc/grub.d/01_track_initrdless_boot_fallback" | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | force_boot_without_initramfs() { | ||||||
|  |     mountpoint=$1 | ||||||
|  | 
 | ||||||
|  |     partuuid=$(blkid -s PARTUUID -o value $(findmnt -n -o SOURCE --target "${mountpoint}")) | ||||||
|  |     if [ -n "${partuuid}" ]; then | ||||||
|  |         echo "Force booting without an initramfs..." | ||||||
|  |         mkdir -p "${mountpoint}/etc/default/grub.d" | ||||||
|  |         cat << EOF >> "${mountpoint}/etc/default/grub.d/40-force-partuuid.cfg" | ||||||
|  | # Force boot without an initramfs by setting GRUB_FORCE_PARTUUID | ||||||
|  | # Remove this line to enable boot with an initramfs | ||||||
|  | GRUB_FORCE_PARTUUID=${partuuid} | ||||||
|  | EOF | ||||||
|  |         divert_grub "${mountpoint}" | ||||||
|  |         chroot "${mountpoint}" update-grub | ||||||
|  |         undivert_grub "${mountpoint}" | ||||||
|  |     fi | ||||||
| } | } | ||||||
|  | |||||||
| @ -109,14 +109,6 @@ install_grub() { | |||||||
|     efi_boot_dir="/boot/efi/EFI/BOOT" |     efi_boot_dir="/boot/efi/EFI/BOOT" | ||||||
|     chroot mountpoint mkdir -p "${efi_boot_dir}" |     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 |     chroot mountpoint apt-get -y update | ||||||
| 
 | 
 | ||||||
|     # UEFI GRUB modules are meant to be used equally by Secure Boot and |     # UEFI GRUB modules are meant to be used equally by Secure Boot and | ||||||
| @ -222,6 +214,7 @@ EOF | |||||||
|     fi |     fi | ||||||
| 
 | 
 | ||||||
|     divert_grub mountpoint |     divert_grub mountpoint | ||||||
|  |     track_initramfs_boot_fallback mountpoint | ||||||
|     chroot mountpoint update-grub |     chroot mountpoint update-grub | ||||||
|     replace_grub_root_with_label mountpoint |     replace_grub_root_with_label mountpoint | ||||||
|     undivert_grub mountpoint |     undivert_grub mountpoint | ||||||
| @ -241,8 +234,6 @@ create_empty_disk_image "${disk_image}" | |||||||
| create_partitions "${disk_image}" | create_partitions "${disk_image}" | ||||||
| mount_image "${disk_image}" 1 | mount_image "${disk_image}" 1 | ||||||
| 
 | 
 | ||||||
| partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper") |  | ||||||
| 
 |  | ||||||
| # Copy the chroot in to the disk | # Copy the chroot in to the disk | ||||||
| make_ext4_partition "${rootfs_dev_mapper}" | make_ext4_partition "${rootfs_dev_mapper}" | ||||||
| mkdir mountpoint | mkdir mountpoint | ||||||
|  | |||||||
| @ -73,8 +73,6 @@ create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1 ext2 "$R | |||||||
| 
 | 
 | ||||||
| mount_image "${disk_image}" "$ROOTPART" | mount_image "${disk_image}" "$ROOTPART" | ||||||
| 
 | 
 | ||||||
| partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper") |  | ||||||
| 
 |  | ||||||
| # Copy the chroot in to the disk | # Copy the chroot in to the disk | ||||||
| make_ext4_partition "${rootfs_dev_mapper}" | make_ext4_partition "${rootfs_dev_mapper}" | ||||||
| mkdir mountpoint | mkdir mountpoint | ||||||
| @ -121,16 +119,12 @@ if [ "${should_install_grub}" -eq 1 ]; then | |||||||
|         --device-map=/tmp/device.map \ |         --device-map=/tmp/device.map \ | ||||||
|         ${loop_device} |         ${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 |     divert_grub mountpoint | ||||||
|  |     track_initramfs_boot_fallback mountpoint | ||||||
|     chroot mountpoint update-grub |     chroot mountpoint update-grub | ||||||
|     undivert_grub mountpoint |     undivert_grub mountpoint | ||||||
| 	fi | 
 | ||||||
|  |     rm mountpoint/tmp/device.map | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [ "$ARCH" = "s390x" ]; then | if [ "$ARCH" = "s390x" ]; then | ||||||
|  | |||||||
| @ -49,9 +49,6 @@ replace_kernel ${mount_d} "linux-kvm" | |||||||
| chroot "${mount_d}" update-grub | chroot "${mount_d}" update-grub | ||||||
| undivert_grub "${mount_d}" | undivert_grub "${mount_d}" | ||||||
| 
 | 
 | ||||||
| env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" rm \ |  | ||||||
|     -rf /boot/initrd.img-* /boot/initrd.img |  | ||||||
| 
 |  | ||||||
| # Remove indices  | # Remove indices  | ||||||
| env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \ | env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \ | ||||||
|     clean |     clean | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user