summaryrefslogtreecommitdiff
path: root/Meta/run.sh
diff options
context:
space:
mode:
authorPankaj Raghav <pankydev8@gmail.com>2021-12-27 09:28:11 +0530
committerAndreas Kling <kling@serenityos.org>2022-01-01 14:55:58 +0100
commit344cfa0db4a76601754aead153fa52d2cde6db1e (patch)
tree6fe0e67d69cded38702817864f41359f257476b5 /Meta/run.sh
parente99fafb683d0ec63f64662cc71b98900118f9f74 (diff)
downloadserenity-344cfa0db4a76601754aead153fa52d2cde6db1e.zip
Meta: Enable attaching NVMe storage devices to qemu
Add an option to enable NVMe storage device as the boot drive. To enable NVMe support, run the following: $ SERENITY_NVME_ENABLE=1 Meta/serenity.sh run i686 root=/dev/nvme0n1
Diffstat (limited to 'Meta/run.sh')
-rwxr-xr-xMeta/run.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/Meta/run.sh b/Meta/run.sh
index 27e361252c..25fcff50b7 100755
--- a/Meta/run.sh
+++ b/Meta/run.sh
@@ -189,6 +189,19 @@ else
SERENITY_QEMU_DISPLAY_DEVICE="VGA,vgamem_mb=64 "
fi
+# Check if SERENITY_NVME_ENABLE is unset
+if [ -z ${SERINITY_NVME_ENABLE+x} ]; then
+ SERENITY_BOOT_DRIVE="-drive file=${SERENITY_DISK_IMAGE},format=raw,index=0,media=disk"
+else
+ if [ "$SERINITY_NVME_ENABLE" -eq 1 ]; then
+ SERENITY_BOOT_DRIVE="-drive file=${SERENITY_DISK_IMAGE},format=raw,index=0,media=disk,if=none,id=disk"
+ SERENITY_BOOT_DRIVE="$SERENITY_BOOT_DRIVE -device i82801b11-bridge,id=bridge4 -device sdhci-pci,bus=bridge4"
+ SERENITY_BOOT_DRIVE="$SERENITY_BOOT_DRIVE -device nvme,serial=deadbeef,drive=disk,bus=bridge4"
+ else
+ SERENITY_BOOT_DRIVE="-drive file=${SERENITY_DISK_IMAGE},format=raw,index=0,media=disk"
+ fi
+fi
+
if [ -z "$SERENITY_DISABLE_GDB_SOCKET" ]; then
SERENITY_EXTRA_QEMU_ARGS="$SERENITY_EXTRA_QEMU_ARGS -s"
fi
@@ -206,7 +219,6 @@ if [ -z "$SERENITY_MACHINE" ]; then
-smp $SERENITY_CPUS
-display $SERENITY_QEMU_DISPLAY_BACKEND
-device $SERENITY_QEMU_DISPLAY_DEVICE
- -drive file=${SERENITY_DISK_IMAGE},format=raw,index=0,media=disk
-device virtio-serial,max_ports=2
-device virtconsole,chardev=stdout
-device isa-debugcon,chardev=stdout
@@ -219,6 +231,7 @@ if [ -z "$SERENITY_MACHINE" ]; then
-device i82801b11-bridge,id=bridge3 -device sdhci-pci,bus=bridge3
-device ich9-ahci,bus=bridge3
-chardev stdio,id=stdout,mux=on
+ $SERENITY_BOOT_DRIVE
"
fi
fi
@@ -289,6 +302,7 @@ $SERENITY_EXTRA_QEMU_ARGS
-device virtio-rng-pci
$SERENITY_AUDIO_BACKEND
$SERENITY_AUDIO_HW
+$SERENITY_BOOT_DRIVE
"
export SDL_VIDEO_X11_DGAMOUSE=0