* [scarthgap] meta-oe: image: optionally remove RAW image after sparse image creation
@ 2025-09-18 14:42 AshishKumar Mishra
2025-09-23 6:30 ` Ashish Mishra
0 siblings, 1 reply; 3+ messages in thread
From: AshishKumar Mishra @ 2025-09-18 14:42 UTC (permalink / raw)
To: openembedded-devel; +Cc: anuj.mittal, AshishKumar Mishra, Khem Raj
From: AshishKumar Mishra <emailaddress.ashish@gmail.com>
When creating sparse images, the RAW image is no longer needed in
some workflows such as Android and CI pipelines. These RAW images
can be multi-GB artifacts and consume significant disk space.
This change introduces a configuration option
`DELETE_RAWIMAGE_AFTER_SPARSE_CMD` which, when set to "1",
removes the RAW image after sparse image generation.
This reduces disk usage in builds where sparse images are the
final deliverables and RAW images are not required.
Default behavior is unchanged: RAW images are kept unless the
variable is explicitly enabled:
DELETE_RAWIMAGE_AFTER_SPARSE_CMD = "1" # Delete RAW image
DELETE_RAWIMAGE_AFTER_SPARSE_CMD = "0" # Default behavior
(cherry-picked from f5246b7df447ac76ec04c6e5add398862d1c9ccd in master )
Signed-off-by: AshishKumar Mishra <emailaddress.ashish@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta-oe/classes/image_types_sparse.bbclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta-oe/classes/image_types_sparse.bbclass b/meta-oe/classes/image_types_sparse.bbclass
index d6ea68968e..5416c2a019 100644
--- a/meta-oe/classes/image_types_sparse.bbclass
+++ b/meta-oe/classes/image_types_sparse.bbclass
@@ -9,9 +9,15 @@ SPARSE_BLOCK_SIZE ??= "4096"
CONVERSIONTYPES += "sparse"
+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}; \
+ 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"
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [scarthgap] meta-oe: image: optionally remove RAW image after sparse image creation
2025-09-18 14:42 [scarthgap] meta-oe: image: optionally remove RAW image after sparse image creation AshishKumar Mishra
@ 2025-09-23 6:30 ` Ashish Mishra
2025-09-23 6:33 ` [oe] " Mittal, Anuj
0 siblings, 1 reply; 3+ messages in thread
From: Ashish Mishra @ 2025-09-23 6:30 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 146 bytes --]
Hi Anuj ,
Can you please share your comments on this backported patch.
This patch i have already merged in Master branch
Thanks ,
Ashish
[-- Attachment #2: Type: text/html, Size: 272 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [oe] [scarthgap] meta-oe: image: optionally remove RAW image after sparse image creation
2025-09-23 6:30 ` Ashish Mishra
@ 2025-09-23 6:33 ` Mittal, Anuj
0 siblings, 0 replies; 3+ messages in thread
From: Mittal, Anuj @ 2025-09-23 6:33 UTC (permalink / raw)
To: openembedded-devel@lists.openembedded.org,
emailaddress.ashish@gmail.com
On Mon, 2025-09-22 at 23:30 -0700, Ashish Mishra via
lists.openembedded.org wrote:
> Hi Anuj ,
>
> Can you please share your comments on this backported patch.
Thank you for reminder. It's in my test queue.
Thanks,
Anuj
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-23 6:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 14:42 [scarthgap] meta-oe: image: optionally remove RAW image after sparse image creation AshishKumar Mishra
2025-09-23 6:30 ` Ashish Mishra
2025-09-23 6:33 ` [oe] " Mittal, Anuj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.