kbuild: add comment about why cmd_shipped uses 'cat'
PATCH 1/1 kbuild: add comment about why cmd_shipped uses 'cat'
cmd_shipped uses 'cat' instead of 'cp' for copying a file. The reason is explained in the commit [1], but it was in the pre-git era.
$ touch a $ chmod -w a $ cp a b $ cp a b cp: cannot create regular file 'b': Permission denied
Add comments so that you can see the reason without looking into the history.
Signed-off-by Masahiro Yamada <[email protected]>
---
scripts/Makefile.lib | 3 +++ 1 file changed, 3 insertions(+)
scripts/Makefile.lib +3 -0
@@ -240,6 +240,9 @@ quiet_cmd_copy = COPY $@ # Shipped files # =========================================================================== +# '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 $< > $@
Signature · 1 line
2.27.0