]> git.wh0rd.org Git - home.git/commitdiff
custom-chroot: run with --propagation=private when available
authorMike Frysinger <vapier@gentoo.org>
Wed, 30 Sep 2015 03:24:37 +0000 (03:24 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 30 Sep 2015 03:24:37 +0000 (03:24 +0000)
.bin/custom-chroot

index ebc5957b9ba567f58de173b8de57b2085cd634ff..8b109d01b4d7a8f77749edaf04095bf0dc1cfeb4 100755 (executable)
@@ -6,10 +6,12 @@ bootstrap() {
        if [[ -z ${UNSHARE} ]] ; then
                mount_args=
                if type -P unshare >&/dev/null ; then
+                       test_arg() { unshare "$@" -- true >&/dev/null && uargs+=( "$@" ); }
                        uargs=( -m )
-                       unshare -u -- true >&/dev/null && uargs+=( -u )
-                       unshare -i -- true >&/dev/null && uargs+=( -i )
-                       unshare -p -- true >&/dev/null && uargs+=( -p -f --mount-proc )
+                       test_arg -u
+                       test_arg -i
+                       test_arg -p -f --mount-proc
+                       test_arg --propagation=private
                        UNSHARE=true exec unshare "${uargs[@]}" -- "$0" "$@"
                fi
        else