summaryrefslogtreecommitdiff
path: root/scripts/uchroot
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2019-04-28 18:58:56 +0200
committerKarel Kočí <cynerd@email.cz>2019-04-28 18:58:56 +0200
commitdecb3606471b8a65687a72e13f6aec0fd7debb82 (patch)
tree20f636e79d5c34c8dc3088e76669aefe6572f7e2 /scripts/uchroot
parent090bf5e725ccc9e20b230286444e9f2cd81146c8 (diff)
downloadlaminar-cnf-decb3606471b8a65687a72e13f6aec0fd7debb82.tar.gz
laminar-cnf-decb3606471b8a65687a72e13f6aec0fd7debb82.tar.bz2
laminar-cnf-decb3606471b8a65687a72e13f6aec0fd7debb82.zip
uchroot: fix usage with qemu
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 \"\$@\"" -- "$@"