[openwrt/openwrt] prereq: add support for creating relative symlinks

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 26 05:38:42 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/660e398f92472fd31dc6947f669268301c96b547

commit 660e398f92472fd31dc6947f669268301c96b547
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Thu Oct 3 00:49:10 2024 -0400

    prereq: add support for creating relative symlinks
    
    For targets that install symlinks, like coreutils,
    if the links happen to be deleted, let prereq stage
    be capable of creating them again with a relative path.
    
    Tested-by: Georgi Valkov <gvalkov at gmail.com> # macOS
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    Link: https://github.com/openwrt/openwrt/pull/16522
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/prereq.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/prereq.mk b/include/prereq.mk
index 1039c5540c..23287eade4 100644
--- a/include/prereq.mk
+++ b/include/prereq.mk
@@ -113,7 +113,7 @@ define SetupHostCommand
 						[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
 						;; \
 				esac; \
-				ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
+				ln -sf "$$$$$$$${bin#$(STAGING_DIR_HOST)/bin/}" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
 				exit 1; \
 			fi; \
 		fi; \




More information about the lede-commits mailing list