sort order of files packed into initramfs

This commit is contained in:
Lance Vick 2020-10-13 23:07:41 -07:00
parent e3bf233b34
commit 9894b08bcb
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
index 28a435dd5e..81f8c393d1 100644
--- a/fs/cpio/cpio.mk
+++ b/fs/cpio/cpio.mk
@@ -37,7 +37,11 @@ ROOTFS_CPIO_OPTS += --reproducible
endif
define ROOTFS_CPIO_CMD
- cd $(TARGET_DIR) && find . | cpio $(ROOTFS_CPIO_OPTS) --quiet -o -H newc > $@
+ cd $(TARGET_DIR) && \
+ find . \
+ | LC_ALL=C sort \
+ | cpio $(ROOTFS_CPIO_OPTS) --quiet -o -H newc \
+ > $@
endef
ifeq ($(BR2_TARGET_ROOTFS_CPIO_UIMAGE),y)