linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	linux-kbuild@vger.kernel.org,
	Michal Marek <michal.lkml@markovi.net>,
	Michal Simek <monstr@monstr.eu>, Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kbuild: unify cmd_copy and cmd_shipped
Date: Tue, 25 Jan 2022 17:11:41 -0500	[thread overview]
Message-ID: <87h79rsbxe.fsf@collabora.com> (raw)
In-Reply-To: <CAKwvOdm=-x1EP_xu2V_OZNdPid=gacVzCTx+=uSYqzCv+1Rbfw@mail.gmail.com> (Nick Desaulniers's message of "Tue, 25 Jan 2022 13:04:56 -0800")

Nick Desaulniers <ndesaulniers@google.com> writes:

> On Mon, Jan 24, 2022 at 10:41 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>
>> cmd_copy and cmd_shipped have similar functionality. The difference is
>> that cmd_copy uses 'cp' while cmd_shipped 'cat'.
>>
>> Unify them into cmd_copy because this macro name is more intuitive.
>>
>> Going forward, cmd_copy will use 'cat' to avoid the permission issue.
>> I also thought of 'cp --no-preserve=mode' but this option is not
>> mentioned in the POSIX spec [1], so I am keeping the 'cat' command.
>>
>> [1]: https://pubs.opengroup.org/onlinepubs/009695299/utilities/cp.html
>> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>> ---
>>
>>  arch/microblaze/boot/Makefile     |  2 +-
>>  arch/microblaze/boot/dts/Makefile |  2 +-
>>  fs/unicode/Makefile               |  2 +-
>>  scripts/Makefile.lib              | 12 ++++--------
>>  usr/Makefile                      |  4 ++--
>>  5 files changed, 9 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile
>> index cff570a71946..2b42c370d574 100644
>> --- a/arch/microblaze/boot/Makefile
>> +++ b/arch/microblaze/boot/Makefile
>> @@ -29,7 +29,7 @@ $(obj)/simpleImage.$(DTB).ub: $(obj)/simpleImage.$(DTB) FORCE
>>         $(call if_changed,uimage)
>>
>>  $(obj)/simpleImage.$(DTB).unstrip: vmlinux FORCE
>> -       $(call if_changed,shipped)
>> +       $(call if_changed,copy)
>>
>>  $(obj)/simpleImage.$(DTB).strip: vmlinux FORCE
>>         $(call if_changed,strip)
>> diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile
>> index ef00dd30d19a..b84e2cbb20ee 100644
>> --- a/arch/microblaze/boot/dts/Makefile
>> +++ b/arch/microblaze/boot/dts/Makefile
>> @@ -12,7 +12,7 @@ $(obj)/linked_dtb.o: $(obj)/system.dtb
>>  # Generate system.dtb from $(DTB).dtb
>>  ifneq ($(DTB),system)
>>  $(obj)/system.dtb: $(obj)/$(DTB).dtb
>> -       $(call if_changed,shipped)
>> +       $(call if_changed,copy)
>>  endif
>>  endif
>>
>> diff --git a/fs/unicode/Makefile b/fs/unicode/Makefile
>> index 2f9d9188852b..74ae80fc3a36 100644
>> --- a/fs/unicode/Makefile
>> +++ b/fs/unicode/Makefile
>> @@ -31,7 +31,7 @@ $(obj)/utf8data.c: $(obj)/mkutf8data $(filter %.txt, $(cmd_utf8data)) FORCE
>>  else
>>
>>  $(obj)/utf8data.c: $(src)/utf8data.c_shipped FORCE
>
> do we want to retitle the _shipped suffix for this file to _copy now, too?
> fs/unicode/Makefile:11
> fs/unicode/Makefile:33
> fs/unicode/Makefile:34

I think _copy doesn't convey the sense that this is distributed with the
kernel tree, even though it is also generated from in-tree sources.
Even if that is not the original sense of _shipped (is it?), it makes
sense to me that way, but _copy doesn't.

The patch looks good to me, though.

Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>


>
> Either way
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
>
>> -       $(call if_changed,shipped)
>> +       $(call if_changed,copy)
>>
>>  endif
>>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index 79be57fdd32a..40735a3adb54 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -246,20 +246,16 @@ $(foreach m, $(notdir $1), \
>>         $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
>>  endef
>>
>> -quiet_cmd_copy = COPY    $@
>> -      cmd_copy = cp $< $@
>> -
>> -# Shipped files
>> +# Copy a file
>>  # ===========================================================================
>>  # 'cp' preserves permissions. If you use it to copy a file in read-only srctree,
>>  # the copy would be read-only as well, leading to an error when executing the
>>  # rule next time. Use 'cat' instead in order to generate a writable file.
>> -
>> -quiet_cmd_shipped = SHIPPED $@
>> -cmd_shipped = cat $< > $@
>> +quiet_cmd_copy = COPY    $@
>> +      cmd_copy = cat $< > $@
>>
>>  $(obj)/%: $(src)/%_shipped
>> -       $(call cmd,shipped)
>> +       $(call cmd,copy)
>>
>>  # Commands useful for building a boot image
>>  # ===========================================================================
>> diff --git a/usr/Makefile b/usr/Makefile
>> index cc0d2824e100..59d9e8b07a01 100644
>> --- a/usr/Makefile
>> +++ b/usr/Makefile
>> @@ -3,7 +3,7 @@
>>  # kbuild file for usr/ - including initramfs image
>>  #
>>
>> -compress-y                                     := shipped
>> +compress-y                                     := copy
>>  compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP)  := gzip
>>  compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2
>>  compress-$(CONFIG_INITRAMFS_COMPRESSION_LZMA)  := lzma
>> @@ -37,7 +37,7 @@ endif
>>  # .cpio.*, use it directly as an initramfs, and avoid double compression.
>>  ifeq ($(words $(subst .cpio.,$(space),$(ramfs-input))),2)
>>  cpio-data := $(ramfs-input)
>> -compress-y := shipped
>> +compress-y := copy
>>  endif
>>
>>  endif
>> --
>> 2.32.0
>>

-- 
Gabriel Krisman Bertazi

  reply	other threads:[~2022-01-25 22:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  6:40 [PATCH] kbuild: unify cmd_copy and cmd_shipped Masahiro Yamada
2022-01-25 21:04 ` Nick Desaulniers
2022-01-25 22:11   ` Gabriel Krisman Bertazi [this message]
2022-01-26  2:19     ` Masahiro Yamada
2022-02-08  4:10       ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h79rsbxe.fsf@collabora.com \
    --to=krisman@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=monstr@monstr.eu \
    --cc=ndesaulniers@google.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).