make.sh: Fix build with kernels < 6.0.0

unshare(8) seems to fail with kernels older than 6.0.0 when mounting
the /proc filesystem in the inner namespace. This seems to be an bug
where unshare does not even try to mount the /proc filesystem but tries
to make its mount propagation private.

This is now solved in that way that we will use unshare on newer kernels
but will fall back on manually mounting the /proc filesystem once we have
entered the chroot environment.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2024-08-19 18:06:23 +00:00
parent f3c360cd6e
commit 8ea702f3f8
2 changed files with 86 additions and 4 deletions

View File

@@ -22,6 +22,11 @@
# This is a helper script that is called after we have created the new
# namespaces to perform further setup. This will be executed on the host.
# Mount /proc if it has not been mounted, yet
if ! mountpoint /proc; then
mount -t procfs none /proc -o nosuid,noexec,nodev
fi
# Bring up the loopback interface
ip link set lo up &>/dev/null