Skip to content

Commit a8c964d

Browse files
lumagkraj
authored andcommitted
image_types_sparse: fix sparse image generation
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): openembedded#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): openembedded#1: main, [.......]/temp/run.do_image_ext4.1247938, line 151 Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Khem Raj <[email protected]>
1 parent 5013bd7 commit a8c964d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
inherit image_types
22

33
CONVERSIONTYPES += "sparse"
4-
CONVERSION_CMD:sparse() {
5-
in="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
6-
out="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sparse"
7-
case "${type}" in
8-
ext*)
9-
ext2simg "$in" "$out"
10-
;;
11-
*)
12-
img2simg "$in" "$out"
13-
;;
14-
esac
15-
}
4+
CONVERSION_CMD:sparse = " \
5+
case "${type}" in \
6+
ext*) \
7+
ext2simg "${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" \
8+
"${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sparse" \
9+
;; \
10+
*) \
11+
img2simg "${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" \
12+
"${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sparse" \
13+
;; \
14+
esac \
15+
"
1616
CONVERSION_DEPENDS_sparse = "android-tools-native"

0 commit comments

Comments
 (0)