Skip to content

Commit

Permalink
ledge: patch runqemu script
Browse files Browse the repository at this point in the history
apply ledge specific patch, which sent to upstream:
runqemu: add virtio block device
openembedded/openembedded-core#56

Change-Id: I3f0eb41d460d9ca66a69b49fee105734d31a720c
Signed-off-by: Maxim Uvarov <[email protected]>
  • Loading branch information
muvarov committed Nov 22, 2019
1 parent 8cb9355 commit 7160f27
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
36 changes: 36 additions & 0 deletions patches/0001-runqemu-add-virtio-block-device.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 6371ec15042ab3933ee38447bbef3cffcd92aa22 Mon Sep 17 00:00:00 2001
From: Maxim Uvarov <[email protected]>
Date: Fri, 22 Nov 2019 15:19:00 +0300
Subject: [PATCH] runqemu: add virtio block device

Implement new QB_DRIVE_TYPE="/dev/vdb" which falls back
to virtio block device emulated by qemu.
That is needed to support following qemu command line:
-drive id=disk0,file=%s,if=none,format=%s \
-device virtio-blk-device,drive=disk0'

Real use case is arm64 emulation with qemu with atf+optee+uboot,
so that uboot driver sees this disk and able to load from it.

Signed-off-by: Maxim Uvarov <[email protected]>
---
scripts/runqemu | 3 +++
1 file changed, 3 insertions(+)

diff --git a/scripts/runqemu b/scripts/runqemu
index a05facd0db..98d3377b52 100755
--- a/openembedded-core/scripts/runqemu
+++ b/openembedded-core/scripts/runqemu
@@ -1187,6 +1187,9 @@ class BaseConfig(object):
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/vdb"):
+ logger.info('Using block virtio drive');
+ vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0' % (self.rootfs, rootfs_format)
else:
# virtio might have been selected explicitly (just use it), or
# is used as fallback (then warn about that).
--
2.17.1

5 changes: 5 additions & 0 deletions setup-environment-internal
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ ln -sf "${MANIFESTS}"/README.md README.md

ln -sf "${MANIFESTS}" "${OEROOT}"/layers/

echo "Applying ledge patches"
cd "${OEROOT}"/layers
patch -p1 < ${MANIFESTS}/patches/*.patch
cd -

DISTRO_DIRNAME=$(echo "${DISTRO}" | sed 's#[.-]#_#g')

cat > conf/auto.conf <<EOF
Expand Down

0 comments on commit 7160f27

Please sign in to comment.