aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGravatar Atharva Lele <itsatharva@gmail.com>2019-07-16 23:05:18 +0530
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2019-07-17 08:53:03 +0200
commitfd544aaebbaad9d8d3631d58f988227fada0a3db (patch)
tree87747e0248b33d7f27d19d2b8002ed3e6258b602 /fs
parent48f2f4dd8e4a54dcbfcda947c6ced724c77841c2 (diff)
downloadbuildroot-fd544aaebbaad9d8d3631d58f988227fada0a3db.tar.gz
buildroot-fd544aaebbaad9d8d3631d58f988227fada0a3db.tar.bz2
fs/cpio: make cpio rootfs reproducible
Pass the recommended argument in the CPIO manual to make cpio archives reproducible. Reference: https://www.gnu.org/software/cpio/manual/cpio.html#Copy_002dpass-mode Pre-patch diffoscope output: https://gitlab.com/snippets/1874745 Post-patch: https://gitlab.com/snippets/1874746 We can see that post-patch, the archive related differences are removed. The differences are arising from utils/bin/getconf. This will have to be investigated further. However, that is unrelated to cpio. Signed-off-by: Atharva Lele <itsatharva@gmail.com> Reviewed-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cpio/cpio.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
index 1f0cafe62f..8b133f3875 100644
--- a/fs/cpio/cpio.mk
+++ b/fs/cpio/cpio.mk
@@ -29,8 +29,15 @@ endif # BR2_ROOTFS_DEVICE_CREATION_STATIC
ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT
+# --repoducible option was introduced in cpio v2.12, which may not be
+# available in some old distributions, so we build host-cpio
+ifeq ($(BR2_REPRODUCIBLE),y)
+ROOTFS_CPIO_DEPENDENCIES += host-cpio
+ROOTFS_CPIO_OPTS += --reproducible
+endif
+
define ROOTFS_CPIO_CMD
- cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $@
+ cd $(TARGET_DIR) && find . | cpio $(ROOTFS_CPIO_OPTS) --quiet -o -H newc > $@
endef
ifeq ($(BR2_TARGET_ROOTFS_CPIO_UIMAGE),y)