From 66bb9b8e2ac0039305c28a9b09125c0ca0f142a0 Mon Sep 17 00:00:00 2001 From: AshishKumar Mishra Date: Tue, 21 Jul 2026 21:56:42 +0530 Subject: [PATCH] e2fsprogs-ext4sparse-native: compiles ext2simg.c using android-tools-native 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 Signed-off-by: Khem Raj --- .../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 +} +