mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
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>
This commit is contained in:
@@ -1,14 +1,9 @@
|
|||||||
inherit kernel-uboot kernel-artifact-names uboot-sign
|
inherit kernel-uboot kernel-artifact-names uboot-sign
|
||||||
|
|
||||||
KERNEL_IMAGETYPE_REPLACEMENT = ""
|
def get_fit_replacement_type(d):
|
||||||
|
|
||||||
python __anonymous () {
|
|
||||||
kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
|
kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
|
||||||
|
replacementtype = ""
|
||||||
if 'fitImage' in kerneltypes.split():
|
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")
|
uarch = d.getVar("UBOOT_ARCH")
|
||||||
if uarch == "arm64":
|
if uarch == "arm64":
|
||||||
replacementtype = "Image"
|
replacementtype = "Image"
|
||||||
@@ -22,15 +17,18 @@ python __anonymous () {
|
|||||||
replacementtype = "linux.bin"
|
replacementtype = "linux.bin"
|
||||||
else:
|
else:
|
||||||
replacementtype = "zImage"
|
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
|
# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
|
||||||
# to kernel.bbclass . We have to override it, since we pack zImage
|
# to kernel.bbclass . We have to override it, since we pack zImage
|
||||||
# (at least for now) into the fitImage .
|
# (at least for now) into the fitImage .
|
||||||
typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
|
typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
|
||||||
if 'fitImage' in typeformake.split():
|
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')
|
image = d.getVar('INITRAMFS_IMAGE')
|
||||||
if image:
|
if image:
|
||||||
|
|||||||
Reference in New Issue
Block a user