fix: Ensure that grub/shim package installs do not install recommends for minimized ubuntu-cpc image builds (LP: #2037075)

minimized cloud image policy, introduced in version 23.10.16, is to not install recommends for any package
installs during build. This is to keep the image as small as possible. This also extends to
the grub related packages.

This solves the problems detailed in LP: #2037075 and aligns other arches more with amd64 install of
grub/shim packages for both minimized and non minimized ubuntu-cpc cloud image builds.
ubuntu/mantic
Philip Roche 1 year ago
parent 94ea97758d
commit 1a884c1427

7
debian/changelog vendored

@ -1,3 +1,10 @@
livecd-rootfs (23.10.47) UNRELEASED; urgency=medium
* fix: Ensure that grub/shim package installs do not install recommends for
minimized ubuntu-cpc image builds (LP: #2037075)
-- Phil Roche <phil.roche@canonical.com> Fri, 22 Sep 2023 11:59:10 +0100
livecd-rootfs (23.10.46) UNRELEASED; urgency=medium
[ Simon Poirier ]

@ -106,25 +106,33 @@ install_grub() {
chroot mountpoint apt-get -y update
package_install_recommends_option=""
# minimized cloud image policy, introduced in version 23.10.16, is to not install recommends for any package
# installs during build. This is to keep the image as small as possible. This also extends to
# the grub related packages.
if [ "${SUBPROJECT:-}" = minimized ]; then
package_install_recommends_option="--no-install-recommends"
fi
# UEFI GRUB modules are meant to be used equally by Secure Boot and
# non-Secure Boot systems. If you need an extra module not already
# provided or run into "Secure Boot policy forbids loading X" problems,
# please file a bug against grub2 to include the affected module.
case $ARCH in
arm64)
chroot mountpoint apt-get -qqy install --no-install-recommends shim-signed grub-efi-arm64-signed
chroot mountpoint apt-get -qqy install ${package_install_recommends_option} shim-signed grub-efi-arm64-signed
efi_target=arm64-efi
;;
armhf)
chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm grub-efi-arm-bin
chroot mountpoint apt-get -qqy install ${package_install_recommends_option} grub-efi-arm grub-efi-arm-bin
efi_target=arm-efi
;;
amd64)
chroot mountpoint apt-get install -qqy grub-pc shim-signed
chroot mountpoint apt-get install -qqy ${package_install_recommends_option} grub-pc shim-signed
efi_target=x86_64-efi
;;
riscv64)
chroot mountpoint apt-get install -qqy u-boot-menu grub-efi-riscv64
chroot mountpoint apt-get install -qqy ${package_install_recommends_option} u-boot-menu grub-efi-riscv64
efi_target=riscv64-efi
chroot mountpoint u-boot-update

Loading…
Cancel
Save