Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14169053ybl; Mon, 30 Dec 2019 05:21:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzJE2g75meitbAIeTx22rtRvcqq1/J9xWaY0Q/iFoYp812dwf8m5QkQTMQXiIFiVVgzj11f X-Received: by 2002:a9d:402:: with SMTP id 2mr16889247otc.357.1577712096624; Mon, 30 Dec 2019 05:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577712096; cv=none; d=google.com; s=arc-20160816; b=zAEF2CR5IcjvenrHEkliu99F+yMt3bxE6SH1F6Qqre7aWs3jamI5ZGWpe8CdYZbruK KCA9dA3ey6s6dH9SQVUwZ77tZWq3RHj1gfbAoOTsZenDzXqJsWUvhLK/6AgZDe+C9HAS AK8m6RDgLIXEwWuAb8ssF1BQGvR/7/uxZjQMoJVzyF3oZtdtp+udw6/KmtkSHzfksNBD fEqpZS/Zh3dyIhicPCcE8/00B9g1xRqb5mLPTdcd+HlKtD5lEQM1f1Vi3pk/Wy/9jVl8 aUWV61heSqSuoV4RsdgGecR2IQkBhzISt7uIXnpw1cjZyur7rRbYXGzKG+RVEJS/epcg LKiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=pnBt8xUVdXEnrnK1yEByI/0eROSFkY8hUgAQAoImYAQ=; b=1A3GPrnoK7hJTnsmKB3zgyVRSiGS6tMwilEmGs0WSWxkaRQVk2bc2sx1T2d+3cCBj6 3bF5JCBu7nIQR9bg7pjuFFxZ9cVRo/zLKCr33IYb3ae/s83Ai0itSJqPavvhquBPfLpt Xka1iW6UlzjP6Gqb/KLsd2bL/vHF7HyOzWYVFRH+3H/EROCnmeuCTDhETvIj+zzS8Pqr h2cfyE5CFXzWtwP8JEYgq3o5yf49q8Q9hWQa+Fb99MmtARsbKZTxKI4lrJcNqXJ5iaCt RevcyXMdWZ3WNLLfFmdbny53Yoz/+x9dnS4KYTkO33/6z/O42oAYnmPkbC3DDXfOuL1Y qAMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="HluJL/CB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si23688730otn.202.2019.12.30.05.21.25; Mon, 30 Dec 2019 05:21:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="HluJL/CB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727467AbfL3NUp (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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%,} -- 2.17.1