From 930c1f69c928e21bda6bef7aad926d335195e107 Mon Sep 17 00:00:00 2001 From: Ernst Sjöstrand Date: Mon, 25 Nov 2019 05:41:41 +0000 Subject: do_image_cpio: Improve reproducibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Ernst Sjöstrand Signed-off-by: Richard Purdie --- meta/classes/image_types.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'meta/classes/image_types.bbclass') diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 2eeffbb366..c7af889075 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass @@ -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 -- cgit 1.2.3-korg