From 8e7b015b35593d14e57532b28e50396ed8a92280 Mon Sep 17 00:00:00 2001 From: Adrian Freihofer Date: Mon, 15 May 2023 17:26:20 +0200 Subject: 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 Signed-off-by: Bruce Ashfield --- recipes-core/busybox/busybox-initrd.bb | 35 +++++++++++++++++++++++++++ recipes-core/busybox/busybox-initrd_1.36.0.bb | 21 ---------------- 2 files changed, 35 insertions(+), 21 deletions(-) create mode 100644 recipes-core/busybox/busybox-initrd.bb delete mode 100644 recipes-core/busybox/busybox-initrd_1.36.0.bb (limited to 'recipes-core') 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 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/busybox-initrd:${COREBASE}/meta/recipes-core/busybox/busybox:${COREBASE}/meta/recipes-core/busybox/files:" + +def get_busybox_pv(d): + import re + corebase = d.getVar('COREBASE') + bb_dir = os.path.join(corebase, 'meta', 'recipes-core', 'busybox') + if os.path.isdir(bb_dir): + re_bb_name = re.compile(r"busybox_([0-9.]*)\.bb") + for bb_file in os.listdir(bb_dir): + result = re_bb_name.match(bb_file) + if result: + return result.group(1) + bb.fatal("Cannot find busybox recipe in %s" % bb_dir) + +PV := "${@get_busybox_pv(d)}" + +require recipes-core/busybox/busybox_${PV}.bb + +SRC_URI += "file://init.cfg \ + file://mdev.cfg \ + file://runx.cfg \ + ${@bb.utils.contains('DISTRO_FEATURES', 'vmsep', 'file://static.cfg', '', d)} \ + file://initrd.cfg" + +S = "${WORKDIR}/busybox-${PV}" + +# override security-flags settings, we have some warnings to ignore +SECURITY_STRINGFORMAT = "" + +# we do this to get the target binary available to recipes that +# depend on busybox +SYSROOT_DIRS += "/bin" +BUSYBOX_SPLIT_SUID = "0" + +FILES:${PN} += "${sysconfdir}/init.d/*" diff --git a/recipes-core/busybox/busybox-initrd_1.36.0.bb b/recipes-core/busybox/busybox-initrd_1.36.0.bb deleted file mode 100644 index 6108e9af..00000000 --- a/recipes-core/busybox/busybox-initrd_1.36.0.bb +++ /dev/null @@ -1,21 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/busybox-initrd:${COREBASE}/meta/recipes-core/busybox/busybox:${COREBASE}/meta/recipes-core/busybox/files:" - -require recipes-core/busybox/busybox_${PV}.bb - -SRC_URI += "file://init.cfg \ - file://mdev.cfg \ - file://runx.cfg \ - ${@bb.utils.contains('DISTRO_FEATURES', 'vmsep', 'file://static.cfg', '', d)} \ - file://initrd.cfg" - -S = "${WORKDIR}/busybox-${PV}" - -# override security-flags settings, we have some warnings to ignore -SECURITY_STRINGFORMAT = "" - -# we do this to get the target binary available to recipes that -# depend on busybox -SYSROOT_DIRS += "/bin" -BUSYBOX_SPLIT_SUID = "0" - -FILES:${PN} += "${sysconfdir}/init.d/*" -- cgit v1.2.3-54-g00ecf