Build without pacman's download sandbox where the kernel has no Landlock
pacman 7 sandboxes its downloads with Landlock and fails every database sync on a kernel without it, which Namespace's AmpereOne arm64 machines run: "restricting filesystem access failed because Landlock is not supported by the kernel!". An ISO build there stops at its first pacman -Sy. Where /sys/kernel/security/lsm lists no landlock, or cannot be read, a wrapper in /usr/local/bin runs every pacman in the build container, pacstrap's included, with --disable-sandbox, the flag pacman provides for such kernels. Not DisableSandbox in a config: pacman-offline.conf ships on the ISO.
This commit is contained in:
1 parent
d90119f5d8
commit
c6b1d2dadc
1 file changed
+13
@@ -23,6 +23,19 @@ esac
|
|||||||
: "${OMARCHY_NVIM_PACKAGE:=omarchy-nvim}"
|
: "${OMARCHY_NVIM_PACKAGE:=omarchy-nvim}"
|
||||||
export OMARCHY_RUNTIME_PACKAGE OMARCHY_SETTINGS_PACKAGE OMARCHY_NVIM_PACKAGE
|
export OMARCHY_RUNTIME_PACKAGE OMARCHY_SETTINGS_PACKAGE OMARCHY_NVIM_PACKAGE
|
||||||
|
|
||||||
|
# pacman 7 sandboxes its downloads with Landlock and fails every sync on a
|
||||||
|
# kernel without it (Namespace's AmpereOne arm64 machines): "restricting
|
||||||
|
# filesystem access failed because Landlock is not supported by the kernel".
|
||||||
|
# There, every pacman in this container (pacstrap's too) runs with
|
||||||
|
# --disable-sandbox, which pacman provides for exactly this. A wrapper rather
|
||||||
|
# than DisableSandbox in a config: pacman-offline.conf ships on the ISO.
|
||||||
|
if ! grep -qw landlock /sys/kernel/security/lsm 2>/dev/null; then
|
||||||
|
echo "No Landlock in this kernel: pacman runs with --disable-sandbox in this container"
|
||||||
|
printf '#!/bin/sh\nexec /usr/bin/pacman --disable-sandbox "$@"\n' >/usr/local/bin/pacman
|
||||||
|
chmod +x /usr/local/bin/pacman
|
||||||
|
hash -r
|
||||||
|
fi
|
||||||
|
|
||||||
# Packages installed into the Arch container used to build the ISO.
|
# Packages installed into the Arch container used to build the ISO.
|
||||||
pacman-key --init
|
pacman-key --init
|
||||||
pacman --noconfirm -Sy archlinux-keyring
|
pacman --noconfirm -Sy archlinux-keyring
|
||||||
|
|||||||
Reference in new issue
Block a user