[lkml]   [2020]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 5.4 124/191] fix bad variable name error
From: Masahiro Yamada <>

commit cc976614f59bd8e45de8ce988a6bcb5de711d994 upstream.

Prior to commit 858805b336be ("kbuild: add $(BASH) to run scripts with
bash-extension"), this shell script was almost always run by bash since
bash is usually installed on the system by default.

Now, this script is run by sh, which might be a symlink to dash. On such
distributions, the following code emits an error:

local dev=`LC_ALL=C ls -l "${location}"`

You can reproduce the build error, for example by setting

GEN usr/initramfs_data.cpio.gz
./usr/ 131: local: 1: bad variable name
make[1]: *** [usr/Makefile:61: usr/initramfs_data.cpio.gz] Error 2

This is because `LC_ALL=C ls -l "${location}"` contains spaces.
Surrounding it with double-quotes fixes the error.

Fixes: 858805b336be ("kbuild: add $(BASH) to run scripts with bash-extension")
Reported-by: Jory A. Pratt <>
Signed-off-by: Masahiro Yamada <>
Signed-off-by: Greg Kroah-Hartman <>

usr/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/usr/
+++ b/usr/
@@ -128,7 +128,7 @@ parse() {
str="${ftype} ${name} ${location} ${str}"
- local dev=`LC_ALL=C ls -l "${location}"`
+ local dev="`LC_ALL=C ls -l "${location}"`"
local maj=`field 5 ${dev}`
local min=`field 6 ${dev}`

 \ /
  Last update: 2020-01-07 22:40    [W:0.490 / U:3.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site