mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: "Andrzej Pietrasiewicz" <andrzej.p@samsung.com>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Bjørn Forsman" <bjorn.forsman@gmail.com>
Subject: [PATCH] kbuild: make sorting initramfs contents independent of locale
Date: Fri, 17 Aug 2018 14:03:19 +0200	[thread overview]
Message-ID: <20180817120319.21002-1-andrzej.p@samsung.com> (raw)
In-Reply-To: <CAK7LNASUsZB--DWMB4hpw74OnTiz+d2jrdp+CA9L=AOdkbEmhg@mail.gmail.com>

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 <andrzej.p@samsung.com>
---
 scripts/gen_initramfs_list.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 10e528b..0aad760 100755
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -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
-- 
2.7.4


  parent reply	other threads:[~2018-08-17 12:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180816161825eucas1p11be9cea5d622b905154590bae90a47a4@eucas1p1.samsung.com>
2018-08-16 16:18 ` [PATCH] Revert "kbuild: create deterministic initramfs directory listings" Andrzej Pietrasiewicz
2018-08-16 23:34   ` Bjørn Forsman
2018-08-17  7:47     ` Andrzej Pietrasiewicz
2018-08-17  8:14       ` Masahiro Yamada
     [not found]         ` <CGME20180817120447eucas1p1dde0176cf7d824e8a42e2d39ac5531f9@eucas1p1.samsung.com>
2018-08-17 12:03           ` Andrzej Pietrasiewicz [this message]
2018-08-20 15:03             ` [PATCH] kbuild: make sorting initramfs contents independent of locale Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180817120319.21002-1-andrzej.p@samsung.com \
    --to=andrzej.p@samsung.com \
    --cc=bjorn.forsman@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®