2020-10-14 06:07:41 +00:00
|
|
|
diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
|
2020-10-20 08:02:39 +00:00
|
|
|
index 28a435dd5e..72923ded47 100644
|
2020-10-14 06:07:41 +00:00
|
|
|
--- a/fs/cpio/cpio.mk
|
|
|
|
+++ b/fs/cpio/cpio.mk
|
2020-10-20 08:02:39 +00:00
|
|
|
@@ -32,12 +32,17 @@ ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT
|
|
|
|
# --reproducible 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
|
|
|
|
+ROOTFS_CPIO_DEPENDENCIES += host-cpio host-libarchive
|
2020-10-14 06:07:41 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
define ROOTFS_CPIO_CMD
|
|
|
|
- cd $(TARGET_DIR) && find . | cpio $(ROOTFS_CPIO_OPTS) --quiet -o -H newc > $@
|
2020-10-20 08:02:39 +00:00
|
|
|
+ cd $(TARGET_DIR) \
|
|
|
|
+ && find . -mindepth 1 -execdir touch -hcd "@0" "{}" + \
|
|
|
|
+ && find . -mindepth 1 -printf '%P\0' \
|
|
|
|
+ | sort -z \
|
|
|
|
+ | LANG=C bsdtar --null -cnf - -T - \
|
|
|
|
+ | LANG=C bsdtar --uid 0 --gid 0 --null -cf - --format=newc @- \
|
2020-10-14 06:07:41 +00:00
|
|
|
+ > $@
|
|
|
|
endef
|
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_CPIO_UIMAGE),y)
|