fff-babel: Make implementation runtime switchable #201

Closed
fbl wants to merge 3 commits from fbl/firmware:bird2-select into master
7 changed files with 35 additions and 4 deletions
Showing only changes of commit bdcaa1c285 - Show all commits

View File

@ -12,7 +12,6 @@ define Package/fff-babel-bird2
URL:=https://www.freifunk-franken.de
DEPENDS:=+bird2 +bird2c
PROVIDES:=fff-babel-implementation
CONFLICTS:=fff-babeld
endef
define Package/fff-babel-bird2/description

View File

@ -0,0 +1,3 @@
/etc/init.d/bird disable
exit 0

View File

@ -44,7 +44,7 @@ babel_apply() {
return 0
}
babel_reload() {
babel_reload_implementation() {
# Change include file path, so bird uses the correct configuration, depending on the configuration state:
# - If test mode is active (and /tmp/bird-babel exists), switch to the temporary (/tmp) configuration to be tested.
# - If new settings are applied or the old settings are restored after an unsuccessful test (and /tmp/bird-babel does not exist),

View File

@ -1,4 +1,6 @@
. /lib/functions/fff/babeldaemon
implementation=babeld
. /lib/functions/fff/babeldaemon/$implementation
babel_add_iifrules() {
[ "$#" -ne "1" ] && return 1
@ -62,3 +64,26 @@ babel_add_peer6addr() {
return 0
}
babel_reload() {
# switch implementation
case $implementation in
bird2)
/etc/init.d/babeld stop 2>/dev/null
/etc/init.d/babeld disable
/etc/init.d/bird enable
/etc/init.d/bird start
;;
babeld)
/etc/init.d/bird stop 2>/dev/null
/etc/init.d/bird disable
/etc/init.d/babeld enable
/etc/init.d/babeld start
;;
esac
# call implementation-specific reload commands
babel_reload_implementation
return 0
}

View File

@ -0,0 +1,3 @@
/etc/init.d/babeld disable
exit 0

View File

@ -63,7 +63,7 @@ babel_apply() {
uci commit babeld
}
babel_reload() {
babel_reload_implementation() {
return 0
}

View File

@ -13,6 +13,7 @@ define Package/fff-layer3
DEPENDS:=+fff-alfred-monitoring-proxy \
+fff-babel \
+fff-babeld \
+fff-babel-bird2 \
+fff-boardname \
+fff-dhcp \
+fff-layer3-config \