Commit f4c498c7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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