]> git.wh0rd.org Git - home.git/commitdiff
chroot: support uts/pid namespaces too
authorMike Frysinger <vapier@gentoo.org>
Tue, 13 May 2014 18:47:32 +0000 (14:47 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 13 May 2014 18:47:32 +0000 (14:47 -0400)
.bin/custom-chroot

index 324405cc915c28fc20f2c8adec911a80bb17d788..66613bcfd7b09d02a0111fd6926893b2e416b1cf 100755 (executable)
@@ -6,7 +6,10 @@ bootstrap() {
        if [[ -z ${UNSHARE} ]] ; then
                mount_args=
                if type -P unshare >&/dev/null ; then
-                       UNSHARE=true exec unshare -m -- "$0" "$@"
+                       uargs=( -m )
+                       unshare -u -- true >&/dev/null && uargs+=( -u )
+                       unshare -p -- true >&/dev/null && uargs+=( -p -f --mount-proc )
+                       UNSHARE=true exec unshare "${uargs[@]}" -- "$0" "$@"
                fi
        else
                mount_args='-n'