From ea5f01942fa67b366272d4be3fb9e058b675fc34 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Sat, 9 Mar 2019 20:08:29 +0000 Subject: [PATCH] divert grub when calling into lb chroot UbuntuStudio image builds have recently begun failing as a result of adding a grub theme customization to their flavor, which they then try to apply by running update-grub from their maintainer scripts. This fails with: Setting up plymouth-theme-ubuntustudio (0.57) ... update-alternatives: using /usr/share/plymouth/themes/ubuntustudio-logo/ubuntustudio-logo.plymouth to provide /usr/share/plymouth/themes/default.plymouth (default.plymouth) in auto mode update-alternatives: using /usr/share/plymouth/themes/ubuntustudio-text/ubuntustudio-text.plymouth to provide /usr/share/plymouth/themes/text.plymouth (text.plymouth) in auto mode update-initramfs: diverted by livecd-rootfs (will be called later) /usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?). dpkg: error processing package plymouth-theme-ubuntustudio (--configure): installed plymouth-theme-ubuntustudio package post-installation script subprocess returned error exit status 1 Packages providing grub themes should be able to call update-grub from their maintainer scripts, and they should be able to be installed under livecd-rootfs. It's surprising to me that this hasn't been a problem before now for any flavors. We know that grub-probe should not be called as part of an image build, so just use our standard helper function to divert it before running the chroot stage and undivert it after. --- debian/changelog | 4 ++++ live-build/auto/build | 2 ++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 19cd495d..a38db801 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ livecd-rootfs (2.568) UNRELEASED; urgency=medium * Make sure snap-tool exits with non-zero exit status, if a problem occurred. + [ Steve Langasek ] + * divert grub when calling into lb chroot, to avoid any problems from + grub-probe. + -- Tobias Koch Wed, 27 Feb 2019 10:16:46 +0100 livecd-rootfs (2.567) disco; urgency=medium diff --git a/live-build/auto/build b/live-build/auto/build index b4bd0094..3a964636 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -261,12 +261,14 @@ EOF chmod +x chroot/usr/bin/man fi + divert_grub chroot if [ -n "${PASSES}" ]; then PATH="config/:$PATH" lb chroot_layered "$@" else divert_update_initramfs lb chroot "$@" fi + undivert_grub chroot # Let all configuration non multi-layered project here. # If those are moving to a multi-layer layout, this needs to be