mirror of
				https://git.launchpad.net/livecd-rootfs
				synced 2025-11-04 10:54:07 +00:00 
			
		
		
		
	Add replace_grub_root_with_label function thereby consolidating multiple
uses of the same calls to sed. Thanks to Dan Watkins.
This commit is contained in:
		
						commit
						f79fc7973c
					
				
							
								
								
									
										2
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -17,6 +17,8 @@ livecd-rootfs (2.440) UNRELEASED; urgency=medium
 | 
				
			|||||||
  * Fix the OVF's metadata to include Ubuntu specific identifiers and
 | 
					  * Fix the OVF's metadata to include Ubuntu specific identifiers and
 | 
				
			||||||
    descriptions instead of the generic Linux ones. Thanks to Chris Glass.
 | 
					    descriptions instead of the generic Linux ones. Thanks to Chris Glass.
 | 
				
			||||||
    (LP: #1656293)
 | 
					    (LP: #1656293)
 | 
				
			||||||
 | 
					  * Add replace_grub_root_with_label function thereby consolidating multiple
 | 
				
			||||||
 | 
					    uses of the same calls to sed. Thanks to Dan Watkins.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  [ Adam Conrad ]
 | 
					  [ Adam Conrad ]
 | 
				
			||||||
  * Set device_tree_address for the new kernel in the RPi bootloader config.txt
 | 
					  * Set device_tree_address for the new kernel in the RPi bootloader config.txt
 | 
				
			||||||
 | 
				
			|||||||
@ -249,4 +249,11 @@ convert_to_qcow2() {
 | 
				
			|||||||
    qemu-img info "$destination"
 | 
					    qemu-img info "$destination"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					replace_grub_root_with_label() {
 | 
				
			||||||
 | 
					    # When update-grub is run, it will detect the disks in the build system.
 | 
				
			||||||
 | 
					    # Instead, we want grub to use the cloudimg-rootfs labelled disk
 | 
				
			||||||
 | 
					    CHROOT_ROOT="$1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    sed -i -e "s,root=[^ ]\+,root=LABEL=cloudimg-rootfs," \
 | 
				
			||||||
 | 
					        "$CHROOT_ROOT/boot/grub/grub.cfg"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -105,7 +105,7 @@ EOF
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
 | 
					    chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
 | 
				
			||||||
    chroot mountpoint update-grub
 | 
					    chroot mountpoint update-grub
 | 
				
			||||||
    sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg
 | 
					    replace_grub_root_with_label mountpoint
 | 
				
			||||||
    chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
 | 
					    chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    chroot mountpoint apt-get -y clean
 | 
					    chroot mountpoint apt-get -y clean
 | 
				
			||||||
 | 
				
			|||||||
@ -52,7 +52,7 @@ EOF
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
 | 
					    chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
 | 
				
			||||||
    chroot mountpoint update-grub
 | 
					    chroot mountpoint update-grub
 | 
				
			||||||
    sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg
 | 
					    replace_grub_root_with_label mountpoint
 | 
				
			||||||
    chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
 | 
					    chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    umount_partition mountpoint
 | 
					    umount_partition mountpoint
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user