public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: ashishkumar.mishra@bmwtechworks.in,
	 openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [RFC] Improving ext* sparse image generation: migrating from img2simg to ext4sparse for ext* filesystem
Date: Tue, 10 Feb 2026 08:39:58 +0000	[thread overview]
Message-ID: <9c9458ef6c32d63781cdfa8039caae30f63e1437.camel@linuxfoundation.org> (raw)
In-Reply-To: <Tn1R.1770617538678222907.ff9l@lists.openembedded.org>

[-- Attachment #1: Type: text/plain, Size: 3015 bytes --]

Hi,

On Sun, 2026-02-08 at 22:12 -0800, AshishKumar Mishra via
lists.openembedded.org wrote:
> Hello Community Members  , 
>  
> I would like to propose a change to how we handle sparse image
> generation for ext* file-systems in OpenEmbedded, 
> specifically moving away from the generic img2simg tool toward the
> specialised ext2simg in the e2fsprogs [contrib/android]

Firstly, you should probably mention that image_types_sparse is in
meta-oe, not oe-core. You should therefore probably mention this on the
list where meta-oe is maintained too.

> 1) Problem
> Currently, image_types_sparse.bbclass uses img2simg for all file-
> system types. 
> img2simg is a  tool that reads the raw image to find zero-filled
> blocks. 
> For ext* file-systems, this is inefficient compared to  ext2simg from
> e2fsprogs [contrib/android]
> which understands the file-system structure and uses the block bitmap
> to determine sparse areas.

That seems reasonable.

> 2) History
> Previously, 'ext2simg' was bundled within android-tools (v5.1 and
> older).
> The utility has since migrated to the e2fsprogs project
> (contrib/android).
> However, upstream e2fsprogs does not provide a build system for this
> tool,
> and it requires libsparse from android-tools to compile.
>  
>  
> 3) Proposed Changes
> To implement this, I am looking at a cross-layer approach:
>  
> a. meta-oe (android-tools):
> Export libsparse, libbase, and liblog headers and libraries to the
> sysroot. Currently, these are often internal to the build.
> Reorganise header installation to ${includedir}/sparse to match the
> expected include paths for e2fsprogs contrib tools.
>  
> b. oe-core (e2fsprogs):
> Add a conditional compilation step in e2fsprogs-native to build the
> ext4sparse utility located in contrib/android/.
> This would link against the exported libsparse from android-tools-
> native.
>  
> c. meta-oe (image_types_sparse.bbclass):
> Update CONVERSION_CMD:sparse to detect ext* types.
> Use  ext2simg from the e2fsprogs [contrib/android] for these types
> while falling back to img2simg for others (like f2fs).
>  
>  
> 4) Points for Discussion / Feasibility
>      I am seeking feedback on the following:
>  
> a. Layer Dependency: 
> This introduces a tighter coupling between oe-core and meta-oe. 
> Is it acceptable for e2fsprogs-native (core) to optionally depend on
> android-tools-native (meta-oe), 
> or i can create an bbapend file in meta-oe called
> e2fsprogs_%.bbappend. 

oe-core cannot depend on meta-oe.

The bbappend is one approach but it means e2fsprogs would rebuild
whenever a layer is added/removed and it would likely fail the yocto-
check-layer tests. It would also mean anything depending on e2fsprogs
would also rebuild and sstate would not be reused. None of this is
particularly good.

Instead, how about a separate recipe, e2fsprogs-ext4sparse which just
builds this utility?

Cheers,

Richard

[-- Attachment #2: Type: text/html, Size: 5996 bytes --]

  parent reply	other threads:[~2026-02-10  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09  6:12 [RFC] Improving ext* sparse image generation: migrating from img2simg to ext4sparse for ext* filesystem AshishKumar Mishra
2026-02-10  5:35 ` AshishKumar Mishra
2026-02-10  8:39 ` Richard Purdie [this message]
2026-02-10  8:45   ` [OE-core] " 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=9c9458ef6c32d63781cdfa8039caae30f63e1437.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=ashishkumar.mishra@bmwtechworks.in \
    --cc=openembedded-core@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