diff options
| author | 2022-08-05 18:06:23 -0400 | |
|---|---|---|
| committer | 2022-08-05 18:06:23 -0400 | |
| commit | 64bb46311547cb5ea13d3d8f7d0d1836f33a68f5 (patch) | |
| tree | f7a60ef0ebfc50f94ad75a670f031e121a8ed14d /arch-chroot.in | |
| parent | 22faa4b00068fc50c66614c4e4812273aa231d55 (diff) | |
New upstream version 26.upstream/26
Diffstat (limited to 'arch-chroot.in')
| -rw-r--r-- | arch-chroot.in | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch-chroot.in b/arch-chroot.in index bcb38df..3bf6523 100644 --- a/arch-chroot.in +++ b/arch-chroot.in @@ -5,7 +5,7 @@ shopt -s extglob m4_include(common) setup=chroot_setup -unshare="$root_unshare" +unshare=0 usage() { cat <<EOF @@ -82,7 +82,7 @@ while getopts ':hNu:' flag; do ;; N) setup=unshare_setup - unshare="$user_unshare" + unshare=1 ;; u) userspec=$OPTARG @@ -116,8 +116,12 @@ arch-chroot() { chroot_args=() [[ $userspec ]] && chroot_args+=(--userspec "$userspec") - SHELL=/bin/bash chroot "${chroot_args[@]}" -- "$chrootdir" "${args[@]}" + SHELL=/bin/bash $pid_unshare chroot "${chroot_args[@]}" -- "$chrootdir" "${args[@]}" } args=("$@") -$unshare bash -c "$(declare_all); arch-chroot" +if (( unshare )); then + $mount_unshare bash -c "$(declare_all); arch-chroot" +else + arch-chroot +fi |
