diff --git a/build.sh b/build.sh index 0414b2f06..8b687153c 100755 --- a/build.sh +++ b/build.sh @@ -30,6 +30,8 @@ apt-get install -y live-build patch ubuntu-keyring # https://salsa.debian.org/live-team/live-build/merge_requests/31 patch -d /usr/lib/live/build/ < live-build-fix-syslinux.patch +patch -d /usr/lib/live/build/ < live-build-fix-shim-remove.patch + # TODO: Remove this once debootstrap 1.0.117 or newer is released and available: # https://salsa.debian.org/installer-team/debootstrap/blob/master/debian/changelog ln -sfn /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/focal diff --git a/live-build-fix-shim-remove.patch b/live-build-fix-shim-remove.patch new file mode 100644 index 000000000..e04254210 --- /dev/null +++ b/live-build-fix-shim-remove.patch @@ -0,0 +1,18 @@ +--- /usr/lib/live/build/binary_grub-efi 2019-03-11 10:05:40.000000000 +0000 ++++ /usr/lib/live/build/binary_grub-efi_v2 2021-08-04 13:37:20.064547041 +0000 +@@ -267,8 +267,12 @@ + # Saving cache + Save_cache cache/packages.binary + +- # Removing depends +- Remove_package ++ # Removing depends, some bootloader packages are marked as Protected/Important ++ # in Ubuntu, so temporarily add an apt flag to allow them to be removed ++ PRE_APT_OPTIONS="${APT_OPTIONS}" ++ APT_OPTIONS="${APT_OPTIONS} --allow-remove-essential" ++ Remove_package ++ APT_OPTIONS="${PRE_APT_OPTIONS}" + ;; + + false) +