summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/qemu/nativesdk-qemu-vcontainer.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/qemu/nativesdk-qemu-vcontainer.bb')
-rw-r--r--recipes-devtools/qemu/nativesdk-qemu-vcontainer.bb65
1 files changed, 65 insertions, 0 deletions
diff --git a/recipes-devtools/qemu/nativesdk-qemu-vcontainer.bb b/recipes-devtools/qemu/nativesdk-qemu-vcontainer.bb
new file mode 100644
index 00000000..8fc68679
--- /dev/null
+++ b/recipes-devtools/qemu/nativesdk-qemu-vcontainer.bb
@@ -0,0 +1,65 @@
1# SPDX-FileCopyrightText: Copyright (C) 2025 Bruce Ashfield
2#
3# SPDX-License-Identifier: MIT
4#
5# Minimal QEMU variant for vcontainer tools (vdkr/vpdmn)
6#
7# This recipe provides a stripped-down nativesdk QEMU without OpenGL/SDL
8# dependencies, avoiding the mesa -> llvm -> clang build chain.
9#
10# This is separate from the main nativesdk-qemu to avoid affecting other
11# users who may need OpenGL support in their SDK QEMU.
12#
13# VERSION TRACKING: This recipe automatically discovers the QEMU version
14# from oe-core, so no updates are needed when oe-core bumps QEMU.
15
16SUMMARY = "Minimal QEMU for vcontainer tools"
17DESCRIPTION = "QEMU built without OpenGL/virglrenderer for use in vcontainer \
18 standalone tarballs. Avoids pulling in mesa/llvm/clang."
19
20# Dynamically discover QEMU version from oe-core (same pattern as busybox-initrd.bb)
21def get_qemu_pv(d):
22 import os
23 import re
24 corebase = d.getVar('COREBASE')
25 qemu_dir = os.path.join(corebase, 'meta', 'recipes-devtools', 'qemu')
26 if os.path.isdir(qemu_dir):
27 re_bb_name = re.compile(r"^qemu_([0-9.]+)\.bb$")
28 for bb_file in os.listdir(qemu_dir):
29 result = re_bb_name.match(bb_file)
30 if result:
31 return result.group(1)
32 bb.fatal("Cannot find qemu recipe in %s" % qemu_dir)
33
34PV := "${@get_qemu_pv(d)}"
35
36# Point to oe-core qemu files directory for patches and support files
37FILESEXTRAPATHS:prepend := "${COREBASE}/meta/recipes-devtools/qemu/qemu:"
38
39# Use the same base as oe-core qemu
40require recipes-devtools/qemu/qemu.inc
41
42# Pull in the main recipe's dependencies and settings
43DEPENDS += "glib-2.0 zlib pixman"
44DEPENDS:append:libc-musl = " libucontext"
45
46# Inherit nativesdk explicitly (not via BBCLASSEXTEND)
47inherit nativesdk
48
49# Target list for nativesdk (cross-prefix is already set by qemu.inc for class-nativesdk)
50EXTRA_OECONF:append = " --target-list=${@get_qemu_target_list(d)}"
51
52# Minimal PACKAGECONFIG - no opengl, no sdl, no virglrenderer
53# This avoids mesa -> llvm -> clang dependency chain
54# virtfs is needed for volume mounts (-v host:container)
55PACKAGECONFIG = "fdt kvm pie slirp virtfs"
56
57# Only build the QEMU targets we actually need for vcontainer
58# This saves ~150MB compared to building all architectures
59QEMU_TARGETS = "aarch64 x86_64"
60
61# QEMU's configure doesn't support --disable-static, so disable it
62DISABLE_STATIC = ""
63
64# Ensure proper naming
65BPN = "qemu"