feat(startqemu): add argument parser for specifying different qcow image (#7)
This commit is contained in:
parent
218dcea615
commit
00857a7aaa
1 changed files with 9 additions and 1 deletions
10
startqemu.sh
10
startqemu.sh
|
@ -7,6 +7,14 @@
|
||||||
. /usr/share/makepkg/util.sh
|
. /usr/share/makepkg/util.sh
|
||||||
colorize
|
colorize
|
||||||
|
|
||||||
|
parse-args() {
|
||||||
|
local OPTIND=1
|
||||||
|
shift "$(( OPTIND-1 ))"
|
||||||
|
file=${1:-archriscv-$(date --rfc-3339=date).qcow2}
|
||||||
|
}
|
||||||
|
|
||||||
|
parse-args "$@"
|
||||||
|
|
||||||
msg "Starting qemu"
|
msg "Starting qemu"
|
||||||
qemu-system-riscv64 \
|
qemu-system-riscv64 \
|
||||||
-nographic \
|
-nographic \
|
||||||
|
@ -17,5 +25,5 @@ qemu-system-riscv64 \
|
||||||
-device virtio-blk-device,drive=hd0 \
|
-device virtio-blk-device,drive=hd0 \
|
||||||
-object rng-random,filename=/dev/urandom,id=rng0 \
|
-object rng-random,filename=/dev/urandom,id=rng0 \
|
||||||
-device virtio-rng-device,rng=rng0 \
|
-device virtio-rng-device,rng=rng0 \
|
||||||
-drive file=archriscv-$(date --rfc-3339=date).qcow2,format=qcow2,id=hd0 \
|
-drive file="$file",format=qcow2,id=hd0 \
|
||||||
-monitor unix:/tmp/qemu-monitor,server,nowait
|
-monitor unix:/tmp/qemu-monitor,server,nowait
|
||||||
|
|
Loading…
Add table
Reference in a new issue