Browse Source

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 <[email protected]> # macOS
Signed-off-by: Michael Pratt <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <[email protected]>
Michael Pratt 1 year ago
parent
commit
660e398f92
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/prereq.mk

+ 1 - 1
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; \