diff options
author | Michael Pratt <mcpratt@pm.me> | 2023-05-27 17:11:47 -0400 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2023-06-05 08:31:50 +0200 |
commit | 729909c07fae4201591e51895833112cb88485e1 (patch) | |
tree | 4ca58581ec4a1c42c1a18da137bbf9d24afe6bb7 /include/prereq.mk | |
parent | 9ffd6013b918145295d12ef15ca4282f48ce49e5 (diff) |
prereq-build: do not replace binaries with symlinks
Some programs, like bash and patch, are checked by prereq stage
and have a symlink installed, but then is later built from source.
Now that the prereq-build checks are not successful
just by finding the file alone, it is possible for
a new symlink to overwrite the installed binary.
If a normal file is found in staging_dir/host/bin,
let the check look for the associated stampfile, and if found,
skip creation of a symlink and exit successfully.
Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Diffstat (limited to 'include/prereq.mk')
-rw-r--r-- | include/prereq.mk | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/prereq.mk b/include/prereq.mk index c72878ebb0..c888268d85 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -110,6 +110,10 @@ define SetupHostCommand *" -> $$$$$$$$bin"*) \ [ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \ ;; \ + "-"*) \ + find "$(STAGING_DIR_HOST)/stamp" | grep $(strip $(1)) && \ + [ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \ + ;; \ esac; \ ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \ exit 1; \ |