diff mbox series

runqemu: add sd card device

Message ID 20240829111604.149519-1-alessandro.pecugi@seco.com
State Accepted, archived
Commit 0740896afbe13f37058e990a0a13b2b51bba70fd
Headers show
Series runqemu: add sd card device | expand

Commit Message

Alessandro Pecugi Aug. 29, 2024, 11:16 a.m. UTC
runqemu currently only supports scsi, ide and virtio drive types.
Implement QB_DRIVE_TYPE=/dev/mmcblk which adds an sdhci-pci device and
mounts the rootfs file as an sd card.

Signed-off-by: Alessandro Pecugi <alessandro.pecugi@seco.com>
---
 scripts/runqemu | 4 ++++
 1 file changed, 4 insertions(+)

--
2.34.1


[CleaTrial, SECO SpA]<https://clea.ai/demo>
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 69cd44864e..d86b80b86e 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1295,6 +1295,10 @@  to your build configuration.
                     elif drive_type.startswith("/dev/hd"):
                         logger.info('Using ide drive')
                         vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format)
+                    elif drive_type.startswith("/dev/mmcblk"):
+                        logger.info('Using sdcard drive')
+                        vm_drive = '-drive id=sdcard0,if=none,file=%s,format=%s -device sdhci-pci -device sd-card,drive=sdcard0' \
+                                    % (self.rootfs, rootfs_format)
                     elif drive_type.startswith("/dev/vdb"):
                         logger.info('Using block virtio drive');
                         vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0%s' \