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

Commit f55f2328 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Masahiro Yamada
Browse files

kbuild: make sorting initramfs contents independent of locale



Some LANG values (e.g. pl_PL.UTF-8) cause the sort command to output
files before their parent directories, which makes them inaccessible for
the kernel. In other words, when the kernel populates the rootfs, it is
unable to create files whose parent directories have not been yet created.

This patch makes sorting use the default (LANG=C) locale, which results in
correctly laid out initramfs images (parent directories before files).

Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent dd5806ed
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ dir_filelist() {
	${dep_list}header "$1"

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

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