Fix build with Docker

This commit is contained in:
Aleksey Samoilov 2023-02-19 15:41:17 +04:00
parent 8c82ce7ac9
commit 6c486b1a3b
5 changed files with 48 additions and 2 deletions

0
= Normal file
View file

View file

@ -27,16 +27,27 @@ echo -e "
"
# Use system live-build if running on Debian
apt-get update && apt-get install -y lsb-release
dist="$(lsb_release -i -s)"
if [ $dist == "Debian" ]; then
apt-get install -y binutils zstd live-build
apt-get install -y binutils patch zstd live-build
dpkg -i ./debs/ubuntu-keyring*.deb
else
apt-get install -y binutils zstd debootstrap
apt-get install -y binutils patch zstd debootstrap
dpkg -i ./debs/*.deb
fi
# TODO: This patch was submitted upstream at:
# https://salsa.debian.org/live-team/live-build/-/merge_requests/255
# This can be removed when our Debian container has a version containing this fix
patch -d /usr/lib/live/build/ < live-build-fix-shim-remove.patch
# TODO: This can be removed when our Debian container has debootstrap 1.0.124 or later
# It's needed to support the new zstd .deb package compression that Ubuntu is doing
patch -d /usr/share/debootstrap/ < debootstrap-backport-zstd-support.patch
# Increase number of blocks for creating efi.img.
# This prevents error with "Disk full" on the lb binary_grub-efi stage
patch -d /usr/lib/live/build/ < increase_number_of_blocks.patch

View file

@ -0,0 +1,18 @@
--- /usr/share/debootstrap/functions.orig 2021-10-23 23:13:10.576805331 +0000
+++ /usr/share/debootstrap/functions 2021-10-23 23:14:05.465350379 +0000
@@ -974,6 +974,7 @@
case "$tarball" in
control.tar.gz) cat_cmd=zcat ;;
control.tar.xz) cat_cmd=xzcat ;;
+ control.tar.zst) cat_cmd=zstdcat ;;
control.tar) cat_cmd=cat ;;
*) error 1 UNKNOWNCONTROLCOMP "Unknown compression type for %s in %s" "$tarball" "$pkg" ;;
esac
@@ -996,6 +997,7 @@
data.tar.gz) cat_cmd=zcat ;;
data.tar.bz2) cat_cmd=bzcat ;;
data.tar.xz) cat_cmd=xzcat ;;
+ data.tar.zst) cat_cmd=zstdcat ;;
data.tar) cat_cmd=cat ;;
*) error 1 UNKNOWNDATACOMP "Unknown compression type for %s in %s" "$tarball" "$pkg" ;;
esac

View file

@ -44,6 +44,7 @@ lb config noauto \
--zsync false \
--security true \
--updates true \
--debootstrap-options="--extractor=ar" \
"${@}"
# replace channel and suite

View file

@ -0,0 +1,16 @@
--- binary_grub-efi 2021-04-02 15:43:54.000000000 +0000
+++ binary_grub-efi_v2 2021-10-23 22:43:57.314540341 +0000
@@ -280,8 +280,12 @@
# Saving cache
Save_package_cache binary
- # Removing depends
+ # 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_packages
+ APT_OPTIONS="${PRE_APT_OPTIONS}"
;;
false)