kbuild: unify cmd_copy and cmd_shipped
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 25 Jan 2022 06:40:27 +0000 (15:40 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 14 Feb 2022 01:37:32 +0000 (10:37 +0900)
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>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
arch/microblaze/boot/Makefile
arch/microblaze/boot/dts/Makefile
fs/unicode/Makefile
scripts/Makefile.lib
usr/Makefile

index cff570a719461ffd34ffec2e93d0ddaea0776de6..2b42c370d57427839d394c475bb6ec8a4471726f 100644 (file)
@@ -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)
index ef00dd30d19a2cf74720e27aabe7d15a46368a06..b84e2cbb20eef0a711a688f4d3249ce206368e94 100644 (file)
@@ -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
 
index 0cc87423de828082c2320fe5e5e7d54969258a2b..0e51c0025a16fd753ba7a65c8131b928e9a8ee39 100644 (file)
@@ -33,7 +33,7 @@ $(obj)/utf8data.c: $(obj)/mkutf8data $(filter %.txt, $(cmd_utf8data)) FORCE
 else
 
 $(obj)/utf8data.c: $(src)/utf8data.c_shipped FORCE
-       $(call if_changed,shipped)
+       $(call if_changed,copy)
 
 endif
 
index 79be57fdd32a400e00fa0084c1982f937e48cf92..40735a3adb54583094b5ca2e5f90ed2f391ab5d5 100644 (file)
@@ -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
 # ===========================================================================
index cc0d2824e1006626c1d1bbcc4efc47af6a135e1d..59d9e8b07a017ce2fe26833d32d941e20d59d954 100644 (file)
@@ -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