summaryrefslogtreecommitdiff
path: root/Kernel/run
diff options
context:
space:
mode:
authorJonathan Archer <jon@jonnyarcher.com>2019-11-01 18:01:45 -0500
committerAndreas Kling <awesomekling@gmail.com>2019-11-02 21:46:00 +0100
commitcddbb7fdd74209f6266961abd1268f5fb8362af5 (patch)
tree87d19ddd5ea94f1af6c9f2b4a64a1755f37be4dd /Kernel/run
parent9cad24259089edec208066c17ac95764680773ce (diff)
downloadserenity-cddbb7fdd74209f6266961abd1268f5fb8362af5.zip
Run: Don't repeat common QEMU arguments
Diffstat (limited to 'Kernel/run')
-rwxr-xr-xKernel/run74
1 files changed, 28 insertions, 46 deletions
diff --git a/Kernel/run b/Kernel/run
index 5c7363a939..777fa58bcb 100755
--- a/Kernel/run
+++ b/Kernel/run
@@ -6,6 +6,17 @@
[ -z "$SERENITY_RAM_SIZE" ] && SERENITY_RAM_SIZE=128M
+[ -z "$SERENITY_COMMON_QEMU_ARGS" ] && SERENITY_COMMON_QEMU_ARGS="
+$SERENITY_EXTRA_QEMU_ARGS
+-s -m $SERENITY_RAM_SIZE
+-d cpu_reset,guest_errors
+-device VGA,vgamem_mb=64
+-hda _disk_image
+-debugcon stdio
+-soundhw pcspk
+-soundhw sb16
+"
+
export SDL_VIDEO_X11_DGAMOUSE=0
if [ "$1" = "b" ]; then
@@ -13,73 +24,44 @@ if [ "$1" = "b" ]; then
bochs -q -f .bochsrc
elif [ "$1" = "qn" ]; then
# ./run qn: qemu without network
- $SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
- $SERENITY_EXTRA_QEMU_ARGS \
- -d cpu_reset,guest_errors \
- -device VGA,vgamem_mb=64 \
- -debugcon stdio \
+ $SERENITY_QEMU_BIN \
+ $SERENITY_COMMON_QEMU_ARGS \
-device e1000 \
-kernel kernel \
- -append "${SERENITY_KERNEL_CMDLINE}" \
- -hda _disk_image \
- -soundhw pcspk \
- -soundhw sb16
+ -append "${SERENITY_KERNEL_CMDLINE}"
elif [ "$1" = "qtap" ]; then
# ./run qtap: qemu with tap
- sudo $SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
- $SERENITY_EXTRA_QEMU_ARGS \
+ sudo $SERENITY_QEMU_BIN \
+ $SERENITY_COMMON_QEMU_ARGS \
-enable-kvm \
- -d cpu_reset,guest_errors \
- -device VGA,vgamem_mb=64 \
- -debugcon stdio \
-object filter-dump,id=hue,netdev=br0,file=e1000.pcap \
-netdev tap,ifname=tap0,id=br0 \
-device e1000,netdev=br0 \
-kernel kernel \
- -append "${SERENITY_KERNEL_CMDLINE}" \
- -hda _disk_image \
- -soundhw pcspk \
- -soundhw sb16
+ -append "${SERENITY_KERNEL_CMDLINE}"
elif [ "$1" = "qgrub" ]; then
# ./run qgrub: qemu with grub
- $SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
- $SERENITY_EXTRA_QEMU_ARGS \
+ $SERENITY_QEMU_BIN \
+ $SERENITY_COMMON_QEMU_ARGS \
-enable-kvm \
- -d cpu_reset,guest_errors \
- -device VGA,vgamem_mb=64 \
- -debugcon stdio \
-object filter-dump,id=hue,netdev=breh,file=e1000.pcap \
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
- -device e1000,netdev=breh \
- -hda _disk_image \
- -soundhw pcspk
+ -device e1000,netdev=breh
elif [ "$1" = "qtext" ]; then
- $SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
- $SERENITY_EXTRA_QEMU_ARGS \
- -d cpu_reset,guest_errors \
- -device VGA,vgamem_mb=64 \
- -debugcon stdio \
+ # ./run: qemu with serenity in text mode
+ $SERENITY_QEMU_BIN \
+ $SERENITY_COMMON_QEMU_ARGS \
-device e1000 \
-kernel kernel \
- -append "${SERENITY_KERNEL_CMDLINE} text_debug" \
- -hda _disk_image \
- -soundhw pcspk \
- -soundhw sb16
+ -append "${SERENITY_KERNEL_CMDLINE} text_debug"
else
# ./run: qemu with user networking
- $SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
- $SERENITY_EXTRA_QEMU_ARGS \
+ $SERENITY_QEMU_BIN \
+ $SERENITY_COMMON_QEMU_ARGS \
-enable-kvm \
- -d cpu_reset,guest_errors \
- -device VGA,vgamem_mb=64 \
- -debugcon stdio \
-object filter-dump,id=hue,netdev=breh,file=e1000.pcap \
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
-device e1000,netdev=breh \
-kernel kernel \
- -append "${SERENITY_KERNEL_CMDLINE}" \
- -hda _disk_image \
- -soundhw pcspk \
- -soundhw sb16
-fi
-
+ -append "${SERENITY_KERNEL_CMDLINE}"
+fi \ No newline at end of file