mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-23 11:21:12 +00:00
Undivert update-initramfs more carefully
Previously the wrapper script and diversion were left in place on images such as buildd images that don't have initramfs-tools installed. LP: #1841573
This commit is contained in:
parent
ce58687eed
commit
9a65a4013d
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
||||
livecd-rootfs (2.606) UNRELEASED; urgency=medium
|
||||
|
||||
* Undivert update-initramfs more carefully: previously the wrapper script
|
||||
and diversion were left in place on images such as buildd images that
|
||||
don't have initramfs-tools installed (LP: #1841573).
|
||||
|
||||
-- Colin Watson <cjwatson@ubuntu.com> Tue, 27 Aug 2019 12:43:55 +0100
|
||||
|
||||
livecd-rootfs (2.605) eoan; urgency=medium
|
||||
|
||||
[ David Krauser ]
|
||||
|
@ -284,6 +284,7 @@ EOF
|
||||
divert_grub chroot
|
||||
divert_update_initramfs
|
||||
lb chroot "$@"
|
||||
undivert_update_initramfs
|
||||
undivert_grub chroot
|
||||
fi
|
||||
|
||||
|
@ -875,13 +875,12 @@ echo "update-initramfs: diverted by livecd-rootfs (will be called later)" >&2
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x chroot/usr/sbin/update-initramfs
|
||||
}
|
||||
|
||||
cat > config/hooks/999-undivert-update-initramfs.chroot <<'EOF'
|
||||
#! /bin/sh
|
||||
[ ! -f /usr/sbin/update-initramfs.REAL ] && exit 0
|
||||
rm -f /usr/sbin/update-initramfs
|
||||
dpkg-divert --quiet --remove --rename /usr/sbin/update-initramfs
|
||||
EOF
|
||||
undivert_update_initramfs () {
|
||||
rm -f chroot/usr/sbin/update-initramfs
|
||||
Chroot chroot "dpkg-divert --quiet --remove --rename \
|
||||
/usr/sbin/update-initramfs"
|
||||
}
|
||||
|
||||
is_root_layer () {
|
||||
|
@ -261,6 +261,11 @@ create_chroot_pass () {
|
||||
lb chroot_dpkg remove ${*}
|
||||
lb chroot_debianchroot remove ${*}
|
||||
|
||||
# Restore update-initramfs, if necessary
|
||||
if $(is_root_layer $pass); then
|
||||
undivert_update_initramfs
|
||||
fi
|
||||
|
||||
# Restore grub
|
||||
undivert_grub chroot
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user