Skip to content

Commit be5d136

Browse files
committed
make ubuntu disk optional
1 parent 60246ef commit be5d136

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

scripts/qemu_runner.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
parser.add_argument("--memory", default="2G")
1515
parser.add_argument("--debug", action="store_true", help="Enable QEMU debugging")
1616
parser.add_argument("--display", action="store_true", help="Add a display device to the VM")
17+
parser.add_argument("--disk", action="store_true", help="Add a disk device to the VM")
1718

1819

1920

@@ -44,11 +45,10 @@
4445
"-snapshot": None,
4546
"-kernel": bin_executable_location,
4647
"-append": f"{append_args} --rootfs=ext4fs --automount=/dev,devfs --automount=/tmp,tmpfs --automount=/proc,procfs --automount=/sys,sysfs",
47-
"-drive": "file=ubuntu-noble-arm64.img,format=raw,if=none,cache=none,id=x0",
4848
}
4949

5050
# Arguments that can appear multiple times (e.g. -device)
51-
extra_args = ["-device", "virtio-rng-device", "-device", "virtio-blk-device,drive=x0"]
51+
extra_args = ["-device", "virtio-rng-device"]
5252

5353
if args.debug:
5454
default_args["-S"] = None
@@ -61,6 +61,10 @@
6161
default_args["-serial"] = "stdio"
6262
extra_args += ["-device", "virtio-gpu-device"]
6363

64+
if args.disk:
65+
default_args["-drive"] = "file=ubuntu-noble-arm64.img,format=raw,if=none,cache=none,id=x0"
66+
extra_args += ["-device", "virtio-blk-device,drive=x0"]
67+
6468
qemu_command = ["qemu-system-aarch64"]
6569

6670
for key, value in default_args.items():

0 commit comments

Comments
 (0)