From e300546f301685647b3b1b82be3b304c23f47126 Mon Sep 17 00:00:00 2001 From: nanpuyue Date: Sat, 5 Sep 2020 11:51:18 +0800 Subject: [PATCH] fix(openwrt): move config to `/etc/n2n` The `/etc/config` directory should only store the "UCI" configuration files. Reference: https://openwrt.org/docs/guide-user/base-system/uci --- packages/openwrt/Makefile | 12 ++++++------ packages/openwrt/README.md | 4 ++-- packages/openwrt/etc/init.d/edge | 2 +- packages/openwrt/etc/init.d/supernode | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/openwrt/Makefile b/packages/openwrt/Makefile index 1ceca50..11ae54e 100644 --- a/packages/openwrt/Makefile +++ b/packages/openwrt/Makefile @@ -56,7 +56,7 @@ define Build/Configure endef define Package/n2n-edge/conffiles -/etc/config/n2n-edge.conf +/etc/n2n/edge.conf endef define Package/n2n-edge/install @@ -64,12 +64,12 @@ define Package/n2n-edge/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/edge $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) $(PKG_BUILD_DIR)/packages/openwrt/etc/init.d/edge $(1)/etc/init.d/edge - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) $(PKG_BUILD_DIR)/packages/etc/n2n/edge.conf.sample $(1)/etc/config/n2n-edge.conf + $(INSTALL_DIR) $(1)/etc/n2n + $(INSTALL_CONF) $(PKG_BUILD_DIR)/packages/etc/n2n/edge.conf.sample $(1)/etc/n2n/edge.conf endef define Package/n2n-supernode/conffiles -/etc/config/n2n-supernode.conf +/etc/n2n/supernode.conf endef define Package/n2n-supernode/install @@ -77,8 +77,8 @@ define Package/n2n-supernode/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/supernode $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) $(PKG_BUILD_DIR)/packages/openwrt/etc/init.d/supernode $(1)/etc/init.d/supernode - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) $(PKG_BUILD_DIR)/packages/etc/n2n/supernode.conf.sample $(1)/etc/config/n2n-supernode.conf + $(INSTALL_DIR) $(1)/etc/n2n + $(INSTALL_CONF) $(PKG_BUILD_DIR)/packages/etc/n2n/supernode.conf.sample $(1)/etc/n2n/supernode.conf endef $(eval $(call BuildPackage,n2n-edge)) diff --git a/packages/openwrt/README.md b/packages/openwrt/README.md index 773f315..44b229f 100644 --- a/packages/openwrt/README.md +++ b/packages/openwrt/README.md @@ -33,7 +33,7 @@ copied to the target device, and installed with `opkg install`. ## Configuration The edge node can be started with `/etc/init.d/edge start`. -Its configuration file is `/etc/config/n2n-edge.conf`. +Its configuration file is `/etc/n2n/edge.conf`. The supernode can be started with `/etc/init.d/supernode start`. -Its configuration file is `/etc/config/n2n-supernode.conf`. +Its configuration file is `/etc/n2n/supernode.conf`. diff --git a/packages/openwrt/etc/init.d/edge b/packages/openwrt/etc/init.d/edge index f59dd90..84e2b57 100644 --- a/packages/openwrt/etc/init.d/edge +++ b/packages/openwrt/etc/init.d/edge @@ -4,7 +4,7 @@ STOP=10 USE_PROCD=1 PROG=/usr/bin/edge -CONFIGFILE=/etc/config/n2n-edge.conf +CONFIGFILE=/etc/n2n/edge.conf start_service() { procd_open_instance diff --git a/packages/openwrt/etc/init.d/supernode b/packages/openwrt/etc/init.d/supernode index e8981c8..56aa81d 100644 --- a/packages/openwrt/etc/init.d/supernode +++ b/packages/openwrt/etc/init.d/supernode @@ -4,7 +4,7 @@ STOP=10 USE_PROCD=1 PROG=/usr/bin/supernode -CONFIGFILE=/etc/config/n2n-supernode.conf +CONFIGFILE=/etc/n2n/supernode.conf start_service() { procd_open_instance