mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Split QEMU run, automate GDB debugging
This commit is contained in:
30
runqemu
Executable file
30
runqemu
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# CLI handling.
|
||||
extra_append=''
|
||||
extra_flags=''
|
||||
while getopts dn OPT; do
|
||||
case "$OPT" in
|
||||
d)
|
||||
extra_flags="$extra_flags -S -s"
|
||||
;;
|
||||
n)
|
||||
extra_append="$extra_append console=ttyS0"
|
||||
extra_flags="$extra_flags -nographic"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
qemu-system-x86_64 \
|
||||
-M pc \
|
||||
-append "root=/dev/vda $extra_append" \
|
||||
-drive file=buildroot/output/images/rootfs.ext2,if=virtio,format=raw \
|
||||
-kernel buildroot/output/images/bzImage \
|
||||
-m 128M \
|
||||
-net nic,model=virtio \
|
||||
-net user \
|
||||
-smp 1 \
|
||||
$extra_flags \
|
||||
;
|
||||
Reference in New Issue
Block a user