summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: