summaryrefslogtreecommitdiff
path: root/scripts/uchroot
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/uchroot')
-rwxr-xr-xscripts/uchroot10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/uchroot b/scripts/uchroot
index b94e14f..dd3d77a 100755
--- a/scripts/uchroot
+++ b/scripts/uchroot
@@ -35,8 +35,6 @@ shift
exit 1
}
-EXECUTOR=
-
mount --rbind "$ROOT" "$ROOT"
mount -t proc none "$ROOT/proc"
mount --rbind /dev "$ROOT/dev"
@@ -48,10 +46,10 @@ done <<<"$MOUNT"
cp -f /etc/resolv.conf "$ROOT/etc/resolv.conf"
cp -f /etc/hosts "$ROOT/etc/hosts"
-if [ -n "$ARCH" -a "$ARCH" != "$(arch)" ]; then
- cp -f "$(which "qemu-$ARCH")" "$ROOT/qemu"
- EXECUTOR=/qemu
+if [ "$ARCH" != "$(arch)" ]; then
+ qemu_exec="$(which "qemu-$ARCH")"
+ cp -f "$qemu_exec" "$ROOT$qemu_exec"
fi
-exec chroot "$ROOT" $EXECUTOR /bin/sh -c \
+exec chroot "$ROOT" /bin/sh -c \
". /etc/profile && exec su -l $USR $CMD \"\$@\"" -- "$@"