mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-03-09 18:31:11 +00:00
Add replace_grub_root_with_label function
When update-grub is run, it will detect the disks in the build system. Currently, we sed the grub configuration in places where this happens; replace_grub_root_with_label moves that seddery in to a single callable location to avoid ending up with multiple versions of it. (It's worth noting that we also do this in 999-cpc-fixes.chroot, but as our functions file isn't available within the chroot we don't use it there.)
This commit is contained in:
parent
b62de15a85
commit
15d147bcdb
live-build/ubuntu-cpc
@ -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"
|
||||||
|
}
|
||||||
|
@ -108,7 +108,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