build: set PATH for post-install scripts

post-install scripts may need to call executables installed to
STAGING_DIR_HOSTPKG which is not part of the PATH set to TARGET_PATH in
rules.mk.
Set PATH for post-install scripts to TARGET_PATH_PKG.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://github.com/openwrt/openwrt/pull/16865
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Daniel Golle 2024-11-05 03:05:31 +00:00 committed by Christian Marangi
parent 48028cd102
commit 21b5ac862e
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ define prepare_rootfs
IPKG_POSTINST_PATH=./usr/lib/opkg/info/*.postinst; \ IPKG_POSTINST_PATH=./usr/lib/opkg/info/*.postinst; \
fi; \ fi; \
for script in $$IPKG_POSTINST_PATH; do \ for script in $$IPKG_POSTINST_PATH; do \
IPKG_INSTROOT=$(1) $$(command -v bash) $$script; \ PATH="$(TARGET_PATH_PKG)" IPKG_INSTROOT=$(1) $$(command -v bash) $$script; \
ret=$$?; \ ret=$$?; \
if [ $$ret -ne 0 ]; then \ if [ $$ret -ne 0 ]; then \
echo "postinst script $$script has failed with exit code $$ret" >&2; \ echo "postinst script $$script has failed with exit code $$ret" >&2; \