Compare commits

..

1 Commits

Author SHA1 Message Date
Sukru Senli
2cfb81644a swmodd: 2.3.4 2023-09-11 16:17:58 +02:00
46 changed files with 385 additions and 482 deletions

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.1.4
PKG_VERSION:=1.0.20
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=dec994de5a1338bbda82c2fb01218d70bef9b09d
PKG_SOURCE_VERSION:=4a8d286201efdff814f106e92147c697c32a94a9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -225,9 +225,7 @@ define Package/userinterface/install
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
$(INSTALL_BIN) ./files/etc/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
endef
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)

View File

@@ -1,74 +0,0 @@
#!/bin/sh
. /lib/functions.sh
log() {
echo "${@}"|logger -t firewall.dnat -p info
}
exec_cmd() {
if ! eval "$*"; then
log "Failed to run [$*]"
fi
}
reorder_dnat_rules() {
nat_chains=$(iptables -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
for chain in ${nat_chains}; do
# Collect empty remote host & empty dport rules
EMPTY_HOST_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect empty remote host but non empty dport rules
EMPTY_HOST=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect non empty remote host but empty dport rules
EMPTY_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Now add rules as per datamodel precedence shown below
## Non empty remote host, empty dport
## empty remote host, non empty dport
## empty remote host, empty dport
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
done
}
# Re-order portmapping rules according to precedence hierarchy
reorder_dnat_rules

View File

@@ -1,12 +0,0 @@
#!/bin/sh
uci -q batch <<-EOT
delete firewall.port_hook
set firewall.port_hook=include
set firewall.port_hook.path=/etc/firewall.portmap
set firewall.port_hook.reload=1
commit firewall
EOT
exit 0

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=4.0.2.6
PKG_VERSION:=4.0.2.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=944a981d8d3f9548f464c862778b67455aee9112
PKG_SOURCE_VERSION:=fa1b24690ca00a73401fec1386dbf98932545d05
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -17,11 +17,10 @@ start_service() {
config_load mapcontroller
config_get en controller enabled "0"
config_get collect_int controller de_collect_interval
[ $en -gt 0 ] && {
procd_open_instance
procd_set_param command "$PROG" "-d" "${collect_int:+-t $collect_int}"
procd_set_param command "$PROG" "-d"
#procd_set_param stdout 1
#procd_set_param stderr 1
procd_set_param respawn

View File

@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.5.11
PKG_VERSION:=3.5.9
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=18dece420502e25a9bd9f3b534bc6c338fcc9377
PKG_SOURCE_VERSION:=ae9e8f3406f1087464b994cdfbc64a4ce2f86ed4
PKG_MIRROR_HASH:=skip
endif

View File

@@ -6,16 +6,16 @@ get_max_port_speed() {
fi
local ifname="$1"
local phycap="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
local phycap="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Capabilities' | awk '{print$NF}' | cut -d'|' -f1)"
local speed=1000
case "$phycap" in
10GFD*) speed=10000 ;;
5GFD*) speed=5000 ;;
2.5GFD*) speed=2500 ;;
1GFD*) speed=1000 ;;
100MFD*|100MHD*) speed=100 ;;
10MFD*|10MHD*) speed=10 ;;
10GFD) speed=10000 ;;
5GFD) speed=5000 ;;
2.5GFD) speed=2500 ;;
1GFD|1GHD) speed=1000 ;;
100MFD|100MHD) speed=100 ;;
10MFD|10MHD) speed=10 ;;
esac
echo $speed
@@ -84,16 +84,21 @@ set_port_settings() {
[ "$duplex" == 0 ] && dplx="HD" || dplx="FD"
[ "$autoneg" == "on" ] && media_type="auto" || media_type="$speed$dplx"
phycaps="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
numofcaps="$(echo $phycaps | tr ':' ' ' | wc -w)"
phycrossbar="$(ethctl $ifname phy-crossbar | head -1)"
crossbartype="$(echo $phycrossbar | awk '{print$2$3}')"
# Take only the last PHY Endpoint (non-Serdes) into account as Serdes port number precedes
[ "$crossbartype" == "oncrossbar" ] && pyhendpoint="$(echo $phycrossbar | awk '{print$NF}')"
phycaps="$(ethctl $ifname media-type ${pyhendpoint:+ port $pyhendpoint} | awk -F'PHY Capabilities: ' '{print$2}')"
numofcaps="$(echo $phycaps | tr '|' ' ' | wc -w)"
# Reset the port before setting new params
reset_port $ifname
if [ "$numofcaps" == "1" ]; then
logger -t "ethmngr" "$ifname is capable of $phycaps only; not setting speed/duplex"
logger -t "port-management" "$ifname is capable of $phycaps only; not setting speed/duplex"
else
logger -t "ethmngr" "$ifname is capable of $phycaps; setting speed/duplex to $media_type"
logger -t "port-management" "$ifname is capable of $phycaps; setting speed/duplex to $media_type"
ethctl $ifname media-type $media_type ${pyhendpoint:+ port $pyhendpoint} &>/dev/null
fi

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.3.8
PKG_VERSION:=9.3.5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=09b7cd7a6b647dd8cbc038698af9298883b5c262
PKG_SOURCE_VERSION:=caa4ac86b91b698e73e09a3ba8b60add36ea4b62
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -14,8 +14,6 @@ handle_icwmp_update() {
return 0
fi
# wait for some time to avoid interface fluctuation
sleep 10
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
if [ "$ret" = "true" ]; then

View File

@@ -488,17 +488,20 @@ reload_service() {
fi
}
add_interface_trigger() {
procd_add_interface_trigger "interface.update" "$1" /etc/icwmpd/update.sh
}
service_triggers() {
local wan_interface
config_load cwmp
config_get wan_interface cpe default_wan_interface "wan"
procd_add_reload_trigger "cwmp"
add_interface_trigger ${default_wan_interface}
procd_open_trigger
json_add_array
json_add_string "" "interface.update"
json_add_array
json_add_array
json_add_string "" "run_script"
json_add_string "" "/etc/icwmpd/update.sh"
json_close_array
json_close_array
json_add_int "" "2000"
json_close_array
procd_close_trigger
}

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.1.16
PKG_VERSION:=8.1.11
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=4843afa0069c8eff18c6bdde6a5dd76625dc1ac5
PKG_SOURCE_VERSION:=90b8f44ca78b4711d5c86234fb0fc621ebd97fd9
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip

View File

@@ -36,18 +36,6 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
TARGET_CFLAGS +=-DIOPSYS_TEST
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
-I$(STAGING_DIR)/usr/include/libnl3
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)" \
PLATFORM="$(TARGET_PLATFORM)" \
subdirs="$(subdirs)"
define Package/libdsl
SECTION:=libs
CATEGORY:=Libraries

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-airoha
PKG_RELEASE:=1
PKG_VERSION:=1.0.5
PKG_VERSION:=1.0.3
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=3f4cdca981b30d54ec5a426775fdcec2a63f83d9
PKG_SOURCE_VERSION:=3043d53818166ce02644d53f99b5830d228f78dd
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -48,7 +48,7 @@
"bitrate": 15.2
},
"gsm": {
"name": "AMR",
"name": "GSM-AMR",
"ptime_min": 10,
"ptime_max": 30,
"ptime_default": 20,

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-broadcom
PKG_RELEASE:=1
PKG_VERSION:=1.0.1
PKG_VERSION:=1.0.0
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=548f8fccc9f8f0b5dd6bb39bdd9cac8659400cb6
PKG_SOURCE_VERSION:=dc227982c48ee6d722f3fe18dc9db71495ce9758
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -48,7 +48,7 @@
"bitrate": 15.2
},
"gsm": {
"name": "AMR",
"name": "GSM-AMR",
"ptime_min": 10,
"ptime_max": 30,
"ptime_default": 20,

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-d2
PKG_RELEASE:=1
PKG_VERSION:=1.0.6
PKG_VERSION:=1.0.4
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=062a265754b93a865cfcd2745f200aa09fb4a668
PKG_SOURCE_VERSION:=f2134d372b3f5e5810e18f34d64d5486d17fca64
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -15,6 +15,14 @@
"ptime_increment": 10,
"bitrate": 64
},
"g729a": {
"name": "G.729a",
"ptime_min": 10,
"ptime_max": 40,
"ptime_default": 20,
"ptime_increment": 10,
"bitrate": 64
},
"g729": {
"name": "G.729",
"ptime_min": 10,

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.2.107
PKG_VERSION:=7.2.104
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1bd819ac21f86a0956b1f69ef1d110665e240a5f
PKG_SOURCE_VERSION:=a246bf9fd92a1a8c107ffff3eb3428a4174a67df
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=4.3.3.10
PKG_VERSION:=4.3.3.2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=644884a8b421fd830f793b94779876395eecd8e6
PKG_SOURCE_VERSION:=6b1347b33333f3ef9884de0745aa862a0a1dabc8
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
@@ -28,7 +28,7 @@ define Package/map-agent
CATEGORY:=Utilities
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
+map-plugin +ip-bridge
+map-plugin +ip-bridge +@BUSYBOX_CONFIG_PATCH +@BUSYBOX_CONFIG_DIFF
endef

View File

@@ -8,7 +8,6 @@ config agent 'agent'
option eth_onboards_wifi_bhs '0'
# option controller_macaddr '0a:1b:2c:3d:4e:50'
option scan_on_boot_only '0'
list map_port 'all'
config dynamic_backhaul
option missing_bh_timer '60'

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=4.3.0.8
PKG_VERSION:=4.3.0.6
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=0d83f8acd66a4cb97f2f123149696334d7f03e6e
PKG_SOURCE_VERSION:=cadbccc7654a40f16f96f2c48e584b998c03620e
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
LOCAL_DEV=0

View File

@@ -155,10 +155,6 @@ validate_controller_config() {
return 0
}
create_dir() {
mkdir -p /etc/multiap
}
start_service() {
local enabled
@@ -168,8 +164,6 @@ start_service() {
config_get_bool enabled controller enabled 1
[ "$enabled" -eq 0 ] && return
create_dir
procd_open_instance
procd_set_param command "/usr/sbin/mapcontroller" "-d"

View File

@@ -18,9 +18,5 @@ config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI
enabled through TOPOLOGYD_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
through which such features would be exposed.
config TOPOLOGYD_HOST_WAN_STATS
bool "Enable wan statistics collection per hosts"
default y
endmenu
endif

View File

@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=map-topology
PKG_VERSION:=2.5.1.24
PKG_VERSION:=2.5.1.21
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_VERSION:=9f15e813c39ff23cef27975ce138bd3286f30adf
PKG_SOURCE_VERSION:=693b79873af0017bd53ec001af7f3997565420e8
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-topology.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
@@ -52,9 +52,6 @@ ifeq ($(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT),y)
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)\\\"
endif
ifeq ($(CONFIG_TOPOLOGYD_HOST_WAN_STATS),y)
TARGET_CFLAGS += -DHOST_WAN_STATS
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare

View File

@@ -10,81 +10,37 @@ PROG_EXE=/usr/sbin/mcproxy
PROG_PARAMS=
PROG_PARAMS_SEPARATOR=:
__device_is_bridge() {
local device="$2"
local devsec__="$(uci show network | grep name=.*$device | cut -d'.' -f2)"
local sectype="$(uci -q get network.$devsec__)"
local devtype="$(uci -q get network.$devsec__.type)"
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
eval "$1=$devsec__"
}
device_is_bridge() {
local device="$1"
local devsec=
__device_is_bridge devsec "$device" || return 1
}
device_ports() {
local device="$1"
local devsec=
if __device_is_bridge devsec "$device"; then
echo "$(uci get network.$devsec.ports)"
else
echo "$device"
fi
}
device_has_ip() {
local protocol="$1"
local device="$2"
# Read the openwrt interface for the device.
# Device can have multiple logical interfaces like wan and wan6
# but same l3 device
# NB. Don't use 'get_network_of' here.
# This function fails in some uci configurations for interfaces that refer
# to a device indirectly.
local ifaces=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.device='$device'].interface")
for iface in $ifaces; do
local ip=
case "$protocol" in
"igmp") network_get_ipaddr ip "$iface" ;;
"mld") network_get_ipaddr6 ip "$iface" ;;
esac
[ -n "$ip" ] && return
done
return 1
setup_mcast_mode() {
unused(){ :;}
}
config_mcproxy_interfaces() {
local protocol="$1"
local upstreams="$2"
local downstreams="$3"
local exceptions="$4"
if [ -z "$upstreams" ] || [ -z "$downstreams" ]; then
return 1
fi
local upstreams="$1"
local downstreams="$2"
local exceptions="$3"
local str_up=""
for upstream in $upstreams; do
device_has_ip "$protocol" "$upstream" || continue
str_up="$str_up \"$upstream\""
done
[ -z "$str_up" ] && return 1
if [ -n "$upstreams" ]; then
for upstream in $upstreams; do
str_up="$str_up \"$upstream\""
done
fi
local str_down=""
for downstream in $downstreams; do
device_has_ip "$protocol" "$downstream" || continue
str_down="$str_down \"$downstream\""
done
[ -z "$str_down" ] && return 1
if [ -n "$downstreams" ]; then
for downstream in $downstreams; do
str_down="$str_down \"$downstream\""
done
fi
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
if [ ! -z $downstream ]; then
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
fi
if [ -z "$exceptions" ] || [ -z "$upstreams" ]; then
return
fi
for excp in $exceptions; do
local filter=""
@@ -100,63 +56,34 @@ config_mcproxy_interfaces() {
;;
esac
for upstream in $str_up; do
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
for upstream in $upstreams; do
echo "pinstance main upstream \"$upstream\" in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream \"$upstream\" out blacklist table{$filter };" >> $CONFFILE
done
for downstream in $str_down; do
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
for downstream in $downstreams; do
echo "pinstance main downstream \"$downstream\" in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main downstream \"$downstream\" out blacklist table{$filter };" >> $CONFFILE
done
done
}
config_sysfs_mcast_snooping() {
local downstreams="$1"
local devsec=
local sectype=
local devtype=
local ports=
for downstream in $downstreams; do
if device_is_bridge "$downstream"; then
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
sectype="$(uci -q get network.$devsec)"
devtype="$(uci -q get network.$devsec.type)"
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
echo 1 > /sys/class/net/$downstream/bridge/multicast_snooping
fi
done
}
config_sysfs_mcast_fastleave() {
local downstreams="$1"
local fastleave="$2"
local prt
for downstream in $downstreams; do
for prt in $(device_ports $downstream); do
if [ -f /sys/class/net/$prt/brport/multicast_fast_leave ]; then
echo $fastleave > /sys/class/net/$prt/brport/multicast_fast_leave
fi
done
done
}
config_sysfs_mcast_mode() {
local downstreams=$1
local mcast_mode=$2
local prt
local mcast_flood=
if [ $mcast_mode == "2" ]; then # disable mcast flood
mcast_flood=0
else
mcast_flood=1
fi
for downstream in $downstreams; do
for prt in $(device_ports $downstream); do
if [ -f /sys/class/net/$prt/brport/multicast_flood ]; then
echo $mcast_flood > /sys/class/net/$prt/brport/multicast_flood
fi
done
done
}
config_mcproxy_instance() {
local protocol="$1"
local version="$2"
@@ -169,7 +96,7 @@ config_mcproxy_instance() {
local exceptions=
local upstreams=
local downstreams=
local mcast_mode=2 # default value 2 is for blocking mode
local intf_has_ip=
CONFFILE=/var/etc/mcproxy_"$protocol".conf
rm -f $CONFFILE
@@ -194,7 +121,6 @@ config_mcproxy_instance() {
upstreams=$igmp_p_up_interfaces
downstreams=$igmp_p_down_interfaces
mcast_mode=$igmp_p_mode
elif [ "$protocol" == "mld" ]; then
case "$version" in
[1-2])
@@ -214,26 +140,59 @@ config_mcproxy_instance() {
upstreams=$mld_p_up_interfaces
downstreams=$mld_p_down_interfaces
mcast_mode=$mld_p_mode
fi
# for snooping to work we should enable it on the bridge, doing it from
# here instead of from inside network config
config_sysfs_mcast_snooping
[ -n "$max_groups" ] && echo -e "max_groups $max_groups;" >> $CONFFILE
[ -n "$robustness" ] && echo -e "rv $robustness;" >> $CONFFILE
[ -n "$query_interval" ] && echo -e "qi $query_interval;" >> $CONFFILE
[ -n "$q_resp_interval" ] && echo -e "qri $q_resp_interval;" >> $CONFFILE
[ -n "$last_mem_q_int" ] && echo -e "lmqi $last_mem_q_int;" >> $CONFFILE
[ -n "$fast_leave" ] && echo -e "fastleave $fast_leave;\n" >> $CONFFILE
if [[ -n $fast_leave ]]; then
echo -e "fastleave $fast_leave;\n" >> $CONFFILE
config_sysfs_mcast_fastleave $fast_leave
fi
config_mcproxy_interfaces "$protocol" "$upstreams" "$downstreams" "$exceptions" || return
[ -n "$upstreams" ] && [ -n "$downstreams" ] &&
config_mcproxy_interfaces "$upstreams" "$downstreams" "$exceptions"
# for snooping to work we should enable it on the bridge, doing it from
# here instead of from inside network config
config_sysfs_mcast_snooping "$downstreams"
[ -n $fast_leave ] &&
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
config_sysfs_mcast_mode "$downstreams" "$mcast_mode"
# In case on proxy, upstreams is a list. Iterating and running the mcproxy
# for each valid upstream interface
for upstream_device in $upstreams;
do
# Read the upstream interface for the upstream device
# upstream device can have multiple logical interfaces like wan and wan6
# but same l3 device
local upstream_ifaces=$(get_network_of $upstream_device)
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
for iface in $upstream_ifaces;
do
if [ "$protocol" == "igmp" ]; then
network_get_ipaddr upstream_ip $iface
if [ ! -z "${upstream_ip}" ]; then
intf_has_ip=1
break
fi
fi
if [ "$protocol" == "mld" ]; then
network_get_ipaddr6 upstream_ip $iface
if [ ! -z "${upstream_ip}" ]; then
intf_has_ip=1
break
fi
fi
done
if [ -z "${intf_has_ip}" ]; then
continue
fi
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
done
}
config_mcproxy() {
@@ -246,6 +205,28 @@ config_mcproxy() {
fi
}
config_sysfs_mcast_fastleave() {
local devsec=
local sectype=
local devtype=
local ports=
for downstream in $downstreams; do
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
sectype="$(uci -q get network.$devsec)"
devtype="$(uci -q get network.$devsec.type)"
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
ports="$(uci get network.$devsec.ports)"
for prt in $ports; do
echo $1 > /sys/class/net/$prt/brport/multicast_fast_leave
done
else
[[ -f /sys/class/net/$downstream/brport/multicast_fast_leave ]] && echo $1 > /sys/class/net/$downstream/brport/multicast_fast_leave
fi
done
}
configure_mcast() {
config_global_params "set_max_groups_and_sources"

View File

@@ -4,27 +4,15 @@
. /lib/functions.sh
read_mcast_stats() {
local temp_igmp_file='/tmp/igmp_stats_'$$
local snooping_stats='/tmp/igmp_snooping_stats'
local old_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
temp_igmp_file='/tmp/igmp_stats_'$$
# Sending signal to mcproxy to dump multicast data in /tmp/igmp_snooping_stats
local mcast_pids=$(pidof mcproxy)
mcast_pids=$(pidof mcproxy)
for pid in $mcast_pids
do
$(kill -10 $pid)
done
# Wait for signal is being processed by mcproxy
if [ -n "$mcast_pids" ]; then
for i in 1 2 3; do
local new_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
[ -n "$new_mod_time" ] && [ "$new_mod_time" != "$old_mod_time" ] && break
sleep 0.1
done
fi
cat "$snooping_stats" > "$temp_igmp_file"
cat /tmp/igmp_snooping_stats > temp_igmp_file
local mcast_addrs=""
local ifaces=""
@@ -54,7 +42,7 @@ read_mcast_stats() {
fi
;;
esac
done < "$temp_igmp_file"
done < temp_igmp_file
while read line; do
# reading each line
@@ -81,7 +69,7 @@ read_mcast_stats() {
fi
;;
esac
done < "$temp_igmp_file"
done < temp_igmp_file
json_init
json_add_array "snooping"
@@ -101,7 +89,7 @@ read_mcast_stats() {
break
;;
esac
done < "$temp_igmp_file"
done < temp_igmp_file
IFS=" "
for gip_addr in $mcast_addrs; do
grp_obj_added=0
@@ -136,7 +124,7 @@ read_mcast_stats() {
json_close_object #close the associated device object
;;
esac
done < "$temp_igmp_file"
done < temp_igmp_file
json_close_array #close the associated devices array
json_close_object # close the groups object
done # close the loop for group addresses
@@ -146,7 +134,7 @@ read_mcast_stats() {
json_close_array # close the snooping array
json_dump
rm -f "$temp_igmp_file"
rm -f temp_igmp_file
}
case "$1" in

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=7.0.2.22.1
PKG_VERSION:=7.0.2.16
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
PKG_SOURCE_VERSION:=001a4cf2de7e20f322ac48ef73c6b5b84db39992
PKG_SOURCE_VERSION:=312a739dc9106e8ff490288ba22270f4ce7e1fed
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -12,7 +12,7 @@ KEEP_FILE="/lib/upgrade/keep.d/obuspa"
RESET_FILE="/tmp/obuspa/obuspa_param_reset.txt"
SQL_DB_FILE="/tmp/obuspa/usp.db"
DB_DUMP="/tmp/obuspa/usp.dump_$(date +%s)"
DB_DUMP="/tmp/obuspa/usp.dump"
BASEPATH=""
INSTANCE_COUNT=0
@@ -76,7 +76,7 @@ db_set()
dump_db()
{
${PROG} -v0 -f ${SQL_DB_FILE} -c show database |awk '/^Device./ || /^Internal./ {print $1 " \"" $3 "\""}' | sort > ${DB_DUMP}
${PROG} -f ${SQL_DB_FILE} -c show database |awk 'NR>1 {print $1 " \"" $3 "\""}' | sort > ${DB_DUMP}
}
# if db present then check if it matches with existing instances
@@ -196,10 +196,6 @@ validate_obuspa_section()
'debug:bool:0' \
'prototrace:bool:0' \
'log_level:uinteger' \
'min_num_to_group:uinteger' \
'max_group_sep:uinteger' \
'max_cache_time:uinteger' \
'ipc_timeout:uinteger' \
'log_dest:string' \
'db_file:string' \
'role_file:file'
@@ -1036,8 +1032,8 @@ register_service()
configure_obuspa
procd_set_param respawn \
"${respawn_threshold:-10}" \
"${respawn_timeout:-10}" "${respawn_retry:-5}"
"${respawn_threshold:-5}" \
"${respawn_timeout:-10}" "${respawn_retry:-3}"
procd_set_param watch bbfdm
procd_close_instance

View File

@@ -587,7 +587,7 @@
],
"datatype": "string",
"enumerations": [
"G-PON",
"GPON",
"XG-PON",
"NG-PON2",
"XGS-PON"
@@ -858,7 +858,7 @@
}
]
},
"VendorName": {
"ModuleVendor": {
"type": "string",
"read": true,
"write": false,
@@ -871,11 +871,11 @@
{
"data": "@Parent",
"type": "json",
"key": "VendorName"
"key": "ModuleVendor"
}
]
},
"VendorPartNumber": {
"ModuleName": {
"type": "string",
"read": true,
"write": false,
@@ -888,11 +888,11 @@
{
"data": "@Parent",
"type": "json",
"key": "VendorPartNumber"
"key": "ModuleName"
}
]
},
"VendorRevision": {
"ModuleVersion": {
"type": "string",
"read": true,
"write": false,
@@ -905,7 +905,24 @@
{
"data": "@Parent",
"type": "json",
"key": "VendorRevision"
"key": "ModuleVersion"
}
]
},
"ModuleFirmwareVersion": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"mapping": [
{
"data": "@Parent",
"type": "json",
"key": "ModuleFirmwareVersion"
}
]
},

View File

@@ -85,19 +85,3 @@ After adding the makefile, user need to specify the list of plugins in below con
```bash
CONFIG_SULU_EXTRA_PACKAGES="sulu-plugin1 sulu-plugin2 sulu-theme1"
```
# SULU PWA (Progressive Web App)
PWA applications generally used for well know secured sites, which can be installed directly from web-browser as desktop/mobile application.
> Note:
> 1. It requires well defined SSL keys for deployment of PWA for a defined site.
> 2. It should be used with sites with well defined FQDN
To enable SULU PWA application, user need to select PWA in sulu/sulu-builder config options and provide the path of the pwa key file
```bash
CONFIG_SULU_PWA_APP=y
CONFIG_SULU_PWA_KEYS_PATH="/somepath_with_pwa.{crt,key}"
```
>Note: Replacing/changing the keys might requires uninstall/install of PWA App and CTRL+Shift+R in browser to drop the cached site and load the new site with new keys.

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-base
PKG_VERSION:=2.3.0
PKG_VERSION:=2.2.5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
PKG_SOURCE_VERSION:=f7d77710c288668c7abf84ec82eeffc613723004
PKG_SOURCE_VERSION:=2964b4263ee25fe16a0a74e833e269889dc8375f
PKG_MIRROR_HASH:=skip
SULU_MOD:=core

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-builder
PKG_VERSION:=2.3.0
PKG_VERSION:=2.2.5
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
PKG_SOURCE_VERSION:=6d4933ac821600b051193951f24765569da2c9a4
PKG_SOURCE_VERSION:=046bb209b4650564cc07d288112f3eb367aabca2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
@@ -28,8 +28,7 @@ define Package/sulu/default
CATEGORY:=Utilities
SUBMENU:=SULU
TITLE:=SULU-CE
DEPENDS:=+mosquitto-auth-shadow +usermngr +jq
EXTRA_DEPENDS:=nginx
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr +jq
endef
define Package/sulu
@@ -42,10 +41,10 @@ endef
define Package/sulu-builder
$(Package/sulu/default)
CONFLICTS:=sulu
TITLE += (Builder)
VARIANT:=builder
DEPENDS+=+sulu-base $(foreach plugin,$(SULU_PLUGINS), +PACKAGE_$(plugin):$(plugin)) $(foreach plugin,$(SULU_EXTRA), +PACKAGE_$(plugin):$(plugin))
MENU:=1
endef
define Package/sulu/description
@@ -56,45 +55,16 @@ define Package/sulu-builder/description
SULU-CE ReactJS based Web UI builder.
endef
define Package/sulu/config
config SULU_PWA_APP
depends on PACKAGE_sulu
bool "Enable SULU PWA App support"
default n
help
Enable SULU PWA (Progressive Web App) support, this requires
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
config SULU_PWA_KEYS_PATH
depends on PACKAGE_sulu
string "Path of pwa.crt and pwa.key for sulu/PWA"
help
Provide directory path for the certficates for PWA,
directory must contain 'pwa.crt' and 'pwa.key'.
endef
define Package/sulu-builder/config
config SULU_EXTRA_PACKAGES
menu "Configuration"
depends on PACKAGE_sulu-builder
config SULU_EXTRA_PACKAGES
string "Space separated list of sulu packages"
help
You can specify the list of non core sulu package,
so that sulu-builder include them before building the core.
config SULU_PWA_APP
depends on PACKAGE_sulu-builder
bool "Enable SULU PWA App support"
default n
help
Enable SULU PWA (Progressive Web App) support, this requires
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
config SULU_PWA_KEYS_PATH
depends on PACKAGE_sulu-builder
string "Path of pwa.crt and pwa.key for sulu/PWA"
help
Provide directory path for the certficates for PWA,
directory must contain 'pwa.crt' and 'pwa.key'.
endmenu
endef
ifeq ($(BUILD_VARIANT),builder)
@@ -129,19 +99,11 @@ define Package/sulu/install/Default
$(INSTALL_BIN) ./files/etc/uci-defaults/40-add-sulu-nginx-config $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/01-update-nginx-uci-template $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/10-add-mqtt-config $(1)/etc/uci-defaults/
ifeq ($(CONFIG_SULU_PWA_APP),y)
$(INSTALL_BIN) ./files/etc/uci-defaults/99-eval-set-sulu-pwa-keys $(1)/etc/uci-defaults/
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.crt $(1)/etc/sulu/
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.key $(1)/etc/sulu/
endif
endef
define Package/sulu/install
$(Package/sulu/install/Default)
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu
ifneq ($(CONFIG_SULU_PWA_APP),y)
$(CP) $(PKG_BUILD_DIR)/dist/nonPWA.html $(1)/sulu/index.html
endif
ifneq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
$(RM) $(1)/sulu/config/widgets/lcm-store.json
endif
@@ -150,9 +112,6 @@ endef
define Package/sulu-builder/install
$(Package/sulu/install/Default)
$(CP) $(PKG_BUILD_DIR)/build/dist/* $(1)/sulu
ifneq ($(CONFIG_SULU_PWA_APP),y)
$(CP) $(PKG_BUILD_DIR)/build/dist/nonPWA.html $(1)/sulu/index.html
endif
$(CP) $(PKG_BUILD_DIR)/build/src/config/*.json $(1)/sulu/config/
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/wan.json $(1)/sulu/config/widgets/

View File

@@ -9,14 +9,15 @@ add_sulu_nginx_uci()
if ! uci_get nginx _sulu_s >/dev/null 2>&1; then
uci_add nginx server _sulu_s
uci_set nginx _sulu_s root '/sulu'
uci_add_list nginx _sulu_s listen "8443 ssl default_server"
uci_add_list nginx _sulu_s listen "[::]:8443 ssl default_server"
uci_add_list nginx _sulu_s listen "8443 http2 ssl"
uci_add_list nginx _sulu_s listen "[::]:8443 http2 ssl"
uci_set nginx _sulu_s server_name '_sulu_s'
uci_add_list nginx _sulu_s include '/etc/sulu/nginx.locations'
uci_set nginx _sulu_s uci_manage_ssl 'self-signed'
uci_set nginx _sulu_s ssl_certificate '/etc/nginx/conf.d/_lan.crt'
uci_set nginx _sulu_s ssl_certificate_key '/etc/nginx/conf.d/_lan.key'
uci_set nginx _sulu_s ssl_session_cache 'none'
uci_set nginx _sulu_s ssl_session_cache 'shared:SSL:32k'
uci_set nginx _sulu_s ssl_session_timeout '64m'
uci_set nginx _sulu_s access_log 'off; # logd openwrt'
uci_set nginx _sulu_s error_log '/dev/null'
fi
@@ -26,7 +27,7 @@ add_sulu_nginx_uci()
uci_add_list nginx _suluredirect listen "8080"
uci_add_list nginx _suluredirect listen "[::]:8080"
uci_set nginx _suluredirect server_name '_suluredirect'
uci_set nginx _suluredirect return '302 https://$host:8443$request_uri'
uci_set nginx _suluredirect return 'https://$host:8443$request_uri'
fi
}

View File

@@ -1,14 +0,0 @@
#!/bin/sh
. /lib/functions.sh
set_sulu_pwa_key()
{
if [ -f "/etc/sulu/pwa.crt" -a -f "/etc/sulu/pwa.key" ]; then
uci_load nginx
uci_set nginx _sulu_s ssl_certificate '/etc/sulu/pwa.crt'
uci_set nginx _sulu_s ssl_certificate_key '/etc/sulu/pwa.key'
fi
}
set_sulu_pwa_key

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-lcm
PKG_VERSION:=2.2.12
PKG_VERSION:=2.2.4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
PKG_SOURCE_VERSION:=bc866b3679d07a80828aa40f7fcdaf18d48c7c61
PKG_SOURCE_VERSION:=46975426ffa53ffcc3b0d9e9160f6b3d4b6d82fd
PKG_MIRROR_HASH:=skip
SULU_PLUGIN_INSTALL:=1

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-multi-ap
PKG_VERSION:=2.2.18
PKG_VERSION:=2.2.4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
PKG_SOURCE_VERSION:=ae4cb0a27b7d084aaad69e81cb4d96d88ecdffee
PKG_SOURCE_VERSION:=d77f19d8d964c9ecf8ab6d2cc3c8ddc369135d7e
PKG_MIRROR_HASH:=skip
include ../sulu-builder/sulu.mk

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-parental-control
PKG_VERSION:=2.2.12
PKG_VERSION:=2.2.3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
PKG_SOURCE_VERSION:=e005dd22fd98342df9589e05dd89e322265a2dcc
PKG_SOURCE_VERSION:=27f3859e30efbbed211c033f923f35974b3619fd
PKG_MIRROR_HASH:=skip
include ../sulu-builder/sulu.mk

View File

@@ -1,53 +1,83 @@
menu "Configuration"
config SWMODD_REGISTRY_PULL_SUPPORT
bool "Add support to pull images from container image registries (i.e: docker.io, quay.io)"
depends on PACKAGE_swmodd
default n
select PACKAGE_skopeo
select PACKAGE_umoci
config SWMODD_LXC_SUPPORT
bool "Handles LXC based containers"
default y
config SWMODD_LXC_SUPPORT
bool "Handles LXC based containers"
depends on PACKAGE_swmodd
default y
select PACKAGE_lxc
select PACKAGE_lxc-attach
select PACKAGE_lxc-auto
select PACKAGE_lxc-cgroup
select PACKAGE_lxc-checkconfig
select PACKAGE_lxc-common
select PACKAGE_lxc-config
select PACKAGE_lxc-configs
select PACKAGE_lxc-console
select PACKAGE_lxc-create
select PACKAGE_lxc-destroy
select PACKAGE_lxc-execute
select PACKAGE_lxc-freeze
select PACKAGE_lxc-hooks
select PACKAGE_lxc-info
select PACKAGE_lxc-init
select PACKAGE_lxc-ls
select PACKAGE_lxc-device
select PACKAGE_lxc-start
select PACKAGE_lxc-stop
select PACKAGE_lxc-templates
select PACKAGE_lxc-top
select PACKAGE_lxc-unfreeze
select PACKAGE_lxc-unprivileged
select PACKAGE_lxc-unshare
select PACKAGE_lxc-user-nic
select PACKAGE_lxc-usernsexec
select PACKAGE_lxc-wait
config SWMODD_OCI_SUPPORT
bool "Handles OCI containers"
default y
depends on PACKAGE_swmodd
select PACKAGE_crun
config SWMODD_OCI_SUPPORT
bool "Handles OCI containers"
depends on PACKAGE_swmodd
default y
select PACKAGE_crun
config SWMODD_REGISTRY_PULL_SUPPORT
bool "Add support to pull images from container image registries (i.e: docker.io, quay.io)"
default n
depends on PACKAGE_swmodd
select PACKAGE_skopeo
select PACKAGE_umoci
config SWMODD_KERNEL_OPTIONS
bool "Enable kernel support for LXC and OCI containers"
depends on PACKAGE_swmodd
default y
select LXC_KERNEL_OPTIONS
select LXC_BUSYBOX_OPTIONS
select LXC_SECCOMP
select LXC_NETWORKING
select KERNEL_CGROUPS
select KERNEL_CGROUP_SCHED
select KERNEL_CGROUP_DEVICE
select KERNEL_CGROUP_FREEZER
select KERNEL_CGROUP_CPUACCT
select KERNEL_CGROUP_NET_PRIO
select KERNEL_NET_CLS_CGROUP
select KERNEL_NAMESPACES
select KERNEL_DEVPTS_MULTIPLE_INSTANCES
select KERNEL_POSIX_MQUEUE
select KERNEL_FAIR_GROUP_SCHED
select KERNEL_RT_GROUP_SCHED
select KERNEL_MEMCG
select KERNEL_MEMCG_KMEM
select KERNEL_CPUSETS
select PACKAGE_kmod-ikconfig
help
Select needed kernel options for LXC and CRUN related utilities. Options
include cgroups, namespaces and other miscellaneous options. These
options unfortunately can not be installed as a module.
config SWMODD_KERNEL_OPTIONS
bool "Enable kernel support for LXC and OCI containers"
default y
select KERNEL_CGROUPS
select KERNEL_CGROUP_SCHED
select KERNEL_CGROUP_DEVICE
select KERNEL_CGROUP_FREEZER
select KERNEL_CGROUP_CPUACCT
select KERNEL_CGROUP_NET_PRIO
select KERNEL_NET_CLS_CGROUP
select KERNEL_NAMESPACES
select KERNEL_DEVPTS_MULTIPLE_INSTANCES
select KERNEL_POSIX_MQUEUE
select KERNEL_FAIR_GROUP_SCHED
select KERNEL_RT_GROUP_SCHED
select KERNEL_MEMCG
select KERNEL_MEMCG_KMEM
select KERNEL_CPUSETS
select PACKAGE_kmod-ikconfig
help
Select needed kernel options for LXC and CRUN related utilities. Options
include cgroups, namespaces and other miscellaneous options. These
options unfortunately can not be installed as a module.
config SWMODD_NETWORKING
bool "Enable networking support for LXC/OCI containers"
default y
select PACKAGE_kmod-veth
select PACKAGE_kmod-macvlan
help
Enable "veth pair device" and "macvlan"
endmenu
config SWMODD_NETWORKING
bool "Enable networking support for LXC/OCI containers"
depends on PACKAGE_swmodd
default y
select PACKAGE_kmod-veth
select PACKAGE_kmod-macvlan
help
Enable "veth pair device" and "macvlan"

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=swmodd
PKG_VERSION:=2.2.7
PKG_VERSION:=2.3.4
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
PKG_SOURCE_VERSION:=e202399a238369b792d20aded0e085ab71d1b120
PKG_SOURCE_VERSION:=d29418d26e630894079de73fae66bf04b5db0ab3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -28,6 +28,7 @@ define Package/swmodd
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:= Software Modules Daemon
MENU:=1
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
+PACKAGE_lxc:lxc +PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
+@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT +@BUSYBOX_CONFIG_SCRIPT \
@@ -54,12 +55,12 @@ TARGET_CFLAGS += \
-D_GNU_SOURCE \
-Wall -Werror
ifeq ($(CONFIG_PACKAGE_crun),y)
ifeq ($(CONFIG_SWMODD_OCI_SUPPORT),y)
MAKE_FLAGS += \
SWMOD_CRUN="yes"
endif
ifeq ($(CONFIG_PACKAGE_lxc),y)
ifeq ($(CONFIG_SWMODD_LXC_SUPPORT),y)
MAKE_FLAGS += \
SWMOD_LXC="yes"
endif

View File

@@ -14,6 +14,34 @@ is_container_running() {
return $?
}
configure_lxc_container() {
local requested_state name ctype du_status BUNDLE
ctype="${1}"
name="${2}"
requested_state="${3}"
du_state="${4}"
BUNDLE="${5}"
if [ "${ctype}" != "lxc" ]; then
return 0;
fi
if [ "${du_status}" = "Uninstalling" ]; then
lxc-stop -q -k "${name}"
if [ -d "${BUNDLE:?}/${name:?}" ]; then
rm -rf "${BUNDLE:?}/${name:?}"
fi
fi
if [ "${requested_state}" = "Idle" ]; then
lxc-stop -q -k "${name}"
elif [ "${requested_state}" = "Active" ]; then
lxc-start -q "${name}" >/dev/null 2>&1
fi
}
configure_crun_container() {
local name type autostart du_status requested_state url username password
local BRIDGE BUNDLE BOOT
@@ -38,6 +66,7 @@ configure_crun_container() {
fi
if [ "${type}" != "crun" ]; then
configure_lxc_container "${type}" "${name}" "${requested_state}" "${du_status}" "${BUNDLE}"
return 0;
fi

View File

@@ -6,6 +6,11 @@ STOP=01
USE_PROCD=1
PROG=/usr/sbin/swmodd
log()
{
logger -t swmodd.init "$*"
}
validate_globals_section()
{
uci_validate_section swmodd swmodd "globals" \
@@ -18,15 +23,23 @@ validate_globals_section()
}
start_lxc_container() {
local root
config_get name "${1}" name ""
config_get type "${1}" type ""
config_get autostart "${1}" autostart "0"
config_get timeout "${1}" timeout "300"
root="${2}"
if [ -z "${name}" ] || [ -z "${type}" ]; then
return 0;
fi
# workaround to install lxc container with installdu and autostart them
if [ -f "${root}/$name/config" ]; then
type=lxc
fi
if [ "${type}" != "lxc" ]; then
return 0;
fi
@@ -39,12 +52,12 @@ start_lxc_container() {
if [ "${autostart}" == "0" ]; then
if [ "${state}" == "RUNNING" ]; then
# stop the container if running
lxc-stop -n "${name}" -t "${timeout}" &
lxc-stop -k -n "${name}" &
return 0;
elif [ "${state}" == "FROZEN" ]; then
# first unfreeze then stop
lxc-unfreeze -n "${name}"
lxc-stop -n "${name}" -t "${timeout}" &
lxc-stop -k -n "${name}" &
return 0;
fi
else
@@ -59,6 +72,12 @@ start_lxc_container() {
fi
}
stop_lxc_containers() {
for f in `lxc-ls`; do
lxc-stop -k -n $f >/dev/null 2>&1;
done
}
start_service() {
local enabled debug log_level sock lxc_bundle_root oci_bundle_root
@@ -70,9 +89,15 @@ start_service() {
[ "${enabled}" -eq 0 ] && return 0
# Create the bundle paths if not present
[ -n "${lxc_bundle_root}" ] && mkdir -p "${lxc_bundle_root}"
[ -n "${oci_bundle_root}" ] && mkdir -p "${oci_bundle_root}"
if [ ! -d "${lxc_bundle_root}" ]; then
log "# Not staring lxc [${lxc_bundle_root}] not present/defined"
return 1
fi
if [ ! -d "${oci_bundle_root}" ]; then
log "# Not staring oci [${oci_bundle_root}] not present/defined"
return 1
fi
procd_open_instance swmodd
procd_set_param command ${PROG}
@@ -94,8 +119,17 @@ start_service() {
if [ -f "${lxc_bundle_root}/lxccontainer" ]; then
UCI_CONFIG_DIR="${lxc_bundle_root}"
config_load lxccontainer
config_foreach start_lxc_container container
config_foreach start_lxc_container container ${lxc_bundle_root}
fi
if [ -f "${oci_bundle_root}/ocicontainer" ]; then
UCI_CONFIG_DIR="${oci_bundle_root}"
config_load ocicontainer
config_foreach start_lxc_container du_eu_assoc ${oci_bundle_root}
fi
}
stop_service() {
stop_lxc_containers
}
reload_service() {

View File

@@ -21,23 +21,18 @@ if [ -n "${lxc_bundle}" ]; then
elif [ -n "${lxc}" ]; then
# if lxc_bundle_root not define in swmodd, update it with lxc path
uci_set swmodd globals lxc_bundle_root ${lxc}
uci_commit
else
mkdir -p /etc/lxc
echo "lxc.lxcpath = /srv/" > /etc/lxc/lxc.conf
uci_set swmodd globals lxc_bundle_root "/srv/"
uci_commit
fi
if [ -z "${oci_bundle}" ] && [ -n "${lxc_bundle}" ]; then
# if oci_bundle_root not defined in swmodd, update it with lxc_bundle_root if defined
uci_set swmodd globals oci_bundle_root ${lxc_bundle}
uci_commit
elif [ -z "${oci_bundle}" ] && [ -n "${lxc}" ]; then
# if oci_bundle_root not defined in swmodd, update it with lxc path
uci_set swmodd globals oci_bundle_root ${lxc}
uci_commit
elif [ -z "${oci_bundle}" ]; then
uci_set swmodd globals oci_bundle_root "/srv/"
uci_commit
fi

View File

@@ -19,7 +19,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=190cc528047a834597007f2763abdc381cde93c1
PKG_SOURCE_VERSION:=11b27a3bbf80f87ddfe10ed984d2945655ce3ba1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wifimngr
PKG_VERSION:=16.0.9
PKG_VERSION:=16.0.6
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1d2ac09305a6540c5b495fa8ba669599e9e75826
PKG_SOURCE_VERSION:=93b34813aa41220e57bbec8c13c7a68d390c7a61
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -20,3 +20,6 @@ reload_service() {
start
}
service_triggers() {
procd_add_reload_trigger "wireless"
}