Split QEMU run, automate GDB debugging

This commit is contained in:
Ciro Santilli
2017-05-20 11:17:37 +01:00
parent c886a85f58
commit 7f6b148dc4
6 changed files with 120 additions and 33 deletions

32
run
View File

@@ -1,36 +1,8 @@
#!/usr/bin/env bash
set -e
# CLI handling.
nographic=false
while getopts n OPT; do
case "$OPT" in
n)
nographic=true
;;
esac
done
if $nographic; then
extra_append='console=ttyS0'
extra_flags='-nographic'
else
extra_append=''
extra_flags=''
fi
# Work.
cd buildroot
make BR2_EXTERNAL="$(pwd)/../kernel_module" qemu_x86_64_defconfig
cat ../buildroot_config_fragment >> .config
env -u LD_LIBRARY_PATH make BR2_JLEVEL="$(($(nproc) - 2))" kernel_module-rebuild all
qemu-system-x86_64 \
-M pc \
-append "root=/dev/vda $extra_append" \
-drive file=output/images/rootfs.ext2,if=virtio,format=raw \
-kernel output/images/bzImage \
-m 128M \
-net nic,model=virtio \
-net user \
-smp 1 \
$extra_flags \
;
cd ..
./runqemu "$@"