summaryrefslogtreecommitdiffstats
path: root/recipes-core/busybox/busybox-initrd.bb
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2023-05-15 17:26:20 +0200
committerBruce Ashfield <bruce.ashfield@gmail.com>2023-05-17 11:44:51 -0400
commit8e7b015b35593d14e57532b28e50396ed8a92280 (patch)
treed149d41c7b11a0ef95f7db9ec71e96df857eb66a /recipes-core/busybox/busybox-initrd.bb
parent668871ce79cf0523df96739d7ad0f0c83cfb849b (diff)
downloadmeta-virtualization-8e7b015b35593d14e57532b28e50396ed8a92280.tar.gz
busybox-initrd: auto pv from busybox
Not hardcoding the version of busybox from the core layer in this layer is a small improvement for maintenance. But the main motivation is to support the following layer combination without getting a parse error from bitbake: - poky LTS, branch = kirkstone - meta-lts-mixins, branch = kirkstone/go - meta-lts-mixins, branch = kirkstone/rust - meta-virtualization, branch = master Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-core/busybox/busybox-initrd.bb')
-rw-r--r--recipes-core/busybox/busybox-initrd.bb35
1 files changed, 35 insertions, 0 deletions
diff --git a/recipes-core/busybox/busybox-initrd.bb b/recipes-core/busybox/busybox-initrd.bb
new file mode 100644
index 00000000..513ed135
--- /dev/null
+++ b/recipes-core/busybox/busybox-initrd.bb
@@ -0,0 +1,35 @@
1FILESEXTRAPATHS:prepend := "${THISDIR}/busybox-initrd:${COREBASE}/meta/recipes-core/busybox/busybox:${COREBASE}/meta/recipes-core/busybox/files:"
2
3def get_busybox_pv(d):
4 import re
5 corebase = d.getVar('COREBASE')
6 bb_dir = os.path.join(corebase, 'meta', 'recipes-core', 'busybox')
7 if os.path.isdir(bb_dir):
8 re_bb_name = re.compile(r"busybox_([0-9.]*)\.bb")
9 for bb_file in os.listdir(bb_dir):
10 result = re_bb_name.match(bb_file)
11 if result:
12 return result.group(1)
13 bb.fatal("Cannot find busybox recipe in %s" % bb_dir)
14
15PV := "${@get_busybox_pv(d)}"
16
17require recipes-core/busybox/busybox_${PV}.bb
18
19SRC_URI += "file://init.cfg \
20 file://mdev.cfg \
21 file://runx.cfg \
22 ${@bb.utils.contains('DISTRO_FEATURES', 'vmsep', 'file://static.cfg', '', d)} \
23 file://initrd.cfg"
24
25S = "${WORKDIR}/busybox-${PV}"
26
27# override security-flags settings, we have some warnings to ignore
28SECURITY_STRINGFORMAT = ""
29
30# we do this to get the target binary available to recipes that
31# depend on busybox
32SYSROOT_DIRS += "/bin"
33BUSYBOX_SPLIT_SUID = "0"
34
35FILES:${PN} += "${sysconfdir}/init.d/*"