if [[ -z ${UNSHARE} ]] ; then
mount_args=
if type -P unshare >&/dev/null ; then
- UNSHARE=true exec unshare -m -- "$0" "$@"
+ test_arg() { unshare "$@" -- true >&/dev/null && uargs+=( "$@" ) || :; }
+ uargs=( -m )
+ test_arg -u
+ test_arg -i
+ test_arg -p -f --mount-proc
+ test_arg --propagation=private
+ UNSHARE=true exec unshare "${uargs[@]}" -- "$0" "$@"
fi
else
mount_args='-n'
*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
}
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
}
main() {
bootstrap "$@"
- local mounts=( proc sys tmp dev dev/pts dev/shm usr/portage usr/portage/distfiles usr/local/src )
+ local mounts=( proc sys tmp dev dev/pts dev/shm run usr/portage usr/portage/distfiles usr/local/src )
local chroot=${0%/*}
case ${chroot} in
-u) cmd='umount' ;;
-m) mounts+=( "$2" ); shift ;;
-d) chroot=$(realpath "$2"); shift ;;
- -h) usage ;;
+ --help|-h) usage ;;
-*) echo "${0##*/}: unknown option $1"; exit 1 ;;
*) break ;;
esac