]> git.wh0rd.org - home.git/blobdiff - .bin/custom-chroot
le-renew: switch to cryptography module
[home.git] / .bin / custom-chroot
index f86e41df71e3f548edb7eda593250d35f711d7a4..67da2eaa286fedeae1350c457bd906903d347aef 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
@@ -35,6 +37,13 @@ get_type() {
        *64-bit*PowerPC*) echo ppc64;;
        *32-bit*S/390*)   echo s390;;
        *64-bit*S/390*)   echo s390x;;
+       *64-bit*MIPS*)    echo mips64;;
+       *32-bit*MIPS*N32*)echo mips64;;
+       *32-bit*MIPS*)    echo mips;;
+       *32-bit*PA-RISC*) echo parisc;;
+       *64-bit*PA-RISC*) echo parisc64;;
+       *32-bit*SPARC*)   echo sparc;;
+       *64-bit*SPARC*)   echo sparc64;;
        esac
 }
 
@@ -72,9 +81,11 @@ init_chroot() {
                fi
        done
 
-       f="${HOME}/.profile.d/aliases.sh"
-       if [[ -e ${f} ]] ; then
-               cat "${f}" > root/.bash_profile
+       if [[ ! -d root/.git ]] ; then
+               f="${HOME}/.profile.d/aliases.sh"
+               if [[ -e ${f} ]] ; then
+                       cat "${f}" > root/.bash_profile
+               fi
        fi
 }