Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp875367pxf; Wed, 7 Apr 2021 13:54:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgdAaI3be5Ep6cp/ylFMGI+8coYdDYu04w4wrqhyiwiRYTU6jGSOTohv0XkZtcUYNngQmG X-Received: by 2002:a17:906:d04d:: with SMTP id bo13mr6005911ejb.157.1617828847496; Wed, 07 Apr 2021 13:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617828847; cv=none; d=google.com; s=arc-20160816; b=s4dyQxnfi5B3C0HMeA96/7JUZ+MvdWTBbdlZrIPpfBOSCBqq6FykD4ANiuScXaYD3p jmh1akKx/io3oW0Q+UftKXvvuVQnSmMsXrycfyWC1WGsNLb8DinkoJOPew/TAtCf35l2 HKRD7PpRqAA42WVN1JrMAUMsPntOwsYJ+bGALkX62sE11/Qo5cqmn6RhBGBDhvc2Uxnw TdgOPuOUCxxpY+jTmJYEGyu/rhiYQCl3gxGHXbX4oE/zDWc4QIgYW8oIMu4LfriRlesK KmNXDWtqIrb5KmYfFtQGHISfPvZUDeGBhgZPqUGjnhFz1O3iPsO+/T1bD0FrpVS/ePIx WYaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=HsHy1BlkdzgaJU7jTvUQfH1kV2wKWxfz5Llhj+2yTjo=; b=osuFqIpcOjIo4pXuB4BGUswXMnzjXb+RAcey+nVIrw8Aid4QAvawEymSvIJGD/GT8K yQcDTP7omJX0MepQuw31uFGJDqfAovKS4vXWMgbxCARsBuZs6REZwgsVBIJNsnQsITCz Joee8XW4+ntB+VEcgQs+7H4tvNDanQuSq9yJ4w0hhsydKgPQfSv4avpQsUAm/EtvT8Jr mUOWu+BnaTzW0cPCdH8IKLkgZLycR3vebHBPc0nYl9DcqsLpKvaP5YUjRN5yHpvV7JYi pOVHQrDA8D+fZk9WybGGe6l0ltDiv8wd6ofk76tEAFAweAHGe1AmDj/igFMsBkPBuzfS OXsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=VHdHLD6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj22si15001849ejb.425.2021.04.07.13.53.44; Wed, 07 Apr 2021 13:54:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=VHdHLD6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347205AbhDGLAb (ORCPT + 99 others); Wed, 7 Apr 2021 07:00:31 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:28844 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242100AbhDGLAa (ORCPT ); Wed, 7 Apr 2021 07:00:30 -0400 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 137B05fV001106; Wed, 7 Apr 2021 20:00:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 137B05fV001106 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1617793205; bh=HsHy1BlkdzgaJU7jTvUQfH1kV2wKWxfz5Llhj+2yTjo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VHdHLD6jFP5PcQTjgL8Yad0n2VtsgvTj/S8EEMqNtiYE8wHYBTIG39maLA+17/gd+ GMryX0df5i46XfWuEXHr7cPyn6f9UH6fOFJACWPMTTZH0UmfXX9CKxbrJNnjOCwYIT jsJjVaYYOQ4+PWmnEBjrCRlxYArih52LSMEBushOUwxnTx4V+8slFT82zFikWqlj/r OExAxG3qp9MENrmj5Fb4i+HakcLCbQGjIsGn0HCQD/9W2hWllG7iVbilF/cawPEsGw gAwA5YPkXTU0vogq/ubP0JxCo3cDaKAx2gl32kHGtLnNyC224lVU+Gd9ZEGrK8FwJC 9d6qmW0Ggg5qw== X-Nifty-SrcIP: [209.85.216.46] Received: by mail-pj1-f46.google.com with SMTP id t23so6340235pjy.3; Wed, 07 Apr 2021 04:00:05 -0700 (PDT) X-Gm-Message-State: AOAM530HazePKO0vqxajMVIjDpbusVbEmPwD8C9LkpyhEoOUcx/KHVKq hPc5J4QrhpJH9a1x08R67i3hYWRLA0QMi82ceBU= X-Received: by 2002:a17:90a:28a1:: with SMTP id f30mr2764084pjd.198.1617793204616; Wed, 07 Apr 2021 04:00:04 -0700 (PDT) MIME-Version: 1.0 References: <20210407053419.449796-1-gregkh@linuxfoundation.org> <20210407053419.449796-3-gregkh@linuxfoundation.org> In-Reply-To: <20210407053419.449796-3-gregkh@linuxfoundation.org> From: Masahiro Yamada Date: Wed, 7 Apr 2021 19:59:26 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables To: Greg Kroah-Hartman Cc: Michal Marek , Linux Kbuild mailing list , linux-arch , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman wrote: > > A few variables are quoted to handle spaces in directory names, but not > all of them. Properly quote everything so that the kernel build can > handle working correctly with directory names with spaces. > > This change makes the script "shellcheck" clean now. > > Signed-off-by: Greg Kroah-Hartman > --- > scripts/install.sh | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/scripts/install.sh b/scripts/install.sh > index d13ec1c38640..c183d6ddd00c 100644 > --- a/scripts/install.sh > +++ b/scripts/install.sh > @@ -33,21 +33,21 @@ verify "$3" > > # User may have a custom install script > > -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi > -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi > +if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi > +if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi > > # Default install - same as make zlilo > > -if [ -f $4/vmlinuz ]; then > - mv $4/vmlinuz $4/vmlinuz.old > +if [ -f "$4"/vmlinuz ]; then > + mv "$4"/vmlinuz "$4"/vmlinuz.old > fi Another way of quoting is doing like this: if [ -f "$4/vmlinuz" ]; then mv "$4/vmlinuz" "$4/vmlinuz.old" fi shellcheck is still satisfied. Because you will add more quotes, quoting the whole of each parameter might be cleaner. See my comment in 07/20. > -if [ -f $4/System.map ]; then > - mv $4/System.map $4/System.old > +if [ -f "$4"/System.map ]; then > + mv "$4"/System.map "$4"/System.old > fi > > -cat $2 > $4/vmlinuz > -cp $3 $4/System.map > +cat "$2" > "$4"/vmlinuz > +cp "$3" "$4"/System.map > > if [ -x /sbin/lilo ]; then > /sbin/lilo > -- > 2.31.1 > -- Best Regards Masahiro Yamada