improve qemu tooling, and document it
This commit is contained in:
2
scripts/connect-qemu.sh
Executable file
2
scripts/connect-qemu.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env sh
|
||||
nix-shell -p socat --run "socat -,raw,echo=0,icanon=0,isig=0,icrnl=0,escape=0x0f unix-connect:$1"
|
22
scripts/run-qemu.sh
Executable file
22
scripts/run-qemu.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p qemu
|
||||
|
||||
if test "$1" = "--background" ; then
|
||||
socket=$2
|
||||
echo "running in background, socket is $socket"
|
||||
flags="--daemonize -chardev socket,id=sock,path=$2,server=on,wait=off,mux=on -mon chardev=sock,mode=readline -serial chardev:sock "
|
||||
shift;shift
|
||||
else
|
||||
flags="-serial mon:stdio"
|
||||
fi
|
||||
|
||||
qemu-system-mips \
|
||||
-M malta -m 256 \
|
||||
-echr 16 \
|
||||
-append "default console=ttyS0,38400n8 panic=10 oops=panic init=/bin/init loglevel=8 root=/dev/vda" \
|
||||
-drive file=$2,format=raw,readonly=on,if=virtio \
|
||||
-netdev socket,id=access,mcast=230.0.0.1:1234 \
|
||||
-device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=access,mac=ba:ad:1d:ea:21:02 \
|
||||
-netdev socket,id=lan,mcast=230.0.0.1:1235 \
|
||||
-device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=lan,mac=ba:ad:1d:ea:21:01 \
|
||||
-kernel $1 -display none $flags
|
Reference in New Issue
Block a user