diff --git a/debian/changelog b/debian/changelog index faa3189e..a22e966b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 27 Aug 2019 12:43:55 +0100 + livecd-rootfs (2.605) eoan; urgency=medium [ David Krauser ] diff --git a/live-build/auto/build b/live-build/auto/build index 82abbdaf..17c5e228 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -284,6 +284,7 @@ EOF divert_grub chroot divert_update_initramfs lb chroot "$@" + undivert_update_initramfs undivert_grub chroot fi diff --git a/live-build/functions b/live-build/functions index e837582d..ee2bc2f8 100644 --- a/live-build/functions +++ b/live-build/functions @@ -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 () { diff --git a/live-build/lb_chroot_layered b/live-build/lb_chroot_layered index 72188fa2..22d50bdb 100755 --- a/live-build/lb_chroot_layered +++ b/live-build/lb_chroot_layered @@ -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