postinst trigger: the new postinst trigger broke IB

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42571
This commit is contained in:
John Crispin 2014-09-16 11:56:19 +00:00
parent ac01f2b9d6
commit 44249f71a8
4 changed files with 15 additions and 10 deletions

View File

@ -176,6 +176,7 @@ ifeq ($(DUMP),)
chmod 644 $$(IDIR_$(1))/CONTROL/control chmod 644 $$(IDIR_$(1))/CONTROL/control
( \ ( \
echo "#!/bin/sh"; \ echo "#!/bin/sh"; \
echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \ echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
echo "default_postinst \$$$$0 \$$$$@"; \ echo "default_postinst \$$$$0 \$$$$@"; \
) > $$(IDIR_$(1))/CONTROL/postinst ) > $$(IDIR_$(1))/CONTROL/postinst

View File

@ -59,6 +59,7 @@ endif
# where to build (and put) .ipk packages # where to build (and put) .ipk packages
OPKG:= \ OPKG:= \
IPKG_NO_SCRIPT=1 \
IPKG_TMP=$(TMP_DIR)/ipkg \ IPKG_TMP=$(TMP_DIR)/ipkg \
IPKG_INSTROOT=$(TARGET_DIR) \ IPKG_INSTROOT=$(TARGET_DIR) \
IPKG_CONF_DIR=$(STAGING_DIR)/etc \ IPKG_CONF_DIR=$(STAGING_DIR)/etc \
@ -108,9 +109,8 @@ $(curdir)/install: $(TMP_DIR)/.build
@mkdir -p $(TARGET_DIR)/etc/rc.d @mkdir -p $(TARGET_DIR)/etc/rc.d
@( \ @( \
cd $(TARGET_DIR); \ cd $(TARGET_DIR); \
for script in ./etc/init.d/*; do \ for script in ./usr/lib/opkg/info/*.postinst; do \
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \ IPKG_INSTROOT=$(TARGET_DIR) $$(which bash) $$script; \
IPKG_INSTROOT=$(TARGET_DIR) $$(which bash) ./etc/rc.common $$script enable; \
done || true \ done || true \
) )
@-find $(TARGET_DIR) -name CVS | $(XARGS) rm -rf @-find $(TARGET_DIR) -name CVS | $(XARGS) rm -rf

View File

@ -197,9 +197,12 @@ default_postinst() {
done done
done done
} }
[ -n "${IPKG_INSTROOT}" -o "$PKG_UPGRADE" = "1" ] || for i in `cat /usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do [ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do
$i enable [ -n "${IPKG_INSTROOT}" ] && $(which bash) ${IPKG_INSTROOT}/etc/rc.common ${IPKG_INSTROOT}$i enable; \
$i start [ -n "${IPKG_INSTROOT}" ] || {
$i enable
$i start
}
done done
return 0 return 0
} }

View File

@ -54,6 +54,7 @@ help: FORCE
# override variables from rules.mk # override variables from rules.mk
PACKAGE_DIR:=$(TOPDIR)/packages PACKAGE_DIR:=$(TOPDIR)/packages
OPKG:= \ OPKG:= \
IPKG_NO_SCRIPT=1 \
IPKG_TMP="$(TOPDIR)/tmp/ipkgtmp" \ IPKG_TMP="$(TOPDIR)/tmp/ipkgtmp" \
IPKG_INSTROOT="$(TARGET_DIR)" \ IPKG_INSTROOT="$(TARGET_DIR)" \
IPKG_CONF_DIR="$(TOPDIR)/tmp" \ IPKG_CONF_DIR="$(TOPDIR)/tmp" \
@ -142,12 +143,12 @@ package_postinst: FORCE
@rm -f $(TARGET_DIR)/tmp/opkg.lock @rm -f $(TARGET_DIR)/tmp/opkg.lock
@echo @echo
@echo Activating init scripts @echo Activating init scripts
@mkdir -p $(TARGET_DIR)/etc/rc.d
@( \ @( \
cd $(TARGET_DIR); \ cd $(TARGET_DIR); \
for script in ./etc/init.d/*; do \ for script in ./usr/lib/opkg/info/*.postinst; do \
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \ IPKG_INSTROOT=$(TARGET_DIR) $$(which bash) $$script; \
IPKG_INSTROOT=$(TARGET_DIR) $(which bash) ./etc/rc.common $$script enable; \ done || true \
done || true; \
) )
rm -f $(TARGET_DIR)/usr/lib/opkg/info/*.postinst rm -f $(TARGET_DIR)/usr/lib/opkg/info/*.postinst
$(if $(CONFIG_CLEAN_IPKG),rm -rf $(TARGET_DIR)/usr/lib/opkg) $(if $(CONFIG_CLEAN_IPKG),rm -rf $(TARGET_DIR)/usr/lib/opkg)