Commit f4c498c7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6e2d36cc
......@@ -27,23 +27,29 @@ if [ $$ == 1 ]; then
mount -t debugfs none /sys/kernel/debug
#mount -t bpf none /sys/fs/bpf
mount -t proc none /proc
mount -t devtmpfs none /dev
mkdir /dev/{pts,mqueue,hugepages,shm}
mount -t devpts none /dev/pts
mount -t mqueue none /dev/mqueue
mount -t hugetlbfs none /dev/hugepages
mount -t tmpfs none /dev/shm
# XXX securityfs
# XXX udev?
mount -t tmpfs none /dev/shm
mount -t tmpfs none /run
mkdir /run/lock
mount -t tmpfs none /run/lock
mount -t tmpfs none /tmp
qrun=`grep -o 'QRUN=.*$' /proc/cmdline` || qdie "QRUN=?"
qrun=${qrun#QRUN=} # QRUN=prog -> prog
test -n "$qrun" || qdie "QRUN empty"
# XXX source bashrc ?
# FIXME "/dev/tty: No such device or address"
test -n "$QDIR" || qdie "QDIR=?"
cd "$QDIR"
test -n "$QRUN" || qdie "QRUN=?"
set +e
$qrun
$QRUN
echo "exit code: $?"
qshutdown
......@@ -57,6 +63,7 @@ test -z "$kernel" && kernel=arch/$arch/boot/bzImage
shift
prog="$@"
dir=`pwd`
# may be also useful:
# -serial stdio
......@@ -79,12 +86,17 @@ prog="$@"
qemu-system-$arch \
-enable-kvm \
-nographic \
\
-m 512M `# default 128M is too limiting` \
\
-fsdev local,id=R,path=/,security_model=none,readonly \
-device virtio-9p-pci,fsdev=R,mount_tag=/dev/root \
\
-kernel $kernel \
-append "ro rootfstype=9p rootflags=trans=virtio console=ttyS0 init=$(realpath $0) QRUN=$prog"
-append "ro rootfstype=9p rootflags=trans=virtio \
console=ttyS0 init=$(realpath $0) QDIR=$dir QRUN=$prog \
HOME="$HOME" LANG="$LANG" TERM="$TERM" PATH="$PATH" \
"
# \
......
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