summaryrefslogtreecommitdiffstats
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:13:50 +0000
commit16d7103df101d50bf56064833a7427f9e2332aeb (patch)
treecf19e1305eaebc855c3ca3d71ad882a6fadafdc1
parent43299607cca58a3d178765e009bb64ae0ced4fc5 (diff)
downloadpoky-16d7103df101d50bf56064833a7427f9e2332aeb.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. (From OE-Core rev: 5238facb2f067b65959ac51695d100c0e849d3ee) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 @@
1inherit kernel-uboot kernel-artifact-names uboot-sign 1inherit kernel-uboot kernel-artifact-names uboot-sign
2 2
3KERNEL_IMAGETYPE_REPLACEMENT = "" 3def get_fit_replacement_type(d):
4
5python __anonymous () {
6 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or "" 4 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
5 replacementtype = ""
7 if 'fitImage' in kerneltypes.split(): 6 if 'fitImage' in kerneltypes.split():
8 depends = d.getVar("DEPENDS")
9 depends = "%s u-boot-tools-native dtc-native" % depends
10 d.setVar("DEPENDS", depends)
11
12 uarch = d.getVar("UBOOT_ARCH") 7 uarch = d.getVar("UBOOT_ARCH")
13 if uarch == "arm64": 8 if uarch == "arm64":
14 replacementtype = "Image" 9 replacementtype = "Image"
@@ -22,15 +17,18 @@ python __anonymous () {
22 replacementtype = "linux.bin" 17 replacementtype = "linux.bin"
23 else: 18 else:
24 replacementtype = "zImage" 19 replacementtype = "zImage"
20 return replacementtype
25 21
26 d.setVar("KERNEL_IMAGETYPE_REPLACEMENT", replacementtype) 22KERNEL_IMAGETYPE_REPLACEMENT ?= "${@get_fit_replacement_type(d)}"
23DEPENDS:append = " ${@'u-boot-tools-native dtc-native' if 'fitImage' in (d.getVar('KERNEL_IMAGETYPES') or '').split() else ''}"
27 24
25python __anonymous () {
28 # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal 26 # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
29 # to kernel.bbclass . We have to override it, since we pack zImage 27 # to kernel.bbclass . We have to override it, since we pack zImage
30 # (at least for now) into the fitImage . 28 # (at least for now) into the fitImage .
31 typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or "" 29 typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
32 if 'fitImage' in typeformake.split(): 30 if 'fitImage' in typeformake.split():
33 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype)) 31 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT')))
34 32
35 image = d.getVar('INITRAMFS_IMAGE') 33 image = d.getVar('INITRAMFS_IMAGE')
36 if image: 34 if image: