From decb3606471b8a65687a72e13f6aec0fd7debb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 28 Apr 2019 18:58:56 +0200 Subject: uchroot: fix usage with qemu --- scripts/uchroot | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'scripts/uchroot') 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 \"\$@\"" -- "$@" -- cgit v1.2.3