All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] image_types_sparse: fix sparse image generation
@ 2021-08-09  2:22 Dmitry Baryshkov
  0 siblings, 0 replies; only message in thread
From: Dmitry Baryshkov @ 2021-08-09  2:22 UTC (permalink / raw)
  To: openembedded-devel

After changing image_types_sparse to follow new override syntax, using
this class generates the syntax error, because CONVERSION_CMD:sparse()
function is added to the generated shell file, but color can not be a
part of the function name. Rewrite it to be the variable rather than the
function, so that it does not end up the run.do_image_FOO file.

DEBUG: Executing shell function do_image_ext4
[.......]/temp/run.do_image_ext4.1247938: line 184: `CONVERSION_CMD:sparse': not a valid identifier
WARNING: [.......]/temp/run.do_image_ext4.1247938:151 exit 2 from 'export systemd_user_unitdir="/usr/lib/systemd/user"'
WARNING: Backtrace (BB generated script):
	#1: main, [.......]/temp/run.do_image_ext4.1247938, line 151
ERROR: Execution of '[.......]/temp/run.do_image_ext4.1247938' failed with exit code 2:
[.......]/temp/run.do_image_ext4.1247938: line 184: `CONVERSION_CMD:sparse': not a valid identifier
WARNING: [.......]/temp/run.do_image_ext4.1247938:151 exit 2 from 'export systemd_user_unitdir="/usr/lib/systemd/user"'
WARNING: Backtrace (BB generated script):
	#1: main, [.......]/temp/run.do_image_ext4.1247938, line 151

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 meta-oe/classes/image_types_sparse.bbclass | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/meta-oe/classes/image_types_sparse.bbclass b/meta-oe/classes/image_types_sparse.bbclass
index af3879372b68..65d980fd913f 100644
--- a/meta-oe/classes/image_types_sparse.bbclass
+++ b/meta-oe/classes/image_types_sparse.bbclass
@@ -1,16 +1,16 @@
 inherit image_types
 
 CONVERSIONTYPES += "sparse"
-CONVERSION_CMD:sparse() {
-    in="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
-    out="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sparse"
-    case "${type}" in
-        ext*)
-            ext2simg "$in" "$out"
-            ;;
-        *)
-            img2simg "$in" "$out"
-            ;;
-    esac
-}
+CONVERSION_CMD:sparse = " \
+    case "${type}" in \
+        ext*) \
+            ext2simg "${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" \
+                     "${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sparse" \
+            ;; \
+        *) \
+            img2simg "${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" \
+                     "${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sparse" \
+            ;; \
+    esac \
+"
 CONVERSION_DEPENDS_sparse = "android-tools-native"
-- 
2.30.2


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

only message in thread, other threads:[~2021-08-09  2:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09  2:22 [meta-oe][PATCH] image_types_sparse: fix sparse image generation Dmitry Baryshkov

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.