From d5a2099c33d0f3aba62789425e4607b33adf1ce9 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Fri, 13 Nov 2020 09:13:59 -0800 Subject: [PATCH 1/2] amd64: always install grub-pc with shim-signed shim-signed depends on grub-efi-amd64-signed, which in turn has alternative depends on either `grub-efi-amd64 | grub-pc`. However to support booting with either via shim&signed-grub and BIOS, the choice must be made to install grub-pc, not grub-efi-amd64. This makes images consistent with Ubuntu Deskop, Live Server, buildd bootable images; all of which already do install grub-pc and shim-signed. Additionally, this will ensure that autoremove is run after installing anything in the CPC build hooks. This is done to avoid shipping images that include packages that are autoremovable. This will clean-up as packages are installed and detect any breakage at build time. LP: #1901906 --- live-build/auto/config | 3 +-- live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary | 1 + live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary | 4 +++- live-build/ubuntu-cpc/hooks.d/base/disk-image.binary | 1 + live-build/ubuntu-cpc/hooks.d/base/wsl-gz.binary | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index c3fb12c4..7f0b27c3 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -654,8 +654,7 @@ case $PROJECT in add_package install grub-pc ;; amd64) - add_package install grub-pc-bin - add_package install grub-efi-amd64-signed + add_package install grub-pc add_package install shim-signed ;; esac diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index 77f24e7e..dc87a361 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -33,6 +33,7 @@ install_grub() { chroot mountpoint apt-get -qqy update chroot mountpoint apt-get -qqy install grub-ieee1275 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2 + chroot mountpoint apt-get autoremove --purge --assume-yes # set the kernel commandline to use hvc0 mkdir -p mountpoint/etc/default/grub.d diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 1c91963d..e818e0ad 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -97,11 +97,13 @@ install_grub() { efi_target=arm-efi ;; amd64) - chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed + chroot mountpoint apt-get install -qqy grub-pc shim-signed efi_target=x86_64-efi ;; esac + chroot mountpoint apt-get autoremove --purge --assume-yes + # This call to populate the package manifest is added here to capture # grub-efi packages that otherwise would not make it into the base # manifest. filesystem.packages is moved into place via symlinking to 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 19978ff0..9de9967b 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary @@ -136,6 +136,7 @@ fi if [ "$ARCH" = "s390x" ]; then # Do ZIPL install bits chroot mountpoint apt-get -qqy install s390-tools sysconfig-hardware + chroot mountpoint apt-get autoremove --purge --assume-yes # Write out cloudy zipl.conf for future kernel updates cat << EOF > mountpoint/etc/zipl.conf diff --git a/live-build/ubuntu-cpc/hooks.d/base/wsl-gz.binary b/live-build/ubuntu-cpc/hooks.d/base/wsl-gz.binary index 05f51e30..8ce28140 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/wsl-gz.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/wsl-gz.binary @@ -35,6 +35,7 @@ cp -a rootfs.dir $rootfs_dir setup_mountpoint $rootfs_dir env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl +env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get autoremove --purge --assume-yes create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest teardown_mountpoint $rootfs_dir From bc9f8bad69ed933af3a33deb9a63a19ecf0f0351 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Fri, 13 Nov 2020 09:15:13 -0800 Subject: [PATCH 2/2] releasing package livecd-rootfs version 2.525.47 --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index ea0ac0e8..8d179847 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.525.48) bionic; urgency=medium + + [ Dimitri John Ledkov & Joshua Powers ] + * amd64: always install grub-pc with shim-signed (LP: #1901906), and + ensure to autoremove packages + + -- Joshua Powers Fri, 13 Nov 2020 09:14:35 -0800 + livecd-rootfs (2.525.47) bionic; urgency=medium * Apparently the lxd appliance needs to use a custom track (4.0) and since