mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 21:17:55 +00:00
Makefile: add --remove-destination to cp calls.
This avoids overwriting the busybox binary (and bricking the system) by following a symlink when busybox and other module both provide a command with the same filename. Signed-off-by: Daniel Pineda <daniel.pineda@puri.sm>
This commit is contained in:
parent
17ac64bdf1
commit
b51fda22c1
6
Makefile
6
Makefile
@ -234,7 +234,7 @@ define do-copy =
|
||||
if cmp --quiet "$1" "$2" ; then \
|
||||
echo "$(DATE) UNCHANGED $(1:$(pwd)/%=%)" ; \
|
||||
fi ; \
|
||||
cp -a "$1" "$2" ; \
|
||||
cp -a --remove-destination "$1" "$2" ; \
|
||||
)
|
||||
@sha256sum "$(2:$(pwd)/%=%)"
|
||||
endef
|
||||
@ -415,7 +415,7 @@ $(call map, define_module, $(modules-y))
|
||||
#
|
||||
define install =
|
||||
@-mkdir -p "$(dir $2)"
|
||||
$(call do,INSTALL,$2,cp -a "$1" "$2")
|
||||
$(call do,INSTALL,$2,cp -a --remove-destination "$1" "$2")
|
||||
endef
|
||||
|
||||
#
|
||||
@ -424,7 +424,7 @@ endef
|
||||
#
|
||||
define initrd_bin_add =
|
||||
$(initrd_bin_dir)/$(notdir $1): $1
|
||||
$(call do,INSTALL-BIN,$$(<:$(pwd)/%=%),cp -a "$$<" "$$@")
|
||||
$(call do,INSTALL-BIN,$$(<:$(pwd)/%=%),cp -a --remove-destination "$$<" "$$@")
|
||||
@$(CROSS)strip --preserve-dates "$$@" 2>&-; true
|
||||
initrd_bins += $(initrd_bin_dir)/$(notdir $1)
|
||||
endef
|
||||
|
Loading…
Reference in New Issue
Block a user