From 294a65452db7b78514271519ed0e39b37df1b471 Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Thu, 17 Aug 2023 11:49:11 +0100 Subject: [PATCH] fix: Ensure required dependencies are installed before trying `grub-install` (LP: #2031640) As a result of not installing recommended packages the packages required to run `grub-install` are no longer installed by default. To ensure we can successfully run `grub-install` we install both `grub-pc` and `grub2-common` packages. --- debian/changelog | 1 + live-build/ubuntu-cpc/hooks.d/base/disk-image.binary | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 91852618..7bf741d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ livecd-rootfs (23.10.16) mantic; urgency=medium * fix: Do not install recommends for ubuntu-cpc minimized project (LP: #2031640) * fix: Remove dangling symlink /boot/initrd.img.old if exists (LP: #2031640) + * fix: Ensure required dependencies are installed before trying `grub-install` (LP: #2031640) -- Philip Roche Thu, 17 Aug 2023 11:44:23 +0100 diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary index 7fcc8167..8751773e 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary @@ -115,6 +115,8 @@ esac if [ "${should_install_grub}" -eq 1 ]; then echo "(hd0) ${loop_device}" > mountpoint/tmp/device.map + # install the required package to get the grub-install command + chroot mountpoint apt-get -qqy install --no-install-recommends grub-pc grub2-common chroot mountpoint grub-install ${loop_device} chroot mountpoint grub-bios-setup \ --boot-image=i386-pc/boot.img \