Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: AshishKumar Mishra <emailaddress.ashish@gmail.com>
To: openembedded-devel@lists.openembedded.org
Cc: AshishKumar Mishra <emailaddress.ashish@gmail.com>
Subject: [meta-openembedded][PATCH v3 1/3] e2fsprogs-ext4sparse-native: compiles ext2simg.c using android-tools-native
Date: Tue, 21 Jul 2026 21:56:42 +0530	[thread overview]
Message-ID: <20260721162645.2056048-2-emailaddress.ashish@gmail.com> (raw)
In-Reply-To: <20260721162645.2056048-1-emailaddress.ashish@gmail.com>

Add a custom do_compile step to build the  ext2simg_android utility (ext2simg)
when building for the native class.
This can be used to generate ext* based sparse image

Signed-off-by: AshishKumar Mishra <emailaddress.ashish@gmail.com>
---
 .../e2fsprogs-ext4sparse-native_1.47.4.bb     | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse-native_1.47.4.bb

diff --git a/meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse-native_1.47.4.bb b/meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse-native_1.47.4.bb
new file mode 100644
index 0000000000..04f9aaaf2b
--- /dev/null
+++ b/meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse-native_1.47.4.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Native ext sparse conversion utility from e2fsprogs"
+DESCRIPTION = "Builds only ext2simg for host-side ext* sparse image conversion"
+HOMEPAGE = "http://e2fsprogs.sourceforge.net/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://contrib/android/ext2simg.c;beginline=1;endline=14;md5=fc8a826484cc82548adeaad2579adfca"
+
+DEPENDS = "e2fsprogs-native android-tools-native"
+
+SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git;branch=master;protocol=https"
+SRCREV = "ece89fac4603e400155b7bbf6326284f8511bca9"
+
+inherit native
+
+do_compile() {
+    bbnote "Compiling ext2simg.c with native toolchain"
+    # Source directory for ext2simg.c in the e2fsprogs tree
+    SRC_EXT2SIMG="${S}/contrib/android"
+
+    INCLUDES="-I${S}/lib -I${B}/lib -I${SRC_EXT2SIMG}/lib"
+
+    # STAGING_LIBDIR_NATIVE: where android-tools-native installed libsparse
+    LIBS="-L${B}/lib -L${RECIPE_SYSROOT_NATIVE}${libdir} -L${RECIPE_SYSROOT_NATIVE}${libdir}/android -lsparse -lext2fs -lz -lcom_err"
+
+    ${CC} ${CFLAGS} ${LDFLAGS} -o "${B}/ext2simg_android" "${SRC_EXT2SIMG}/ext2simg.c" ${INCLUDES} ${LIBS}
+    bbnote "ext2simg_android compilation finished"
+}
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${B}/ext2simg_android ${D}${bindir}/ext2simg_android
+}
+
-- 
2.43.0



  reply	other threads:[~2026-07-21 16:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 16:26 [meta-openembedded][PATCH v3 0/3] image_types_sparse: use ext2simg_android for ext* sparse images AshishKumar Mishra
2026-07-21 16:26 ` AshishKumar Mishra [this message]
2026-07-21 16:26 ` [meta-openembedded][PATCH v3 2/3] android-tools: export libsparse/libbase/liblog headers and libs to sysroot AshishKumar Mishra
2026-07-21 16:26 ` [meta-openembedded][PATCH v3 3/3] image_types_sparse: switch ext* conversion to ext2simg_android AshishKumar Mishra
2026-07-21 16:29 ` [meta-openembedded][PATCH v3 0/3] image_types_sparse: use ext2simg_android for ext* sparse images AshishKumar Mishra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260721162645.2056048-2-emailaddress.ashish@gmail.com \
    --to=emailaddress.ashish@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox