From 256eae27d94abd1cbee421c1263035196873a60e Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Sat, 31 Aug 2019 03:39:25 +0900 Subject: [PATCH] partitions & flashlayout: Prevent accident substring match There is a case that I bitbake my-image when INITRAMFS_IMAGE is my-image-initramfs. In this case my-image is a substring of my-image-initramfs, causing ST's flashlayout and partitions classes accidentally skip adding their tasks. This patch makes sure to use exact string match during variable checks. Signed-off-by: Bumsik Kim --- classes/flashlayout-stm32mp.bbclass | 2 +- classes/st-partitions-image.bbclass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/flashlayout-stm32mp.bbclass b/classes/flashlayout-stm32mp.bbclass index b8a2514..0875777 100644 --- a/classes/flashlayout-stm32mp.bbclass +++ b/classes/flashlayout-stm32mp.bbclass @@ -135,7 +135,7 @@ python __anonymous () { # Init partition list from PARTITIONS_IMAGE image_partitions = (d.getVar('PARTITIONS_IMAGE') or "").split() # We need to clearly identify ROOTFS build, not InitRAMFS one (if any) - if current_image_name not in image_partitions and current_image_name not in initramfs and current_image_name not in initrd: + if current_image_name not in image_partitions and current_image_name != initramfs and current_image_name != initrd: # We need to make sure to add all extra dependencies as 'depends' # for image_complete task if d.getVar('FLASHLAYOUT_DEPEND_TASKS'): diff --git a/classes/st-partitions-image.bbclass b/classes/st-partitions-image.bbclass index 0b93ff4..dc06fdf 100755 --- a/classes/st-partitions-image.bbclass +++ b/classes/st-partitions-image.bbclass @@ -32,7 +32,7 @@ python __anonymous () { # We need to append partition images generation only to image # that are not one of the defined partitions and not the InitRAMFS image. # Without this check we would create circular dependency - if current_image_name not in image_partitions and current_image_name not in initramfs: + if current_image_name not in image_partitions and current_image_name != initramfs: for partition in image_partitions: d.appendVarFlag('do_image_complete', 'depends', ' %s:do_image_complete' % partition) }