Commit 8b60658b authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'master' into t

* master:
  t/qemu-runlinux: Mount bpf and fusectl filesystems
  t/qemu-runlinux: Issue terminal resize before running program
  t/qemu-runlinux: Don't propagate $TERM in graphics mode
parents 2768e2e3 a568d6d9
......@@ -49,7 +49,8 @@ if [ $$ == 1 ]; then
mount -t sysfs none /sys
mount -t debugfs none /sys/kernel/debug
#mount -t bpf none /sys/fs/bpf
mount -t bpf none /sys/fs/bpf
mount -t fusectl none /sys/fs/fuse/connections
mount -t proc none /proc
mount -t devtmpfs none /dev
......@@ -75,7 +76,7 @@ if [ $$ == 1 ]; then
#env
#set -x
set +e
setsid "$@" <>/dev/ttyS0 >&0 2>&1 # run argv[1:] passed to init
setsid "$0" .qinit2 "$@" <>/dev/ttyS0 >&0 2>&1 # run qinit2 with argv[1:] passed to init
echo "exit code: $?"
qshutdown
......@@ -83,6 +84,17 @@ if [ $$ == 1 ]; then
qdie "unreachable"
fi
# init part spawned from under setsid.
# $0 .qinit2 <command> ...
if [ "$1" == .qinit2 ]; then
# resize terminal to current host's xterm
command -v resize >/dev/null && eval `resize`
# tail to argv[1:] passed to init
shift
exec "$@"
fi
# ---- qemu setup ----
......@@ -164,6 +176,6 @@ qemu-system-$arch \
-kernel $kernel \
-append "ro rootfstype=9p rootflags=trans=virtio \
${nographic:+console=ttyS0} init="$(realpath $0)" \
CWD="$dir" HOME="$HOME" LANG="$LANG" TERM="$TERM" PATH="$PATH" \
CWD="$dir" HOME="$HOME" LANG="$LANG" ${nographic:+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