forked from freifunk-franken/firmware
packages/fff: Add fff-simple-tc
This new packages is meant to serve as meta-package to store setup for simple-tc. This achieves two objectives: - Increase general maintainability by having relevant code in one location. - Provide the option to include/exclude simple-tc functionality just by selecting/deselecting the fff-simple-tc package. This will allow for easier testing of image size impact of this functionality, too. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Acked-by: Christian Dresel <fff@chrisi01.de> Reviewed-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
parent
aa0d237fa9
commit
93cebbf3f7
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fff-config
|
PKG_NAME:=fff-config
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
|
|
@ -5,24 +5,16 @@
|
||||||
touch /etc/config/fff
|
touch /etc/config/fff
|
||||||
|
|
||||||
if ! uci -q get fff.system > /dev/null ; then
|
if ! uci -q get fff.system > /dev/null ; then
|
||||||
uci -q set fff.system=fff
|
uci set fff.system=fff
|
||||||
uci -q set "fff.system.hostname=FFF"
|
uci set "fff.system.hostname=FFF"
|
||||||
|
uci commit fff
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FFF_hostname=$(uci -q get "fff.system.hostname")
|
FFF_hostname=$(uci -q get "fff.system.hostname")
|
||||||
test -n "${FFF_hostname}" && uci -q set "system.@system[0].hostname=${FFF_hostname}"
|
test -n "${FFF_hostname}" && uci -q set "system.@system[0].hostname=${FFF_hostname}"
|
||||||
test -n "${FFF_hostname}" && echo "${FFF_hostname}" > /proc/sys/kernel/hostname
|
test -n "${FFF_hostname}" && echo "${FFF_hostname}" > /proc/sys/kernel/hostname
|
||||||
|
|
||||||
traffic_enabled=$(uci -q get "fff.trafficcontrol.enabled")
|
uci commit system
|
||||||
traffic_in=$(uci -q get "fff.trafficcontrol.limit_in")
|
|
||||||
traffic_out=$(uci -q get "fff.trafficcontrol.limit_out")
|
|
||||||
|
|
||||||
test -n "${traffic_enabled}" && uci -q set "simple-tc.example.enabled=${traffic_enabled}"
|
|
||||||
uci -q set "simple-tc.example.ifname=wan"
|
|
||||||
uci -q set "simple-tc.example.limit_ingress=${traffic_in}"
|
|
||||||
uci -q set "simple-tc.example.limit_egress=${traffic_out}"
|
|
||||||
|
|
||||||
uci -q commit
|
|
||||||
|
|
||||||
poe_passthrough=$(uci -q get "fff.poe_passthrough.active")
|
poe_passthrough=$(uci -q get "fff.poe_passthrough.active")
|
||||||
if [ "$poe_passthrough" = "1" ] && [ -s /usr/lib/fff-support/activate_poe_passthrough.sh ] ; then
|
if [ "$poe_passthrough" = "1" ] && [ -s /usr/lib/fff-support/activate_poe_passthrough.sh ] ; then
|
||||||
|
|
38
src/packages/fff/fff-simple-tc/Makefile
Normal file
38
src/packages/fff/fff-simple-tc/Makefile
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=fff-simple-tc
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)
|
||||||
|
SECTION:=base
|
||||||
|
CATEGORY:=Freifunk
|
||||||
|
TITLE:=Freifunk-Franken simple-tc config
|
||||||
|
URL:=https://www.freifunk-franken.de
|
||||||
|
DEPENDS:=+simple-tc
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)/description
|
||||||
|
This meta-package configures simple-tc for FFF
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
echo "all: " > $(PKG_BUILD_DIR)/Makefile
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Configure
|
||||||
|
# nothing
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
# nothing
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)/install
|
||||||
|
$(CP) ./files/* $(1)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
traffic_enabled=$(uci -q get "fff.trafficcontrol.enabled")
|
||||||
|
traffic_in=$(uci -q get "fff.trafficcontrol.limit_in")
|
||||||
|
traffic_out=$(uci -q get "fff.trafficcontrol.limit_out")
|
||||||
|
|
||||||
|
test -n "${traffic_enabled}" && uci set "simple-tc.example.enabled=${traffic_enabled}"
|
||||||
|
uci set "simple-tc.example.ifname=wan"
|
||||||
|
uci set "simple-tc.example.limit_ingress=${traffic_in}"
|
||||||
|
uci set "simple-tc.example.limit_egress=${traffic_out}"
|
||||||
|
|
||||||
|
uci commit simple-tc
|
|
@ -12,7 +12,7 @@ define Package/$(PKG_NAME)
|
||||||
CATEGORY:=Freifunk
|
CATEGORY:=Freifunk
|
||||||
TITLE:= Freifunk-Franken Webinterface
|
TITLE:= Freifunk-Franken Webinterface
|
||||||
URL:=http://www.freifunk-franken.de
|
URL:=http://www.freifunk-franken.de
|
||||||
DEPENDS:=+uhttpd +libustream-mbedtls +haserl +px5g +simple-tc \
|
DEPENDS:=+uhttpd +libustream-mbedtls +haserl +px5g +fff-simple-tc \
|
||||||
+fff-boardname +fff-config +fff-network +fff-hoodutils \
|
+fff-boardname +fff-config +fff-network +fff-hoodutils \
|
||||||
+@BUSYBOX_CONFIG_WGET +@BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT
|
+@BUSYBOX_CONFIG_WGET +@BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -24,7 +24,7 @@ define Package/fff-base
|
||||||
+fff-sysupgrade \
|
+fff-sysupgrade \
|
||||||
+fff-wireless \
|
+fff-wireless \
|
||||||
+fff-timeserver \
|
+fff-timeserver \
|
||||||
+simple-tc
|
+fff-simple-tc
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/fff-base/description
|
define Package/fff-base/description
|
||||||
|
|
Loading…
Reference in New Issue
Block a user