Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow live-build to remove protected pkgs in iso bootloader stage #517

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions live-build-fix-shim-remove.patch
Original file line number Diff line number Diff line change
@@ -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)