mcextend: Add helper class useful for multiconfig
PATCH 1/2 mcextend: Add helper class useful for multiconfig
This class allows users to easily create multiconfig BBCLASSEXTEND recipes and is generally useful. It will be used by new tests so add as a general feature.
Signed-off-by Richard Purdie <[email protected]>
--- meta/classes/mcextend.bbclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 meta/classes/mcextend.bbclass
meta/classes/mcextend.bbclass new file +16 -0
@@ -0,0 +1,16 @@ +python mcextend_virtclass_handler () { + cls = e.data.getVar("BBEXTENDCURR") + variant = e.data.getVar("BBEXTENDVARIANT") + if cls != "mcextend" or not variant: + return + + override = ":virtclass-mcextend-" + variant + + e.data.setVar("PN", e.data.getVar("PN", False) + "-" + variant) + e.data.setVar("MCNAME", variant) + e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override) +} + +addhandler mcextend_virtclass_handler +mcextend_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" +
Signature · 1 line
2.20.1
PATCH 2/2 selftest: Add multiconfig test
Add a test for a multiconfig build which mixes tiny and musl builds along with using the mcextend class to combine and package multiple images into another image. This gives the multiconfig a decent test in a scenario users may use.
Signed-off-by Richard Purdie <[email protected]>
--- .../multiconfig-image-packager_0.1.bb | 25 +++++++++++ meta/lib/oeqa/selftest/cases/multiconfig.py | 43 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 meta-selftest/recipes-test/mulitconfig/multiconfig-image-packager_0.1.bb create mode 100644 meta/lib/oeqa/selftest/cases/multiconfig.py
meta-selftest/recipes-test/mulitconfig/multiconfig-image-packager_0.1.bb new file +25 -0
@@ -0,0 +1,25 @@ +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +MCMACHINE_virtclass-mcextend-musl = "qemux86-64" +MCMACHINE_virtclass-mcextend-tiny = "qemux86" +MCIMGTYPE_virtclass-mcextend-musl = "ext4" +MCIMGTYPE_virtclass-mcextend-tiny = "cpio.gz" + +MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}" + +do_install[mcdepends] += "multiconfig::${MCNAME}:core-image-minimal:do_image_complete multiconfig::${MCNAME}:virtual/kernel:do_deploy" + +do_install () { + install -d ${D}/var/lib/machines/${MCNAME} + install ${MC_DEPLOY_DIR_IMAGE}/core-image-minimal-${MCMACHINE}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/core-image-minimal.${MCIMGTYPE} + install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME} +} + +python () { + mcname = d.getVar('MCNAME') + if not mcname: + raise bb.parse.SkipRecipe("Not a multiconfig target") +} + +BBCLASSEXTEND = "mcextend:tiny mcextend:musl"
meta/lib/oeqa/selftest/cases/multiconfig.py new file +43 -0
43 lines not on this page · raw message
Signature · 1 line
2.20.1