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 \
|
if cmp --quiet "$1" "$2" ; then \
|
||||||
echo "$(DATE) UNCHANGED $(1:$(pwd)/%=%)" ; \
|
echo "$(DATE) UNCHANGED $(1:$(pwd)/%=%)" ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
cp -a "$1" "$2" ; \
|
cp -a --remove-destination "$1" "$2" ; \
|
||||||
)
|
)
|
||||||
@sha256sum "$(2:$(pwd)/%=%)"
|
@sha256sum "$(2:$(pwd)/%=%)"
|
||||||
endef
|
endef
|
||||||
@ -415,7 +415,7 @@ $(call map, define_module, $(modules-y))
|
|||||||
#
|
#
|
||||||
define install =
|
define install =
|
||||||
@-mkdir -p "$(dir $2)"
|
@-mkdir -p "$(dir $2)"
|
||||||
$(call do,INSTALL,$2,cp -a "$1" "$2")
|
$(call do,INSTALL,$2,cp -a --remove-destination "$1" "$2")
|
||||||
endef
|
endef
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -424,7 +424,7 @@ endef
|
|||||||
#
|
#
|
||||||
define initrd_bin_add =
|
define initrd_bin_add =
|
||||||
$(initrd_bin_dir)/$(notdir $1): $1
|
$(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
|
@$(CROSS)strip --preserve-dates "$$@" 2>&-; true
|
||||||
initrd_bins += $(initrd_bin_dir)/$(notdir $1)
|
initrd_bins += $(initrd_bin_dir)/$(notdir $1)
|
||||||
endef
|
endef
|
||||||
|
Loading…
Reference in New Issue
Block a user