mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
runqemu factor archs more
This commit is contained in:
52
runqemu
52
runqemu
@@ -43,45 +43,47 @@ done
|
||||
shift "$(($OPTIND - 1))"
|
||||
extra_flags="$extra_flags $@"
|
||||
|
||||
images_dir='buildroot/output/images'
|
||||
buildroot_out_dir='./buildroot/output'
|
||||
images_dir="$buildroot_out_dir/images"
|
||||
qemu_common="\
|
||||
$debug_qemu \
|
||||
$buildroot_out_dir/host/usr/bin/qemu-system-$arch \
|
||||
-m 128M \
|
||||
-monitor telnet::45454,server,nowait \
|
||||
-net user \
|
||||
-smp 1 \
|
||||
"
|
||||
case "$arch" in
|
||||
x86_64)
|
||||
if $kgdb; then
|
||||
extra_append="$extra_append kgdboc=ttyS0,115200"
|
||||
fi
|
||||
cmd="$debug_qemu ./buildroot/output/host/usr/bin/qemu-system-x86_64 \
|
||||
-M pc \
|
||||
-append 'root=/dev/vda $extra_append' \
|
||||
-device edu \
|
||||
-drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \
|
||||
-kernel ${images_dir}/bzImage \
|
||||
-monitor telnet::45454,server,nowait \
|
||||
-m 128M \
|
||||
-net nic,model=virtio \
|
||||
-net user \
|
||||
-smp 1 \
|
||||
$extra_flags
|
||||
"
|
||||
;;
|
||||
if $kgdb; then
|
||||
extra_append="$extra_append kgdboc=ttyS0,115200"
|
||||
fi
|
||||
cmd="$qemu_common \
|
||||
-M pc \
|
||||
-append 'root=/dev/vda $extra_append' \
|
||||
-drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \
|
||||
-kernel ${images_dir}/bzImage \
|
||||
-net nic,model=virtio \
|
||||
$extra_flags
|
||||
"
|
||||
;;
|
||||
arm)
|
||||
if $kgdb; then
|
||||
extra_append="$extra_append kgdboc=ttyAMA0,115200"
|
||||
fi
|
||||
cmd="qemu-system-arm \
|
||||
cmd="$qemu_common \
|
||||
-M versatilepb \
|
||||
-append 'root=/dev/sda $extra_append' \
|
||||
-drive file=${images_dir}/rootfs.ext2,if=scsi,format=raw \
|
||||
-dtb ${images_dir}/versatile-pb.dtb \
|
||||
-kernel ${images_dir}/zImage \
|
||||
-m 128M \
|
||||
-monitor telnet::45454,server,nowait \
|
||||
-net nic,model=rtl8139 \
|
||||
-net user \
|
||||
-serial stdio \
|
||||
-smp 1 \
|
||||
$extra_flags"
|
||||
;;
|
||||
$extra_flags
|
||||
"
|
||||
;;
|
||||
esac
|
||||
echo "$cmd"
|
||||
if "$debug" && ! "$nographic" && [ ! "$arch" = 'arm' ]; then
|
||||
eval "$cmd" &>/dev/null &
|
||||
# TODO: Ctrl +C gets sent to QEMU? Why? Does not happen if I run
|
||||
|
||||
Reference in New Issue
Block a user