Commit 4d915099 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f4c498c7
...@@ -44,15 +44,18 @@ if [ $$ == 1 ]; then ...@@ -44,15 +44,18 @@ if [ $$ == 1 ]; then
# XXX source bashrc ? # XXX source bashrc ?
# FIXME "/dev/tty: No such device or address" # FIXME "/dev/tty: No such device or address"
test -n "$QDIR" || qdie "QDIR=?" test -n "$CWD" || qdie "CWD=?"
cd "$QDIR" cd "$CWD"
test -n "$QRUN" || qdie "QRUN=?" test $# != 0 || qdie "no program to run"
set +e cat /proc/cmdline
$QRUN env
set +e -x
"$@" # run argv[1:] passes to init
echo "exit code: $?" echo "exit code: $?"
qshutdown qshutdown
sleep 1d # give time to shutdown
qdie "unreachable" qdie "unreachable"
fi fi
...@@ -94,8 +97,9 @@ qemu-system-$arch \ ...@@ -94,8 +97,9 @@ qemu-system-$arch \
\ \
-kernel $kernel \ -kernel $kernel \
-append "ro rootfstype=9p rootflags=trans=virtio \ -append "ro rootfstype=9p rootflags=trans=virtio \
console=ttyS0 init=$(realpath $0) QDIR=$dir QRUN=$prog \ console=ttyS0 init="$(realpath $0)" \
HOME="$HOME" LANG="$LANG" TERM="$TERM" PATH="$PATH" \ CWD="$dir" HOME="$HOME" LANG="$LANG" TERM="$TERM" PATH="$PATH" \
-- $prog \
" "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment