]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
make.sh: Bind-mount /proc as a workaround for unshare
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Aug 2024 15:28:42 +0000 (15:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Aug 2024 15:28:42 +0000 (15:28 +0000)
unshare seems to want to change the mount propagation for /proc
before it has been mounted. In order to workaround that problem,
we bind-mount /proc to itself before.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 8c5e1c6e7c2872b612962023f5c8baf26b74d34a..91674b772829e6493dae05a66e8c14f1225762d5 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -461,6 +461,10 @@ prepareenv() {
        mount build_tmp "${BUILD_DIR}/tmp" \
                -t tmpfs -o "nosuid,nodev,strictatime,size=4G,nr_inodes=1M,mode=1777"
 
+       # Create an empty /proc directory and make it a mountpoint
+       mkdir -p "${BUILD_DIR}/proc"
+       mount --bind "${BUILD_DIR}/proc" "${BUILD_DIR}/proc"
+
        # Make all sources and proc available under lfs build
        mount --bind            /sys                                    "${BUILD_DIR}/sys"
        mount --bind -o ro      "${BASEDIR}/cache"              "${BUILD_DIR}/usr/src/cache"