Browse Source

make installation of package network hooks optional

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
Phil Sutter 15 năm trước cách đây
mục cha
commit
4935edd89d
3 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 11 0
      Config.in
  2. 2 0
      package/base-files/Makefile
  3. 4 0
      package/ppp/Makefile

+ 11 - 0
Config.in

@@ -58,6 +58,17 @@ config ADK_INSTALL_PACKAGE_INIT_SCRIPTS
 	  Note that without further customisation, turning this option
 	  Note that without further customisation, turning this option
 	  off will almost certainly render the resulting system unusable.
 	  off will almost certainly render the resulting system unusable.
 
 
+config ADK_INSTALL_PACKAGE_NETWORK_SCRIPTS
+	boolean "ship custom network-scripts along with packages"
+	default y
+	help
+	  Turning this option to false will prevent the ADK from
+	  installing network-scripts (i.e. files in /etc/network/) for
+	  packages providing any.
+
+	  Note that without further customisation, turning this option
+	  off will almost certainly render the resulting system unusable.
+
 source "package/Config.in.auto.global"
 source "package/Config.in.auto.global"
 source "package/Config.in.auto"
 source "package/Config.in.auto"
 endmenu
 endmenu

+ 2 - 0
package/base-files/Makefile

@@ -45,7 +45,9 @@ endif
 	mkdir -p $(IDIR_BASE_FILES)/usr/lib/ipkg/lists
 	mkdir -p $(IDIR_BASE_FILES)/usr/lib/ipkg/lists
 	mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
 	mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
 	mkdir -p $(IDIR_BASE_FILES)/{dev,boot,root,sys,proc,tmp,mnt}
 	mkdir -p $(IDIR_BASE_FILES)/{dev,boot,root,sys,proc,tmp,mnt}
+ifeq (${ADK_INSTALL_PACKAGE_NETWORK_SCRIPTS},y)
 	mkdir -p $(IDIR_BASE_FILES)/etc/network/{if-pre-up.d,if-up.d,if-down.d,if-post-down.d}
 	mkdir -p $(IDIR_BASE_FILES)/etc/network/{if-pre-up.d,if-up.d,if-down.d,if-post-down.d}
+endif
 	mkdir -p $(IDIR_BASE_FILES)/usr/{lib,bin}
 	mkdir -p $(IDIR_BASE_FILES)/usr/{lib,bin}
 	chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
 	chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
 	chmod 600 $(IDIR_BASE_FILES)/etc/shadow
 	chmod 600 $(IDIR_BASE_FILES)/etc/shadow

+ 4 - 0
package/ppp/Makefile

@@ -65,9 +65,11 @@ post-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
 	${INSTALL_BIN} ./files/pon ${IDIR_PPP}/usr/sbin/
 	${INSTALL_BIN} ./files/pon ${IDIR_PPP}/usr/sbin/
 	${INSTALL_BIN} ./files/poff ${IDIR_PPP}/usr/sbin/
 	${INSTALL_BIN} ./files/poff ${IDIR_PPP}/usr/sbin/
 	${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/peers
 	${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/peers
+ifeq (${ADK_INSTALL_PACKAGE_NETWORK_SCRIPTS},y)
 	$(INSTALL_DIR) ${IDIR_PPP}/etc/network/if-pre-up.d
 	$(INSTALL_DIR) ${IDIR_PPP}/etc/network/if-pre-up.d
 	$(INSTALL_BIN) ./files/ppp.pre-up \
 	$(INSTALL_BIN) ./files/ppp.pre-up \
 		${IDIR_PPP}/etc/network/if-pre-up.d/05-ppp
 		${IDIR_PPP}/etc/network/if-pre-up.d/05-ppp
+endif
 
 
 mod-radius-install:
 mod-radius-install:
 	${INSTALL_DIR} ${IDIR_PPP_MOD_RADIUS}/etc/radiusclient
 	${INSTALL_DIR} ${IDIR_PPP_MOD_RADIUS}/etc/radiusclient
@@ -110,11 +112,13 @@ mod-pppumts-install:
 	${INSTALL_DIR} ${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/templates
 	${INSTALL_DIR} ${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/templates
 	${INSTALL_DATA} ./files/etc/ppp/templates/umts \
 	${INSTALL_DATA} ./files/etc/ppp/templates/umts \
 		${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/templates/
 		${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/templates/
+ifeq (${ADK_INSTALL_PACKAGE_NETWORK_SCRIPTS},y)
 	$(INSTALL_DIR) ${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-pre-up.d
 	$(INSTALL_DIR) ${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-pre-up.d
 	$(INSTALL_DIR) ${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-post-down.d
 	$(INSTALL_DIR) ${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-post-down.d
 	$(INSTALL_BIN) ./files/hso.if-up \
 	$(INSTALL_BIN) ./files/hso.if-up \
 		${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-pre-up.d/06-hso
 		${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-pre-up.d/06-hso
 	$(INSTALL_BIN) ./files/hso.if-down \
 	$(INSTALL_BIN) ./files/hso.if-down \
 		${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-post-down.d/06-hso
 		${IDIR_PPP_MOD_PPPUMTS}/etc/network/if-post-down.d/06-hso
+endif
 
 
 include ${TOPDIR}/mk/pkg-bottom.mk
 include ${TOPDIR}/mk/pkg-bottom.mk