Skip to contentSkip to conversation

kernel-fitimage: avoid duplicated items in KERNEL_IMAGETYPE_FOR_MAKE

PATCH New [email protected] 1 participant 1 message Jan 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-fitimage: avoid duplicated items in KERNEL_IMAGETYPE_FOR_MAKE

From: Ming Liu <[email protected]>

When replacementtype is already in KERNEL_IMAGETYPE_FOR_MAKE, we do not have to replace fitImage with it again, that will lead to duplicated items in KERNEL_IMAGETYPE_FOR_MAKE.

---
 meta/classes/kernel-fitimage.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/classes/kernel-fitimage.bbclass +6 -2
index ec18a3d..acdd679 100644
@@ -25,8 +25,12 @@ python __anonymous () {
         # 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))
+        typeformakelist = typeformake.split()
+        if 'fitImage' in typeformakelist:
+            if replacementtype in typeformakelist:
+                d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', ''))
+            else:
+                d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype))
 
         image = d.getVar('INITRAMFS_IMAGE')
         if image:
Signature · 1 line
2.7.4