Skip to content

Commit

Permalink
busybox-initrd: auto pv from busybox
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
afreof authored and zeddii committed May 17, 2023
1 parent 668871c commit 8e7b015
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
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 \
Expand Down

0 comments on commit 8e7b015

Please sign in to comment.