blob: d7785cee2e1311a87bbfe58bcaa8bf311f47add6 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001LICENSE = "MIT"
2LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
3
Patrick Williams213cb262021-08-07 19:21:33 -05004MCMACHINE:virtclass-mcextend-musl = "qemux86-64"
5MCMACHINE:virtclass-mcextend-tiny = "qemux86"
6MCIMGTYPE:virtclass-mcextend-musl = "ext4"
7MCIMGTYPE:virtclass-mcextend-tiny = "cpio.gz"
Brad Bishop19323692019-04-05 15:28:33 -04008
9MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}"
Andrew Geissler8f840682023-07-21 09:09:43 -050010MC_DEPLOY_IMAGE_BASENAME = "core-image-minimal"
Brad Bishop19323692019-04-05 15:28:33 -040011
Brad Bishop15ae2502019-06-18 21:44:24 -040012do_install[mcdepends] += "mc::${MCNAME}:core-image-minimal:do_image_complete mc::${MCNAME}:virtual/kernel:do_deploy"
Brad Bishop19323692019-04-05 15:28:33 -040013
14do_install () {
15 install -d ${D}/var/lib/machines/${MCNAME}
Andrew Geissler8f840682023-07-21 09:09:43 -050016 install ${MC_DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/${MC_DEPLOY_IMAGE_BASENAME}.${MCIMGTYPE}
Brad Bishop19323692019-04-05 15:28:33 -040017 install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME}
18}
19
Andrew Geissler8f840682023-07-21 09:09:43 -050020# for IMAGE_LINK_NAME, IMAGE_BASENAME
21inherit image-artifact-names
22
Brad Bishop19323692019-04-05 15:28:33 -040023python () {
24 mcname = d.getVar('MCNAME')
25 if not mcname:
26 raise bb.parse.SkipRecipe("Not a multiconfig target")
27 multiconfigs = d.getVar('BBMULTICONFIG') or ""
28 if mcname not in multiconfigs:
29 raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname)
Andrew Geissler8f840682023-07-21 09:09:43 -050030
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)
Brad Bishop19323692019-04-05 15:28:33 -040042}
43
44BBCLASSEXTEND = "mcextend:tiny mcextend:musl"