All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel-fitimage: avoid duplicated items in KERNEL_IMAGETYPE_FOR_MAKE
@ 2020-01-13 21:21 liu.ming50
  0 siblings, 0 replies; only message in thread
From: liu.ming50 @ 2020-01-13 21:21 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ming Liu

From: Ming Liu <liu.ming50@gmail.com>

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.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
 meta/classes/kernel-fitimage.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index ec18a3d..acdd679 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -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:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-13 21:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 21:21 [PATCH] kernel-fitimage: avoid duplicated items in KERNEL_IMAGETYPE_FOR_MAKE liu.ming50

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.