Skip to contentSkip to conversation

do_image_cpio: Improve reproducibility

PATCH In review Ernst Sjöstrand 3 participants 6 messages Nov 18, 2019 – Nov 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 do_image_cpio: Improve reproducibility

Find lists files in the order that the filesystem has registered them, which can vary. Adding a sort should have minimal performance impact. Also use the --reproducible option to cpio.

---
 meta/classes/image_types.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/image_types.bbclass +1 -1
index 2eeffbb366..c7af889075 100644
@@ -128,7 +128,7 @@ IMAGE_CMD_tar = "${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NA
 
 do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
 IMAGE_CMD_cpio () {
-	(cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
+	(cd ${IMAGE_ROOTFS} && find . | sort | cpio --reproducible -o -H newc >${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
 	# We only need the /init symlink if we're building the real
 	# image. The -dbg image doesn't need it! By being clever
 	# about this we also avoid 'touch' below failing, as it
Signature · 1 line
2.24.0
#1 lore raw

✗ patchtest: failure for do_image_cpio: Improve reproducibility

== Series Details ==

Series: do_image_cpio: Improve reproducibility
Revision: 1
URL : https://patchwork.openembedded.org/series/21190/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at dfb3b56641)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
#2 lore raw
In reply to Ernst Sjöstrand
Quoted 3 lines · Ernst Sjöstrand

Find lists files in the order that the filesystem has registered them, which can vary. Adding a sort should have minimal performance impact. Also use the --reproducible option to cpio.

For some reason this doesn't apply:

Applying: do_image_cpio: Improve reproducibility Using index info to reconstruct a base tree...
error: patch failed: meta/classes/image_types.bbclass:128
error: meta/classes/image_types.bbclass: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index. Patch failed at 0001 do_image_cpio: Improve reproducibility

Ross

#3 lore raw

I see, it was created against the yocto/poky git. However I made sure it applied to openembedded-core with "git am" also. If you use that it should work. I can create a new version if you want.

Regards
//Ernst
________________________________
From: [email protected] <[email protected]> on behalf of Ross Burton <[email protected]>
Sent: Monday, November 18, 2019 15:35
To: [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] do_image_cpio: Improve reproducibility

Quoted 3 lines · Ernst Sjöstrand

Find lists files in the order that the filesystem has registered them, which can vary. Adding a sort should have minimal performance impact. Also use the --reproducible option to cpio.

For some reason this doesn't apply:

Applying: do_image_cpio: Improve reproducibility Using index info to reconstruct a base tree...
error: patch failed: meta/classes/image_types.bbclass:128
error: meta/classes/image_types.bbclass: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index. Patch failed at 0001 do_image_cpio: Improve reproducibility

Ross
--
_______________________________________________
Openembedded-core mailing list
[email protected]
https://urldefense.com/v3/__http://lists.openembedded.org/mailman/listinfo/openembedded-core__;!!BFCLnRDDbM3FOmw!pzTjX-9fH0eNz5xLqWdhAP0q_Ns8zaAaf7amSkaV7fLGmXkB-29C2Awxih5o3OdxaDAFDw$

#4 lore raw
Quoted 2 lines · Ernst Sjöstrand

I see, it was created against the yocto/poky git. However I made sure it applied to openembedded-core with "git am" also. If you use that it should work. I can create a new version if you want.

This was applying to poky... maybe your mailer mangled the whitespace.

Ross

#5 lore raw

Find lists files in the order that the filesystem has registered them, which can vary. Adding a sort should have minimal performance impact. Also use the --reproducible option to cpio.

---

Trying again, looks like tabs were converted to spaces the first time.

 meta/classes/image_types.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/image_types.bbclass +1 -1
index 2eeffbb366..c7af889075 100644
@@ -128,7 +128,7 @@ IMAGE_CMD_tar = "${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NA
 
 do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
 IMAGE_CMD_cpio () {
-	(cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
+	(cd ${IMAGE_ROOTFS} && find . | sort | cpio --reproducible -o -H newc >${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
 	# We only need the /init symlink if we're building the real
 	# image. The -dbg image doesn't need it! By being clever
 	# about this we also avoid 'touch' below failing, as it
Signature · 1 line
2.24.0