Simplify service activation

This commit is contained in:
Matthias Schiffer 2013-04-05 20:01:02 +02:00
parent 94dd4ddec0
commit 38b3a9f075

View File

@ -74,20 +74,11 @@ $(eval $(call merge-lists,GLUON_PACKAGES,GLUON_DEFAULT_PACKAGES GLUON_SITE_PACKA
include $(INCLUDE_DIR)/image.mk include $(INCLUDE_DIR)/image.mk
define EnableInitscript EnableInitscript = ! grep -q '\#!/bin/sh /etc/rc.common' $(1) || bash ./etc/rc.common $(1) enable
( \ FileOrigin = $(firstword $(shell $(OPKG) search $(1)))
grep '#!/bin/sh /etc/rc.common' $(1) >/dev/null && \
IPKG_INSTROOT=$(TARGET_DIR) $(which bash) ./etc/rc.common $(1) enable || \
true \
)
endef
define FileOrigin
$(firstword $(shell $(OPKG) search $(1)))
endef
enable_initscripts: FORCE enable_initscripts: FORCE
cd $(TARGET_DIR) && ( \ cd $(TARGET_DIR) && ( export IPKG_INSTROOT=$(TARGET_DIR); \
$(foreach script,$(wildcard $(TARGET_DIR)/etc/init.d/*), \ $(foreach script,$(wildcard $(TARGET_DIR)/etc/init.d/*), \
$(if $(filter $(ENABLE_INITSCRIPTS_FROM),$(call FileOrigin,$(script))),$(call EnableInitscript,$(script));) \ $(if $(filter $(ENABLE_INITSCRIPTS_FROM),$(call FileOrigin,$(script))),$(call EnableInitscript,$(script));) \
) : \ ) : \