Message ID | 20231104194207.3370542-3-sjg@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1816460vqu; Sat, 4 Nov 2023 12:42:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgEq5otvnGg/aHsIXfPWPQaIrk17xpZvnksKhkFBrPXVhMLUxIgu0oJJDjS7bMuuC8jfav X-Received: by 2002:a17:902:e84b:b0:1cc:4559:f5 with SMTP id t11-20020a170902e84b00b001cc455900f5mr22560368plg.14.1699126960744; Sat, 04 Nov 2023 12:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699126960; cv=none; d=google.com; s=arc-20160816; b=kpKezkaB45gS+9tT5e3/Aj24wS+S5SfiTktdWwpR+7dujhMXQabUykRx78YO90xuie oiz7/OyhMCom6Tg9ivHllyskQSjh92p4PWQPwWRIXGcj0S8pqajfMpVNxTj8DARx1rmH ru0/3VB0zVlzExhBg8EwyQxiCqPIHcOrQOG6gFkb330YyoUWmRxKfcqB/zX2dXFFwtaG 3i32ZwN3hjsL/Y5+3EN1IWZxM0ikl6rdjNjCwDGKbmB8Nx30LKZ2Wcf+jDDdHjI0edJ0 QL77/98wcJ67gQiyOmvAdSEkpT1PQXmZinPkCFrDuGhecHYf+lh/PNp2TOXWMAa7ksHO 0Qfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BDtk6Lut1ZOMIQsv1zjp0Y23IQKARp0A3/De87KmLgY=; fh=ga9qGJDOEMp+1IM3d6kHFYmCBysRaZjBj4d3T47SzI8=; b=Z59jKISsfcgxiJk3Szd4I/ExRqYiuM1lXKYrNPjCyTvQBHW+cb379OmEwi2+0l0XXC lwCJd+te4rC+RFO7O4pbkd52LlMxTdnY+AfiYHzioOJ01hFAsczHZ2i97ETIz3Sjg1X0 R7vMyGBK5g4S3Hm0J+cSnaABaTUZli77BRRFi9ctLbLgzhx0Iah0bosGh4QlXxXfvZjx g4ZlAkBDWZ86IntP9bWWi7Zm+mdac/M8gdSBeMkwXs/WIoVMMNorMKkTlpX50OmR6S42 Z8KELwh1wfRAxMdwSBakiJhSs8T3eH33SyXYkGfdqDMqRCwf6QjqFhdCGvUOANdw5Kud r01g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="GT/y38S4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a11-20020a170902eccb00b001c1e1fe16cbsi4669180plh.255.2023.11.04.12.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 12:42:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="GT/y38S4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DAFB280ACB46; Sat, 4 Nov 2023 12:42:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232469AbjKDTmh (ORCPT <rfc822;lhua1029@gmail.com> + 35 others); Sat, 4 Nov 2023 15:42:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232244AbjKDTme (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 4 Nov 2023 15:42:34 -0400 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2546D45 for <linux-kernel@vger.kernel.org>; Sat, 4 Nov 2023 12:42:31 -0700 (PDT) Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-35961c61febso7335755ab.1 for <linux-kernel@vger.kernel.org>; Sat, 04 Nov 2023 12:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1699126951; x=1699731751; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BDtk6Lut1ZOMIQsv1zjp0Y23IQKARp0A3/De87KmLgY=; b=GT/y38S4KK1N3UIzHTx+VBrYwMYcqYpNqYG7BaLfSW+LXyPV0g1z9z9TkTaMRBm5xL ZtA6Sf0SDfKWL/WOBPSQSpUQTlqJknXi30K1c/Al4J2mRav9HoWoROJLO8xFiWrFNpJx O5Cd55WJmNnCWqPWEOWqOcklHTFqLcKZyKcHM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699126951; x=1699731751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BDtk6Lut1ZOMIQsv1zjp0Y23IQKARp0A3/De87KmLgY=; b=FZdXPt1n8riIUdt2ttbv8ghXOFWYRiELAqxCDo1PpVm5DnE1bnFWQt9xvIhZNVvKMD UYhLxSjQdUS8SzgRVyES5O06TDc1FKQ4R0m3Keozby2BRp74bp+8XVVv/8D7q6tDfZLi WvSv3yahJdcUJR7btCV92JyYPAShWF5umGnS1YR3dKsxyDLlyaGD3YQH/2mSaU9y9YB0 K7smYFGUbarhkCBz4bEAqMnUxXvX7S5Cm7XpH2Aeqhe2Us31xIa+1BMANbghktHDONC5 GkAnxuPkCR07aP3ujXQP3ZppndILKVauDA5EknBwD22dFp7NhlNVTciNkug6xo/3mBYm hMMQ== X-Gm-Message-State: AOJu0YyXViqMYUvdhzkPsLKXAS1SbtM4A98UComyCPGSDovCJsgpFwxx x7LMzKZeGDZF5enf4J3CTaXnbg== X-Received: by 2002:a05:6602:2d87:b0:783:4bc6:636e with SMTP id k7-20020a0566022d8700b007834bc6636emr31219991iow.21.1699126951160; Sat, 04 Nov 2023 12:42:31 -0700 (PDT) Received: from sjg1.united_club.lax.united.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id o4-20020a6b5a04000000b0079fbb834232sm1293318iob.19.2023.11.04.12.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 12:42:30 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: linux-arm-kernel@lists.infradead.org Cc: U-Boot Mailing List <u-boot@lists.denx.de>, Tom Rini <trini@konsulko.com>, Masahiro Yamada <masahiroy@kernel.org>, Simon Glass <sjg@chromium.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu>, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] arm: boot: Use double quotes for image name Date: Sat, 4 Nov 2023 13:42:03 -0600 Message-ID: <20231104194207.3370542-3-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231104194207.3370542-1-sjg@chromium.org> References: <20231104194207.3370542-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 04 Nov 2023 12:42:38 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781663752248005816 X-GMAIL-MSGID: 1781663752248005816 |
Series |
arm64: Add a build target for Flat Image Tree
|
|
Commit Message
Simon Glass
Nov. 4, 2023, 7:42 p.m. UTC
The use of single quotes in the image name causes them to appear in
the image description when the uImage is created. Use double quotes, to
avoid this.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Split double-quote change out into its own patch
scripts/Makefile.lib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, Nov 4, 2023 at 9:42 PM Simon Glass <sjg@chromium.org> wrote: > > The use of single quotes in the image name causes them to appear in > the image description when the uImage is created. Use double quotes, to > avoid this. > > Signed-off-by: Simon Glass <sjg@chromium.org> > --- > > Changes in v2: > - Split double-quote change out into its own patch > > scripts/Makefile.lib | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index 68d0134bdbf9..03e79e319293 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -487,7 +487,7 @@ UIMAGE_OPTS-y ?= > UIMAGE_TYPE ?= kernel > UIMAGE_LOADADDR ?= arch_must_set_this > UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) > -UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' > +UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" > > quiet_cmd_uimage = UIMAGE $@ > cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ > -- > 2.42.0.869.gea05f2083d-goog > NACK. This is because you are doing *WRONG* in 3/3. Look at your code closely. https://lore.kernel.org/linux-kbuild/20231104194207.3370542-4-sjg@chromium.org/T/#me2fb68151d6f4f330808406f9a711fffee149529 In the mainline kernel, the quotation appears only in the definition of UIMAGE_NAME. masahiro@zoe:~/ref/linux(master)$ git grep UIMAGE_NAME scripts/Makefile.lib:UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' scripts/Makefile.lib: -n $(UIMAGE_NAME) -d $< $@ The single quotes are consumed by shell. This is mainline + your patch set. masahiro@zoe:~/ref/linux(simon-v2)$ git grep UIMAGE_NAME scripts/Makefile.lib:UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" scripts/Makefile.lib: -n "$(UIMAGE_NAME)" -d $< $@ scripts/Makefile.lib: --name "$(UIMAGE_NAME)" \ You quoted the definition of UIMAGE_NAME, and also variable references. See how it is expanded. --name "$(UIMAGE_NAME)" ==> --name ""Linux-$(KERNELRELEASE)"" ==> --name Linux-$(KERNELRELEASE) You added double quotes in a row, just to cancel it.
Hi Masahiro, On Tue, 7 Nov 2023 at 03:13, Masahiro Yamada <masahiroy@kernel.org> wrote: > > On Sat, Nov 4, 2023 at 9:42 PM Simon Glass <sjg@chromium.org> wrote: > > > > The use of single quotes in the image name causes them to appear in > > the image description when the uImage is created. Use double quotes, to > > avoid this. > > > > Signed-off-by: Simon Glass <sjg@chromium.org> > > --- > > > > Changes in v2: > > - Split double-quote change out into its own patch > > > > scripts/Makefile.lib | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > index 68d0134bdbf9..03e79e319293 100644 > > --- a/scripts/Makefile.lib > > +++ b/scripts/Makefile.lib > > @@ -487,7 +487,7 @@ UIMAGE_OPTS-y ?= > > UIMAGE_TYPE ?= kernel > > UIMAGE_LOADADDR ?= arch_must_set_this > > UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) > > -UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' > > +UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" > > > > quiet_cmd_uimage = UIMAGE $@ > > cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ > > -- > > 2.42.0.869.gea05f2083d-goog > > > > > NACK. > > > This is because you are doing *WRONG* in 3/3. > > Look at your code closely. > > https://lore.kernel.org/linux-kbuild/20231104194207.3370542-4-sjg@chromium.org/T/#me2fb68151d6f4f330808406f9a711fffee149529 > > > > In the mainline kernel, the quotation appears > only in the definition of UIMAGE_NAME. > > > masahiro@zoe:~/ref/linux(master)$ git grep UIMAGE_NAME > scripts/Makefile.lib:UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' > scripts/Makefile.lib: -n $(UIMAGE_NAME) -d $< $@ > > > The single quotes are consumed by shell. > > > > > > > This is mainline + your patch set. > > masahiro@zoe:~/ref/linux(simon-v2)$ git grep UIMAGE_NAME > scripts/Makefile.lib:UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" > scripts/Makefile.lib: -n "$(UIMAGE_NAME)" -d $< $@ > scripts/Makefile.lib: --name "$(UIMAGE_NAME)" \ > > > You quoted the definition of UIMAGE_NAME, > and also variable references. > > > > > See how it is expanded. > > > --name "$(UIMAGE_NAME)" > > > ==> > > > --name ""Linux-$(KERNELRELEASE)"" > > > ==> > > > --name Linux-$(KERNELRELEASE) > > > > > You added double quotes in a row, just to cancel it. Yes, I understand that. But without the quotes in -n "$(UIMAGE_NAME)" then the name cannot contain spaces. So we do need some sort of quoting, right? It just seems strange to use single quotes in a Makefile variable. I found it confusing. I think you are saying you want to keep the single quotes in the var declaration and drop the quotes from the cmd_fit rule. I am OK with that, but I do think it is unusual not to quote something which might have spaces. It may cause confusion for others, as it did for me? Anyway, I'll send a new version with the quoting reverted. Regards, Simon
Hi Simon, On Tue, Nov 7, 2023 at 3:11 PM Simon Glass <sjg@chromium.org> wrote: > > Hi Masahiro, > > On Tue, 7 Nov 2023 at 03:13, Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > On Sat, Nov 4, 2023 at 9:42 PM Simon Glass <sjg@chromium.org> wrote: > > > > > > The use of single quotes in the image name causes them to appear in > > > the image description when the uImage is created. Use double quotes, to > > > avoid this. > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org> > > > --- > > > > > > Changes in v2: > > > - Split double-quote change out into its own patch > > > > > > scripts/Makefile.lib | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > > index 68d0134bdbf9..03e79e319293 100644 > > > --- a/scripts/Makefile.lib > > > +++ b/scripts/Makefile.lib > > > @@ -487,7 +487,7 @@ UIMAGE_OPTS-y ?= > > > UIMAGE_TYPE ?= kernel > > > UIMAGE_LOADADDR ?= arch_must_set_this > > > UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) > > > -UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' > > > +UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" > > > > > > quiet_cmd_uimage = UIMAGE $@ > > > cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ > > > -- > > > 2.42.0.869.gea05f2083d-goog > > > > > > > > > NACK. > > > > > > This is because you are doing *WRONG* in 3/3. > > > > Look at your code closely. > > > > https://lore.kernel.org/linux-kbuild/20231104194207.3370542-4-sjg@chromium.org/T/#me2fb68151d6f4f330808406f9a711fffee149529 > > > > > > > > In the mainline kernel, the quotation appears > > only in the definition of UIMAGE_NAME. > > > > > > masahiro@zoe:~/ref/linux(master)$ git grep UIMAGE_NAME > > scripts/Makefile.lib:UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' > > scripts/Makefile.lib: -n $(UIMAGE_NAME) -d $< $@ > > > > > > The single quotes are consumed by shell. > > > > > > > > > > > > > > This is mainline + your patch set. > > > > masahiro@zoe:~/ref/linux(simon-v2)$ git grep UIMAGE_NAME > > scripts/Makefile.lib:UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" > > scripts/Makefile.lib: -n "$(UIMAGE_NAME)" -d $< $@ > > scripts/Makefile.lib: --name "$(UIMAGE_NAME)" \ > > > > > > You quoted the definition of UIMAGE_NAME, > > and also variable references. > > > > > > > > > > See how it is expanded. > > > > > > --name "$(UIMAGE_NAME)" > > > > > > ==> > > > > > > --name ""Linux-$(KERNELRELEASE)"" > > > > > > ==> > > > > > > --name Linux-$(KERNELRELEASE) > > > > > > > > > > You added double quotes in a row, just to cancel it. > > Yes, I understand that. But without the quotes in -n "$(UIMAGE_NAME)" > then the name cannot contain spaces. So we do need some sort of > quoting, right? Yes. If you move the quoting to the variable reference, it is acceptable because there is a good reason to do so. UIMAGE_NAME ?= Linux-$(KERNELRELEASE) ... -n '$(UIMAGE_NAME)' -d $< $@ This is the correct change. > > It just seems strange to use single quotes in a Makefile variable. I > found it confusing. Right. Why don't you remove it, then? For clarification, there is no concept of quoting in GNU Make. The single quote character ' and the double quote character " are just normal characters for Make. GNU Make handles them just like alphabets and numbers. GNU Make just replaces $(UIMAGE_NAME) with 'Linux-$(KERNELRELEASE)' verbatim. It is the _shell_ that understands the quoting. Just in case here is the spec for "2.2.2 Single-Quotes" vs "2.2.3 Double-Quotes" https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html Shell supports both single-quoting and double-quoting for good reasons. There is no good or bad because both of them are meaningful. > > I think you are saying you want to keep the single quotes in the var > declaration and drop the quotes from the cmd_fit rule. I am OK with > that, but I do think it is unusual not to quote something which might > have spaces. It may cause confusion for others, as it did for me? > > Anyway, I'll send a new version with the quoting reverted. > Please move the single quotes as I suggested above. The reason is because UIMAGE_NAME can be passed-in by a user and it can contain whitespaces. > Regards, > Simon
Hi Masahiro, On Tue, 7 Nov 2023 at 07:13, Masahiro Yamada <masahiroy@kernel.org> wrote: > > Hi Simon, > > > On Tue, Nov 7, 2023 at 3:11 PM Simon Glass <sjg@chromium.org> wrote: > > > > Hi Masahiro, > > > > On Tue, 7 Nov 2023 at 03:13, Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > > > On Sat, Nov 4, 2023 at 9:42 PM Simon Glass <sjg@chromium.org> wrote: > > > > > > > > The use of single quotes in the image name causes them to appear in > > > > the image description when the uImage is created. Use double quotes, to > > > > avoid this. > > > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org> > > > > --- > > > > > > > > Changes in v2: > > > > - Split double-quote change out into its own patch > > > > > > > > scripts/Makefile.lib | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > > > index 68d0134bdbf9..03e79e319293 100644 > > > > --- a/scripts/Makefile.lib > > > > +++ b/scripts/Makefile.lib > > > > @@ -487,7 +487,7 @@ UIMAGE_OPTS-y ?= > > > > UIMAGE_TYPE ?= kernel > > > > UIMAGE_LOADADDR ?= arch_must_set_this > > > > UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) > > > > -UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' > > > > +UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" > > > > > > > > quiet_cmd_uimage = UIMAGE $@ > > > > cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ > > > > -- > > > > 2.42.0.869.gea05f2083d-goog > > > > > > > > > > > > > NACK. > > > > > > > > > This is because you are doing *WRONG* in 3/3. > > > > > > Look at your code closely. > > > > > > https://lore.kernel.org/linux-kbuild/20231104194207.3370542-4-sjg@chromium.org/T/#me2fb68151d6f4f330808406f9a711fffee149529 > > > > > > > > > > > > In the mainline kernel, the quotation appears > > > only in the definition of UIMAGE_NAME. > > > > > > > > > masahiro@zoe:~/ref/linux(master)$ git grep UIMAGE_NAME > > > scripts/Makefile.lib:UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' > > > scripts/Makefile.lib: -n $(UIMAGE_NAME) -d $< $@ > > > > > > > > > The single quotes are consumed by shell. > > > > > > > > > > > > > > > > > > > > > This is mainline + your patch set. > > > > > > masahiro@zoe:~/ref/linux(simon-v2)$ git grep UIMAGE_NAME > > > scripts/Makefile.lib:UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" > > > scripts/Makefile.lib: -n "$(UIMAGE_NAME)" -d $< $@ > > > scripts/Makefile.lib: --name "$(UIMAGE_NAME)" \ > > > > > > > > > You quoted the definition of UIMAGE_NAME, > > > and also variable references. > > > > > > > > > > > > > > > See how it is expanded. > > > > > > > > > --name "$(UIMAGE_NAME)" > > > > > > > > > ==> > > > > > > > > > --name ""Linux-$(KERNELRELEASE)"" > > > > > > > > > ==> > > > > > > > > > --name Linux-$(KERNELRELEASE) > > > > > > > > > > > > > > > You added double quotes in a row, just to cancel it. > > > > Yes, I understand that. But without the quotes in -n "$(UIMAGE_NAME)" > > then the name cannot contain spaces. So we do need some sort of > > quoting, right? > > > Yes. > > If you move the quoting to the variable reference, > it is acceptable because there is a good reason to do so. > > > > UIMAGE_NAME ?= Linux-$(KERNELRELEASE) > > > ... > -n '$(UIMAGE_NAME)' -d $< $@ > > > This is the correct change. OK. > > > > > > > It just seems strange to use single quotes in a Makefile variable. I > > found it confusing. > > > Right. Why don't you remove it, then? > > > For clarification, there is no concept of quoting in GNU Make. > > The single quote character ' and the double quote character " are > just normal characters for Make. > > GNU Make handles them just like alphabets and numbers. > > GNU Make just replaces $(UIMAGE_NAME) > with 'Linux-$(KERNELRELEASE)' verbatim. > > > It is the _shell_ that understands the quoting. > > Just in case here is the spec for > "2.2.2 Single-Quotes" vs "2.2.3 Double-Quotes" > > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html > > > Shell supports both single-quoting and double-quoting > for good reasons. > > There is no good or bad because both of them are meaningful. Yes...I suppose I knew that Makefiles are completely literal, but thanks for the pointers. I tend to use double quotes by default and single quotes only when I have to...but it doesn't really matter so long as it is consistent. Anyway, moving the single quotes away from the var removes the confusion I had at the start of all of this. > > > > > > > > > > I think you are saying you want to keep the single quotes in the var > > declaration and drop the quotes from the cmd_fit rule. I am OK with > > that, but I do think it is unusual not to quote something which might > > have spaces. It may cause confusion for others, as it did for me? > > > > Anyway, I'll send a new version with the quoting reverted. > > > > > Please move the single quotes as I suggested above. > > The reason is because UIMAGE_NAME can be passed-in > by a user and it can contain whitespaces. OK, done in v4. Regards, Simon
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 68d0134bdbf9..03e79e319293 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -487,7 +487,7 @@ UIMAGE_OPTS-y ?= UIMAGE_TYPE ?= kernel UIMAGE_LOADADDR ?= arch_must_set_this UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) -UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' +UIMAGE_NAME ?= "Linux-$(KERNELRELEASE)" quiet_cmd_uimage = UIMAGE $@ cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \