Instead of preloading ucode modules via the cmdline, require the modules
as needed. This simplifies test case constructions since mock modules
can be injected by modifying the search path.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
esac
ACTION=start \
- ucode -S -m fs -m uci -m ubus -m fw4 -i $MAIN | nft $VERBOSE -f /proc/self/fd/0
+ ucode -S -i $MAIN | nft $VERBOSE -f /proc/self/fd/0
} 1000>$LOCK
}
print() {
ACTION=print \
- ucode -S -m fs -m uci -m ubus -m fw4 -i $MAIN
+ ucode -S -i $MAIN
}
stop() {
reload_sets() {
ACTION=reload-sets \
- flock -x $LOCK ucode -S -m fs -m uci -m ubus -m fw4 -i $MAIN | nft $VERBOSE -f /proc/self/fd/0
+ flock -x $LOCK ucode -S -i $MAIN | nft $VERBOSE -f /proc/self/fd/0
}
lookup() {
ACTION=$1 OBJECT=$2 DEVICE=$3 \
- flock -x $LOCK ucode -S -m fs -m uci -m ubus -m fw4 -i $MAIN
+ flock -x $LOCK ucode -S -i $MAIN
}
while [ -n "$1" ]; do
{%
+let fw4 = require("fw4");
+
/* Find existing sets.
*
* Unfortunately, terse mode (-t) is incompatible with JSON output so
{%
+let fs = require("fs");
+let uci = require("uci");
+let ubus = require("ubus");
+
let STATEFILE = "/var/run/fw4.state";
let PARSE_LIST = 0x01;