Skip to content

Commit 7160f27

Browse files
committed
ledge: patch runqemu script
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]>
1 parent 8cb9355 commit 7160f27

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 6371ec15042ab3933ee38447bbef3cffcd92aa22 Mon Sep 17 00:00:00 2001
2+
From: Maxim Uvarov <[email protected]>
3+
Date: Fri, 22 Nov 2019 15:19:00 +0300
4+
Subject: [PATCH] runqemu: add virtio block device
5+
6+
Implement new QB_DRIVE_TYPE="/dev/vdb" which falls back
7+
to virtio block device emulated by qemu.
8+
That is needed to support following qemu command line:
9+
-drive id=disk0,file=%s,if=none,format=%s \
10+
-device virtio-blk-device,drive=disk0'
11+
12+
Real use case is arm64 emulation with qemu with atf+optee+uboot,
13+
so that uboot driver sees this disk and able to load from it.
14+
15+
Signed-off-by: Maxim Uvarov <[email protected]>
16+
---
17+
scripts/runqemu | 3 +++
18+
1 file changed, 3 insertions(+)
19+
20+
diff --git a/scripts/runqemu b/scripts/runqemu
21+
index a05facd0db..98d3377b52 100755
22+
--- a/openembedded-core/scripts/runqemu
23+
+++ b/openembedded-core/scripts/runqemu
24+
@@ -1187,6 +1187,9 @@ class BaseConfig(object):
25+
elif drive_type.startswith("/dev/hd"):
26+
logger.info('Using ide drive')
27+
vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format)
28+
+ elif drive_type.startswith("/dev/vdb"):
29+
+ logger.info('Using block virtio drive');
30+
+ vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0' % (self.rootfs, rootfs_format)
31+
else:
32+
# virtio might have been selected explicitly (just use it), or
33+
# is used as fallback (then warn about that).
34+
--
35+
2.17.1
36+

setup-environment-internal

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ ln -sf "${MANIFESTS}"/README.md README.md
240240

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

243+
echo "Applying ledge patches"
244+
cd "${OEROOT}"/layers
245+
patch -p1 < ${MANIFESTS}/patches/*.patch
246+
cd -
247+
243248
DISTRO_DIRNAME=$(echo "${DISTRO}" | sed 's#[.-]#_#g')
244249

245250
cat > conf/auto.conf <<EOF

0 commit comments

Comments
 (0)