Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e6e0d5f authored by Bjørn Forsman's avatar Bjørn Forsman Committed by Masahiro Yamada
Browse files

kbuild: create deterministic initramfs directory listings



kbuild runs "find" on each entry in CONFIG_INITRAMFS_SOURCE that is a
directory. The order of the file listing output by "find" matter for
build reproducability, hence this patch applies "sort" to get
deterministic results.

Without this patch, two different machines with identical initramfs
directory input may produce differing initramfs cpio archives (different
hash) due to the different order of the files within the archive.

Signed-off-by: default avatarBjørn Forsman <bjorn.forsman@gmail.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent adcc3f7c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -174,7 +174,7 @@ dir_filelist() {
	${dep_list}header "$1"
	${dep_list}header "$1"


	srcdir=$(echo "$1" | sed -e 's://*:/:g')
	srcdir=$(echo "$1" | sed -e 's://*:/:g')
	dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n")
	dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | sort)


	# If $dirlist is only one line, then the directory is empty
	# If $dirlist is only one line, then the directory is empty
	if [  "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
	if [  "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then