* [PATCH] meta-oe: image: optionally remove RAW image after sparse image creation
@ 2025-09-14 15:19 Ashish Mishra
0 siblings, 0 replies; 4+ messages in thread
From: Ashish Mishra @ 2025-09-14 15:19 UTC (permalink / raw)
To: openembedded-devel; +Cc: raj.khem, AshishKumar Mishra
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
Signed-off-by: AshishKumar Mishra <emailaddress.ashish@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] 4+ messages in thread
* [PATCH] meta-oe: image: optionally remove RAW image after sparse image creation
@ 2025-09-14 15:40 AshishKumar Mishra
2025-09-14 15:45 ` Patchtest results for " patchtest
2025-09-16 4:56 ` Ashish Mishra
0 siblings, 2 replies; 4+ messages in thread
From: AshishKumar Mishra @ 2025-09-14 15:40 UTC (permalink / raw)
To: openembedded-core, openembedded-devel; +Cc: raj.khem, AshishKumar Mishra
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
Signed-off-by: AshishKumar Mishra <emailaddress.ashish@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] 4+ messages in thread
* Patchtest results for [PATCH] meta-oe: image: optionally remove RAW image after sparse image creation
2025-09-14 15:40 [PATCH] meta-oe: image: optionally remove RAW image after sparse image creation AshishKumar Mishra
@ 2025-09-14 15:45 ` patchtest
2025-09-16 4:56 ` Ashish Mishra
1 sibling, 0 replies; 4+ messages in thread
From: patchtest @ 2025-09-14 15:45 UTC (permalink / raw)
To: AshishKumar Mishra; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 3241 bytes --]
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:
---
Testing patch /home/patchtest/share/mboxes/meta-oe-image-optionally-remove-RAW-image-after-sparse-image-creation.patch
FAIL: test target mailing list: Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists (test_mbox.TestMbox.test_target_mailing_list)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] meta-oe: image: optionally remove RAW image after sparse image creation
2025-09-14 15:40 [PATCH] meta-oe: image: optionally remove RAW image after sparse image creation AshishKumar Mishra
2025-09-14 15:45 ` Patchtest results for " patchtest
@ 2025-09-16 4:56 ` Ashish Mishra
1 sibling, 0 replies; 4+ messages in thread
From: Ashish Mishra @ 2025-09-16 4:56 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 125 bytes --]
Hi Team ,
Any feedback on the patch or any suggestion .
I can share the updated patch accordingly .
Thanks ,
Ashish
[-- Attachment #2: Type: text/html, Size: 244 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-16 4:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-14 15:40 [PATCH] meta-oe: image: optionally remove RAW image after sparse image creation AshishKumar Mishra
2025-09-14 15:45 ` Patchtest results for " patchtest
2025-09-16 4:56 ` Ashish Mishra
-- strict thread matches above, loose matches on Subject: below --
2025-09-14 15:19 Ashish Mishra
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.