summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-09-16 11:56:19 +0000
committerJohn Crispin <john@openwrt.org>2014-09-16 11:56:19 +0000
commit44249f71a863682ab2569c4794ed2a98bd59c1d9 (patch)
treee01492c520450e01200f2be5bde9f0f3e743b057 /package
parentac01f2b9d6f83fcb63b03b48be1dddd6ca963c0f (diff)
downloadmaster-31e0f0ae-44249f71a863682ab2569c4794ed2a98bd59c1d9.tar.gz
master-31e0f0ae-44249f71a863682ab2569c4794ed2a98bd59c1d9.tar.bz2
master-31e0f0ae-44249f71a863682ab2569c4794ed2a98bd59c1d9.zip
postinst trigger: the new postinst trigger broke IB
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 42571
Diffstat (limited to 'package')
-rw-r--r--package/Makefile6
-rwxr-xr-xpackage/base-files/files/lib/functions.sh9
2 files changed, 9 insertions, 6 deletions
diff --git a/package/Makefile b/package/Makefile
index a42b4b0dd0..a6b34be0f4 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -59,6 +59,7 @@ endif
# where to build (and put) .ipk packages
OPKG:= \
+ IPKG_NO_SCRIPT=1 \
IPKG_TMP=$(TMP_DIR)/ipkg \
IPKG_INSTROOT=$(TARGET_DIR) \
IPKG_CONF_DIR=$(STAGING_DIR)/etc \
@@ -108,9 +109,8 @@ $(curdir)/install: $(TMP_DIR)/.build
@mkdir -p $(TARGET_DIR)/etc/rc.d
@( \
cd $(TARGET_DIR); \
- for script in ./etc/init.d/*; do \
- grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
- IPKG_INSTROOT=$(TARGET_DIR) $$(which bash) ./etc/rc.common $$script enable; \
+ for script in ./usr/lib/opkg/info/*.postinst; do \
+ IPKG_INSTROOT=$(TARGET_DIR) $$(which bash) $$script; \
done || true \
)
@-find $(TARGET_DIR) -name CVS | $(XARGS) rm -rf
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 67f4a046e5..fafb7a340f 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -197,9 +197,12 @@ default_postinst() {
done
done
}
- [ -n "${IPKG_INSTROOT}" -o "$PKG_UPGRADE" = "1" ] || for i in `cat /usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do
- $i enable
- $i start
+ [ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do
+ [ -n "${IPKG_INSTROOT}" ] && $(which bash) ${IPKG_INSTROOT}/etc/rc.common ${IPKG_INSTROOT}$i enable; \
+ [ -n "${IPKG_INSTROOT}" ] || {
+ $i enable
+ $i start
+ }
done
return 0
}