Adds a class to create sparse image files using the Android tools

Signed-off-by: Joshua Watt <jpewhac...@gmail.com>
---
 meta-oe/classes/image_types_sparse.bbclass | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 meta-oe/classes/image_types_sparse.bbclass

diff --git a/meta-oe/classes/image_types_sparse.bbclass 
b/meta-oe/classes/image_types_sparse.bbclass
new file mode 100644
index 000000000..1459f800a
--- /dev/null
+++ b/meta-oe/classes/image_types_sparse.bbclass
@@ -0,0 +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_DEPENDS_sparse = "android-tools-native"
-- 
2.30.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#89987): 
https://lists.openembedded.org/g/openembedded-devel/message/89987
Mute This Topic: https://lists.openembedded.org/mt/81186763/21656
Group Owner: openembedded-devel+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to