summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-fitimage.bbclass
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2022-03-19 13:32:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-23 12:11:15 +0000
commit5238facb2f067b65959ac51695d100c0e849d3ee (patch)
tree4f4348845346df5ac39084b2c3f4cd69468ae588 /meta/classes/kernel-fitimage.bbclass
parent09eabeff2168c416c18b1c375e095b472830a9b0 (diff)
downloadopenembedded-core-5238facb2f067b65959ac51695d100c0e849d3ee.tar.gz
kernel-fitimage.bbclass: introduce get_fit_replacement_type function
Avoid to set KERNEL_IMAGETYPE_REPLACEMENT in anonymous python function, otherwise it chould not be overridden in config files, for instance, it's being set now in meta/lib/oeqa/selftest/cases/fitimage.py. Introduce a get_fit_replacement_type function to get the default value of KERNEL_IMAGETYPE_REPLACEMENT, and it could be overridden in config files. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-fitimage.bbclass')
-rw-r--r--meta/classes/kernel-fitimage.bbclass16
1 files changed, 7 insertions, 9 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 8a9b195d6e..df5de0427b 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -1,14 +1,9 @@
inherit kernel-uboot kernel-artifact-names uboot-sign
-KERNEL_IMAGETYPE_REPLACEMENT = ""
-
-python __anonymous () {
+def get_fit_replacement_type(d):
kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
+ replacementtype = ""
if 'fitImage' in kerneltypes.split():
- depends = d.getVar("DEPENDS")
- depends = "%s u-boot-tools-native dtc-native" % depends
- d.setVar("DEPENDS", depends)
-
uarch = d.getVar("UBOOT_ARCH")
if uarch == "arm64":
replacementtype = "Image"
@@ -22,15 +17,18 @@ python __anonymous () {
replacementtype = "linux.bin"
else:
replacementtype = "zImage"
+ return replacementtype
- d.setVar("KERNEL_IMAGETYPE_REPLACEMENT", replacementtype)
+KERNEL_IMAGETYPE_REPLACEMENT ?= "${@get_fit_replacement_type(d)}"
+DEPENDS:append = " ${@'u-boot-tools-native dtc-native' if 'fitImage' in (d.getVar('KERNEL_IMAGETYPES') or '').split() else ''}"
+python __anonymous () {
# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
# to kernel.bbclass . We have to override it, since we pack zImage
# (at least for now) into the fitImage .
typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
if 'fitImage' in typeformake.split():
- d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype))
+ d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT')))
image = d.getVar('INITRAMFS_IMAGE')
if image: