diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2023-02-03 08:44:01 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2023-02-03 08:44:01 +0100 |
commit | 16cc62db836611212d597df4491a79cd8facd49a (patch) | |
tree | e2c84b3d71530c2774b064ec00c0c02d847a313b | |
parent | 58eae3eedcb68e4123c81364d1bf4df879054b22 (diff) |
Provide a script to start the qemu image
-rwxr-xr-x | start-qemu.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/start-qemu.sh b/start-qemu.sh new file mode 100755 index 0000000..f241f42 --- /dev/null +++ b/start-qemu.sh @@ -0,0 +1,21 @@ +#!/bin/sh +( +BINARIES_DIR="${0%/*}/" +cd ${BINARIES_DIR} + +if [ "${1}" = "serial-only" ]; then + EXTRA_ARGS='-nographic' +else + EXTRA_ARGS='-serial stdio' +fi + +export PATH="output/qemu_x86_64/host/bin:${PATH}" +qemu-system-x86_64 -M pc \ + -kernel output/qemu_x86_64/images/bzImage \ + -drive \ + file=output/qemu_x86_64/images/rootfs.ext2,if=virtio,format=raw \ + -append "rootwait root=/dev/vda console=tty1 console=ttyS0" \ + -net nic,model=virtio \ + -net user,hostfwd=tcp::6600-:6600,hostfwd=tcp::2222-:22 \ + ${EXTRA_ARGS} +) |