summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb18
1 files changed, 17 insertions, 1 deletions
diff --git a/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb
index daf2834958..d7785cee2e 100644
--- a/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb
+++ b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb
@@ -7,15 +7,19 @@ MCIMGTYPE:virtclass-mcextend-musl = "ext4"
7MCIMGTYPE:virtclass-mcextend-tiny = "cpio.gz" 7MCIMGTYPE:virtclass-mcextend-tiny = "cpio.gz"
8 8
9MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}" 9MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}"
10MC_DEPLOY_IMAGE_BASENAME = "core-image-minimal"
10 11
11do_install[mcdepends] += "mc::${MCNAME}:core-image-minimal:do_image_complete mc::${MCNAME}:virtual/kernel:do_deploy" 12do_install[mcdepends] += "mc::${MCNAME}:core-image-minimal:do_image_complete mc::${MCNAME}:virtual/kernel:do_deploy"
12 13
13do_install () { 14do_install () {
14 install -d ${D}/var/lib/machines/${MCNAME} 15 install -d ${D}/var/lib/machines/${MCNAME}
15 install ${MC_DEPLOY_DIR_IMAGE}/core-image-minimal-${MCMACHINE}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/core-image-minimal.${MCIMGTYPE} 16 install ${MC_DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/${MC_DEPLOY_IMAGE_BASENAME}.${MCIMGTYPE}
16 install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME} 17 install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME}
17} 18}
18 19
20# for IMAGE_LINK_NAME, IMAGE_BASENAME
21inherit image-artifact-names
22
19python () { 23python () {
20 mcname = d.getVar('MCNAME') 24 mcname = d.getVar('MCNAME')
21 if not mcname: 25 if not mcname:
@@ -23,6 +27,18 @@ python () {
23 multiconfigs = d.getVar('BBMULTICONFIG') or "" 27 multiconfigs = d.getVar('BBMULTICONFIG') or ""
24 if mcname not in multiconfigs: 28 if mcname not in multiconfigs:
25 raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname) 29 raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname)
30
31 # these will most likely start with my BPN multiconfig-image-packager, but I want them from core-image-minimal
32 # as there is no good way to query core-image-minimal's context lets assume that there are no overrides
33 # and that we can just replace IMAGE_BASENAME
34 image_link_name = d.getVar('IMAGE_LINK_NAME')
35 image_basename = d.getVar('IMAGE_BASENAME')
36 machine = d.getVar('MACHINE')
37 mcmachine = d.getVar('MCMACHINE')
38 image_to_deploy = d.getVar('MC_DEPLOY_IMAGE_BASENAME')
39 image_link_name_to_deploy = image_link_name.replace(image_basename, image_to_deploy).replace(machine, mcmachine)
40 bb.warn('%s: assuming that "%s" built for "%s" has IMAGE_LINK_NAME "%s"' % (d.getVar('PN'), mcmachine, image_to_deploy, image_link_name_to_deploy))
41 d.setVar('IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL', image_link_name_to_deploy)
26} 42}
27 43
28BBCLASSEXTEND = "mcextend:tiny mcextend:musl" 44BBCLASSEXTEND = "mcextend:tiny mcextend:musl"