From patchwork Mon Dec 30 13:20:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11313041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7FDE13A4 for ; Mon, 30 Dec 2019 13:20:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A1A220663 for ; Mon, 30 Dec 2019 13:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577712045; bh=yXjtj3QOO5nG863hqRtcRcOVEvhCcTn95UWi2cv017M=; h=From:To:Cc:Subject:Date:List-ID:From; b=O4sz4/aixJ5JntIdpOg08cUeV0hIYdahxlA9KzB4cixb0tUC1VAtJOeojXRgPBad2 I7Is69ep6xLEatdClqUrEfUdhId/RI1wn0BP5ExonlK6fRuiR95p8uG7ISdz5gTP+e mOhJcZgLnvM+9GTru+S+UlIeY910QsK8HKr+7b6I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727445AbfL3NUp (ORCPT ); Mon, 30 Dec 2019 08:20:45 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64258 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727397AbfL3NUo (ORCPT ); Mon, 30 Dec 2019 08:20:44 -0500 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-07.nifty.com with ESMTP id xBUDK8fI023590; Mon, 30 Dec 2019 22:20:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com xBUDK8fI023590 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1577712010; bh=pnBt8xUVdXEnrnK1yEByI/0eROSFkY8hUgAQAoImYAQ=; h=From:To:Cc:Subject:Date:From; b=HluJL/CBuyQeAdk7OIIZRrd69Ejlmzhjkac59K+L68i5vhiA1d8Jcgjw3PIKCpkXk wHBZB7/bz6DhpNIKJKwdpntoXuFVJ1gOrTnAx4rwP+G3BfZdgqWubFhhUmstqKl45m bFswy6EsRIqxEmDC7sd/fQjsKMq7UBdjmA7HnNmEPGHprPGYaQHH/2vr7K/PvrwfxU pU5Aoa+c0HLFe1BnFfMmHSsiyMX5E+8TLFkNjpQslBRNcRGJ4dOB9/Mf3f7LkGmq5u 2FYLKE0/7bfc5+7uyx3KVKRine7RokWDztzduVtLBYF+irc6X1ZtOMI2PTM0WoGNNU m3NOOqx+WeePA== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: "Jory A . Pratt" , Masahiro Yamada , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH] initramfs: fix 'bad variable name' error in gen_initramfs_list.sh Date: Mon, 30 Dec 2019 22:20:06 +0900 Message-Id: <20191230132006.7401-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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 distros, the following code emits an error: local dev=`LC_ALL=C ls -l "${location}"` You can reproduce the build error, for example by setting CONFIG_INITRAMFS_SOURCE="/dev". GEN usr/initramfs_data.cpio.gz ./usr/gen_initramfs_list.sh: 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 --- usr/gen_initramfs_list.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/gen_initramfs_list.sh b/usr/gen_initramfs_list.sh index 0aad760fcd8c..2bbac73e6477 100755 --- a/usr/gen_initramfs_list.sh +++ b/usr/gen_initramfs_list.sh @@ -128,7 +128,7 @@ parse() { str="${ftype} ${name} ${location} ${str}" ;; "nod") - 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}` maj=${maj%,}