Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kbuild: unify cmd_copy and cmd_shipped

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>

+9 -13
+1 -1
arch/microblaze/boot/Makefile
··· 29 29 $(call if_changed,uimage) 30 30 31 31 $(obj)/simpleImage.$(DTB).unstrip: vmlinux FORCE 32 - $(call if_changed,shipped) 32 + $(call if_changed,copy) 33 33 34 34 $(obj)/simpleImage.$(DTB).strip: vmlinux FORCE 35 35 $(call if_changed,strip)
+1 -1
arch/microblaze/boot/dts/Makefile
··· 12 12 # Generate system.dtb from $(DTB).dtb 13 13 ifneq ($(DTB),system) 14 14 $(obj)/system.dtb: $(obj)/$(DTB).dtb 15 - $(call if_changed,shipped) 15 + $(call if_changed,copy) 16 16 endif 17 17 endif 18 18
+1 -1
fs/unicode/Makefile
··· 33 33 else 34 34 35 35 $(obj)/utf8data.c: $(src)/utf8data.c_shipped FORCE 36 - $(call if_changed,shipped) 36 + $(call if_changed,copy) 37 37 38 38 endif 39 39
+4 -8
scripts/Makefile.lib
··· 246 246 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) 247 247 endef 248 248 249 - quiet_cmd_copy = COPY $@ 250 - cmd_copy = cp $< $@ 251 - 252 - # Shipped files 249 + # Copy a file 253 250 # =========================================================================== 254 251 # 'cp' preserves permissions. If you use it to copy a file in read-only srctree, 255 252 # the copy would be read-only as well, leading to an error when executing the 256 253 # rule next time. Use 'cat' instead in order to generate a writable file. 257 - 258 - quiet_cmd_shipped = SHIPPED $@ 259 - cmd_shipped = cat $< > $@ 254 + quiet_cmd_copy = COPY $@ 255 + cmd_copy = cat $< > $@ 260 256 261 257 $(obj)/%: $(src)/%_shipped 262 - $(call cmd,shipped) 258 + $(call cmd,copy) 263 259 264 260 # Commands useful for building a boot image 265 261 # ===========================================================================
+2 -2
usr/Makefile
··· 3 3 # kbuild file for usr/ - including initramfs image 4 4 # 5 5 6 - compress-y := shipped 6 + compress-y := copy 7 7 compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP) := gzip 8 8 compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2 9 9 compress-$(CONFIG_INITRAMFS_COMPRESSION_LZMA) := lzma ··· 37 37 # .cpio.*, use it directly as an initramfs, and avoid double compression. 38 38 ifeq ($(words $(subst .cpio.,$(space),$(ramfs-input))),2) 39 39 cpio-data := $(ramfs-input) 40 - compress-y := shipped 40 + compress-y := copy 41 41 endif 42 42 43 43 endif