]> Git Repo - linux.git/commitdiff
kbuild: make sorting initramfs contents independent of locale
authorAndrzej Pietrasiewicz <[email protected]>
Fri, 17 Aug 2018 12:03:19 +0000 (14:03 +0200)
committerMasahiro Yamada <[email protected]>
Wed, 22 Aug 2018 14:21:43 +0000 (23:21 +0900)
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: Andrzej Pietrasiewicz <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
scripts/gen_initramfs_list.sh

index 10e528b3a08fc4b4f4e2bde66ced6fa4d7684787..0aad760fcd8c3704a6445e1a5218082d3d069063 100755 (executable)
@@ -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
This page took 0.058159 seconds and 4 git commands to generate.