Skip to contentSkip to conversation

image_types_sparse: Fix syntax error

PATCH New Bastian Krause 1 participant 1 message Sep 8, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 image_types_sparse: Fix syntax error

From: Chris Dimich <[email protected]>

When using the image type:

	IMAGE_FSTYPES += " wic.sparse"
	IMAGE_CLASSES += " image_types_sparse"

The following error arises:

Syntax error: Bad function name

So need to remove function in favor of variable.

---
This is a backport of dff205f5a ("image_types_sparse: Fix syntax error"), excluding the removal of IMAGE_NAME_SUFFIX because in mickledore, ${IMAGE_NAME_SUFFIX} is and will not be included in ${IMAGE_NAME}.

Changes since (implicit) v1:
- add missing semicolons

---
 meta-oe/classes/image_types_sparse.bbclass | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meta-oe/classes/image_types_sparse.bbclass +7 -5
index 69e24cbb7..68c5dbaa1 100644
@@ -8,9 +8,11 @@ inherit image_types
 SPARSE_BLOCK_SIZE ??= "4096"
 
 CONVERSIONTYPES += "sparse"
-CONVERSION_CMD:sparse() {
-    INPUT="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
-    truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "$INPUT"
-    img2simg -s "$INPUT" "$INPUT.sparse" ${SPARSE_BLOCK_SIZE}
-}
+
+CONVERSION_CMD:sparse = " \
+    INPUT="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"; \
+    truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "$INPUT"; \
+    img2simg -s "$INPUT" "$INPUT.sparse" ${SPARSE_BLOCK_SIZE}; \
+ "
+
 CONVERSION_DEPENDS_sparse = "android-tools-native"
Signature · 1 line
2.39.2