From: Gyorgy Sarvari <skandigraun@gmail.com>
To: git-patches@bmwtechworks.in, openembedded-devel@lists.openembedded.org
Cc: AshishKumar Mishra <ashishkumar.mishra@bmwtechworks.in>
Subject: Re: [oe] [meta-oe][PATCH v1] image_types_sparse: switch ext* conversion to ext2simg_android
Date: Fri, 20 Mar 2026 09:24:56 +0100 [thread overview]
Message-ID: <f4bd5e86-4f7e-44fc-80da-ee914ed741df@gmail.com> (raw)
In-Reply-To: <20260320052813.3323280-1-git-patches@bmwtechworks.in>
I have added a few notes - I would recommend to wait a couple of days
before sending a v2, there might be further feedback from others (and
maybe I will forget also something)
On 3/20/26 06:28, Ashish Kumar Mishra via lists.openembedded.org wrote:
> We have RFC discussion at
> https://lists.openembedded.org/g/openembedded-devel/message/124499
>
> Move ext* sparse image generation from 'img2simg' to ' ext2simg_android'
> Summary of changes:
> - android-tools: Export libsparse/libbase/liblog headers and libs to
> sysroot to allow external linking. Masked v5.1.1.
>
> - image_types_sparse.bbclass: Update CONVERSION_CMD to use ext2simg_android
> for ext* types
>
> - layer.conf: Sync BBMASK and add dynamic-layer paths.
BBMASK doesn't sound something that belongs to meta-oe. There are other
ways to ignore recipes - PREFERRED_VERSION variable for example. Also,
there are/were some discussions[1] on dropping one of the android-tools
recipes - you may want to chime in and speed it up?
[1]: https://lists.openembedded.org/g/openembedded-devel/topic/117415388
>
> - Add a custom do_compile step to build the ext2simg_android utility (ext2simg)
> when building for the native class.
>
> - Added 'image_types_sparse' to IMAGE_CLASSES and enabled 'ext4.sparse'
> in IMAGE_FSTYPES.
> This allows the build system to generate Android-style sparse image
>
> - Switch to using $ORIGIN/../${baselib}.
> $ORIGIN is a special variable recognized by the dynamic linker that represents
> the directory containing the executable.
>
This might useful to also mention the motivation for specifying the
rpath (I still have some vague memories, but it fades by the minute)
> Signed-off-by: AshishKumar Mishra <ashishkumar.mishra@bmwtechworks.in>
> ---
> meta-oe/classes/image_types_sparse.bbclass | 15 +++-
> meta-oe/conf/layer.conf | 11 ++-
> .../android-tools/android-tools_29.0.6.r14.bb | 44 ++++++++++++
> .../e2fsprogs-ext4sparse.inc | 26 +++++++
> ...inode.c-Fix-for-file-larger-than-2GB.patch | 40 +++++++++++
> ...-missing-check-for-permission-denied.patch | 32 +++++++++
> .../e2fsprogs-ext4sparse/mkdir_p.patch | 28 ++++++++
> .../e2fsprogs-ext4sparse/quiet-debugfs.patch | 27 ++++++++
> .../remove.ldconfig.call.patch | 41 +++++++++++
> .../e2fsprogs-ext4sparse_1.0.bb | 68 +++++++++++++++++++
> 10 files changed, 328 insertions(+), 4 deletions(-)
> create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse.inc
> create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse/0001-misc-create_inode.c-Fix-for-file-larger-than-2GB.patch
> create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse/e2fsprogs-fix-missing-check-for-permission-denied.patch
> create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse/mkdir_p.patch
> create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse/quiet-debugfs.patch
> create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse/remove.ldconfig.call.patch
> create mode 100644 meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse_1.0.bb
>
> diff --git a/meta-oe/classes/image_types_sparse.bbclass b/meta-oe/classes/image_types_sparse.bbclass
> index 5416c2a019..75f0d00703 100644
> --- a/meta-oe/classes/image_types_sparse.bbclass
> +++ b/meta-oe/classes/image_types_sparse.bbclass
> @@ -13,11 +13,20 @@ DELETE_RAWIMAGE_AFTER_SPARSE_CMD ??= "0"
>
> CONVERSION_CMD:sparse = " \
> truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "${IMAGE_NAME}.${type}"; \
> - img2simg -s "${IMAGE_NAME}.${type}" "${IMAGE_NAME}.${type}.sparse" ${SPARSE_BLOCK_SIZE}; \
> + case '${type}' in \
> + ext*) \
> + bbwarn 'Running e2fsprogs-derived ext2simg_android..' ; \
Please do not use bbwarn for generic logging in final patches. This
should be bbdebug or bbnote most probably. Same for the other usages also
(bberror usages look appropriate at the first sight)
> + ext2simg_android '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.simg' || bberror 'ext2simg_android failed' \
> + ;; \
> + *) \
> + bbwarn 'Generating sparse image for non-ext filesystem...'; \
> + img2simg -s '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.${type}.sparse' ${SPARSE_BLOCK_SIZE}; \
> + ;; \
> + esac; \
> if [ "${DELETE_RAWIMAGE_AFTER_SPARSE_CMD}" = "1" ]; then \
> rm -f ${IMAGE_NAME}.${type};\
> bbwarn "Raw file ${IMAGE_NAME}.${type} removed" ;\
> fi;\
> "
> -
> -CONVERSION_DEPENDS_sparse = "android-tools-native"
> +CONVERSION_DEPENDS:sparse = "android-tools-native e2fsprogs-ext4sparse-native"
> +do_image_ext4[depends] += "e2fsprogs-ext4sparse-native:do_populate_sysroot"
... snip ...
> diff --git a/meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse_1.0.bb b/meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse_1.0.bb
> new file mode 100644
> index 0000000000..96f1f08177
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/e2fsprogs-ext4sparse/e2fsprogs-ext4sparse_1.0.bb
> @@ -0,0 +1,68 @@
> +require e2fsprogs-ext4sparse.inc
> +
> +inherit native
> +
> +SRC_URI += "file://remove.ldconfig.call.patch \
> + file://mkdir_p.patch \
> + file://0001-misc-create_inode.c-Fix-for-file-larger-than-2GB.patch \
> + "
> +SRC_URI:append:class-native = " \
> + file://e2fsprogs-fix-missing-check-for-permission-denied.patch \
> + file://quiet-debugfs.patch \
> + "
> +
> +SRCREV = "da631e117dcf8797bfda0f48bdaa05ac0fbcf7af"
> +
> +EXTRA_OECONF = " \
> + --libdir=${base_libdir} \
> + --sbindir=${base_sbindir} \
> + --enable-elf-shlibs \
> + --enable-largefile \
> + --disable-libuuid \
> + --disable-libblkid \
> + --disable-uuidd \
> + --disable-fuse2fs \
> + --with-crond-dir=no \
> +"
> +
> +DEPENDS += "util-linux-native"
> +
> +# Fix e2fsprogs-native do_compile error with old kernel such as 5.10
> +CACHED_CONFIGUREVARS:class-native = "ac_cv_header_linux_fsverity_h=no"
> +
> +do_install () {
> +}
Why empty install for class-target? Is this a native-only recipe?
> +
> +
> +RDEPENDS:${PN} = ""
> +RRECOMMENDS:${PN} = ""
> +ALTERNATIVE:${PN} = ""
Are this overriding something?
> +
> +PACKAGES = "${PN}"
> +FILES:${PN} = "${bindir}/ext2simg_android"
> +FILES:${PN}:class-native += "${bindir}/ext2simg_android"
Does this need to be repeated? I'd expect that the first FILES
assignment would take ffect for class-native also. Is this not the case?
> +
> +DEPENDS:append:class-native = " android-tools-native "
> +
> +do_compile:append:class-native() {
> + oe_runmake -C ${B}/lib/et
> + oe_runmake -C ${B}/lib/ext2fs
> +
> + # 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${STAGING_LIBDIR_NATIVE} -lsparse -lext2fs -lz -lcom_err"
> +
> + ${CC} ${CFLAGS} ${LDFLAGS} -o "${B}/ext2simg_android" "${SRC_EXT2SIMG}/ext2simg.c" ${INCLUDES} ${LIBS}
> +}
> +
> +do_install:append:class-native() {
> + install -d ${D}${bindir}
> + install -m 0755 ${B}/ext2simg_android ${D}${bindir}/ext2simg_android
> +}
> +
> +BUILD_LDFLAGS += "-Wl,-rpath,'\$ORIGIN/../${baselib}'"
> +TARGET_LDFLAGS += "-Wl,-rpath,'\$ORIGIN/../${baselib}'"
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#125420): https://lists.openembedded.org/g/openembedded-devel/message/125420
> Mute This Topic: https://lists.openembedded.org/mt/118413954/6084445
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
next prev parent reply other threads:[~2026-03-20 8:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 5:28 [meta-oe][PATCH v1] image_types_sparse: switch ext* conversion to ext2simg_android Ashish Kumar Mishra
2026-03-20 8:24 ` Gyorgy Sarvari [this message]
2026-03-20 8:40 ` Ashish Mishra
2026-03-23 10:24 ` Ashish Mishra
2026-03-30 10:07 ` [meta-oe][PATCH v2 0/2] android-tools: migration and cleanup Ashish Kumar Mishra
2026-03-30 10:07 ` [meta-oe][PATCH v2 1/2] android-tools: remove android-tools 5.x from meta-oe/recipes-devtools Ashish Kumar Mishra
2026-03-30 10:07 ` [meta-oe][PATCH v2 2/2] android-tools: move android-tools v29.x from dynamic-layers/selinux to meta-oe Ashish Kumar Mishra
2026-04-01 17:21 ` [meta-oe][PATCH v2 0/2] android-tools: migration and cleanup Ashish Mishra
2026-04-02 4:49 ` [oe] " Gyorgy Sarvari
2026-04-03 10:00 ` Etienne Cordonnier
2026-04-06 4:21 ` Ashish Mishra
2026-04-06 5:06 ` [oe] " Khem Raj
2026-04-06 5:18 ` Ashish Mishra
2026-04-06 5:24 ` [oe] " Khem Raj
2026-04-08 6:07 ` Ashish 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=f4bd5e86-4f7e-44fc-80da-ee914ed741df@gmail.com \
--to=skandigraun@gmail.com \
--cc=ashishkumar.mishra@bmwtechworks.in \
--cc=git-patches@bmwtechworks.in \
--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