diff --git a/Note b/Note
new file mode 100644
index 0000000..c8bd7ce
--- /dev/null
+++ b/Note
@@ -0,0 +1,17 @@
+
+decompress:
+gunzip -k openwrt-sunxi-cortexa53-sun50i-a64-sopine-baseboard-squashfs-sdcard.img.gz
+
+find the begining of root fs:
+fdisk openwrt-sunxi-cortexa53-sun50i-a64-sopine-baseboard-squashfs-sdcard.img | grep Linux
+ 2: 83 178 3 12 - 211 1 13 [ 45056 - 524288] Linux files*
+
+dump root fs:
+dd if=openwrt-sunxi-cortexa53-sun50i-a64-sopine-baseboard-squashfs-sdcard.img of=openwrt-sunxi-cortexa53-sun50i-a64-sopine-baseboard-root-squashfs.img ibs=512 skip=45056
+
+mount root fs:
+mount -t squashfs openwrt-sunxi-cortexa53-sun50i-a64-sopine-baseboard-root-squashfs.img /mnt/sunxi
+
+OR in Macos
+
+squashfuse openwrt-sunxi-cortexa53-sun50i-a64-sopine-baseboard-root-squashfs.img /mnt/sunxi
\ No newline at end of file
diff --git a/init.sh b/init.sh
index bf6f217..76a328e 100755
--- a/init.sh
+++ b/init.sh
@@ -10,7 +10,8 @@ echo './proc
./system
./sys
./dev
-./data' | xargs -n1 sh -c 'mkdir -p root/mnt/android/$0'
+./data' | xargs -n1 sh -c 'mkdir -p root/mnt/android/$0; chmod 755 root/mnt/android/$0'
-chmod 771 root/mnt/android/data
chmod 750 root/mnt/android/sbin
+chmod 771 root/mnt/android/data
+chmod 770 root/mnt/android/cache
\ No newline at end of file
diff --git a/overlay_pack.sh b/overlay_pack.sh
index c99e6ea..1428ca9 100644
--- a/overlay_pack.sh
+++ b/overlay_pack.sh
@@ -1,4 +1,4 @@
# use opkg offline mode `opkg -o / -f /etc/opkg.conf install ??` to install, then
# run this on device /overlay/upper/ to package
find etc/init.d/ -type f|xargs -n1 sh -c '/$0 enable'
-find -type f -o -type l|grep -v ./mnt|grep -v ./root/|grep -v dropbear_rsa_host_key|grep -v urandom.seed|grep -v board.json|grep -v ./etc/config/|grep -v ./etc/samba/|tar -czf /tmp/update.tar.gz -T -
+find -type f -o -type l|grep -v ./android|grep -v ./mnt|grep -v ./root/|grep -v dropbear_rsa_host_key|grep -v urandom.seed|grep -v board.json|grep -v ./etc/config/|grep -v ./etc/samba/|tar -czf /tmp/update.tar.gz -T -
diff --git a/root/bin/busybox b/root/bin/busybox
index 5f8b7e3..d7acf62 100755
Binary files a/root/bin/busybox and b/root/bin/busybox differ
diff --git a/root/bin/config_generate b/root/bin/config_generate
index df221cc..3bf48d7 100755
--- a/root/bin/config_generate
+++ b/root/bin/config_generate
@@ -85,12 +85,16 @@ generate_network() {
set network.$1.proto='none'
EOF
- [ -n "$macaddr" ] && uci -q batch <<-EOF
- delete network.$1_dev
- set network.$1_dev='device'
- set network.$1_dev.name='$ifname'
- set network.$1_dev.macaddr='$macaddr'
- EOF
+ if [ -n "$macaddr" ]; then
+ for name in $ifname; do
+ uci -q batch <<-EOF
+ delete network.$1_${name/./_}_dev
+ set network.$1_${name/./_}_dev='device'
+ set network.$1_${name/./_}_dev.name='$name'
+ set network.$1_${name/./_}_dev.macaddr='$macaddr'
+ EOF
+ done
+ fi
case "$protocol" in
static)
@@ -213,7 +217,8 @@ generate_switch() {
json_select switch
json_select "$key"
- json_get_vars enable reset blinkrate cpu_port
+ json_get_vars enable reset blinkrate cpu_port \
+ ar8xxx_mib_type ar8xxx_mib_poll_interval
uci -q batch <<-EOF
add network switch
@@ -221,6 +226,8 @@ generate_switch() {
set network.@switch[-1].reset='$reset'
set network.@switch[-1].enable_vlan='$enable'
set network.@switch[-1].blinkrate='$blinkrate'
+ set network.@switch[-1].ar8xxx_mib_type='$ar8xxx_mib_type'
+ set network.@switch[-1].ar8xxx_mib_poll_interval='$ar8xxx_mib_poll_interval'
EOF
generate_switch_vlans_ports "$1"
diff --git a/root/bin/kill b/root/bin/kill
index a3aaff7..c3fa810 120000
--- a/root/bin/kill
+++ b/root/bin/kill
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+busybox
\ No newline at end of file
diff --git a/root/bin/opkg b/root/bin/opkg
index a43d8ba..94ca874 100755
Binary files a/root/bin/opkg and b/root/bin/opkg differ
diff --git a/root/bin/ps b/root/bin/ps
index a3aaff7..c3fa810 120000
--- a/root/bin/ps
+++ b/root/bin/ps
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+busybox
\ No newline at end of file
diff --git a/root/bin/ubus b/root/bin/ubus
index 66cb11d..10fad08 100755
Binary files a/root/bin/ubus and b/root/bin/ubus differ
diff --git a/root/bin/uclient-fetch b/root/bin/uclient-fetch
index 105ba12..9b1cc5f 100755
Binary files a/root/bin/uclient-fetch and b/root/bin/uclient-fetch differ
diff --git a/root/etc/banner b/root/etc/banner
index ffb48d5..32d833b 100644
--- a/root/etc/banner
+++ b/root/etc/banner
@@ -4,5 +4,5 @@
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
- OpenWrt SNAPSHOT, r9680-0304e76
+ OpenWrt 19.07.0-rc2, r10775-db8345d8e4
-----------------------------------------------------
diff --git a/root/etc/board.d/02_network b/root/etc/board.d/02_network
index 984d5b3..c8449bb 100755
--- a/root/etc/board.d/02_network
+++ b/root/etc/board.d/02_network
@@ -1,25 +1,27 @@
#!/bin/sh
-#
-# Copyright (C) 2013-2015 OpenWrt.org
-#
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2017 LEDE project
. /lib/functions/uci-defaults.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
board_config_update
-case "$(board_name)" in
-"olimex,a20-olinuxino-micro")
- ucidef_set_interface_lan 'wlan0'
- ;;
-"lamobo,lamobo-r1")
- ucidef_add_switch "switch0" \
- "4:lan:1" "0:lan:2" "1:lan:3" "2:lan:4" "3:wan" "8@eth0"
- ;;
-"xunlong,orangepi-r1")
- ucidef_set_interfaces_lan_wan "eth0" "eth1"
+board=$(board_name)
+
+case "$board" in
+raspberrypi,model-b |\
+raspberrypi,model-b-plus |\
+raspberrypi,model-b-rev2 |\
+raspberrypi,2-model-b |\
+raspberrypi,3-model-b |\
+raspberrypi,3-model-b-plus)
+ ucidef_set_interface_lan "eth0"
;;
-*)
- ucidef_set_interface_lan 'eth0'
+
+raspberrypi,model-zero-w)
+ ucidef_set_interface_lan "wlan0"
;;
esac
diff --git a/root/etc/config/luci b/root/etc/config/luci
index 12b69a8..6cc1617 100644
--- a/root/etc/config/luci
+++ b/root/etc/config/luci
@@ -1,34 +1,41 @@
-config core main
- option lang auto
- option mediaurlbase /luci-static/material
- option resourcebase /luci-static/resources
-
-config extern flash_keep
- option uci "/etc/config/"
- option dropbear "/etc/dropbear/"
- option openvpn "/etc/openvpn/"
- option passwd "/etc/passwd"
- option opkg "/etc/opkg.conf"
- option firewall "/etc/firewall.user"
- option uploads "/lib/uci/upload/"
-
-config internal languages
- option en "English"
- option zh_cn "中文 (Chinese)"
-
-config internal sauth
- option sessionpath "/tmp/luci-sessions"
- option sessiontime 3600
-
-config internal ccache
- option enable 1
-
-config internal themes
- option Bootstrap "/luci-static/bootstrap"
- option Material "/luci-static/material"
-
-config internal apply
- option rollback 30
- option holdoff 4
- option timeout 5
- option display 1.5
+
+config core 'main'
+ option lang 'auto'
+ option resourcebase '/luci-static/resources'
+ option mediaurlbase '/luci-static/material'
+
+config extern 'flash_keep'
+ option uci '/etc/config/'
+ option dropbear '/etc/dropbear/'
+ option openvpn '/etc/openvpn/'
+ option passwd '/etc/passwd'
+ option opkg '/etc/opkg.conf'
+ option firewall '/etc/firewall.user'
+ option uploads '/lib/uci/upload/'
+
+config internal 'languages'
+ option zh_cn '中文 (Chinese)'
+ option en 'English'
+
+config internal 'sauth'
+ option sessionpath '/tmp/luci-sessions'
+ option sessiontime '3600'
+
+config internal 'ccache'
+ option enable '1'
+
+config internal 'themes'
+ option Bootstrap '/luci-static/bootstrap'
+ option Material '/luci-static/material'
+
+config internal 'apply'
+ option rollback '30'
+ option holdoff '4'
+ option timeout '5'
+ option display '1.5'
+
+config internal 'diag'
+ option dns 'openwrt.org'
+ option ping 'openwrt.org'
+ option route 'openwrt.org'
+
diff --git a/root/etc/config/minidlna b/root/etc/config/minidlna
index 213beb1..defb02f 100644
--- a/root/etc/config/minidlna
+++ b/root/etc/config/minidlna
@@ -1,19 +1,20 @@
-config minidlna config
- option 'enabled' '0'
+
+config minidlna 'config'
+ option enabled '0'
option user 'nobody'
option port '8200'
option interface 'eth0,wlan0,p2p0'
- option friendly_name 'OpenWrt DLNA Server'
option db_dir '/var/run/minidlna'
option log_dir '/var/log/minidlna'
option inotify '1'
option enable_tivo '0'
option wide_links '0'
option strict_dlna '0'
- option presentation_url ''
option notify_interval '900'
option serial '12345678'
option model_number '1'
option root_container '.'
list media_dir '/mnt'
option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg'
+ option friendly_name 'ZIDOO_Z9S'
+
diff --git a/root/etc/config/ucitrack b/root/etc/config/ucitrack
index edb62b0..2de272d 100644
--- a/root/etc/config/ucitrack
+++ b/root/etc/config/ucitrack
@@ -1,65 +1,76 @@
+
config network
- option init network
- list affects dhcp
- list affects radvd
+ option init 'network'
+ list affects 'dhcp'
+ list affects 'radvd'
config wireless
- list affects network
+ list affects 'network'
config firewall
- option init firewall
- list affects luci-splash
- list affects qos
- list affects miniupnpd
+ option init 'firewall'
+ list affects 'luci-splash'
+ list affects 'qos'
+ list affects 'miniupnpd'
config olsr
- option init olsrd
+ option init 'olsrd'
config dhcp
- option init dnsmasq
- list affects odhcpd
+ option init 'dnsmasq'
+ list affects 'odhcpd'
config odhcpd
- option init odhcpd
+ option init 'odhcpd'
config dropbear
- option init dropbear
+ option init 'dropbear'
config httpd
- option init httpd
+ option init 'httpd'
config fstab
- option init fstab
+ option init 'fstab'
config qos
- option init qos
+ option init 'qos'
config system
- option init led
+ option init 'led'
option exec '/etc/init.d/log reload'
- list affects luci_statistics
- list affects dhcp
+ list affects 'luci_statistics'
+ list affects 'dhcp'
config luci_splash
- option init luci_splash
+ option init 'luci_splash'
config upnpd
- option init miniupnpd
+ option init 'miniupnpd'
config ntpclient
- option init ntpclient
+ option init 'ntpclient'
config samba
- option init samba
+ option init 'samba'
config tinyproxy
- option init tinyproxy
-
-config minidlna 'minidlna'
- option init 'minidlna'
+ option init 'tinyproxy'
config transmission
option init 'transmission'
config aria2
option init 'aria2'
+
+config afpd 'afpd'
+ option init 'afpd'
+
+config nfsd
+ option init 'nfsd'
+
+config vsftpd 'vsftpd'
+ option init 'vsftpd'
+
+config minidlna 'minidlna'
+ option init 'minidlna'
+
diff --git a/root/etc/config/uhttpd b/root/etc/config/uhttpd
index 0bef6df..c24ea8d 100644
--- a/root/etc/config/uhttpd
+++ b/root/etc/config/uhttpd
@@ -24,7 +24,7 @@ config uhttpd main
# If this number is exceeded, further requests are
# queued until the number of running requests drops
# below the limit again.
- option max_requests 1
+ option max_requests 3
# Maximum number of concurrent connections.
# If this number is exceeded, further TCP connection
@@ -118,9 +118,17 @@ config cert defaults
# Validity time
option days 730
+ # key type: rsa or ec
+ option key_type rsa
+
# RSA key size
option bits 2048
+ # EC curve name
+ # Curve names vary between mbedtls/px5g and openssl
+ # P-256 or P-384 are guaranteed to work
+ option ec_curve P-256
+
# Location
option country ZZ
option state Somewhere
diff --git a/root/etc/device_info b/root/etc/device_info
index ea4e03e..3d21cfc 100644
--- a/root/etc/device_info
+++ b/root/etc/device_info
@@ -1,4 +1,4 @@
DEVICE_MANUFACTURER='OpenWrt'
-DEVICE_MANUFACTURER_URL='http://openwrt.org/'
+DEVICE_MANUFACTURER_URL='https://openwrt.org/'
DEVICE_PRODUCT='Generic'
DEVICE_REVISION='v0'
diff --git a/root/etc/diag.sh b/root/etc/diag.sh
index 8eb36c6..ce0f591 100644
--- a/root/etc/diag.sh
+++ b/root/etc/diag.sh
@@ -1,50 +1,35 @@
#!/bin/sh
-# Copyright (C) 2006-2019 OpenWrt.org
+# Copyright (C) 2015-2016 OpenWrt.org
+# Copyright (C) 2017 LEDE project
+. /lib/functions.sh
. /lib/functions/leds.sh
-boot="$(get_dt_led boot)"
-failsafe="$(get_dt_led failsafe)"
-running="$(get_dt_led running)"
-upgrade="$(get_dt_led upgrade)"
-
-set_led_state() {
- status_led="$boot"
+set_state() {
+ case "$(board_name)" in
+ raspberrypi,2-model-b |\
+ raspberrypi,model-b-plus)
+ status_led="led1"
+ ;;
+ raspberrypi,model-b |\
+ raspberrypi,model-zero |\
+ raspberrypi,model-zero-w)
+ status_led="led0"
+ ;;
+ esac
case "$1" in
preinit)
status_led_blink_preinit
;;
failsafe)
- status_led_off
- [ -n "$running" ] && {
- status_led="$running"
- status_led_off
- }
- status_led="$failsafe"
status_led_blink_failsafe
;;
preinit_regular)
status_led_blink_preinit_regular
;;
- upgrade)
- [ -n "$running" ] && {
- status_led="$running"
- status_led_off
- }
- status_led="$upgrade"
- status_led_blink_preinit_regular
- ;;
done)
- status_led_off
- [ -n "$running" ] && {
- status_led="$running"
- status_led_on
- }
+ status_led_on
;;
esac
}
-
-set_state() {
- [ -n "$boot" -o -n "$failsafe" -o -n "$running" -o -n "$upgrade" ] && set_led_state "$1"
-}
diff --git a/root/etc/group b/root/etc/group
index d2189b0..7af6004 100644
--- a/root/etc/group
+++ b/root/etc/group
@@ -1,8 +1,8 @@
root:x:0:
daemon:x:1:
adm:x:4:
-tty:x:5:
mail:x:8:
+dialout:x:20:
audio:x:29:
www-data:x:33:
ftp:x:55:
diff --git a/root/etc/hotplug.d/ieee80211/10-wifi-detect b/root/etc/hotplug.d/ieee80211/10-wifi-detect
new file mode 100644
index 0000000..6be4481
--- /dev/null
+++ b/root/etc/hotplug.d/ieee80211/10-wifi-detect
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# just skip wifi config in openwrt of rtd1296
+exit 0
+
+[ "${ACTION}" = "add" ] && {
+ /sbin/wifi config
+}
diff --git a/root/etc/hotplug.json b/root/etc/hotplug.json
index 1c949bb..f676bac 100644
--- a/root/etc/hotplug.json
+++ b/root/etc/hotplug.json
@@ -20,6 +20,10 @@
[ "regex", "DEVNAME", "^snd" ],
[ "makedev", "/dev/%DEVNAME%", "0660", "audio" ]
],
+ [ "if",
+ [ "regex", "DEVNAME", "^tty" ],
+ [ "makedev", "/dev/%DEVNAME%", "0660", "dialout" ]
+ ],
[ "if",
[ "has", "DEVNAME" ],
[ "makedev", "/dev/%DEVNAME%", "0600" ]
diff --git a/root/etc/init.d/avahi-daemon b/root/etc/init.d/avahi-daemon
index e60bfb2..b2ae458 100755
--- a/root/etc/init.d/avahi-daemon
+++ b/root/etc/init.d/avahi-daemon
@@ -4,7 +4,7 @@ START=61
BIN=avahi-daemon
DEFAULT=/etc/default/$BIN
-OPTIONS="--no-drop-root -D"
+OPTIONS="-D"
RUN_D=/var/run/$BIN
start() {
diff --git a/root/etc/init.d/boot b/root/etc/init.d/boot
index fedf32a..b20ef5a 100755
--- a/root/etc/init.d/boot
+++ b/root/etc/init.d/boot
@@ -2,7 +2,7 @@
# Copyright (C) 2006-2011 OpenWrt.org
START=10
-STOP=98
+STOP=90
uci_apply_defaults() {
. /lib/functions/system.sh
diff --git a/root/etc/init.d/dnsmasq b/root/etc/init.d/dnsmasq
index 93a8f9a..1054f7a 100755
--- a/root/etc/init.d/dnsmasq
+++ b/root/etc/init.d/dnsmasq
@@ -22,10 +22,45 @@ DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh"
DNSMASQ_DHCP_VER=4
+dnsmasq_ignore_opt() {
+ local opt="$1"
+
+ if [ -z "$dnsmasq_features" ]; then
+ dnsmasq_features="$(dnsmasq --version | grep -m1 'Compile time options:' | cut -d: -f2) "
+ [ "${dnsmasq_features#* DHCP }" = "$dnsmasq_features" ] || dnsmasq_has_dhcp=1
+ [ "${dnsmasq_features#* DHCPv6 }" = "$dnsmasq_features" ] || dnsmasq_has_dhcp6=1
+ [ "${dnsmasq_features#* DNSSEC }" = "$dnsmasq_features" ] || dnsmasq_has_dnssec=1
+ [ "${dnsmasq_features#* TFTP }" = "$dnsmasq_features" ] || dnsmasq_has_tftp=1
+ [ "${dnsmasq_features#* ipset }" = "$dnsmasq_features" ] || dnsmasq_has_ipset=1
+ fi
+
+ case "$opt" in
+ dhcp-duid|\
+ ra-param)
+ [ -z "$dnsmasq_has_dhcp6" ] ;;
+ dhcp-*|\
+ bootp-*|\
+ pxe-*)
+ [ -z "$dnsmasq_has_dhcp" ] ;;
+ dnssec-*|\
+ trust-anchor)
+ [ -z "$dnsmasq_has_dnssec" ] ;;
+ tftp-*)
+ [ -z "$dnsmasq_has_tftp" ] ;;
+ ipset)
+ [ -z "$dnsmasq_has_ipset" ] ;;
+ *)
+ return 1
+ esac
+}
+
xappend() {
- local value="$1"
+ local value="${1#--}"
+ local opt="${value%%=*}"
- echo "${value#--}" >> $CONFIGFILE_TMP
+ if ! dnsmasq_ignore_opt "$opt"; then
+ echo "$value" >>$CONFIGFILE_TMP
+ fi
}
hex_to_hostid() {
diff --git a/root/etc/init.d/dropbear b/root/etc/init.d/dropbear
index 2ea637e..173ab09 100755
--- a/root/etc/init.d/dropbear
+++ b/root/etc/init.d/dropbear
@@ -12,6 +12,91 @@ PIDCOUNT=0
EXTRA_COMMANDS="killclients"
EXTRA_HELP=" killclients Kill ${NAME} processes except servers and yourself"
+_dropbearkey()
+{
+ /usr/bin/dropbearkey "$@" 0<&- 1>&- 2>&-
+}
+
+# $1 - host key file name
+hk_verify()
+{
+ [ -f "$1" ] || return 1
+ [ -s "$1" ] || return 2
+ _dropbearkey -y -f "$1" || return 3
+ return 0
+}
+
+# $1 - hk_verify() return code
+hk_errmsg()
+{
+ case "$1" in
+ 0) ;;
+ 1) echo "file does not exist" ;;
+ 2) echo "file has zero length" ;;
+ 3) echo "file is not valid host key or not supported" ;;
+ *) echo "unknown error" ;;
+ esac
+}
+
+# $1 - config option
+# $2 - host key file name
+hk_config()
+{
+ local x m
+ hk_verify "$2"; x=$?
+ case "$x" in
+ 0) procd_append_param command -r "$2"
+ ;;
+ *) m=$(hk_errmsg "$x")
+ logger -t "${NAME}" -p daemon.warn \
+ "option '$1', value '$2': $m, skipping"
+ ;;
+ esac
+}
+
+# $1 - host key file name
+hk_config__keyfile()
+{
+ hk_config 'keyfile' "$1"
+}
+
+hk_generate_as_needed()
+{
+ local kdir kgen ktype tdir kcount tfile
+ kdir='/etc/dropbear'
+
+ kgen=''
+ for ktype in ecdsa rsa; do
+ hk_verify "${kdir}/dropbear_${ktype}_host_key" && continue
+
+ kgen="${kgen} ${ktype}"
+ done
+
+ [ -z "${kgen}" ] && return
+
+ tdir=$(mktemp -d); chmod 0700 "${tdir}"
+
+ kcount=0
+ for ktype in ${kgen}; do
+ tfile="${tdir}/dropbear_${ktype}_host_key"
+
+ if ! _dropbearkey -t ${ktype} -f "${tfile}"; then
+ # unsupported key type
+ rm -f "${tfile}"
+ continue
+ fi
+
+ kcount=$((kcount+1))
+ done
+
+ if [ ${kcount} -ne 0 ]; then
+ mkdir -p "${kdir}"; chmod 0700 "${kdir}"; chown root "${kdir}"
+ mv -f "${tdir}/"* "${kdir}/"
+ fi
+
+ rm -rf "${tdir}"
+}
+
append_ports()
{
local ipaddrs="$1"
@@ -37,8 +122,9 @@ validate_section_dropbear()
'RootPasswordAuth:bool:1' \
'RootLogin:bool:1' \
'rsakeyfile:file' \
+ 'keyfile:list(file)' \
'BannerFile:file' \
- 'Port:list(port):22' \
+ 'Port:port:22' \
'SSHKeepAlive:uinteger:300' \
'IdleTimeout:uinteger:0' \
'MaxAuthTries:uinteger:3' \
@@ -74,7 +160,13 @@ dropbear_instance()
[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
[ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
[ "${RootLogin}" -eq 0 ] && procd_append_param command -w
- [ -n "${rsakeyfile}" ] && procd_append_param command -r "${rsakeyfile}"
+ if [ -n "${rsakeyfile}" ]; then
+ logger -t ${NAME} -p daemon.warn \
+ "option 'rsakeyfile' is considered to be deprecated and" \
+ "will be removed in future releases, use 'keyfile' instead"
+ hk_config 'rsakeyfile' "${rsakeyfile}"
+ fi
+ config_list_foreach "$1" "keyfile" hk_config__keyfile
[ -n "${BannerFile}" ] && procd_append_param command -b "${BannerFile}"
append_ports "${ipaddrs}" "${Port}"
[ "${IdleTimeout}" -ne 0 ] && procd_append_param command -I "${IdleTimeout}"
@@ -87,29 +179,6 @@ dropbear_instance()
procd_close_instance
}
-keygen()
-{
- for keytype in rsa; do
- # check for keys
- key=dropbear/dropbear_${keytype}_host_key
- [ -f /tmp/$key -o -s /etc/$key ] || {
- # generate missing keys
- mkdir -p /tmp/dropbear
- [ -x /usr/bin/dropbearkey ] && {
- /usr/bin/dropbearkey -t $keytype -f /tmp/$key 2>&- >&- && exec /etc/rc.common "$initscript" start
- } &
- exit 0
- }
- done
-
- lock /tmp/.switch2jffs
- mkdir -p /etc/dropbear
- mv /tmp/dropbear/dropbear_* /etc/dropbear/
- lock -u /tmp/.switch2jffs
- chown root /etc/dropbear
- chmod 0700 /etc/dropbear
-}
-
load_interfaces()
{
config_get interface "$1" Interface
@@ -126,7 +195,7 @@ boot()
start_service()
{
- [ -s /etc/dropbear/dropbear_rsa_host_key ] || keygen
+ hk_generate_as_needed
. /lib/functions.sh
. /lib/functions/network.sh
diff --git a/root/etc/init.d/log b/root/etc/init.d/log
index 250f805..ba9c124 100755
--- a/root/etc/init.d/log
+++ b/root/etc/init.d/log
@@ -96,3 +96,7 @@ start_service()
config_foreach validate_log_section system start_service_file
config_foreach validate_log_section system start_service_remote
}
+
+service_running() {
+ procd_running log
+}
diff --git a/root/etc/init.d/minidlna b/root/etc/init.d/minidlna
index e50f9a8..80f1e4e 100755
--- a/root/etc/init.d/minidlna
+++ b/root/etc/init.d/minidlna
@@ -87,7 +87,7 @@ start() {
[ "$enabled" -gt 0 ] || return 1
minidlna_create_config config || return 1
-
+
config_get db_dir config 'db_dir' '/var/run/minidlna'
config_get log_dir config 'log_dir' '/var/log/minidlna'
config_get user config 'user' 'nobody'
diff --git a/root/etc/init.d/network b/root/etc/init.d/network
index 99d9f65..2321a30 100755
--- a/root/etc/init.d/network
+++ b/root/etc/init.d/network
@@ -115,7 +115,9 @@ validate_switch_section()
'name:string' \
'enable:bool' \
'enable_vlan:bool' \
- 'reset:bool'
+ 'reset:bool' \
+ 'ar8xxx_mib_poll_interval:uinteger' \
+ 'ar8xxx_mib_type:range(0,1)'
}
validate_switch_vlan()
diff --git a/root/etc/init.d/portmap b/root/etc/init.d/portmap
new file mode 100755
index 0000000..9ffea47
--- /dev/null
+++ b/root/etc/init.d/portmap
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+START=19
+STOP=19
+
+USE_PROCD=1
+
+start_service() {
+ procd_open_instance
+ procd_set_param command /usr/sbin/portmap -f -g 3003
+ procd_close_instance
+}
diff --git a/root/etc/init.d/rpcd b/root/etc/init.d/rpcd
index 0a37ee1..77ebcbe 100755
--- a/root/etc/init.d/rpcd
+++ b/root/etc/init.d/rpcd
@@ -15,10 +15,10 @@ start_service() {
procd_close_instance
}
-stop() {
- service_stop /sbin/rpcd
+reload_service() {
+ procd_send_signal rpcd
}
-reload() {
- service_reload /sbin/rpcd
+service_running() {
+ procd_running rpcd
}
diff --git a/root/etc/init.d/samba4 b/root/etc/init.d/samba4
index f0bf04d..5b81db2 100755
--- a/root/etc/init.d/samba4
+++ b/root/etc/init.d/samba4
@@ -7,7 +7,8 @@ smb_header() {
config_get samba_iface $1 interface "loopback lan"
# resolve interfaces
- local interfaces=$(
+ local interfaces
+ interfaces=$(
. /lib/functions/network.sh
local net
@@ -15,23 +16,24 @@ smb_header() {
local device
network_is_up $net || continue
network_get_device device "$net"
- echo -n "${device:-$net} "
+ printf "%s " "${device:-$net}"
done
)
local workgroup description charset
# we dont use netbios anymore as default and wsd/avahi is dns based
- local hostname="$(cat /proc/sys/kernel/hostname)"
+ local hostname
+ hostname="$(cat /proc/sys/kernel/hostname)"
config_get workgroup $1 workgroup "WORKGROUP"
config_get description $1 description "Samba on OpenWrt"
- config_get charset $1 charset "UTF-8"
+ config_get charset $1 charset "UTF-8"
- config_get_bool ENABLEDST $1 enabled 0
- config_get_bool MACOS $1 macos 0
+ config_get_bool MACOS $1 macos 0
config_get_bool DISABLE_NETBIOS $1 disable_netbios 0
config_get_bool DISABLE_AD_DC $1 disable_ad_dc 0
config_get_bool DISABLE_WINBIND $1 disable_winbind 0
+ config_get_bool DISABLE_ASYNC_IO $1 disable_async_io 0
mkdir -p /var/etc
sed -e "s#|NAME|#$hostname#g" \
@@ -41,26 +43,26 @@ smb_header() {
-e "s#|CHARSET|#$charset#g" \
/etc/samba/smb.conf.template > /var/etc/smb.conf
- echo -e "\n######### Dynamic written config options #########\n" >> /var/etc/smb.conf
- if [ "$DISABLE_NETBIOS" -eq 1 ] || [ ! -x /usr/sbin/nmbd ]; then
- echo -e "\tdisable netbios = yes" >> /var/etc/smb.conf
+ {
+ printf "\n######### Dynamic written config options #########\n"
+ if [ "$DISABLE_NETBIOS" -eq 1 ] || [ ! -x /usr/sbin/nmbd ]; then
+ printf "\tdisable netbios = yes\n"
+ fi
+
+ if [ "$DISABLE_ASYNC_IO" -eq 1 ]; then
+ printf "\taio read size = 0\n"
+ printf "\taio write size = 0\n"
+ # sendfile bug: https://bugzilla.samba.org/show_bug.cgi?id=14095
+ printf "\tuse sendfile = no\n"
+ fi
+ } >> /var/etc/smb.conf
+
+ [ -e /etc/samba/smb.conf ] || ln -nsf /var/etc/smb.conf /etc/samba/smb.conf
+
+ if ! [ -L /etc/samba/smb.conf ]; then
+ logger -t 'samba4-server' "Local custom /etc/samba/smb.conf file detected, all luci/config settings are ignored!"
fi
- local homes
- config_get_bool homes $1 homes 0
- [ $homes -gt 0 ] && {
- cat <> /var/etc/smb.conf
-
-[homes]
- comment = Home Directories
- browsable = no
- writable = yes
- read only = no
- create mask = 0750
-EOT
- }
-
- [ -L /etc/samba/smb.conf ] || ln -nsf /var/etc/smb.conf /etc/samba/smb.conf
}
smb_add_share() {
@@ -71,6 +73,7 @@ smb_add_share() {
local dir_mask
local browseable
local read_only
+ local writeable
local guest_ok
local guest_only
local inherit_owner
@@ -78,6 +81,8 @@ smb_add_share() {
local timemachine
local timemachine_maxsize
local force_root
+ local write_list
+ local read_list
config_get name $1 name
config_get path $1 path
@@ -86,6 +91,7 @@ smb_add_share() {
config_get dir_mask $1 dir_mask
config_get browseable $1 browseable
config_get read_only $1 read_only
+ config_get writeable $1 writeable
config_get guest_ok $1 guest_ok
config_get guest_only $1 guest_only
config_get inherit_owner $1 inherit_owner
@@ -93,40 +99,48 @@ smb_add_share() {
config_get_bool timemachine $1 timemachine 0
config_get timemachine_maxsize $1 timemachine_maxsize
config_get_bool force_root $1 force_root 0
+ config_get write_list $1 write_list
+ config_get read_list $1 read_list
- [ -z "$name" -o -z "$path" ] && return
+ [ -z "$name" ] || [ -z "$path" ] && return
- echo -e "\n[$name]\n\tpath = $path" >> /var/etc/smb.conf
-
- if [ "$force_root" -eq 1 ]; then
- echo -e "\tforce user = root" >> /var/etc/smb.conf
- echo -e "\tforce group = root" >> /var/etc/smb.conf
- else
- [ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf
- fi
+ {
+ printf "\n[$name]\n\tpath = %s\n" "$path"
- [ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf
- [ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/smb.conf
-
- [ -n "$browseable" ] && echo -e "\tbrowseable = $browseable" >> /var/etc/smb.conf
- [ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /var/etc/smb.conf
- [ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/smb.conf
- [ -n "$guest_only" ] && echo -e "\tguest only = $guest_only" >> /var/etc/smb.conf
- [ -n "$inherit_owner" ] && echo -e "\tinherit owner = $inherit_owner" >> /var/etc/smb.conf
-
- if [ "$MACOS" -eq 1 ]; then
- vfs_objects="catia fruit streams_xattr $vfs_objects"
- echo -e "\tfruit:encoding = native" >> /var/etc/smb.conf
- echo -e "\tfruit:metadata = stream" >> /var/etc/smb.conf
- echo -e "\tfruit:veto_appledouble = no" >> /var/etc/smb.conf
- # avoid mixed shares order for aapl
- if [ "$timemachine" -eq 1 ]; then
- echo -e "\tfruit:time machine = yes" >> /var/etc/smb.conf
- [ -n "$timemachine_maxsize" ] && echo -e "\tfruit:time machine max size = ${timemachine_maxsize}G" >> /var/etc/smb.conf
+ if [ "$force_root" -eq 1 ]; then
+ printf "\tforce user = root\n"
+ printf "\tforce group = root\n"
+ else
+ [ -n "$users" ] && printf "\tvalid users = %s\n" "$users"
fi
- fi
-
- [ -n "$vfs_objects" ] && echo -e "\tvfs objects = $vfs_objects" >> /var/etc/smb.conf
+
+ [ -n "$create_mask" ] && printf "\tcreate mask = %s\n" "$create_mask"
+ [ -n "$dir_mask" ] && printf "\tdirectory mask = %s\n" "$dir_mask"
+
+ [ -n "$browseable" ] && printf "\tbrowseable = %s\n" "$browseable"
+ [ -n "$read_only" ] && printf "\tread only = %s\n" "$read_only"
+ [ -n "$writeable" ] && printf "\twriteable = %s\n" "$writeable"
+ [ -n "$guest_ok" ] && printf "\tguest ok = %s\n" "$guest_ok"
+ [ -n "$guest_only" ] && printf "\tguest only = %s\n" "$guest_only"
+ [ -n "$inherit_owner" ] && printf "\tinherit owner = %s\n" "$inherit_owner"
+
+ [ -n "$write_list" ] && printf "\twrite list = %s\n" "$write_list"
+ [ -n "$read_list" ] && printf "\tread list = %s\n" "$read_list"
+
+ if [ "$MACOS" -eq 1 ]; then
+ vfs_objects="catia fruit streams_xattr $vfs_objects"
+ printf "\tfruit:encoding = native\n"
+ printf "\tfruit:metadata = stream\n"
+ printf "\tfruit:veto_appledouble = no\n"
+ # avoid mixed shares order for aapl
+ if [ "$timemachine" -eq 1 ]; then
+ printf "\tfruit:time machine = yes\n"
+ [ -n "$timemachine_maxsize" ] && printf "\tfruit:time machine max size = %sG\n" "${timemachine_maxsize}"
+ fi
+ fi
+
+ [ -n "$vfs_objects" ] && printf "\tvfs objects = %s\n" "$vfs_objects"
+ } >> /var/etc/smb.conf
}
init_config() {
@@ -135,10 +149,8 @@ init_config() {
[ -d /var/cache/samba ] || mkdir -p /var/cache/samba
[ -d /var/run/samba ] || mkdir -p /var/run/samba
[ -d /var/log/samba ] || mkdir -p /var/log/samba
- [ -d /var/lock ] && chmod 0755 /var/lock || {
- mkdir -p /var/lock
- chmod 0755 /var/lock
- }
+ [ -d /var/lock ] || mkdir -p /var/lock
+ chmod 0755 /var/lock
config_load samba4
config_foreach smb_header samba
@@ -147,9 +159,9 @@ init_config() {
service_triggers() {
PROCD_RELOAD_DELAY=2000
-
+
procd_add_reload_trigger "dhcp" "system" "samba4"
-
+
local i
for i in $samba_iface; do
procd_add_reload_interface_trigger $i
@@ -159,7 +171,6 @@ service_triggers() {
start_service() {
init_config
- [ "$ENABLEDST" == "1" ] || return 1
# start main AD-DC daemon, will spawn (smbd,nmbd,winbindd) as needed/configured.
if [ "$DISABLE_AD_DC" -ne 1 ] && [ -x /usr/sbin/samba ]; then
procd_open_instance
diff --git a/root/etc/init.d/transmission b/root/etc/init.d/transmission
index 6196713..f68388b 100755
--- a/root/etc/init.d/transmission
+++ b/root/etc/init.d/transmission
@@ -14,8 +14,8 @@ append_params() {
IFS="$LIST_SEP"
for v in $v; do
[ -n "$v" ] && (
- echo "\"$p\": $v," | sed -e 's|_|-|g' >> $config_file
- )
+ echo "\"$p\": $v," | sed -e 's|_|-|g'
+ ) >> "$config_file"
done
unset IFS
done
@@ -28,9 +28,9 @@ append_params_quotes() {
IFS="$LIST_SEP"
for v in $v; do
[ -n "$v" ] && (
- echo -n "\"$p" | sed -e 's|/|\\/|g;s|_|-|g' >> $config_file; \
- echo "\": \"$v\"," >> $config_file
- )
+ printf "\"%s" "$p" | sed -e 's|/|\\/|g;s|_|-|g'; \
+ echo "\": \"$v\","
+ ) >> "$config_file"
done
unset IFS
done
@@ -51,7 +51,6 @@ transmission() {
local download_dir config_dir
local mem_percentage
local nice
- local cmdline
local web_home
section_enabled "$section" || return 1
@@ -65,29 +64,24 @@ transmission() {
config_get nice "$cfg" nice 0
config_get web_home "$cfg" 'web_home'
- local MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
+ local MEM
+
+ MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
if test "$MEM" -gt 1;then
- USE=$(expr $MEM \* $mem_percentage \* 10)
+ USE=$((MEM * mem_percentage * 10))
fi
config_file="$config_dir/settings.json"
- [ -d $config_dir ] || {
- mkdir -p $config_dir
- touch $config_file
- }
-
- [ -d $download_dir ] || {
- mkdir -p $download_dir
+ [ -d "$config_dir" ] || {
+ mkdir -p "$config_dir"
+ chmod 0755 "$config_dir"
+ touch "$config_file"
}
+ [ -z "$user" ] || chown -R "$user:$group" "$config_dir"
- chmod 0755 $config_dir
- [ -z "$user" ] || {
- chown -R "$user:$group" $config_dir
- }
-
- [ "$config_overwrite" == 0 ] || {
+ [ "$config_overwrite" = 0 ] || {
- echo "{" > $config_file
+ echo "{" > "$config_file"
append_params "$cfg" \
alt_speed_down alt_speed_enabled alt_speed_time_begin alt_speed_time_day \
@@ -112,20 +106,24 @@ transmission() {
peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \
rpc_username rpc_host_whitelist rpc_whitelist script_torrent_done_filename watch_dir
- echo "\"invalid-key\": false" >> $config_file
- echo "}" >> $config_file
-
+ {
+ echo "\"invalid-key\": false"
+ echo "}"
+ } >> "$config_file"
}
- cmdline="transmission-daemon -g $config_dir -f"
procd_open_instance
- procd_set_param command $cmdline
- procd_set_param user $user
- procd_set_param group $group
- procd_set_param nice $nice
+ procd_set_param command "/usr/bin/transmission-daemon"
+ procd_append_param command -f
+ procd_append_param command --log-error
+ procd_append_param command -g $config_dir
+ procd_set_param user "$user"
+ procd_set_param group "$group"
+ procd_set_param nice "$nice"
+ procd_set_param stderr 1
procd_set_param respawn retry=60
- if test -z $USE; then
+ if [ -z "$USE" ]; then
procd_set_param limits core="0 0"
else
procd_set_param limits core="0 0" as="$USE $USE"
@@ -137,8 +135,8 @@ transmission() {
fi
procd_add_jail transmission log
- procd_add_jail_mount $config_file
- procd_add_jail_mount_rw $download_dir
+ procd_add_jail_mount "$config_file"
+ procd_add_jail_mount_rw "$download_dir"
procd_close_instance
}
diff --git a/root/etc/init.d/uhttpd b/root/etc/init.d/uhttpd
index dc496b3..6322473 100755
--- a/root/etc/init.d/uhttpd
+++ b/root/etc/init.d/uhttpd
@@ -43,15 +43,19 @@ generate_keys() {
config_get state "$cfg" state
config_get location "$cfg" location
config_get commonname "$cfg" commonname
+ config_get key_type "$cfg" key_type
+ config_get ec_curve "$cfg" ec_curve
# Prefer px5g for certificate generation (existence evaluated last)
local GENKEY_CMD=""
+ local KEY_OPTS="rsa:${bits:-2048}"
local UNIQUEID=$(dd if=/dev/urandom bs=1 count=4 | hexdump -e '1/1 "%02x"')
+ [ "$key_type" = "ec" ] && KEY_OPTS="ec -pkeyopt ec_paramgen_curve:${ec_curve:-P-256}"
[ -x "$OPENSSL_BIN" ] && GENKEY_CMD="$OPENSSL_BIN req -x509 -sha256 -outform der -nodes"
[ -x "$PX5G_BIN" ] && GENKEY_CMD="$PX5G_BIN selfsigned -der"
[ -n "$GENKEY_CMD" ] && {
$GENKEY_CMD \
- -days ${days:-730} -newkey rsa:${bits:-2048} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \
+ -days ${days:-730} -newkey ${KEY_OPTS} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \
-subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}"
sync
mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}"
diff --git a/root/etc/init.d/umount b/root/etc/init.d/umount
index 9123864..ba6d35c 100755
--- a/root/etc/init.d/umount
+++ b/root/etc/init.d/umount
@@ -1,7 +1,12 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
-STOP=99
+STOP=90
+
+restart() {
+ :
+}
+
stop() {
sync
find /mnt/ -maxdepth 1 -mindepth 1 -type d | xargs -n1 umount -r
diff --git a/root/etc/init.d/urngd b/root/etc/init.d/urngd
new file mode 100755
index 0000000..7531ca8
--- /dev/null
+++ b/root/etc/init.d/urngd
@@ -0,0 +1,17 @@
+#!/bin/sh /etc/rc.common
+
+START=00
+
+USE_PROCD=1
+NAME=urngd
+PROG=/sbin/urngd
+
+start_service() {
+ procd_open_instance
+ procd_set_param command "$PROG"
+ procd_close_instance
+}
+
+reload_service() {
+ procd_send_signal $PROG
+}
diff --git a/root/etc/inittab b/root/etc/inittab
index be81ab3..b944a93 100644
--- a/root/etc/inittab
+++ b/root/etc/inittab
@@ -1,5 +1,4 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/usr/libexec/login.sh
-ttyS0::askfirst:/usr/libexec/login.sh
+::askconsole:/usr/libexec/login.sh
tty1::askfirst:/usr/libexec/login.sh
diff --git a/root/etc/openwrt_release b/root/etc/openwrt_release
index e1a99c6..0196656 100644
--- a/root/etc/openwrt_release
+++ b/root/etc/openwrt_release
@@ -1,7 +1,7 @@
DISTRIB_ID='OpenWrt'
-DISTRIB_RELEASE='SNAPSHOT'
-DISTRIB_REVISION='r9680-0304e76'
-DISTRIB_TARGET='sunxi/cortexa53'
+DISTRIB_RELEASE='19.07.0-rc2'
+DISTRIB_REVISION='r10775-db8345d8e4'
+DISTRIB_TARGET='brcm2708/bcm2710'
DISTRIB_ARCH='aarch64_cortex-a53'
-DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r9680-0304e76'
+DISTRIB_DESCRIPTION='OpenWrt 19.07.0-rc2 r10775-db8345d8e4'
DISTRIB_TAINTS=''
diff --git a/root/etc/openwrt_version b/root/etc/openwrt_version
index cae1e34..c536fad 100644
--- a/root/etc/openwrt_version
+++ b/root/etc/openwrt_version
@@ -1 +1 @@
-r9680-0304e76
+r10775-db8345d8e4
diff --git a/root/etc/opkg/distfeeds.conf b/root/etc/opkg/distfeeds.conf
index 542443b..7f1f23c 100644
--- a/root/etc/opkg/distfeeds.conf
+++ b/root/etc/opkg/distfeeds.conf
@@ -1,5 +1,5 @@
-src/gz openwrt_core https://mirror.0x.sg/openwrt/snapshots/targets/sunxi/cortexa53/packages
-src/gz openwrt_base https://mirror.0x.sg/openwrt/snapshots/packages/aarch64_cortex-a53/base
-src/gz openwrt_luci https://mirror.0x.sg/openwrt/snapshots/packages/aarch64_cortex-a53/luci
-src/gz openwrt_packages https://mirror.0x.sg/openwrt/snapshots/packages/aarch64_cortex-a53/packages
-src/gz openwrt_routing https://mirror.0x.sg/openwrt/snapshots/packages/aarch64_cortex-a53/routing
+src/gz openwrt_core http://downloads.openwrt.org/releases/19.07.0-rc2/targets/brcm2708/bcm2710/packages
+src/gz openwrt_base http://downloads.openwrt.org/releases/19.07.0-rc2/packages/aarch64_cortex-a53/base
+src/gz openwrt_luci http://downloads.openwrt.org/releases/19.07.0-rc2/packages/aarch64_cortex-a53/luci
+src/gz openwrt_packages http://downloads.openwrt.org/releases/19.07.0-rc2/packages/aarch64_cortex-a53/packages
+src/gz openwrt_routing http://downloads.openwrt.org/releases/19.07.0-rc2/packages/aarch64_cortex-a53/routing
\ No newline at end of file
diff --git a/root/etc/opkg/keys/b26f36ae0f4106d b/root/etc/opkg/keys/0b26f36ae0f4106d
similarity index 52%
rename from root/etc/opkg/keys/b26f36ae0f4106d
rename to root/etc/opkg/keys/0b26f36ae0f4106d
index 8d408eb..a436c1f 100644
--- a/root/etc/opkg/keys/b26f36ae0f4106d
+++ b/root/etc/opkg/keys/0b26f36ae0f4106d
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key of Stijn Tintel
+untrusted comment: Public usign key of Stijn Tintel
RWQLJvNq4PQQbSGZ05Az9jXSt/xlw/IfWc6USiB2FHEUoWL7QpMibzv6
diff --git a/root/etc/opkg/keys/1035ac73cc4e59e3 b/root/etc/opkg/keys/1035ac73cc4e59e3
index e8ce435..6ae478a 100644
--- a/root/etc/opkg/keys/1035ac73cc4e59e3
+++ b/root/etc/opkg/keys/1035ac73cc4e59e3
@@ -1,2 +1,2 @@
-untrusted comment: OpenWrt 18.06 public key
+untrusted comment: Public usign key for 18.06 release builds
RWQQNaxzzE5Z41cVmEh2rilAPKLsyfPKm+S4BJWA1Yv+LP1hKebmGtXi
diff --git a/root/etc/opkg/keys/5151f69420c3f508 b/root/etc/opkg/keys/5151f69420c3f508
index d4cd777..37de5ff 100644
--- a/root/etc/opkg/keys/5151f69420c3f508
+++ b/root/etc/opkg/keys/5151f69420c3f508
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key of Hans Dedecker
+untrusted comment: Public usign key of Hans Dedecker
RWRRUfaUIMP1CAL9wvk3ABBHdUM+3SjMvIuJlK68b3b04Pw3wiaiAfxX
diff --git a/root/etc/opkg/keys/72a57f2191b211e0 b/root/etc/opkg/keys/72a57f2191b211e0
index 1719816..367ece0 100644
--- a/root/etc/opkg/keys/72a57f2191b211e0
+++ b/root/etc/opkg/keys/72a57f2191b211e0
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key of Jo-Philipp Wich
+untrusted comment: Public usign key of Jo-Philipp Wich
RWRypX8hkbIR4FLhtx5pjXcAIsI1iPUIcI5bMG8jZoiCkrwTstECBPqL
diff --git a/root/etc/opkg/keys/792d9d9b39f180dc b/root/etc/opkg/keys/792d9d9b39f180dc
index 9044a0e..089fbaf 100644
--- a/root/etc/opkg/keys/792d9d9b39f180dc
+++ b/root/etc/opkg/keys/792d9d9b39f180dc
@@ -1,2 +1,2 @@
-untrusted comment: LEDE 17.01 "Reboot" public key
+untrusted comment: Public usign key for 17.01 "Reboot" release builds
RWR5LZ2bOfGA3FGliZosEDhodiAKDOISmQs/mmjo4rhcbFtqkibJqMzo
diff --git a/root/etc/opkg/keys/9ef4694208102c43 b/root/etc/opkg/keys/9ef4694208102c43
index c4df7b6..3757905 100644
--- a/root/etc/opkg/keys/9ef4694208102c43
+++ b/root/etc/opkg/keys/9ef4694208102c43
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key of Álvaro Fernández Rojas
+untrusted comment: Public usign key of Álvaro Fernández Rojas
RWSe9GlCCBAsQwI5+wztnWKHfBlvPFP2G00FvZyx+Wfv9AwSViUwo/s2
diff --git a/root/etc/opkg/keys/b2d571e0880ff617 b/root/etc/opkg/keys/b2d571e0880ff617
new file mode 100644
index 0000000..5bcd5f4
--- /dev/null
+++ b/root/etc/opkg/keys/b2d571e0880ff617
@@ -0,0 +1,2 @@
+untrusted comment: Public usign key of Hauke Mehrtens
+RWSy1XHgiA/2F8nrQOTCa0aRCJzueqmDRzhxuwBJuC++Btb37yr7FKG0
diff --git a/root/etc/opkg/keys/b5043e70f9a75cde b/root/etc/opkg/keys/b5043e70f9a75cde
index bcbd9db..82d7677 100644
--- a/root/etc/opkg/keys/b5043e70f9a75cde
+++ b/root/etc/opkg/keys/b5043e70f9a75cde
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key for unattended build jobs
+untrusted comment: Public usign key for unattended snapshot builds
RWS1BD5w+adc3j2Hqg9+b66CvLR7NlHbsj7wjNVj0XGt/othDgIAOJS+
diff --git a/root/etc/opkg/keys/c10b9afab19ee428 b/root/etc/opkg/keys/c10b9afab19ee428
index ee925b4..006b6c7 100644
--- a/root/etc/opkg/keys/c10b9afab19ee428
+++ b/root/etc/opkg/keys/c10b9afab19ee428
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key of Alexander Couzens
+untrusted comment: Public usign key of Alexander Couzens
RWTBC5r6sZ7kKA/C5VnxUbJw5E0vy3MGo3MP2eXCQlgg65+2si4MKBnf
diff --git a/root/etc/opkg/keys/dace9d4df16896bf b/root/etc/opkg/keys/dace9d4df16896bf
index 543d569..f1fc0ea 100644
--- a/root/etc/opkg/keys/dace9d4df16896bf
+++ b/root/etc/opkg/keys/dace9d4df16896bf
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key of Ted Hess
+untrusted comment: Public usign key of Ted Hess
RWTazp1N8WiWvy7rYxstJqaMzGiS4XfW1oyYrk2vwJMRBeBF+8xEA+EZ
diff --git a/root/etc/opkg/keys/dd6de0d06bbd3d85 b/root/etc/opkg/keys/dd6de0d06bbd3d85
index 3c21dcd..a57a150 100644
--- a/root/etc/opkg/keys/dd6de0d06bbd3d85
+++ b/root/etc/opkg/keys/dd6de0d06bbd3d85
@@ -1,2 +1,2 @@
-untrusted comment: LEDE usign key of John Crispin
+untrusted comment: Public usign key of John Crispin
RWTdbeDQa709heyMmwDZjWmlhcTCUv/q+3TBYDPdJAGRuys6xcxE09fp
diff --git a/root/etc/opkg/keys/f94b9dd6febac963 b/root/etc/opkg/keys/f94b9dd6febac963
new file mode 100644
index 0000000..1c130f7
--- /dev/null
+++ b/root/etc/opkg/keys/f94b9dd6febac963
@@ -0,0 +1,2 @@
+OpenWrt 19.07 release signature
+RWT5S53W/rrJY9BiIod3JF04AZ/eU1xDpVOb+rjZzAQBEcoETGx8BXEK
\ No newline at end of file
diff --git a/root/etc/rc.button/reboot b/root/etc/rc.button/reboot
new file mode 100755
index 0000000..cd547e3
--- /dev/null
+++ b/root/etc/rc.button/reboot
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+if [ "$SEEN" -ge 5 ]
+then
+ echo "REBOOT" > /dev/console
+ sync
+ reboot
+fi
+
+return 0
diff --git a/root/etc/rc.button/wps b/root/etc/rc.button/wps
new file mode 100755
index 0000000..d00939d
--- /dev/null
+++ b/root/etc/rc.button/wps
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+wps_catch_credentials() {
+ local iface ifaces ifc ifname ssid encryption key radio radios
+ local found=0
+
+ . /usr/share/libubox/jshn.sh
+ ubus -S -t 30 listen wps_credentials | while read creds; do
+ json_init
+ json_load "$creds"
+ json_select wps_credentials || continue
+ json_get_vars ifname ssid key encryption
+ local ifcname="$ifname"
+ json_init
+ json_load "$(ubus -S call network.wireless status)"
+ json_get_keys radios
+ for radio in $radios; do
+ json_select $radio
+ json_select interfaces
+ json_get_keys ifaces
+ for ifc in $ifaces; do
+ json_select $ifc
+ json_get_vars ifname
+ [ "$ifname" = "$ifcname" ] && {
+ ubus -S call uci set "{\"config\":\"wireless\", \"type\":\"wifi-iface\", \
+ \"match\": { \"device\": \"$radio\", \"encryption\": \"wps\" }, \
+ \"values\": { \"encryption\": \"$encryption\", \
+ \"ssid\": \"$ssid\", \
+ \"key\": \"$key\" } }"
+ ubus -S call uci commit '{"config": "wireless"}'
+ ubus -S call uci apply
+ }
+ json_select ..
+ done
+ json_select ..
+ json_select ..
+ done
+ done
+}
+
+if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
+ wps_done=0
+ ubusobjs="$( ubus -S list hostapd.* )"
+ for ubusobj in $ubusobjs; do
+ ubus -S call $ubusobj wps_start && wps_done=1
+ done
+ [ $wps_done = 0 ] || return 0
+ wps_done=0
+ ubusobjs="$( ubus -S list wpa_supplicant.* )"
+ for ubusobj in $ubusobjs; do
+ ifname="$(echo $ubusobj | cut -d'.' -f2 )"
+ multi_ap=""
+ if [ -e "/var/run/wpa_supplicant-${ifname}.conf.is_multiap" ]; then
+ ubus -S call $ubusobj wps_start '{ "multi_ap": true }' && wps_done=1
+ else
+ ubus -S call $ubusobj wps_start && wps_done=1
+ fi
+ done
+ [ $wps_done = 0 ] || wps_catch_credentials &
+fi
+
+return 0
diff --git a/root/etc/rc.common b/root/etc/rc.common
index d9773a0..75dbeed 100755
--- a/root/etc/rc.common
+++ b/root/etc/rc.common
@@ -131,6 +131,9 @@ ${INIT_TRACE:+set -x}
procd_lock
stop_service "$@"
procd_kill "$(basename ${basescript:-$initscript})" "$1"
+ if eval "type service_stopped" 2>/dev/null >/dev/null; then
+ service_stopped
+ fi
}
reload() {
diff --git a/root/etc/rc.d/K19portmap b/root/etc/rc.d/K19portmap
new file mode 120000
index 0000000..90a406c
--- /dev/null
+++ b/root/etc/rc.d/K19portmap
@@ -0,0 +1 @@
+../init.d/portmap
\ No newline at end of file
diff --git a/root/etc/rc.d/K98boot b/root/etc/rc.d/K90boot
similarity index 100%
rename from root/etc/rc.d/K98boot
rename to root/etc/rc.d/K90boot
diff --git a/root/etc/rc.d/K99umount b/root/etc/rc.d/K90umount
similarity index 100%
rename from root/etc/rc.d/K99umount
rename to root/etc/rc.d/K90umount
diff --git a/root/etc/rc.d/S00urngd b/root/etc/rc.d/S00urngd
new file mode 120000
index 0000000..061fcaa
--- /dev/null
+++ b/root/etc/rc.d/S00urngd
@@ -0,0 +1 @@
+../init.d/urngd
\ No newline at end of file
diff --git a/root/etc/rc.d/S19portmap b/root/etc/rc.d/S19portmap
new file mode 120000
index 0000000..90a406c
--- /dev/null
+++ b/root/etc/rc.d/S19portmap
@@ -0,0 +1 @@
+../init.d/portmap
\ No newline at end of file
diff --git a/root/etc/rc.d/S60samba b/root/etc/rc.d/S60samba
new file mode 120000
index 0000000..1a8aa11
--- /dev/null
+++ b/root/etc/rc.d/S60samba
@@ -0,0 +1 @@
+../init.d/samba
\ No newline at end of file
diff --git a/root/etc/rc.d/S99minidlna b/root/etc/rc.d/S99minidlna
deleted file mode 120000
index 969da53..0000000
--- a/root/etc/rc.d/S99minidlna
+++ /dev/null
@@ -1 +0,0 @@
-../init.d/minidlna
\ No newline at end of file
diff --git a/root/etc/samba/smb.conf.template b/root/etc/samba/smb.conf.template
index 9c18184..1625598 100644
--- a/root/etc/samba/smb.conf.template
+++ b/root/etc/samba/smb.conf.template
@@ -7,73 +7,87 @@
## This global parameter allows the Samba admin to limit what interfaces on a machine will serve SMB requests.
bind interfaces only = yes
-
+
## time for inactive connections to-be closed in minutes
deadtime = 15
-
+
## disable core dumps
enable core files = no
-
+
## set security (auto, user, domain, ads)
security = user
-
+
## This parameter controls whether a remote client is allowed or required to use SMB encryption.
## It has different effects depending on whether the connection uses SMB1 or SMB2 and newer:
## If the connection uses SMB1, then this option controls the use of a Samba-specific extension to the SMB protocol introduced in Samba 3.2 that makes use of the Unix extensions.
## If the connection uses SMB2 or newer, then this option controls the use of the SMB-level encryption that is supported in SMB version 3.0 and above and available in Windows 8 and newer.
- ##(default/auto,desired,required,off)
+ ## (default/auto,desired,required,off)
#smb encrypt = default
-
+
## set invalid users
invalid users = root
-
+
## map unknow users to guest
map to guest = Bad User
## allow client access to accounts that have null passwords.
null passwords = yes
-
+
## The old plaintext passdb backend. Some Samba features will not work if this passdb backend is used. (NOTE: enabled for size reasons)
## (tdbsam,smbpasswd,ldapsam)
passdb backend = smbpasswd
-
+
## Set location of smbpasswd ('smbd -b' will show default compiled location)
#smb passwd file = /etc/samba/smbpasswd
-
+
## LAN/WAN options (IPTOS_LOWDELAY TCP_NODELAY) WAN (IPTOS_THROUGHPUT)
socket options = IPTOS_LOWDELAY TCP_NODELAY
-
- ## lower CPU useage if supported
- use sendfile = yes
-
+
+ ## If this integer parameter is set to a non-zero value, Samba will read from files asynchronously when the request size is bigger than this value.
+ ## Note that it happens only for non-chained and non-chaining reads and when not using write cache.
+ ## The only reasonable values for this parameter are 0 (no async I/O) and 1 (always do async I/O).
+ ## (1/0)
+ #aio read size = 0
+ #aio write size = 0
+
+ ## If Samba has been built with asynchronous I/O support, Samba will not wait until write requests are finished before returning the result to the client for files listed in this parameter.
+ ## Instead, Samba will immediately return that the write request has been finished successfully, no matter if the operation will succeed or not.
+ ## This might speed up clients without aio support, but is really dangerous, because data could be lost and files could be damaged.
+ #aio write behind = /*.tmp/
+
+ ## lower CPU useage if supported and aio is disabled (aio read size = 0 ; aio write size = 0)
+ ## currently broken (NOTE: see https://bugzilla.samba.org/show_bug.cgi?id=14095 )
+ ## (no, yes)
+ #use sendfile = yes
+
## samba will behave as previous versions of Samba would and will fail the lock request immediately if the lock range cannot be obtained.
#blocking locks = No
-
+
## disable loading of all printcap printers by default (iprint, cups, lpstat)
load printers = No
printcap name = /dev/null
## Enabling this parameter will disable Samba's support for the SPOOLSS set of MS-RPC's.
disable spoolss = yes
-
+
## This parameters controls how printer status information is interpreted on your system.
## (BSD, AIX, LPRNG, PLP, SYSV, HPUX, QNX, SOFTQ)
printing = bsd
-
+
## Disable that nmbd is acting as a WINS server for unknow netbios names
#dns proxy = No
-
+
## win/unix user mapping backend
#idmap config * : backend = tdb
-
+
## Allows the server name that is advertised through MDNS to be set to the hostname rather than the Samba NETBIOS name.
## This allows an administrator to make Samba registered MDNS records match the case of the hostname rather than being in all capitals.
## (netbios, mdns)
mdns name = mdns
-
+
## Clients that only support netbios won't be able to see your samba server when netbios support is disabled.
#disable netbios = Yes
-
+
## Setting this value to no will cause nmbd never to become a local master browser.
#local master = no
@@ -83,21 +97,21 @@
## (445 139) Specifies which ports the server should listen on for SMB traffic.
## 139 is netbios/nmbd
#smb ports = 445 139
-
+
## This is a list of files and directories that are neither visible nor accessible.
## Each entry in the list must be separated by a '/', which allows spaces to be included in the entry. '*' and '?' can be used to specify multiple files or directories as in DOS wildcards.
veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/
-
+
## If a directory that is to be deleted contains nothing but veto files this deletion will fail unless you also set the delete veto files parameter to yes.
delete veto files = yes
-
+
################ Filesystem and creation rules ################
## reported filesystem type (NTFS,Samba,FAT)
#fstype = FAT
-
+
## Allows a user who has write access to the file (by whatever means, including an ACL permission) to modify the permissions (including ACL) on it.
#dos filemode = Yes
-
+
## file/dir creating rules
#create mask = 0666
#directory mask = 0777
diff --git a/root/etc/sysctl.d/20-transmission.conf b/root/etc/sysctl.d/20-transmission.conf
index bdf0de2..7d81b73 100644
--- a/root/etc/sysctl.d/20-transmission.conf
+++ b/root/etc/sysctl.d/20-transmission.conf
@@ -1,2 +1,6 @@
+# Transmission requests large buffers by default
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
+
+# Some firewalls block SYN packets that are too small
+net.ipv4.tcp_adv_win_scale = 4
diff --git a/root/etc/uci-defaults/30_luci-theme-bootstrap b/root/etc/uci-defaults/30_luci-theme-bootstrap
new file mode 100755
index 0000000..b516184
--- /dev/null
+++ b/root/etc/uci-defaults/30_luci-theme-bootstrap
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$PKG_UPGRADE" != 1 ]; then
+ uci batch <<-EOF
+ set luci.themes.Bootstrap=/luci-static/bootstrap
+ set luci.main.mediaurlbase=/luci-static/bootstrap
+ commit luci
+ EOF
+fi
+
+exit 0
diff --git a/root/etc/uci-defaults/50_luci-mod-admin-full b/root/etc/uci-defaults/50_luci-mod-admin-full
index 372eb15..140c832 100755
--- a/root/etc/uci-defaults/50_luci-mod-admin-full
+++ b/root/etc/uci-defaults/50_luci-mod-admin-full
@@ -5,7 +5,7 @@ if [ "$(uci -q get luci.diag)" != "internal" ]; then
if [ -s /etc/os-release ]; then
. /etc/os-release
- host="${HOME_URL:-${BUG_URL:-$LEDE_DEVICE_MANUFACTURER_URL}}"
+ host="${HOME_URL:-${BUG_URL:-$OPENWRT_DEVICE_MANUFACTURER_URL}}"
host="${host#*://}"
host="${host%%/*}"
fi
diff --git a/root/etc/uci-defaults/samba4 b/root/etc/uci-defaults/samba4
index b239c3f..3771e09 100755
--- a/root/etc/uci-defaults/samba4
+++ b/root/etc/uci-defaults/samba4
@@ -8,8 +8,4 @@
ln -s samba4 /etc/config/samba
}
-[ -f /etc/init.d/samba ] && {
- /etc/init.d/samba enabled && /etc/init.d/samba disable
-}
-
exit 0
\ No newline at end of file
diff --git a/root/lib/config/uci.sh b/root/lib/config/uci.sh
index 78ec277..1e85ced 100644
--- a/root/lib/config/uci.sh
+++ b/root/lib/config/uci.sh
@@ -85,6 +85,15 @@ uci_set() {
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set "$PACKAGE.$CONFIG.$OPTION=$VALUE"
}
+uci_add_list() {
+ local PACKAGE="$1"
+ local CONFIG="$2"
+ local OPTION="$3"
+ local VALUE="$4"
+
+ /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list "$PACKAGE.$CONFIG.$OPTION=$VALUE"
+}
+
uci_get_state() {
uci_get "$1" "$2" "$3" "$4" "/var/state"
}
@@ -108,7 +117,7 @@ uci_add() {
local CONFIG="$3"
if [ -z "$CONFIG" ]; then
- export ${NO_EXPORT:+-n} CONFIG_SECTION="$(/sbin/uci add "$PACKAGE" "$TYPE")"
+ export ${NO_EXPORT:+-n} CONFIG_SECTION="$(/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add "$PACKAGE" "$TYPE")"
else
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set "$PACKAGE.$CONFIG=$TYPE"
export ${NO_EXPORT:+-n} CONFIG_SECTION="$CONFIG"
@@ -132,6 +141,15 @@ uci_remove() {
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} del "$PACKAGE.$CONFIG${OPTION:+.$OPTION}"
}
+uci_remove_list() {
+ local PACKAGE="$1"
+ local CONFIG="$2"
+ local OPTION="$3"
+ local VALUE="$4"
+
+ /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} del_list "$PACKAGE.$CONFIG.$OPTION=$VALUE"
+}
+
uci_commit() {
local PACKAGE="$1"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit $PACKAGE
diff --git a/root/lib/firmware/brcm/brcmfmac43143.bin b/root/lib/firmware/brcm/brcmfmac43143.bin
new file mode 100644
index 0000000..28b8db9
Binary files /dev/null and b/root/lib/firmware/brcm/brcmfmac43143.bin differ
diff --git a/root/lib/firmware/brcm/brcmfmac43236b.bin b/root/lib/firmware/brcm/brcmfmac43236b.bin
new file mode 100644
index 0000000..8a2004a
Binary files /dev/null and b/root/lib/firmware/brcm/brcmfmac43236b.bin differ
diff --git a/root/lib/firmware/brcm/brcmfmac4329-sdio.txt b/root/lib/firmware/brcm/brcmfmac4329-sdio.txt
deleted file mode 100644
index 6cb3fd7..0000000
--- a/root/lib/firmware/brcm/brcmfmac4329-sdio.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-#AP6210_NVRAM_V1.2_03192013
-manfid=0x2d0
-prodid=0x492
-vendid=0x14e4
-devid=0x4343
-boardtype=0x0598
-
-# Board Revision is P307, same nvram file can be used for P304, P305, P306 and P307 as the tssi pa params used are same
-#Please force the automatic RX PER data to the respective board directory if not using P307 board, for e.g. for P305 boards force the data into the following directory /projects/BCM43362/a1_labdata/boardtests/results/sdg_rev0305
-boardrev=0x1307
-boardnum=777
-xtalfreq=26000
-boardflags=0x80201
-boardflags2=0x80
-sromrev=3
-wl0id=0x431b
-macaddr=00:90:4c:07:71:12
-aa2g=1
-ag0=2
-maxp2ga0=74
-cck2gpo=0x2222
-ofdm2gpo=0x44444444
-mcs2gpo0=0x6666
-mcs2gpo1=0x6666
-pa0maxpwr=56
-
-#P207 PA params
-#pa0b0=5447
-#pa0b1=-658
-#pa0b2=-175
-
-#Same PA params for P304,P305, P306, P307
-
-pa0b0=5447
-pa0b1=-607
-pa0b2=-160
-pa0itssit=62
-pa1itssit=62
-
-
-cckPwrOffset=5
-ccode=0
-rssismf2g=0xa
-rssismc2g=0x3
-rssisav2g=0x7
-triso2g=0
-noise_cal_enable_2g=0
-noise_cal_po_2g=0
-swctrlmap_2g=0x04040404,0x02020202,0x02020202,0x010101,0x1ff
-temp_add=29767
-temp_mult=425
-
-btc_flags=0x6
-btc_params0=5000
-btc_params1=1000
-btc_params6=63
-
diff --git a/root/lib/firmware/brcm/brcmfmac43362-sdio.txt b/root/lib/firmware/brcm/brcmfmac43362-sdio.txt
deleted file mode 100644
index 901e782..0000000
--- a/root/lib/firmware/brcm/brcmfmac43362-sdio.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-#AP6181_NVRAM_V1.1_01152013
-#adjuest PA parameter for g/n mode
-manfid=0x2d0
-prodid=0x492
-vendid=0x14e4
-devid=0x4343
-boardtype=0x0598
-
-# Board Revision is P307, same nvram file can be used for P304, P305, P306 and P307 as the tssi pa params used are same
-#Please force the automatic RX PER data to the respective board directory if not using P307 board, for e.g. for P305 boards force the data into the following directory /projects/BCM43362/a1_labdata/boardtests/results/sdg_rev0305
-boardrev=0x1307
-boardnum=777
-xtalfreq=26000
-boardflags=0xa00
-sromrev=3
-wl0id=0x431b
-macaddr=00:90:4c:07:71:12
-aa2g=1
-ag0=2
-maxp2ga0=74
-cck2gpo=0x2222
-ofdm2gpo=0x66666666
-mcs2gpo0=0x7777
-mcs2gpo1=0x7777
-pa0maxpwr=56
-
-#P207 PA params
-#pa0b0=5447
-#pa0b1=-658
-#pa0b2=-175
-
-#Same PA params for P304,P305, P306, P307
-
-pa0b0=5447
-pa0b1=-607
-pa0b2=-160
-pa0itssit=62
-pa1itssit=62
-
-
-cckPwrOffset=5
-ccode=0
-rssismf2g=0xa
-rssismc2g=0x3
-rssisav2g=0x7
-triso2g=0
-noise_cal_enable_2g=0
-noise_cal_po_2g=0
-swctrlmap_2g=0x04040404,0x02020202,0x02020202,0x010101,0x1ff
-temp_add=29767
-temp_mult=425
diff --git a/root/lib/firmware/brcm/brcmfmac43430-sdio.bin b/root/lib/firmware/brcm/brcmfmac43430-sdio.bin
new file mode 100644
index 0000000..4b2945e
Binary files /dev/null and b/root/lib/firmware/brcm/brcmfmac43430-sdio.bin differ
diff --git a/root/lib/firmware/brcm/brcmfmac43430-sdio.txt b/root/lib/firmware/brcm/brcmfmac43430-sdio.txt
index 9baa5c3..3d917a7 100644
--- a/root/lib/firmware/brcm/brcmfmac43430-sdio.txt
+++ b/root/lib/firmware/brcm/brcmfmac43430-sdio.txt
@@ -1,4 +1,4 @@
-#AP6212_NVRAM_V1.0_20140603
+# NVRAM file for BCM943430WLSELG
# 2.4 GHz, 20 MHz BW mode
# The following parameter values are just placeholders, need to be updated.
@@ -7,12 +7,14 @@ prodid=0x0726
vendid=0x14e4
devid=0x43e2
boardtype=0x0726
-boardrev=0x1101
+boardrev=0x1202
boardnum=22
macaddr=00:90:4c:c5:12:38
sromrev=11
boardflags=0x00404201
-xtalfreq=26000
+boardflags3=0x08000000
+xtalfreq=37400
+#xtalfreq=19200
nocrc=1
ag0=255
aa2g=1
@@ -27,27 +29,31 @@ AvVmid_c0=0x0,0xc8
cckpwroffset0=5
# PPR params
-maxp2ga0=90
+maxp2ga0=84
txpwrbckof=6
-cckbw202gpo=0x5555
-legofdmbw202gpo=0x77777777
-mcsbw202gpo=0xaaaaaaaa
+cckbw202gpo=0
+legofdmbw202gpo=0x66111111
+mcsbw202gpo=0x77711111
+propbw202gpo=0xdd
# OFDM IIR :
-ofdmdigfilttype=7
+ofdmdigfilttype=18
+ofdmdigfilttypebe=18
# PAPD mode:
-papdmode=2
+papdmode=1
+papdvalidtest=1
+pacalidx2g=32
+papdepsoffset=-36
+papdendidx=61
il0macaddr=00:90:4c:c5:12:38
wl0id=0x431b
-#OOB parameters
-hostwake=0x40
-hostrdy=0x41
-usbrdy=0x03
-usbrdydelay=100
deadman_to=0xffffffff
-# muxenab: 0x1 for UART enable, 0x10 for Host awake
-muxenab=0x10
+# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
+muxenab=0x1
# CLDO PWM voltage settings - 0x4 - 1.1 volt
#cldo_pwm=0x4
+
+#VCO freq 326.4MHz
+spurconfig=0x3
diff --git a/root/lib/firmware/brcm/brcmfmac43430a0-sdio.txt b/root/lib/firmware/brcm/brcmfmac43430a0-sdio.txt
deleted file mode 120000
index 2ed6689..0000000
--- a/root/lib/firmware/brcm/brcmfmac43430a0-sdio.txt
+++ /dev/null
@@ -1 +0,0 @@
-brcmfmac43430-sdio.txt
\ No newline at end of file
diff --git a/root/lib/firmware/brcm/brcmfmac43455-sdio.bin b/root/lib/firmware/brcm/brcmfmac43455-sdio.bin
new file mode 100644
index 0000000..0212bcf
Binary files /dev/null and b/root/lib/firmware/brcm/brcmfmac43455-sdio.bin differ
diff --git a/root/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob b/root/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob
new file mode 100644
index 0000000..3b9b5bd
Binary files /dev/null and b/root/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob differ
diff --git a/root/lib/firmware/brcm/brcmfmac43455-sdio.txt b/root/lib/firmware/brcm/brcmfmac43455-sdio.txt
new file mode 100644
index 0000000..260c929
--- /dev/null
+++ b/root/lib/firmware/brcm/brcmfmac43455-sdio.txt
@@ -0,0 +1,92 @@
+# Cloned from bcm94345wlpagb_p2xx.txt
+NVRAMRev=$Rev: 498373 $
+sromrev=11
+vendid=0x14e4
+devid=0x43ab
+manfid=0x2d0
+prodid=0x06e4
+#macaddr=00:90:4c:c5:12:38
+macaddr=b8:27:eb:74:f2:6c
+nocrc=1
+boardtype=0x6e4
+boardrev=0x1304
+
+#XTAL 37.4MHz
+xtalfreq=37400
+
+btc_mode=1
+#------------------------------------------------------
+#boardflags: 5GHz eTR switch by default
+# 2.4GHz eTR switch by default
+# bit1 for btcoex
+boardflags=0x00480201
+boardflags2=0x40800000
+boardflags3=0x48200100
+phycal_tempdelta=15
+rxchain=1
+txchain=1
+aa2g=1
+aa5g=1
+tssipos5g=1
+tssipos2g=1
+femctrl=0
+AvVmid_c0=1,165,2,100,2,100,2,100,2,100
+pa2ga0=-129,6525,-718
+pa2ga1=-149,4408,-601
+pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
+pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
+itrsw=1
+pdoffsetcckma0=2
+pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
+pdoffset2g40ma0=16
+pdoffset40ma0=0x8888
+pdoffset80ma0=0x8888
+extpagain5g=2
+extpagain2g=2
+tworangetssi2g=1
+tworangetssi5g=1
+# LTECX flags
+# WCI2
+ltecxmux=0
+ltecxpadnum=0x0504
+ltecxfnsel=0x22
+ltecxgcigpio=0x32
+
+maxp2ga0=80
+ofdmlrbw202gpo=0x0022
+dot11agofdmhrbw202gpo=0x4442
+mcsbw202gpo=0x98444422
+mcsbw402gpo=0x98444422
+maxp5ga0=82,82,82,82
+mcsbw205glpo=0xb9555000
+mcsbw205gmpo=0xb9555000
+mcsbw205ghpo=0xb9555000
+mcsbw405glpo=0xb9555000
+mcsbw405gmpo=0xb9555000
+mcsbw405ghpo=0xb9555000
+mcsbw805glpo=0xb9555000
+mcsbw805gmpo=0xb9555000
+mcsbw805ghpo=0xb9555000
+
+swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
+swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
+swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
+swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
+
+vcodivmode=1
+deadman_to=481500000
+
+ed_thresh2g=-54
+ed_thresh5g=-54
+eu_edthresh2g=-54
+eu_edthresh5g=-54
+ldo1=4
+rawtempsense=0x1ff
+cckPwrIdxCorr=3
+cckTssiDelay=150
+ofdmTssiDelay=150
+txpwr2gAdcScale=1
+txpwr5gAdcScale=1
+dot11b_opts=0x3aa85
+cbfilttype=1
+fdsslevel_ch11=6
diff --git a/root/lib/firmware/regulatory.db b/root/lib/firmware/regulatory.db
new file mode 100644
index 0000000..927ffb4
Binary files /dev/null and b/root/lib/firmware/regulatory.db differ
diff --git a/root/lib/functions.sh b/root/lib/functions.sh
index edce75e..860fc04 100755
--- a/root/lib/functions.sh
+++ b/root/lib/functions.sh
@@ -213,6 +213,7 @@ add_group_and_user() {
default_postinst() {
local root="${IPKG_INSTROOT}"
local pkgname="$(basename ${1%.*})"
+ local filelist="/usr/lib/opkg/info/${pkgname}.list"
local ret=0
add_group_and_user "${pkgname}"
@@ -227,23 +228,29 @@ default_postinst() {
rm -fR $root/rootfs-overlay/
fi
- if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then
- kmodloader
- fi
+ if [ -z "$root" ]; then
+ if grep -m1 -q -s "^/etc/modules.d/" "$filelist"; then
+ kmodloader
+ fi
- if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then
- . /lib/functions/system.sh
- [ -d /tmp/.uci ] || mkdir -p /tmp/.uci
- for i in $(grep -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"); do
- ( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
- done
- uci commit
- fi
+ if grep -m1 -q -s "^/etc/sysctl.d/" "$filelist"; then
+ /etc/init.d/sysctl restart
+ fi
- [ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null
+ if grep -m1 -q -s "^/etc/uci-defaults/" "$filelist"; then
+ . /lib/functions/system.sh
+ [ -d /tmp/.uci ] || mkdir -p /tmp/.uci
+ for i in $(grep -s "^/etc/uci-defaults/" "$filelist"); do
+ ( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
+ done
+ uci commit
+ fi
+
+ rm -f /tmp/luci-indexcache
+ fi
local shell="$(which bash)"
- for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
+ for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do
if [ -n "$root" ]; then
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
else
diff --git a/root/lib/functions/migrations.sh b/root/lib/functions/migrations.sh
new file mode 100644
index 0000000..b180a02
--- /dev/null
+++ b/root/lib/functions/migrations.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+migrate_led_sysfs() {
+ local cfg="$1"; shift
+ local tuples="$@"
+ local sysfs
+ local name
+
+ config_get sysfs ${cfg} sysfs
+ config_get name ${cfg} name
+
+ [ -z "${sysfs}" ] && return
+
+ for tuple in ${tuples}; do
+ local old=${tuple%=*}
+ local new=${tuple#*=}
+ local new_sysfs
+
+ new_sysfs=$(echo ${sysfs} | sed "s/${old}/${new}/")
+
+ [ "${new_sysfs}" = "${sysfs}" ] && continue
+
+ uci set system.${cfg}.sysfs="${new_sysfs}"
+
+ logger -t led-migration "sysfs option of LED \"${name}\" updated to ${new_sysfs}"
+ done;
+}
+
+migrate_leds() {
+ config_load system
+ config_foreach migrate_led_sysfs led "$@"
+}
+
+migrations_apply() {
+ local realm="$1"
+ [ -n "$(uci changes ${realm})" ] && uci -q commit ${realm}
+}
diff --git a/root/lib/functions/network.sh b/root/lib/functions/network.sh
index 4fdcb66..6b946b9 100644
--- a/root/lib/functions/network.sh
+++ b/root/lib/functions/network.sh
@@ -271,6 +271,11 @@ network_is_up()
# 2: interface
network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; }
+# determine the uptime of the given logical interface
+# 1: destination variable
+# 2: interface
+network_get_uptime() { __network_ifstatus "$1" "$2" ".uptime"; }
+
# determine the metric of the given logical interface
# 1: destination variable
# 2: interface
diff --git a/root/lib/functions/procd.sh b/root/lib/functions/procd.sh
index 72f25fe..529ded1 100644
--- a/root/lib/functions/procd.sh
+++ b/root/lib/functions/procd.sh
@@ -18,14 +18,21 @@
# file: configuration files (array)
# netdev: bound network device (detects ifindex changes)
# limits: resource limits (passed to the process)
-# user info: array with 1 values $username
+# user: $username to run service as
+# group: $groupname to run service as
# pidfile: file name to write pid into
+# stdout: boolean whether to redirect commands stdout to syslog (default: 0)
+# stderr: boolean whether to redirect commands stderr to syslog (default: 0)
+# facility: syslog facility used when logging to syslog (default: daemon)
#
# No space separation is done for arrays/tables - use one function argument per command line argument
#
# procd_close_instance():
# Complete the instance being prepared
#
+# procd_running(service, [instance]):
+# Checks if service/instance is currently running
+#
# procd_kill(service, [instance]):
# Kill a service instance (or all instances)
#
@@ -249,7 +256,7 @@ _procd_set_param() {
reload_signal)
json_add_int "$type" $(kill -l "$1")
;;
- pidfile|user|seccomp|capabilities)
+ pidfile|user|group|seccomp|capabilities|facility)
json_add_string "$type" "$1"
;;
stdout|stderr|no_new_privs)
@@ -398,6 +405,18 @@ _procd_add_instance() {
_procd_close_instance
}
+procd_running() {
+ local service="$1"
+ local instance="${2:-instance1}"
+ local running
+
+ json_init
+ json_add_string name "$service"
+ running=$(_procd_ubus_call list | jsonfilter -e "@['$service'].instances['$instance'].running")
+
+ [ "$running" = "true" ]
+}
+
_procd_kill() {
local service="$1"
local instance="$2"
diff --git a/root/lib/functions/system.sh b/root/lib/functions/system.sh
index 7ed6280..dceb66a 100644
--- a/root/lib/functions/system.sh
+++ b/root/lib/functions/system.sh
@@ -4,7 +4,7 @@ get_mac_binary() {
local path="$1"
local offset="$2"
- if [ -z "$path" ]; then
+ if ! [ -e "$path" ]; then
echo "get_mac_binary: file $path not found!" >&2
return
fi
@@ -79,12 +79,7 @@ mtd_get_mac_binary_ubi() {
local ubidev=$(nand_find_ubi $CI_UBIPART)
local part=$(nand_find_volume $ubidev $1)
- if [ -z "$part" ]; then
- echo "mtd_get_mac_binary: ubi volume $mtdname not found!" >&2
- return
- fi
-
- hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' /dev/$part 2>/dev/null
+ get_mac_binary "/dev/$part" "$offset"
}
mtd_get_part_size() {
diff --git a/root/lib/functions/uci-defaults.sh b/root/lib/functions/uci-defaults.sh
index 315df7b..2fb7555 100755
--- a/root/lib/functions/uci-defaults.sh
+++ b/root/lib/functions/uci-defaults.sh
@@ -182,6 +182,19 @@ _ucidef_finish_switch_roles() {
done
}
+ucidef_set_ar8xxx_switch_mib() {
+ local name="$1"
+ local type="$2"
+ local interval="$3"
+
+ json_select_object switch
+ json_select_object "$name"
+ json_add_int ar8xxx_mib_type $type
+ json_add_int ar8xxx_mib_poll_interval $interval
+ json_select ..
+ json_select ..
+}
+
ucidef_add_switch() {
local name="$1"; shift
local port num role device index need_tag prev_role
@@ -463,6 +476,7 @@ _ucidef_set_led_timer() {
_ucidef_set_led_common "$1" "$2" "$3"
+ json_add_string type "$trigger_name"
json_add_string trigger "$trigger_name"
json_add_int delayon "$delayon"
json_add_int delayoff "$delayoff"
diff --git a/root/lib/libc.so b/root/lib/libc.so
index 9c76b74..3373611 100755
Binary files a/root/lib/libc.so and b/root/lib/libc.so differ
diff --git a/root/lib/libfstools.so b/root/lib/libfstools.so
index 040666e..b4c0298 100644
Binary files a/root/lib/libfstools.so and b/root/lib/libfstools.so differ
diff --git a/root/lib/libgcc_s.so.1 b/root/lib/libgcc_s.so.1
index fc2e1de..602892d 100644
Binary files a/root/lib/libgcc_s.so.1 and b/root/lib/libgcc_s.so.1 differ
diff --git a/root/lib/libpam.so.0.84.2 b/root/lib/libpam.so.0.84.2
index 3249eae..cb7058c 100755
Binary files a/root/lib/libpam.so.0.84.2 and b/root/lib/libpam.so.0.84.2 differ
diff --git a/root/lib/libpamc.so.0.82.1 b/root/lib/libpamc.so.0.82.1
index adaa9ad..db2ebd8 100755
Binary files a/root/lib/libpamc.so.0.82.1 and b/root/lib/libpamc.so.0.82.1 differ
diff --git a/root/lib/librpc.so b/root/lib/librpc.so
new file mode 100644
index 0000000..e6e965a
Binary files /dev/null and b/root/lib/librpc.so differ
diff --git a/root/lib/libuci.so b/root/lib/libuci.so
index 320763f..b433fab 100755
Binary files a/root/lib/libuci.so and b/root/lib/libuci.so differ
diff --git a/root/lib/netifd/hostapd.sh b/root/lib/netifd/hostapd.sh
new file mode 100644
index 0000000..3c1504c
--- /dev/null
+++ b/root/lib/netifd/hostapd.sh
@@ -0,0 +1,976 @@
+. /lib/functions/network.sh
+
+wpa_supplicant_add_rate() {
+ local var="$1"
+ local val="$(($2 / 1000))"
+ local sub="$((($2 / 100) % 10))"
+ append $var "$val" ","
+ [ $sub -gt 0 ] && append $var "."
+}
+
+hostapd_add_rate() {
+ local var="$1"
+ local val="$(($2 / 100))"
+ append $var "$val" " "
+}
+
+hostapd_append_wep_key() {
+ local var="$1"
+
+ wep_keyidx=0
+ set_default key 1
+ case "$key" in
+ [1234])
+ for idx in 1 2 3 4; do
+ local zidx
+ zidx=$(($idx - 1))
+ json_get_var ckey "key${idx}"
+ [ -n "$ckey" ] && \
+ append $var "wep_key${zidx}=$(prepare_key_wep "$ckey")" "$N$T"
+ done
+ wep_keyidx=$((key - 1))
+ ;;
+ *)
+ append $var "wep_key0=$(prepare_key_wep "$key")" "$N$T"
+ ;;
+ esac
+}
+
+hostapd_append_wpa_key_mgmt() {
+ local auth_type_l="$(echo $auth_type | tr 'a-z' 'A-Z')"
+
+ case "$auth_type" in
+ psk|eap)
+ append wpa_key_mgmt "WPA-$auth_type_l"
+ [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type_l}"
+ [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type_l}-SHA256"
+ ;;
+ eap192)
+ append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
+ ;;
+ eap-eap192)
+ append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
+ append wpa_key_mgmt "WPA-EAP"
+ [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP"
+ [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-EAP-SHA256"
+ ;;
+ sae)
+ append wpa_key_mgmt "SAE"
+ [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-SAE"
+ ;;
+ psk-sae)
+ append wpa_key_mgmt "WPA-PSK"
+ [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-PSK"
+ [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-PSK-SHA256"
+ append wpa_key_mgmt "SAE"
+ [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-SAE"
+ ;;
+ owe)
+ append wpa_key_mgmt "OWE"
+ ;;
+ esac
+}
+
+hostapd_add_log_config() {
+ config_add_boolean \
+ log_80211 \
+ log_8021x \
+ log_radius \
+ log_wpa \
+ log_driver \
+ log_iapp \
+ log_mlme
+
+ config_add_int log_level
+}
+
+hostapd_common_add_device_config() {
+ config_add_array basic_rate
+ config_add_array supported_rates
+
+ config_add_string country
+ config_add_boolean country_ie doth
+ config_add_string require_mode
+ config_add_boolean legacy_rates
+
+ config_add_string acs_chan_bias
+ config_add_array hostapd_options
+
+ hostapd_add_log_config
+}
+
+hostapd_prepare_device_config() {
+ local config="$1"
+ local driver="$2"
+
+ local base="${config%%.conf}"
+ local base_cfg=
+
+ json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates acs_chan_bias
+
+ hostapd_set_log_options base_cfg
+
+ set_default country_ie 1
+ set_default doth 1
+ set_default legacy_rates 1
+
+ [ "$hwmode" = "b" ] && legacy_rates=1
+
+ [ -n "$country" ] && {
+ append base_cfg "country_code=$country" "$N"
+
+ [ "$country_ie" -gt 0 ] && append base_cfg "ieee80211d=1" "$N"
+ [ "$hwmode" = "a" -a "$doth" -gt 0 ] && append base_cfg "ieee80211h=1" "$N"
+ }
+
+ [ -n "$acs_chan_bias" ] && append base_cfg "acs_chan_bias=$acs_chan_bias" "$N"
+
+ local brlist= br
+ json_get_values basic_rate_list basic_rate
+ local rlist= r
+ json_get_values rate_list supported_rates
+
+ [ -n "$hwmode" ] && append base_cfg "hw_mode=$hwmode" "$N"
+ [ "$legacy_rates" -eq 0 ] && set_default require_mode g
+
+ [ "$hwmode" = "g" ] && {
+ [ "$legacy_rates" -eq 0 ] && set_default rate_list "6000 9000 12000 18000 24000 36000 48000 54000"
+ [ -n "$require_mode" ] && set_default basic_rate_list "6000 12000 24000"
+ }
+
+ case "$require_mode" in
+ n) append base_cfg "require_ht=1" "$N";;
+ ac) append base_cfg "require_vht=1" "$N";;
+ esac
+
+ for r in $rate_list; do
+ hostapd_add_rate rlist "$r"
+ done
+
+ for br in $basic_rate_list; do
+ hostapd_add_rate brlist "$br"
+ done
+
+ [ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N"
+ [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N"
+ append base_cfg "beacon_int=$beacon_int" "$N"
+
+ json_get_values opts hostapd_options
+ for val in $opts; do
+ append base_cfg "$val" "$N"
+ done
+
+ cat > "$config" < allow management frame protection
+ case "$ieee80211w" in
+ [012])
+ json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout
+ append bss_conf "ieee80211w=$ieee80211w" "$N"
+ [ "$ieee80211w" -gt "0" ] && {
+ append bss_conf "group_mgmt_cipher=${ieee80211w_mgmt_cipher:-AES-128-CMAC}" "$N"
+ [ -n "$ieee80211w_max_timeout" ] && \
+ append bss_conf "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N"
+ [ -n "$ieee80211w_retry_timeout" ] && \
+ append bss_conf "assoc_sa_query_retry_timeout=$ieee80211w_retry_timeout" "$N"
+ }
+ ;;
+ esac
+ fi
+
+ _macfile="/var/run/hostapd-$ifname.maclist"
+ case "$macfilter" in
+ allow)
+ append bss_conf "macaddr_acl=1" "$N"
+ append bss_conf "accept_mac_file=$_macfile" "$N"
+ # accept_mac_file can be used to set MAC to VLAN ID mapping
+ vlan_possible=1
+ ;;
+ deny)
+ append bss_conf "macaddr_acl=0" "$N"
+ append bss_conf "deny_mac_file=$_macfile" "$N"
+ ;;
+ *)
+ _macfile=""
+ ;;
+ esac
+
+ [ -n "$_macfile" ] && {
+ json_get_vars macfile
+ json_get_values maclist maclist
+
+ rm -f "$_macfile"
+ (
+ for mac in $maclist; do
+ echo "$mac"
+ done
+ [ -n "$macfile" -a -f "$macfile" ] && cat "$macfile"
+ ) > "$_macfile"
+ }
+
+ [ -n "$vlan_possible" -a -n "$dynamic_vlan" ] && {
+ json_get_vars vlan_naming vlan_tagged_interface vlan_bridge vlan_file
+ set_default vlan_naming 1
+ append bss_conf "dynamic_vlan=$dynamic_vlan" "$N"
+ append bss_conf "vlan_naming=$vlan_naming" "$N"
+ [ -n "$vlan_bridge" ] && \
+ append bss_conf "vlan_bridge=$vlan_bridge" "$N"
+ [ -n "$vlan_tagged_interface" ] && \
+ append bss_conf "vlan_tagged_interface=$vlan_tagged_interface" "$N"
+ [ -n "$vlan_file" ] && {
+ [ -e "$vlan_file" ] || touch "$vlan_file"
+ append bss_conf "vlan_file=$vlan_file" "$N"
+ }
+ }
+
+ append "$var" "$bss_conf" "$N"
+ return 0
+}
+
+hostapd_set_log_options() {
+ local var="$1"
+
+ local log_level log_80211 log_8021x log_radius log_wpa log_driver log_iapp log_mlme
+ json_get_vars log_level log_80211 log_8021x log_radius log_wpa log_driver log_iapp log_mlme
+
+ set_default log_level 2
+ set_default log_80211 1
+ set_default log_8021x 1
+ set_default log_radius 1
+ set_default log_wpa 1
+ set_default log_driver 1
+ set_default log_iapp 1
+ set_default log_mlme 1
+
+ local log_mask=$(( \
+ ($log_80211 << 0) | \
+ ($log_8021x << 1) | \
+ ($log_radius << 2) | \
+ ($log_wpa << 3) | \
+ ($log_driver << 4) | \
+ ($log_iapp << 5) | \
+ ($log_mlme << 6) \
+ ))
+
+ append "$var" "logger_syslog=$log_mask" "$N"
+ append "$var" "logger_syslog_level=$log_level" "$N"
+ append "$var" "logger_stdout=$log_mask" "$N"
+ append "$var" "logger_stdout_level=$log_level" "$N"
+
+ return 0
+}
+
+_wpa_supplicant_common() {
+ local ifname="$1"
+
+ _rpath="/var/run/wpa_supplicant"
+ _config="${_rpath}-$ifname.conf"
+}
+
+wpa_supplicant_teardown_interface() {
+ _wpa_supplicant_common "$1"
+ rm -rf "$_rpath/$1" "$_config"
+}
+
+wpa_supplicant_prepare_interface() {
+ local ifname="$1"
+ _w_driver="$2"
+
+ _wpa_supplicant_common "$1"
+
+ json_get_vars mode wds multi_ap
+
+ [ -n "$network_bridge" ] && {
+ fail=
+ case "$mode" in
+ adhoc)
+ fail=1
+ ;;
+ sta)
+ [ "$wds" = 1 -o "$multi_ap" = 1 ] || fail=1
+ ;;
+ esac
+
+ [ -n "$fail" ] && {
+ wireless_setup_vif_failed BRIDGE_NOT_ALLOWED
+ return 1
+ }
+ }
+
+ local ap_scan=
+
+ _w_mode="$mode"
+ _w_modestr=
+
+ [[ "$mode" = adhoc ]] && {
+ ap_scan="ap_scan=2"
+
+ _w_modestr="mode=1"
+ }
+
+ local country_str=
+ [ -n "$country" ] && {
+ country_str="country=$country"
+ }
+
+ multiap_flag_file="${_config}.is_multiap"
+ if [ "$multi_ap" = "1" ]; then
+ touch "$multiap_flag_file"
+ else
+ [ -e "$multiap_flag_file" ] && rm "$multiap_flag_file"
+ fi
+ wpa_supplicant_teardown_interface "$ifname"
+ cat > "$_config" <> "$_config"
+ else
+ cat >> "$_config" <> 8) & 3))
+ [ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc"
+ ht_cap_mask="$(( ($ht_cap_mask & ~(0x300)) | ($cap_rx_stbc << 8) ))"
+
+ mac80211_add_capabilities ht_capab_flags $ht_cap_mask \
+ LDPC:0x1::$ldpc \
+ GF:0x10::$greenfield \
+ SHORT-GI-20:0x20::$short_gi_20 \
+ SHORT-GI-40:0x40::$short_gi_40 \
+ TX-STBC:0x80::$tx_stbc \
+ RX-STBC1:0x300:0x100:1 \
+ RX-STBC12:0x300:0x200:1 \
+ RX-STBC123:0x300:0x300:1 \
+ MAX-AMSDU-7935:0x800::$max_amsdu \
+ DSSS_CCK-40:0x1000::$dsss_cck_40
+
+ ht_capab="$ht_capab$ht_capab_flags"
+ [ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
+ }
+
+ # 802.11ac
+ enable_ac=0
+ idx="$channel"
+ case "$htmode" in
+ VHT20) enable_ac=1;;
+ VHT40)
+ case "$(( ($channel / 4) % 2 ))" in
+ 1) idx=$(($channel + 2));;
+ 0) idx=$(($channel - 2));;
+ esac
+ enable_ac=1
+ append base_cfg "vht_oper_chwidth=0" "$N"
+ append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N"
+ ;;
+ VHT80)
+ case "$(( ($channel / 4) % 4 ))" in
+ 1) idx=$(($channel + 6));;
+ 2) idx=$(($channel + 2));;
+ 3) idx=$(($channel - 2));;
+ 0) idx=$(($channel - 6));;
+ esac
+ enable_ac=1
+ append base_cfg "vht_oper_chwidth=1" "$N"
+ append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N"
+ ;;
+ VHT160)
+ case "$channel" in
+ 36|40|44|48|52|56|60|64) idx=50;;
+ 100|104|108|112|116|120|124|128) idx=114;;
+ esac
+ enable_ac=1
+ append base_cfg "vht_oper_chwidth=2" "$N"
+ append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N"
+ ;;
+ esac
+
+ if [ "$enable_ac" != "0" ]; then
+ json_get_vars \
+ rxldpc:1 \
+ short_gi_80:1 \
+ short_gi_160:1 \
+ tx_stbc_2by1:1 \
+ su_beamformer:1 \
+ su_beamformee:1 \
+ mu_beamformer:1 \
+ mu_beamformee:1 \
+ vht_txop_ps:1 \
+ htc_vht:1 \
+ rx_antenna_pattern:1 \
+ tx_antenna_pattern:1 \
+ vht_max_a_mpdu_len_exp:7 \
+ vht_max_mpdu:11454 \
+ rx_stbc:4 \
+ vht_link_adapt:3 \
+ vht160:2
+
+ set_default tx_burst 2.0
+ append base_cfg "ieee80211ac=1" "$N"
+ vht_cap=0
+ for cap in $(iw phy "$phy" info | awk -F "[()]" '/VHT Capabilities/ { print $2 }'); do
+ vht_cap="$(($vht_cap | $cap))"
+ done
+
+ cap_rx_stbc=$((($vht_cap >> 8) & 7))
+ [ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc"
+ vht_cap="$(( ($vht_cap & ~(0x700)) | ($cap_rx_stbc << 8) ))"
+
+ mac80211_add_capabilities vht_capab $vht_cap \
+ RXLDPC:0x10::$rxldpc \
+ SHORT-GI-80:0x20::$short_gi_80 \
+ SHORT-GI-160:0x40::$short_gi_160 \
+ TX-STBC-2BY1:0x80::$tx_stbc_2by1 \
+ SU-BEAMFORMER:0x800::$su_beamformer \
+ SU-BEAMFORMEE:0x1000::$su_beamformee \
+ MU-BEAMFORMER:0x80000::$mu_beamformer \
+ MU-BEAMFORMEE:0x100000::$mu_beamformee \
+ VHT-TXOP-PS:0x200000::$vht_txop_ps \
+ HTC-VHT:0x400000::$htc_vht \
+ RX-ANTENNA-PATTERN:0x10000000::$rx_antenna_pattern \
+ TX-ANTENNA-PATTERN:0x20000000::$tx_antenna_pattern \
+ RX-STBC-1:0x700:0x100:1 \
+ RX-STBC-12:0x700:0x200:1 \
+ RX-STBC-123:0x700:0x300:1 \
+ RX-STBC-1234:0x700:0x400:1 \
+
+ # supported Channel widths
+ vht160_hw=0
+ [ "$(($vht_cap & 12))" -eq 4 -a 1 -le "$vht160" ] && \
+ vht160_hw=1
+ [ "$(($vht_cap & 12))" -eq 8 -a 2 -le "$vht160" ] && \
+ vht160_hw=2
+ [ "$vht160_hw" = 1 ] && vht_capab="$vht_capab[VHT160]"
+ [ "$vht160_hw" = 2 ] && vht_capab="$vht_capab[VHT160-80PLUS80]"
+
+ # maximum MPDU length
+ vht_max_mpdu_hw=3895
+ [ "$(($vht_cap & 3))" -ge 1 -a 7991 -le "$vht_max_mpdu" ] && \
+ vht_max_mpdu_hw=7991
+ [ "$(($vht_cap & 3))" -ge 2 -a 11454 -le "$vht_max_mpdu" ] && \
+ vht_max_mpdu_hw=11454
+ [ "$vht_max_mpdu_hw" != 3895 ] && \
+ vht_capab="$vht_capab[MAX-MPDU-$vht_max_mpdu_hw]"
+
+ # maximum A-MPDU length exponent
+ vht_max_a_mpdu_len_exp_hw=0
+ [ "$(($vht_cap & 58720256))" -ge 8388608 -a 1 -le "$vht_max_a_mpdu_len_exp" ] && \
+ vht_max_a_mpdu_len_exp_hw=1
+ [ "$(($vht_cap & 58720256))" -ge 16777216 -a 2 -le "$vht_max_a_mpdu_len_exp" ] && \
+ vht_max_a_mpdu_len_exp_hw=2
+ [ "$(($vht_cap & 58720256))" -ge 25165824 -a 3 -le "$vht_max_a_mpdu_len_exp" ] && \
+ vht_max_a_mpdu_len_exp_hw=3
+ [ "$(($vht_cap & 58720256))" -ge 33554432 -a 4 -le "$vht_max_a_mpdu_len_exp" ] && \
+ vht_max_a_mpdu_len_exp_hw=4
+ [ "$(($vht_cap & 58720256))" -ge 41943040 -a 5 -le "$vht_max_a_mpdu_len_exp" ] && \
+ vht_max_a_mpdu_len_exp_hw=5
+ [ "$(($vht_cap & 58720256))" -ge 50331648 -a 6 -le "$vht_max_a_mpdu_len_exp" ] && \
+ vht_max_a_mpdu_len_exp_hw=6
+ [ "$(($vht_cap & 58720256))" -ge 58720256 -a 7 -le "$vht_max_a_mpdu_len_exp" ] && \
+ vht_max_a_mpdu_len_exp_hw=7
+ vht_capab="$vht_capab[MAX-A-MPDU-LEN-EXP$vht_max_a_mpdu_len_exp_hw]"
+
+ # whether or not the STA supports link adaptation using VHT variant
+ vht_link_adapt_hw=0
+ [ "$(($vht_cap & 201326592))" -ge 134217728 -a 2 -le "$vht_link_adapt" ] && \
+ vht_link_adapt_hw=2
+ [ "$(($vht_cap & 201326592))" -ge 201326592 -a 3 -le "$vht_link_adapt" ] && \
+ vht_link_adapt_hw=3
+ [ "$vht_link_adapt_hw" != 0 ] && \
+ vht_capab="$vht_capab[VHT-LINK-ADAPT-$vht_link_adapt_hw]"
+
+ [ -n "$vht_capab" ] && append base_cfg "vht_capab=$vht_capab" "$N"
+ fi
+
+ hostapd_prepare_device_config "$hostapd_conf_file" nl80211
+ cat >> "$hostapd_conf_file" <> /var/run/hostapd-$phy.conf </dev/null); do
+ case "$(readlink -f /sys/class/ieee80211/$phy/device)" in
+ *$path) return 0;;
+ esac
+ done
+ }
+ [ -n "$macaddr" ] && {
+ for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
+ grep -i -q "$macaddr" "/sys/class/ieee80211/${phy}/macaddress" && return 0
+ done
+ }
+ return 1
+}
+
+mac80211_check_ap() {
+ has_ap=1
+}
+
+mac80211_iw_interface_add() {
+ local phy="$1"
+ local ifname="$2"
+ local type="$3"
+ local wdsflag="$4"
+ local rc
+
+ iw phy "$phy" interface add "$ifname" type "$type" $wdsflag
+ rc="$?"
+
+ [ "$rc" = 233 ] && {
+ # Device might have just been deleted, give the kernel some time to finish cleaning it up
+ sleep 1
+
+ iw phy "$phy" interface add "$ifname" type "$type" $wdsflag
+ rc="$?"
+ }
+
+ [ "$rc" = 233 ] && {
+ # Device might not support virtual interfaces, so the interface never got deleted in the first place.
+ # Check if the interface already exists, and avoid failing in this case.
+ ip link show dev "$ifname" >/dev/null 2>/dev/null && rc=0
+ }
+
+ [ "$rc" != 0 ] && wireless_setup_failed INTERFACE_CREATION_FAILED
+ return $rc
+}
+
+mac80211_prepare_vif() {
+ json_select config
+
+ json_get_vars ifname mode ssid wds powersave macaddr
+
+ [ -n "$ifname" ] || ifname="wlan${phy#phy}${if_idx:+-$if_idx}"
+ if_idx=$((${if_idx:-0} + 1))
+
+ set_default wds 0
+ set_default powersave 0
+
+ json_select ..
+
+ [ -n "$macaddr" ] || {
+ macaddr="$(mac80211_generate_mac $phy)"
+ macidx="$(($macidx + 1))"
+ }
+
+ json_add_object data
+ json_add_string ifname "$ifname"
+ json_close_object
+ json_select config
+
+ # It is far easier to delete and create the desired interface
+ case "$mode" in
+ adhoc)
+ mac80211_iw_interface_add "$phy" "$ifname" adhoc || return
+ ;;
+ ap)
+ # Hostapd will handle recreating the interface and
+ # subsequent virtual APs belonging to the same PHY
+ if [ -n "$hostapd_ctrl" ]; then
+ type=bss
+ else
+ type=interface
+ fi
+
+ mac80211_hostapd_setup_bss "$phy" "$ifname" "$macaddr" "$type" || return
+
+ [ -n "$hostapd_ctrl" ] || {
+ mac80211_iw_interface_add "$phy" "$ifname" __ap || return
+ hostapd_ctrl="${hostapd_ctrl:-/var/run/hostapd/$ifname}"
+ }
+ ;;
+ mesh)
+ mac80211_iw_interface_add "$phy" "$ifname" mp || return
+ ;;
+ monitor)
+ mac80211_iw_interface_add "$phy" "$ifname" monitor || return
+ ;;
+ sta)
+ local wdsflag=
+ staidx="$(($staidx + 1))"
+ [ "$wds" -gt 0 ] && wdsflag="4addr on"
+ mac80211_iw_interface_add "$phy" "$ifname" managed "$wdsflag" || return
+ [ "$powersave" -gt 0 ] && powersave="on" || powersave="off"
+ iw "$ifname" set power_save "$powersave"
+ ;;
+ esac
+
+ case "$mode" in
+ monitor|mesh)
+ [ "$auto_channel" -gt 0 ] || iw dev "$ifname" set channel "$channel" $htmode
+ ;;
+ esac
+
+ if [ "$mode" != "ap" ]; then
+ # ALL ap functionality will be passed to hostapd
+ # All interfaces must have unique mac addresses
+ # which can either be explicitly set in the device
+ # section, or automatically generated
+ ip link set dev "$ifname" address "$macaddr"
+ fi
+
+ json_select ..
+}
+
+mac80211_setup_supplicant() {
+ wpa_supplicant_prepare_interface "$ifname" nl80211 || return 1
+ if [ "$mode" = "sta" ]; then
+ wpa_supplicant_add_network "$ifname"
+ else
+ wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan"
+ fi
+ wpa_supplicant_run "$ifname" ${hostapd_ctrl:+-H $hostapd_ctrl}
+}
+
+mac80211_setup_supplicant_noctl() {
+ wpa_supplicant_prepare_interface "$ifname" nl80211 || return 1
+ wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan"
+ wpa_supplicant_run "$ifname"
+}
+
+mac80211_setup_adhoc_htmode() {
+ case "$htmode" in
+ VHT20|HT20) ibss_htmode=HT20;;
+ HT40*|VHT40|VHT160)
+ case "$hwmode" in
+ a)
+ case "$(( ($channel / 4) % 2 ))" in
+ 1) ibss_htmode="HT40+" ;;
+ 0) ibss_htmode="HT40-";;
+ esac
+ ;;
+ *)
+ case "$htmode" in
+ HT40+) ibss_htmode="HT40+";;
+ HT40-) ibss_htmode="HT40-";;
+ *)
+ if [ "$channel" -lt 7 ]; then
+ ibss_htmode="HT40+"
+ else
+ ibss_htmode="HT40-"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ [ "$auto_channel" -gt 0 ] && ibss_htmode="HT40+"
+ ;;
+ VHT80)
+ ibss_htmode="80MHZ"
+ ;;
+ NONE|NOHT)
+ ibss_htmode="NOHT"
+ ;;
+ *) ibss_htmode="" ;;
+ esac
+
+}
+
+mac80211_setup_adhoc() {
+ json_get_vars bssid ssid key mcast_rate
+
+ keyspec=
+ [ "$auth_type" = "wep" ] && {
+ set_default key 1
+ case "$key" in
+ [1234])
+ local idx
+ for idx in 1 2 3 4; do
+ json_get_var ikey "key$idx"
+
+ [ -n "$ikey" ] && {
+ ikey="$(($idx - 1)):$(prepare_key_wep "$ikey")"
+ [ $idx -eq $key ] && ikey="d:$ikey"
+ append keyspec "$ikey"
+ }
+ done
+ ;;
+ *)
+ append keyspec "d:0:$(prepare_key_wep "$key")"
+ ;;
+ esac
+ }
+
+ brstr=
+ for br in $basic_rate_list; do
+ wpa_supplicant_add_rate brstr "$br"
+ done
+
+ mcval=
+ [ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
+
+ iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid \
+ beacon-interval $beacon_int \
+ ${brstr:+basic-rates $brstr} \
+ ${mcval:+mcast-rate $mcval} \
+ ${keyspec:+keys $keyspec}
+}
+
+mac80211_setup_mesh() {
+ json_get_vars ssid mesh_id mcast_rate
+
+ mcval=
+ [ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
+ [ -n "$mesh_id" ] && ssid="$mesh_id"
+
+ case "$htmode" in
+ VHT20|HT20) mesh_htmode=HT20;;
+ HT40*|VHT40)
+ case "$hwmode" in
+ a)
+ case "$(( ($channel / 4) % 2 ))" in
+ 1) mesh_htmode="HT40+" ;;
+ 0) mesh_htmode="HT40-";;
+ esac
+ ;;
+ *)
+ case "$htmode" in
+ HT40+) mesh_htmode="HT40+";;
+ HT40-) mesh_htmode="HT40-";;
+ *)
+ if [ "$channel" -lt 7 ]; then
+ mesh_htmode="HT40+"
+ else
+ mesh_htmode="HT40-"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ VHT80)
+ mesh_htmode="80Mhz"
+ ;;
+ VHT160)
+ mesh_htmode="160Mhz"
+ ;;
+ *) mesh_htmode="NOHT" ;;
+ esac
+ iw dev "$ifname" mesh join "$ssid" freq $freq $mesh_htmode \
+ ${mcval:+mcast-rate $mcval} \
+ beacon-interval $beacon_int
+}
+
+mac80211_setup_vif() {
+ local name="$1"
+ local failed
+
+ json_select data
+ json_get_vars ifname
+ json_select ..
+
+ json_select config
+ json_get_vars mode
+ json_get_var vif_txpower txpower
+
+ ip link set dev "$ifname" up || {
+ wireless_setup_vif_failed IFUP_ERROR
+ json_select ..
+ return
+ }
+
+ set_default vif_txpower "$txpower"
+ [ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed "${vif_txpower%%.*}00"
+
+ case "$mode" in
+ mesh)
+ wireless_vif_parse_encryption
+ freq="$(get_freq "$phy" "$channel")"
+ if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ] || chan_is_dfs "$phy" "$channel"; then
+ mac80211_setup_supplicant || failed=1
+ else
+ mac80211_setup_mesh
+ fi
+ for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
+ json_get_var mp_val "$var"
+ [ -n "$mp_val" ] && iw dev "$ifname" set mesh_param "$var" "$mp_val"
+ done
+ ;;
+ adhoc)
+ wireless_vif_parse_encryption
+ mac80211_setup_adhoc_htmode
+ if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then
+ freq="$(get_freq "$phy" "$channel")"
+ mac80211_setup_supplicant_noctl || failed=1
+ else
+ mac80211_setup_adhoc
+ fi
+ ;;
+ sta)
+ mac80211_setup_supplicant || failed=1
+ ;;
+ esac
+
+ json_select ..
+ [ -n "$failed" ] || wireless_add_vif "$name" "$ifname"
+}
+
+get_freq() {
+ local phy="$1"
+ local chan="$2"
+ iw "$phy" info | grep -E -m1 "(\* ${chan:-....} MHz${chan:+|\\[$chan\\]})" | grep MHz | awk '{print $2}'
+}
+
+chan_is_dfs() {
+ local phy="$1"
+ local chan="$2"
+ iw "$phy" info | grep -E -m1 "(\* ${chan:-....} MHz${chan:+|\\[$chan\\]})" | grep -q "MHz.*radar detection"
+ return $!
+}
+
+mac80211_interface_cleanup() {
+ local phy="$1"
+
+ for wdev in $(list_phy_interfaces "$phy"); do
+ ip link set dev "$wdev" down 2>/dev/null
+ iw dev "$wdev" del
+ done
+}
+
+mac80211_set_noscan() {
+ hostapd_noscan=1
+}
+
+drv_mac80211_cleanup() {
+ hostapd_common_cleanup
+}
+
+drv_mac80211_setup() {
+ json_select config
+ json_get_vars \
+ phy macaddr path \
+ country chanbw distance \
+ txpower antenna_gain \
+ rxantenna txantenna \
+ frag rts beacon_int:100 htmode
+ json_get_values basic_rate_list basic_rate
+ json_select ..
+
+ find_phy || {
+ echo "Could not find PHY for device '$1'"
+ wireless_set_retry 0
+ return 1
+ }
+
+ wireless_set_data phy="$phy"
+ mac80211_interface_cleanup "$phy"
+
+ # convert channel to frequency
+ [ "$auto_channel" -gt 0 ] || freq="$(get_freq "$phy" "$channel")"
+
+ [ -n "$country" ] && {
+ iw reg get | grep -q "^country $country:" || {
+ iw reg set "$country"
+ sleep 1
+ }
+ }
+
+ hostapd_conf_file="/var/run/hostapd-$phy.conf"
+
+ no_ap=1
+ macidx=0
+ staidx=0
+
+ [ -n "$chanbw" ] && {
+ for file in /sys/kernel/debug/ieee80211/$phy/ath9k/chanbw /sys/kernel/debug/ieee80211/$phy/ath5k/bwmode; do
+ [ -f "$file" ] && echo "$chanbw" > "$file"
+ done
+ }
+
+ set_default rxantenna 0xffffffff
+ set_default txantenna 0xffffffff
+ set_default distance 0
+ set_default antenna_gain 0
+
+ [ "$txantenna" = "all" ] && txantenna=0xffffffff
+ [ "$rxantenna" = "all" ] && rxantenna=0xffffffff
+
+ iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1
+ iw phy "$phy" set antenna_gain $antenna_gain
+ iw phy "$phy" set distance "$distance"
+
+ [ -n "$frag" ] && iw phy "$phy" set frag "${frag%%.*}"
+ [ -n "$rts" ] && iw phy "$phy" set rts "${rts%%.*}"
+
+ has_ap=
+ hostapd_ctrl=
+ hostapd_noscan=
+ for_each_interface "ap" mac80211_check_ap
+
+ rm -f "$hostapd_conf_file"
+
+ for_each_interface "sta adhoc mesh" mac80211_set_noscan
+ [ -n "$has_ap" ] && mac80211_hostapd_setup_base "$phy"
+
+ for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif
+ for_each_interface "ap" mac80211_prepare_vif
+
+ [ -n "$hostapd_ctrl" ] && {
+ /usr/sbin/hostapd -s -P /var/run/wifi-$phy.pid -B "$hostapd_conf_file"
+ ret="$?"
+ wireless_add_process "$(cat /var/run/wifi-$phy.pid)" "/usr/sbin/hostapd" 1
+ [ "$ret" != 0 ] && {
+ wireless_setup_failed HOSTAPD_START_FAILED
+ return
+ }
+ }
+
+ for_each_interface "ap sta adhoc mesh monitor" mac80211_setup_vif
+
+ wireless_set_up
+}
+
+list_phy_interfaces() {
+ local phy="$1"
+ if [ -d "/sys/class/ieee80211/${phy}/device/net" ]; then
+ ls "/sys/class/ieee80211/${phy}/device/net" 2>/dev/null;
+ else
+ ls "/sys/class/ieee80211/${phy}/device" 2>/dev/null | grep net: | sed -e 's,net:,,g'
+ fi
+}
+
+drv_mac80211_teardown() {
+ wireless_process_kill_all
+
+ json_select data
+ json_get_vars phy
+ json_select ..
+
+ mac80211_interface_cleanup "$phy"
+}
+
+add_driver mac80211
diff --git a/root/lib/preinit/03_b53_hack.sh b/root/lib/preinit/03_b53_hack.sh
deleted file mode 100644
index 170cfd5..0000000
--- a/root/lib/preinit/03_b53_hack.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-do_b53_hack() {
- . /lib/functions.sh
-
- # hack: enable switch on Lamobo R1 and reset counters
- case "$(board_name)" in
- "lamobo,lamobo-r1")
- ifconfig eth0 up
- sleep 1
- swconfig dev switch0 set reset 1
- swconfig dev switch0 set reset_mib 1
- swconfig dev switch0 set apply 1
- ;;
- esac
-}
-
-boot_hook_add preinit_main do_b53_hack
diff --git a/root/lib/preinit/05_set_preinit_iface_brcm2708 b/root/lib/preinit/05_set_preinit_iface_brcm2708
new file mode 100644
index 0000000..3a5c198
--- /dev/null
+++ b/root/lib/preinit/05_set_preinit_iface_brcm2708
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Copyright (C) 2015-2016 OpenWrt.org
+# Copyright (C) 2017 LEDE project
+
+set_preinit_iface() {
+ . /lib/functions.sh
+
+ case "$(board_name)" in
+ raspberrypi,2-model-b |\
+ raspberrypi,3-model-b |\
+ raspberrypi,3-model-b-plus |\
+ raspberrypi,model-b |\
+ raspberrypi,model-b-plus |\
+ raspberrypi,model-b-rev2)
+ ifname=eth0
+ ;;
+ esac
+}
+
+boot_hook_add preinit_main set_preinit_iface
diff --git a/root/lib/preinit/79_move_config b/root/lib/preinit/79_move_config
index c112588..b8738b6 100644
--- a/root/lib/preinit/79_move_config
+++ b/root/lib/preinit/79_move_config
@@ -1,20 +1,20 @@
#!/bin/sh
-# Copyright (C) 2012-2015 OpenWrt.org
+# Copyright (C) 2015 OpenWrt.org
-move_config() {
- local partdev
+. /lib/upgrade/common.sh
- . /lib/upgrade/common.sh
+BOOTPART=/dev/mmcblk0p1
- if export_bootdevice && export_partdevice partdev -1; then
- if mount -t vfat -o rw,noatime "/dev/$partdev" /mnt; then
- if [ -f /mnt/sysupgrade.tgz ]; then
- mv -f /mnt/sysupgrade.tgz /
- fi
- umount /mnt
- fi
+move_config() {
+ if [ -b $BOOTPART ]; then
+ insmod nls_cp437
+ insmod nls_iso8859-1
+ insmod fat
+ insmod vfat
+ mkdir -p /boot
+ mount -t vfat -o rw,noatime $BOOTPART /boot
+ [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
fi
}
boot_hook_add preinit_mount_root move_config
-
diff --git a/root/lib/security/pam_access.so b/root/lib/security/pam_access.so
index 4be39fd..ba5b213 100755
Binary files a/root/lib/security/pam_access.so and b/root/lib/security/pam_access.so differ
diff --git a/root/lib/security/pam_env.so b/root/lib/security/pam_env.so
index 3544190..84d134a 100755
Binary files a/root/lib/security/pam_env.so and b/root/lib/security/pam_env.so differ
diff --git a/root/lib/security/pam_filter/upperLOWER b/root/lib/security/pam_filter/upperLOWER
index 63b7b9b..26e00cb 100755
Binary files a/root/lib/security/pam_filter/upperLOWER and b/root/lib/security/pam_filter/upperLOWER differ
diff --git a/root/lib/security/pam_group.so b/root/lib/security/pam_group.so
index 78f596e..9910f01 100755
Binary files a/root/lib/security/pam_group.so and b/root/lib/security/pam_group.so differ
diff --git a/root/lib/security/pam_limits.so b/root/lib/security/pam_limits.so
index 2dcb36a..9f1d841 100755
Binary files a/root/lib/security/pam_limits.so and b/root/lib/security/pam_limits.so differ
diff --git a/root/lib/security/pam_listfile.so b/root/lib/security/pam_listfile.so
index 33c3934..4882445 100755
Binary files a/root/lib/security/pam_listfile.so and b/root/lib/security/pam_listfile.so differ
diff --git a/root/lib/security/pam_mail.so b/root/lib/security/pam_mail.so
index 4c204c2..bbc7b02 100755
Binary files a/root/lib/security/pam_mail.so and b/root/lib/security/pam_mail.so differ
diff --git a/root/lib/security/pam_mkhomedir.so b/root/lib/security/pam_mkhomedir.so
index 6650b57..b5beccd 100755
Binary files a/root/lib/security/pam_mkhomedir.so and b/root/lib/security/pam_mkhomedir.so differ
diff --git a/root/lib/security/pam_namespace.so b/root/lib/security/pam_namespace.so
index c762563..4621ace 100755
Binary files a/root/lib/security/pam_namespace.so and b/root/lib/security/pam_namespace.so differ
diff --git a/root/lib/security/pam_nologin.so b/root/lib/security/pam_nologin.so
index 26a7167..1fe1bd5 100755
Binary files a/root/lib/security/pam_nologin.so and b/root/lib/security/pam_nologin.so differ
diff --git a/root/lib/security/pam_pwhistory.so b/root/lib/security/pam_pwhistory.so
index 75f87f3..0bb7cc1 100755
Binary files a/root/lib/security/pam_pwhistory.so and b/root/lib/security/pam_pwhistory.so differ
diff --git a/root/lib/security/pam_tally.so b/root/lib/security/pam_tally.so
index 0b1a598..9aa52a6 100755
Binary files a/root/lib/security/pam_tally.so and b/root/lib/security/pam_tally.so differ
diff --git a/root/lib/security/pam_tally2.so b/root/lib/security/pam_tally2.so
index d5f4baf..dfab2ba 100755
Binary files a/root/lib/security/pam_tally2.so and b/root/lib/security/pam_tally2.so differ
diff --git a/root/lib/security/pam_timestamp.so b/root/lib/security/pam_timestamp.so
index 448c615..933f36f 100755
Binary files a/root/lib/security/pam_timestamp.so and b/root/lib/security/pam_timestamp.so differ
diff --git a/root/lib/security/pam_umask.so b/root/lib/security/pam_umask.so
index e8b2182..e0854ba 100755
Binary files a/root/lib/security/pam_umask.so and b/root/lib/security/pam_umask.so differ
diff --git a/root/lib/security/pam_unix.so b/root/lib/security/pam_unix.so
index 2a6162d..754590d 100755
Binary files a/root/lib/security/pam_unix.so and b/root/lib/security/pam_unix.so differ
diff --git a/root/lib/security/pam_xauth.so b/root/lib/security/pam_xauth.so
index 2698a8f..f5f2ca9 100755
Binary files a/root/lib/security/pam_xauth.so and b/root/lib/security/pam_xauth.so differ
diff --git a/root/lib/uboot-envtools.sh b/root/lib/uboot-envtools.sh
deleted file mode 100644
index e21b283..0000000
--- a/root/lib/uboot-envtools.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2011-2012 OpenWrt.org
-#
-
-ubootenv_add_uci_config() {
- local dev=$1
- local offset=$2
- local envsize=$3
- local secsize=$4
- local numsec=$5
- uci batch <>/etc/fw_env.config
-}
-
diff --git a/root/lib/upgrade/common.sh b/root/lib/upgrade/common.sh
index b3a29fb..0d3162d 100644
--- a/root/lib/upgrade/common.sh
+++ b/root/lib/upgrade/common.sh
@@ -2,6 +2,8 @@
RAM_ROOT=/tmp/root
+export BACKUP_FILE=sysupgrade.tgz # file extracted by preinit
+
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; }
@@ -101,35 +103,41 @@ get_magic_long() {
}
export_bootdevice() {
- local cmdline uuid disk uevent line
+ local cmdline bootdisk rootpart uuid blockdev uevent line
local MAJOR MINOR DEVNAME DEVTYPE
if read cmdline < /proc/cmdline; then
case "$cmdline" in
*block2mtd=*)
- disk="${cmdline##*block2mtd=}"
- disk="${disk%%,*}"
+ bootdisk="${cmdline##*block2mtd=}"
+ bootdisk="${bootdisk%%,*}"
;;
*root=*)
- disk="${cmdline##*root=}"
- disk="${disk%% *}"
+ rootpart="${cmdline##*root=}"
+ rootpart="${rootpart%% *}"
+ ;;
+ esac
+
+ case "$bootdisk" in
+ /dev/*)
+ uevent="/sys/class/block/${bootdisk##*/}/uevent"
;;
esac
- case "$disk" in
- PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
- uuid="${disk#PARTUUID=}"
- uuid="${uuid%-02}"
- for disk in $(find /dev -type b); do
- set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
+ case "$rootpart" in
+ PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-[a-f0-9][a-f0-9])
+ uuid="${rootpart#PARTUUID=}"
+ uuid="${uuid%-[a-f0-9][a-f0-9]}"
+ for blockdev in $(find /dev -type b); do
+ set -- $(dd if=$blockdev bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
if [ "$4$3$2$1" = "$uuid" ]; then
- uevent="/sys/class/block/${disk##*/}/uevent"
+ uevent="/sys/class/block/${blockdev##*/}/uevent"
break
fi
done
;;
/dev/*)
- uevent="/sys/class/block/${disk##*/}/uevent"
+ uevent="/sys/class/block/${rootpart##*/}/../uevent"
;;
esac
@@ -201,16 +209,6 @@ get_partitions() { #
fi
}
-jffs2_copy_config() {
- if grep rootfs_data /proc/mtd >/dev/null; then
- # squashfs+jffs2
- mtd -e rootfs_data jffs2write "$CONF_TAR" rootfs_data
- else
- # jffs2
- mtd jffs2write "$CONF_TAR" rootfs
- fi
-}
-
indicate_upgrade() {
. /etc/diag.sh
set_state upgrade
@@ -222,34 +220,10 @@ indicate_upgrade() {
# $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m
default_do_upgrade() {
sync
- if [ "$SAVE_CONFIG" -eq 1 ]; then
- get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}"
+ if [ -n "$UPGRADE_BACKUP" ]; then
+ get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}"
else
get_image "$1" "$2" | mtd $MTD_ARGS write - "${PART_NAME:-image}"
fi
[ $? -ne 0 ] && exit 1
}
-
-do_upgrade_stage2() {
- v "Performing system upgrade..."
- if [ -n "$do_upgrade" ]; then
- eval "$do_upgrade"
- elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
- platform_do_upgrade "$IMAGE"
- else
- default_do_upgrade "$IMAGE"
- fi
-
- if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
- platform_copy_config
- fi
-
- v "Upgrade completed"
- sleep 1
-
- v "Rebooting system..."
- umount -a
- reboot -f
- sleep 5
- echo b 2>/dev/null >/proc/sysrq-trigger
-}
diff --git a/root/lib/upgrade/do_stage2 b/root/lib/upgrade/do_stage2
new file mode 100755
index 0000000..0e32445
--- /dev/null
+++ b/root/lib/upgrade/do_stage2
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+include /lib/upgrade
+
+v "Performing system upgrade..."
+if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
+ platform_do_upgrade "$IMAGE"
+else
+ default_do_upgrade "$IMAGE"
+fi
+
+if [ -n "$UPGRADE_BACKUP" ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
+ platform_copy_config
+fi
+
+v "Upgrade completed"
+sleep 1
+
+v "Rebooting system..."
+umount -a
+reboot -f
+sleep 5
+echo b 2>/dev/null >/proc/sysrq-trigger
diff --git a/root/lib/upgrade/keep.d/platform b/root/lib/upgrade/keep.d/platform
new file mode 100644
index 0000000..7867965
--- /dev/null
+++ b/root/lib/upgrade/keep.d/platform
@@ -0,0 +1 @@
+/boot/config.txt
diff --git a/root/lib/upgrade/keep.d/samba4-server b/root/lib/upgrade/keep.d/samba4-server
index 95ee7a6..d84118e 100644
--- a/root/lib/upgrade/keep.d/samba4-server
+++ b/root/lib/upgrade/keep.d/samba4-server
@@ -5,3 +5,4 @@
/etc/samba/idmap.ldb
/etc/samba/lmhosts
/etc/nsswitch.conf
+/etc/krb5.conf
diff --git a/root/lib/upgrade/keep.d/uboot-envtools b/root/lib/upgrade/keep.d/uboot-envtools
deleted file mode 100644
index 7e6aa56..0000000
--- a/root/lib/upgrade/keep.d/uboot-envtools
+++ /dev/null
@@ -1,2 +0,0 @@
-/etc/config/ubootenv
-/etc/fw_env.config
diff --git a/root/lib/upgrade/platform.sh b/root/lib/upgrade/platform.sh
index 88ef479..811355b 100644
--- a/root/lib/upgrade/platform.sh
+++ b/root/lib/upgrade/platform.sh
@@ -1,7 +1,15 @@
+. /lib/functions.sh
+
+REQUIRE_IMAGE_METADATA=1
+
+# copied from x86's platform.sh
+
platform_check_image() {
local diskdev partdev diff
- export_bootdevice && export_partdevice diskdev -2 || {
+ [ "$#" -gt 1 ] && return 1
+
+ export_bootdevice && export_partdevice diskdev 0 || {
echo "Unable to determine upgrade device"
return 1
}
@@ -23,29 +31,21 @@ platform_check_image() {
ask_bool 0 "Abort" && exit 1
return 0
fi
-}
-
-platform_copy_config() {
- local partdev
- if export_partdevice partdev -1; then
- mount -t vfat -o rw,noatime "/dev/$partdev" /mnt
- cp -af "$CONF_TAR" /mnt/
- umount /mnt
- fi
+ return 0;
}
platform_do_upgrade() {
local diskdev partdev diff
- export_bootdevice && export_partdevice diskdev -2 || {
+ export_bootdevice && export_partdevice diskdev 0 || {
echo "Unable to determine upgrade device"
return 1
}
sync
- if [ "$SAVE_PARTITIONS" = "1" ]; then
+ if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
@@ -60,7 +60,7 @@ platform_do_upgrade() {
fi
if [ -n "$diff" ]; then
- get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
+ get_image "$@" | dd of="/dev/$diskdev" bs=2M conv=fsync
# Separate removal and addtion is necessary; otherwise, partition 1
# will be missing if it overlaps with the old partition 2
@@ -70,20 +70,30 @@ platform_do_upgrade() {
return 0
fi
- #write uboot image
- get_image "$@" | dd of="$diskdev" bs=1024 skip=8 seek=8 count=1016 conv=fsync
#iterate over each partition from the image and write it to the boot disk
while read part start size; do
- part="$(($part - 2))"
if export_partdevice partdev $part; then
echo "Writing image to /dev/$partdev..."
get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync
else
echo "Unable to find partition $part device, skipped."
- fi
+ fi
done < /tmp/partmap.image
#copy partition uuid
echo "Writing new UUID to /dev/$diskdev..."
get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync
}
+
+platform_copy_config() {
+ local partdev
+
+ if export_partdevice partdev 1; then
+ mkdir -p /boot
+ [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot
+ cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE"
+ tar -C / -zxvf "$UPGRADE_BACKUP" boot/config.txt
+ sync
+ unmount /boot
+ fi
+}
diff --git a/root/lib/upgrade/stage2 b/root/lib/upgrade/stage2
index bdc12c7..41a3b2a 100755
--- a/root/lib/upgrade/stage2
+++ b/root/lib/upgrade/stage2
@@ -6,24 +6,13 @@
export IMAGE="$1"
COMMAND="$2"
-export ARGV="$IMAGE"
-export ARGC=1
-
-export SAVE_CONFIG=1
-export SAVE_PARTITIONS=1
-
export INTERACTIVE=0
export VERBOSE=1
export CONFFILES=/tmp/sysupgrade.conffiles
-export CONF_TAR=/tmp/sysupgrade.tgz
RAMFS_COPY_BIN= # extra programs for temporary ramfs root
RAMFS_COPY_DATA= # extra data files
-
-[ -f "$CONF_TAR" ] || export SAVE_CONFIG=0
-[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0
-
include /lib/upgrade
@@ -59,7 +48,7 @@ switch_to_ramfs() {
local file="$(which "$binary" 2>/dev/null)"
[ -n "$file" ] && install_bin "$file"
done
- install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
+ install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh /lib/upgrade/do_stage2 /usr/share/libubox/jshn.sh $RAMFS_COPY_DATA
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
@@ -136,10 +125,7 @@ sleep 1
if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
- IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE"
-
- # Needs to be unset again because of busybox weirdness ...
- IS_PRE_UPGRADE=
+ platform_pre_upgrade "$IMAGE"
fi
if [ -n "$(rootfs_type)" ]; then
diff --git a/root/lib/wifi/mac80211.sh b/root/lib/wifi/mac80211.sh
new file mode 100644
index 0000000..511a918
--- /dev/null
+++ b/root/lib/wifi/mac80211.sh
@@ -0,0 +1,129 @@
+#!/bin/sh
+append DRIVERS "mac80211"
+
+lookup_phy() {
+ [ -n "$phy" ] && {
+ [ -d /sys/class/ieee80211/$phy ] && return
+ }
+
+ local devpath
+ config_get devpath "$device" path
+ [ -n "$devpath" ] && {
+ for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
+ case "$(readlink -f /sys/class/ieee80211/$phy/device)" in
+ *$devpath) return;;
+ esac
+ done
+ }
+
+ local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
+ [ -n "$macaddr" ] && {
+ for _phy in /sys/class/ieee80211/*; do
+ [ -e "$_phy" ] || continue
+
+ [ "$macaddr" = "$(cat ${_phy}/macaddress)" ] || continue
+ phy="${_phy##*/}"
+ return
+ done
+ }
+ phy=
+ return
+}
+
+find_mac80211_phy() {
+ local device="$1"
+
+ config_get phy "$device" phy
+ lookup_phy
+ [ -n "$phy" -a -d "/sys/class/ieee80211/$phy" ] || {
+ echo "PHY for wifi device $1 not found"
+ return 1
+ }
+ config_set "$device" phy "$phy"
+
+ config_get macaddr "$device" macaddr
+ [ -z "$macaddr" ] && {
+ config_set "$device" macaddr "$(cat /sys/class/ieee80211/${phy}/macaddress)"
+ }
+
+ return 0
+}
+
+check_mac80211_device() {
+ config_get phy "$1" phy
+ [ -z "$phy" ] && {
+ find_mac80211_phy "$1" >/dev/null || return 0
+ config_get phy "$1" phy
+ }
+ [ "$phy" = "$dev" ] && found=1
+}
+
+detect_mac80211() {
+ devidx=0
+ config_load wireless
+ while :; do
+ config_get type "radio$devidx" type
+ [ -n "$type" ] || break
+ devidx=$(($devidx + 1))
+ done
+
+ for _dev in /sys/class/ieee80211/*; do
+ [ -e "$_dev" ] || continue
+
+ dev="${_dev##*/}"
+
+ found=0
+ config_foreach check_mac80211_device wifi-device
+ [ "$found" -gt 0 ] && continue
+
+ mode_band="g"
+ channel="11"
+ htmode=""
+ ht_capab=""
+
+ iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20
+
+ iw phy "$dev" info | grep -q '5180 MHz' && {
+ mode_band="a"
+ channel="36"
+ iw phy "$dev" info | grep -q 'VHT Capabilities' && htmode="VHT80"
+ }
+
+ [ -n "$htmode" ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode"
+
+ if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then
+ path="$(readlink -f /sys/class/ieee80211/${dev}/device)"
+ else
+ path=""
+ fi
+ if [ -n "$path" ]; then
+ path="${path##/sys/devices/}"
+ case "$path" in
+ platform*/pci*) path="${path##platform/}";;
+ esac
+ dev_id="set wireless.radio${devidx}.path='$path'"
+ else
+ dev_id="set wireless.radio${devidx}.macaddr=$(cat /sys/class/ieee80211/${dev}/macaddress)"
+ fi
+
+ uci -q batch <<-EOF
+ set wireless.radio${devidx}=wifi-device
+ set wireless.radio${devidx}.type=mac80211
+ set wireless.radio${devidx}.channel=${channel}
+ set wireless.radio${devidx}.hwmode=11${mode_band}
+ ${dev_id}
+ ${ht_capab}
+ set wireless.radio${devidx}.disabled=1
+
+ set wireless.default_radio${devidx}=wifi-iface
+ set wireless.default_radio${devidx}.device=radio${devidx}
+ set wireless.default_radio${devidx}.network=lan
+ set wireless.default_radio${devidx}.mode=ap
+ set wireless.default_radio${devidx}.ssid=OpenWrt
+ set wireless.default_radio${devidx}.encryption=none
+EOF
+ uci -q commit wireless
+
+ devidx=$(($devidx + 1))
+ done
+}
diff --git a/root/sbin/askfirst b/root/sbin/askfirst
index 43ccaa0..ab77d43 100755
Binary files a/root/sbin/askfirst and b/root/sbin/askfirst differ
diff --git a/root/sbin/fw3 b/root/sbin/fw3
index ae85611..9615135 100755
Binary files a/root/sbin/fw3 and b/root/sbin/fw3 differ
diff --git a/root/sbin/init b/root/sbin/init
index 82be979..5bdfa37 100755
Binary files a/root/sbin/init and b/root/sbin/init differ
diff --git a/root/sbin/ip b/root/sbin/ip
index a3aaff7..7125971 120000
--- a/root/sbin/ip
+++ b/root/sbin/ip
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../bin/busybox
\ No newline at end of file
diff --git a/root/sbin/jffs2reset b/root/sbin/jffs2reset
index da748c4..8def885 100755
Binary files a/root/sbin/jffs2reset and b/root/sbin/jffs2reset differ
diff --git a/root/sbin/kmodloader b/root/sbin/kmodloader
index ddef2f3..62ee9ca 100755
Binary files a/root/sbin/kmodloader and b/root/sbin/kmodloader differ
diff --git a/root/sbin/logd b/root/sbin/logd
index a027758..d7ff767 100755
Binary files a/root/sbin/logd and b/root/sbin/logd differ
diff --git a/root/sbin/logread b/root/sbin/logread
index 6080c4e..f402e94 100755
Binary files a/root/sbin/logread and b/root/sbin/logread differ
diff --git a/root/sbin/mount_root b/root/sbin/mount_root
index bd93afa..983c7e9 100755
Binary files a/root/sbin/mount_root and b/root/sbin/mount_root differ
diff --git a/root/sbin/mtd b/root/sbin/mtd
index a580f6f..e824571 100755
Binary files a/root/sbin/mtd and b/root/sbin/mtd differ
diff --git a/root/sbin/netifd b/root/sbin/netifd
index 665212f..4ed5fe5 100755
Binary files a/root/sbin/netifd and b/root/sbin/netifd differ
diff --git a/root/sbin/procd b/root/sbin/procd
index 49bc483..7a86a42 100755
Binary files a/root/sbin/procd and b/root/sbin/procd differ
diff --git a/root/sbin/rpcd b/root/sbin/rpcd
index 0490807..c1d9566 100755
Binary files a/root/sbin/rpcd and b/root/sbin/rpcd differ
diff --git a/root/sbin/swapoff b/root/sbin/swapoff
new file mode 120000
index 0000000..7125971
--- /dev/null
+++ b/root/sbin/swapoff
@@ -0,0 +1 @@
+../bin/busybox
\ No newline at end of file
diff --git a/root/sbin/swapon b/root/sbin/swapon
new file mode 120000
index 0000000..7125971
--- /dev/null
+++ b/root/sbin/swapon
@@ -0,0 +1 @@
+../bin/busybox
\ No newline at end of file
diff --git a/root/sbin/sysupgrade b/root/sbin/sysupgrade
index 54d7a64..935d080 100755
--- a/root/sbin/sysupgrade
+++ b/root/sbin/sysupgrade
@@ -2,6 +2,7 @@
. /lib/functions.sh
. /lib/functions/system.sh
+. /usr/share/libubox/jshn.sh
# initialize defaults
export MTD_ARGS=""
@@ -191,9 +192,6 @@ add_overlayfiles() {
return 0
}
-# hooks
-sysupgrade_image_check="fwtool_check_signature fwtool_check_image platform_check_image"
-
if [ $SAVE_OVERLAY = 1 ]; then
[ ! -d /overlay/upper/etc ] && {
echo "Cannot find '/overlay/upper/etc', required for '-c'" >&2
@@ -316,20 +314,19 @@ case "$IMAGE" in
;;
esac
-export ARGV="$IMAGE"
-export ARGC=1
-
-for check in $sysupgrade_image_check; do
- ( $check "$IMAGE" ) || {
- if [ $FORCE -eq 1 ]; then
- echo "Image check '$check' failed but --force given - will update anyway!" >&2
- break
- else
- echo "Image check '$check' failed." >&2
- exit 1
- fi
- }
-done
+json_load "$(/usr/libexec/validate_firmware_image "$IMAGE")" || {
+ echo "Failed to check image"
+ exit 1
+}
+json_get_var valid "valid"
+[ "$valid" -eq 0 ] && {
+ if [ $FORCE -eq 1 ]; then
+ echo "Image check failed but --force given - will update anyway!" >&2
+ else
+ echo "Image check failed." >&2
+ exit 1
+ fi
+}
if [ -n "$CONF_IMAGE" ]; then
case "$(get_magic_word $CONF_IMAGE cat)" in
@@ -354,24 +351,27 @@ if [ $TEST -eq 1 ]; then
exit 0
fi
-if [ $SAVE_PARTITIONS -eq 0 ]; then
- touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap
-else
- rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
-fi
-
install_bin /sbin/upgraded
v "Commencing upgrade. Closing all shell sessions."
-COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2'
+COMMAND='/lib/upgrade/do_stage2'
if [ -n "$FAILSAFE" ]; then
printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade
lock -u /tmp/.failsafe
else
+ force_attr=""
+ [ $FORCE -eq 1 ] && force_attr="\"force\": true,"
+ backup_attr=""
+ [ $SAVE_CONFIG -eq 1 ] && backup_attr="\"backup\": $(json_string $CONF_TAR),"
ubus call system sysupgrade "{
\"prefix\": $(json_string "$RAM_ROOT"),
\"path\": $(json_string "$IMAGE"),
- \"command\": $(json_string "$COMMAND")
+ $force_attr
+ $backup_attr
+ \"command\": $(json_string "$COMMAND"),
+ \"options\": {
+ \"save_partitions\": $SAVE_PARTITIONS
+ }
}"
fi
diff --git a/root/sbin/ubusd b/root/sbin/ubusd
index aca30d7..0972ea3 100755
Binary files a/root/sbin/ubusd and b/root/sbin/ubusd differ
diff --git a/root/sbin/uci b/root/sbin/uci
index bca040b..f7bb954 100755
Binary files a/root/sbin/uci and b/root/sbin/uci differ
diff --git a/root/sbin/udevtrigger b/root/sbin/udevtrigger
index 4a1a548..718ac40 100755
Binary files a/root/sbin/udevtrigger and b/root/sbin/udevtrigger differ
diff --git a/root/sbin/upgraded b/root/sbin/upgraded
index 5283772..2b6abc8 100755
Binary files a/root/sbin/upgraded and b/root/sbin/upgraded differ
diff --git a/root/sbin/urngd b/root/sbin/urngd
new file mode 100755
index 0000000..66d8c15
Binary files /dev/null and b/root/sbin/urngd differ
diff --git a/root/sbin/validate_data b/root/sbin/validate_data
index 8b0071f..5bc0125 100755
Binary files a/root/sbin/validate_data and b/root/sbin/validate_data differ
diff --git a/root/usr/bin/aria2c b/root/usr/bin/aria2c
index ef56890..0cccc47 100755
Binary files a/root/usr/bin/aria2c and b/root/usr/bin/aria2c differ
diff --git a/root/usr/bin/attr b/root/usr/bin/attr
index a04914a..f935f8c 100755
Binary files a/root/usr/bin/attr and b/root/usr/bin/attr differ
diff --git a/root/usr/bin/dbus-cleanup-sockets b/root/usr/bin/dbus-cleanup-sockets
index 268aa17..00cae76 100755
Binary files a/root/usr/bin/dbus-cleanup-sockets and b/root/usr/bin/dbus-cleanup-sockets differ
diff --git a/root/usr/bin/dbus-daemon b/root/usr/bin/dbus-daemon
index 103b933..e6caae7 100755
Binary files a/root/usr/bin/dbus-daemon and b/root/usr/bin/dbus-daemon differ
diff --git a/root/usr/bin/dbus-launch.real b/root/usr/bin/dbus-launch.real
index 92d2eb6..f4919d4 100755
Binary files a/root/usr/bin/dbus-launch.real and b/root/usr/bin/dbus-launch.real differ
diff --git a/root/usr/bin/dbus-uuidgen b/root/usr/bin/dbus-uuidgen
index 6ae8f03..7e62e3e 100755
Binary files a/root/usr/bin/dbus-uuidgen and b/root/usr/bin/dbus-uuidgen differ
diff --git a/root/usr/bin/find b/root/usr/bin/find
index a3aaff7..f948f1a 120000
--- a/root/usr/bin/find
+++ b/root/usr/bin/find
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../../bin/busybox
\ No newline at end of file
diff --git a/root/usr/bin/flock b/root/usr/bin/flock
index a3aaff7..f948f1a 120000
--- a/root/usr/bin/flock
+++ b/root/usr/bin/flock
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../../bin/busybox
\ No newline at end of file
diff --git a/root/usr/bin/free b/root/usr/bin/free
index a3aaff7..f948f1a 120000
--- a/root/usr/bin/free
+++ b/root/usr/bin/free
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../../bin/busybox
\ No newline at end of file
diff --git a/root/usr/bin/fwtool b/root/usr/bin/fwtool
index 27bea36..e884d51 100755
Binary files a/root/usr/bin/fwtool and b/root/usr/bin/fwtool differ
diff --git a/root/usr/bin/getfattr b/root/usr/bin/getfattr
index a6ac02f..754aea4 100755
Binary files a/root/usr/bin/getfattr and b/root/usr/bin/getfattr differ
diff --git a/root/usr/bin/getrandom b/root/usr/bin/getrandom
index f21fcff..8f1368a 100755
Binary files a/root/usr/bin/getrandom and b/root/usr/bin/getrandom differ
diff --git a/root/usr/bin/iwinfo b/root/usr/bin/iwinfo
new file mode 100755
index 0000000..881173b
Binary files /dev/null and b/root/usr/bin/iwinfo differ
diff --git a/root/usr/bin/jshn b/root/usr/bin/jshn
index b33e43c..148336b 100755
Binary files a/root/usr/bin/jshn and b/root/usr/bin/jshn differ
diff --git a/root/usr/bin/jsonfilter b/root/usr/bin/jsonfilter
index 3011f60..ddfe564 100755
Binary files a/root/usr/bin/jsonfilter and b/root/usr/bin/jsonfilter differ
diff --git a/root/usr/bin/lua b/root/usr/bin/lua
index 384a7e6..f674871 100755
Binary files a/root/usr/bin/lua and b/root/usr/bin/lua differ
diff --git a/root/usr/bin/luci-bwc b/root/usr/bin/luci-bwc
index 5360daf..c3ba237 100755
Binary files a/root/usr/bin/luci-bwc and b/root/usr/bin/luci-bwc differ
diff --git a/root/usr/bin/minidlna b/root/usr/bin/minidlna
index f3651dd..8e1d366 100755
Binary files a/root/usr/bin/minidlna and b/root/usr/bin/minidlna differ
diff --git a/root/usr/bin/pdbedit b/root/usr/bin/pdbedit
index 40fe555..b97ea82 100755
Binary files a/root/usr/bin/pdbedit and b/root/usr/bin/pdbedit differ
diff --git a/root/usr/bin/pgrep b/root/usr/bin/pgrep
index a3aaff7..f948f1a 120000
--- a/root/usr/bin/pgrep
+++ b/root/usr/bin/pgrep
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../../bin/busybox
\ No newline at end of file
diff --git a/root/usr/bin/rpcinfo b/root/usr/bin/rpcinfo
index 7cd23e2..9df55a5 100755
Binary files a/root/usr/bin/rpcinfo and b/root/usr/bin/rpcinfo differ
diff --git a/root/usr/bin/setfattr b/root/usr/bin/setfattr
index 58017b7..d7da932 100755
Binary files a/root/usr/bin/setfattr and b/root/usr/bin/setfattr differ
diff --git a/root/usr/bin/smbpasswd b/root/usr/bin/smbpasswd
index 6dc2a15..01399c6 100755
Binary files a/root/usr/bin/smbpasswd and b/root/usr/bin/smbpasswd differ
diff --git a/root/usr/bin/testparm b/root/usr/bin/testparm
index d4eb646..88b666c 100755
Binary files a/root/usr/bin/testparm and b/root/usr/bin/testparm differ
diff --git a/root/usr/bin/top b/root/usr/bin/top
index a3aaff7..f948f1a 120000
--- a/root/usr/bin/top
+++ b/root/usr/bin/top
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../../bin/busybox
\ No newline at end of file
diff --git a/root/usr/bin/transmission-daemon b/root/usr/bin/transmission-daemon
index f166235..7d3ac9a 100755
Binary files a/root/usr/bin/transmission-daemon and b/root/usr/bin/transmission-daemon differ
diff --git a/root/usr/bin/uptime b/root/usr/bin/uptime
index a3aaff7..f948f1a 120000
--- a/root/usr/bin/uptime
+++ b/root/usr/bin/uptime
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../../bin/busybox
\ No newline at end of file
diff --git a/root/usr/bin/usign b/root/usr/bin/usign
index 05d0916..918c179 100755
Binary files a/root/usr/bin/usign and b/root/usr/bin/usign differ
diff --git a/root/usr/bin/wget b/root/usr/bin/wget
index 2eaf7ec..e98e5f5 120000
--- a/root/usr/bin/wget
+++ b/root/usr/bin/wget
@@ -1 +1 @@
-/usr/bin/wget-ssl
\ No newline at end of file
+/bin/uclient-fetch
\ No newline at end of file
diff --git a/root/usr/bin/wget-ssl b/root/usr/bin/wget-ssl
index 934c0fa..002ba9d 100755
Binary files a/root/usr/bin/wget-ssl and b/root/usr/bin/wget-ssl differ
diff --git a/root/usr/bin/xargs b/root/usr/bin/xargs
index a3aaff7..f948f1a 120000
--- a/root/usr/bin/xargs
+++ b/root/usr/bin/xargs
@@ -1 +1 @@
-/bin/busybox
\ No newline at end of file
+../../bin/busybox
\ No newline at end of file
diff --git a/root/usr/lib/dbus-daemon-launch-helper b/root/usr/lib/dbus-daemon-launch-helper
index e9f68ca..8c0f741 100755
Binary files a/root/usr/lib/dbus-daemon-launch-helper and b/root/usr/lib/dbus-daemon-launch-helper differ
diff --git a/root/usr/lib/libCHARSET3-samba4.so b/root/usr/lib/libCHARSET3-samba4.so
index 62d0bf3..d849c05 100755
Binary files a/root/usr/lib/libCHARSET3-samba4.so and b/root/usr/lib/libCHARSET3-samba4.so differ
diff --git a/root/usr/lib/libFLAC.so.8.3.0 b/root/usr/lib/libFLAC.so.8.3.0
index ab875c9..827b755 100755
Binary files a/root/usr/lib/libFLAC.so.8.3.0 and b/root/usr/lib/libFLAC.so.8.3.0 differ
diff --git a/root/usr/lib/libMESSAGING-SEND-samba4.so b/root/usr/lib/libMESSAGING-SEND-samba4.so
index c91c1fe..af3309b 100755
Binary files a/root/usr/lib/libMESSAGING-SEND-samba4.so and b/root/usr/lib/libMESSAGING-SEND-samba4.so differ
diff --git a/root/usr/lib/libaddns-samba4.so b/root/usr/lib/libaddns-samba4.so
index 38185ad..4c8115e 100755
Binary files a/root/usr/lib/libaddns-samba4.so and b/root/usr/lib/libaddns-samba4.so differ
diff --git a/root/usr/lib/libads-samba4.so b/root/usr/lib/libads-samba4.so
index 2251114..7ac464e 100755
Binary files a/root/usr/lib/libads-samba4.so and b/root/usr/lib/libads-samba4.so differ
diff --git a/root/usr/lib/libasn1-samba4.so.8 b/root/usr/lib/libasn1-samba4.so.8
new file mode 120000
index 0000000..19e63d5
--- /dev/null
+++ b/root/usr/lib/libasn1-samba4.so.8
@@ -0,0 +1 @@
+libasn1-samba4.so.8.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libasn1-samba4.so.8.0.0 b/root/usr/lib/libasn1-samba4.so.8.0.0
new file mode 100755
index 0000000..c5b3bd2
Binary files /dev/null and b/root/usr/lib/libasn1-samba4.so.8.0.0 differ
diff --git a/root/usr/lib/libasn1util-samba4.so b/root/usr/lib/libasn1util-samba4.so
index 1e78f8f..54bc319 100755
Binary files a/root/usr/lib/libasn1util-samba4.so and b/root/usr/lib/libasn1util-samba4.so differ
diff --git a/root/usr/lib/libauth-samba4.so b/root/usr/lib/libauth-samba4.so
index 15bdd94..ff5b952 100755
Binary files a/root/usr/lib/libauth-samba4.so and b/root/usr/lib/libauth-samba4.so differ
diff --git a/root/usr/lib/libauthkrb5-samba4.so b/root/usr/lib/libauthkrb5-samba4.so
index 3f1ef40..29278e4 100755
Binary files a/root/usr/lib/libauthkrb5-samba4.so and b/root/usr/lib/libauthkrb5-samba4.so differ
diff --git a/root/usr/lib/libavahi-core.so.7.0.2 b/root/usr/lib/libavahi-core.so.7.0.2
index fb5eaf0..d6035dc 100755
Binary files a/root/usr/lib/libavahi-core.so.7.0.2 and b/root/usr/lib/libavahi-core.so.7.0.2 differ
diff --git a/root/usr/lib/libavcodec.so.57.107.100 b/root/usr/lib/libavcodec.so.57.107.100
index 4a897d2..f4c8eaf 100755
Binary files a/root/usr/lib/libavcodec.so.57.107.100 and b/root/usr/lib/libavcodec.so.57.107.100 differ
diff --git a/root/usr/lib/libavcodec.so.57.64.101 b/root/usr/lib/libavcodec.so.57.64.101
new file mode 100755
index 0000000..d338cdf
Binary files /dev/null and b/root/usr/lib/libavcodec.so.57.64.101 differ
diff --git a/root/usr/lib/libavformat.so.57.56.101 b/root/usr/lib/libavformat.so.57.56.101
new file mode 100755
index 0000000..0eecbae
Binary files /dev/null and b/root/usr/lib/libavformat.so.57.56.101 differ
diff --git a/root/usr/lib/libavformat.so.57.83.100 b/root/usr/lib/libavformat.so.57.83.100
index a233276..022fa4a 100755
Binary files a/root/usr/lib/libavformat.so.57.83.100 and b/root/usr/lib/libavformat.so.57.83.100 differ
diff --git a/root/usr/lib/libavutil.so.55.34.101 b/root/usr/lib/libavutil.so.55.34.101
new file mode 100755
index 0000000..f854915
Binary files /dev/null and b/root/usr/lib/libavutil.so.55.34.101 differ
diff --git a/root/usr/lib/libavutil.so.55.78.100 b/root/usr/lib/libavutil.so.55.78.100
index ae38c23..48b1572 100755
Binary files a/root/usr/lib/libavutil.so.55.78.100 and b/root/usr/lib/libavutil.so.55.78.100 differ
diff --git a/root/usr/lib/libblkid.so.1.1.0 b/root/usr/lib/libblkid.so.1.1.0
index 8d06a39..02c2fa7 100755
Binary files a/root/usr/lib/libblkid.so.1.1.0 and b/root/usr/lib/libblkid.so.1.1.0 differ
diff --git a/root/usr/lib/libbz2.so.1.0 b/root/usr/lib/libbz2.so.1.0
index 6d4aa98..5ffafa0 120000
--- a/root/usr/lib/libbz2.so.1.0
+++ b/root/usr/lib/libbz2.so.1.0
@@ -1 +1 @@
-libbz2.so.1.0.6
\ No newline at end of file
+libbz2.so.1.0.8
\ No newline at end of file
diff --git a/root/usr/lib/libbz2.so.1.0.6 b/root/usr/lib/libbz2.so.1.0.6
index 8b47c66..173a8a6 100755
Binary files a/root/usr/lib/libbz2.so.1.0.6 and b/root/usr/lib/libbz2.so.1.0.6 differ
diff --git a/root/usr/lib/libbz2.so.1.0.8 b/root/usr/lib/libbz2.so.1.0.8
new file mode 100755
index 0000000..4eb931f
Binary files /dev/null and b/root/usr/lib/libbz2.so.1.0.8 differ
diff --git a/root/usr/lib/libcap.so.2 b/root/usr/lib/libcap.so.2
index 6e3466e..3e20508 120000
--- a/root/usr/lib/libcap.so.2
+++ b/root/usr/lib/libcap.so.2
@@ -1 +1 @@
-libcap.so.2.26
\ No newline at end of file
+libcap.so.2.27
\ No newline at end of file
diff --git a/root/usr/lib/libcap.so.2.27 b/root/usr/lib/libcap.so.2.27
new file mode 100644
index 0000000..1b7972e
Binary files /dev/null and b/root/usr/lib/libcap.so.2.27 differ
diff --git a/root/usr/lib/libcli-cldap-samba4.so b/root/usr/lib/libcli-cldap-samba4.so
index 3cc07b8..af6e905 100755
Binary files a/root/usr/lib/libcli-cldap-samba4.so and b/root/usr/lib/libcli-cldap-samba4.so differ
diff --git a/root/usr/lib/libcli-ldap-common-samba4.so b/root/usr/lib/libcli-ldap-common-samba4.so
index 3c0334f..3921fc1 100755
Binary files a/root/usr/lib/libcli-ldap-common-samba4.so and b/root/usr/lib/libcli-ldap-common-samba4.so differ
diff --git a/root/usr/lib/libcli-ldap-samba4.so b/root/usr/lib/libcli-ldap-samba4.so
index 1ca0465..c1fe8bd 100755
Binary files a/root/usr/lib/libcli-ldap-samba4.so and b/root/usr/lib/libcli-ldap-samba4.so differ
diff --git a/root/usr/lib/libcli-nbt-samba4.so b/root/usr/lib/libcli-nbt-samba4.so
index 0ab4754..67c5d8f 100755
Binary files a/root/usr/lib/libcli-nbt-samba4.so and b/root/usr/lib/libcli-nbt-samba4.so differ
diff --git a/root/usr/lib/libcli-smb-common-samba4.so b/root/usr/lib/libcli-smb-common-samba4.so
index 7a5bc0b..2138f6a 100755
Binary files a/root/usr/lib/libcli-smb-common-samba4.so and b/root/usr/lib/libcli-smb-common-samba4.so differ
diff --git a/root/usr/lib/libcli-spoolss-samba4.so b/root/usr/lib/libcli-spoolss-samba4.so
index 45d4a3d..c89cdc0 100755
Binary files a/root/usr/lib/libcli-spoolss-samba4.so and b/root/usr/lib/libcli-spoolss-samba4.so differ
diff --git a/root/usr/lib/libcliauth-samba4.so b/root/usr/lib/libcliauth-samba4.so
index d65256b..b5228e6 100755
Binary files a/root/usr/lib/libcliauth-samba4.so and b/root/usr/lib/libcliauth-samba4.so differ
diff --git a/root/usr/lib/libcluster-samba4.so b/root/usr/lib/libcluster-samba4.so
index 8009385..9828a20 100755
Binary files a/root/usr/lib/libcluster-samba4.so and b/root/usr/lib/libcluster-samba4.so differ
diff --git a/root/usr/lib/libcmdline-contexts-samba4.so b/root/usr/lib/libcmdline-contexts-samba4.so
index db69d55..bea31d1 100755
Binary files a/root/usr/lib/libcmdline-contexts-samba4.so and b/root/usr/lib/libcmdline-contexts-samba4.so differ
diff --git a/root/usr/lib/libcmdline-credentials-samba4.so b/root/usr/lib/libcmdline-credentials-samba4.so
index e9215da..79ff958 100755
Binary files a/root/usr/lib/libcmdline-credentials-samba4.so and b/root/usr/lib/libcmdline-credentials-samba4.so differ
diff --git a/root/usr/lib/libcom_err.so.0.0 b/root/usr/lib/libcom_err.so.0.0
index 3b8f593..38e0e40 100755
Binary files a/root/usr/lib/libcom_err.so.0.0 and b/root/usr/lib/libcom_err.so.0.0 differ
diff --git a/root/usr/lib/libcommon-auth-samba4.so b/root/usr/lib/libcommon-auth-samba4.so
index 8761ac6..3730dba 100755
Binary files a/root/usr/lib/libcommon-auth-samba4.so and b/root/usr/lib/libcommon-auth-samba4.so differ
diff --git a/root/usr/lib/libcrypto.so.1.0.0 b/root/usr/lib/libcrypto.so.1.0.0
new file mode 100644
index 0000000..f9f28cc
Binary files /dev/null and b/root/usr/lib/libcrypto.so.1.0.0 differ
diff --git a/root/usr/lib/libcrypto.so.1.1 b/root/usr/lib/libcrypto.so.1.1
index 9c99fed..49ead27 100644
Binary files a/root/usr/lib/libcrypto.so.1.1 and b/root/usr/lib/libcrypto.so.1.1 differ
diff --git a/root/usr/lib/libcurl.so.4 b/root/usr/lib/libcurl.so.4
index a5e8ad8..753de06 120000
--- a/root/usr/lib/libcurl.so.4
+++ b/root/usr/lib/libcurl.so.4
@@ -1 +1 @@
-libcurl.so.4.5.0
\ No newline at end of file
+libcurl.so.4.6.0
\ No newline at end of file
diff --git a/root/usr/lib/libcurl.so.4.5.0 b/root/usr/lib/libcurl.so.4.5.0
index 634598b..fec4750 100755
Binary files a/root/usr/lib/libcurl.so.4.5.0 and b/root/usr/lib/libcurl.so.4.5.0 differ
diff --git a/root/usr/lib/libcurl.so.4.6.0 b/root/usr/lib/libcurl.so.4.6.0
new file mode 100755
index 0000000..235d2c5
Binary files /dev/null and b/root/usr/lib/libcurl.so.4.6.0 differ
diff --git a/root/usr/lib/libdaemon.so.0.5.0 b/root/usr/lib/libdaemon.so.0.5.0
index 1883143..fa6583e 100755
Binary files a/root/usr/lib/libdaemon.so.0.5.0 and b/root/usr/lib/libdaemon.so.0.5.0 differ
diff --git a/root/usr/lib/libdbus-1.so.3.19.9 b/root/usr/lib/libdbus-1.so.3.19.9
index 8a9782b..94a60e1 100755
Binary files a/root/usr/lib/libdbus-1.so.3.19.9 and b/root/usr/lib/libdbus-1.so.3.19.9 differ
diff --git a/root/usr/lib/libdbwrap-samba4.so b/root/usr/lib/libdbwrap-samba4.so
index 3f66c15..3c6869e 100755
Binary files a/root/usr/lib/libdbwrap-samba4.so and b/root/usr/lib/libdbwrap-samba4.so differ
diff --git a/root/usr/lib/libdcerpc-binding.so.0.0.1 b/root/usr/lib/libdcerpc-binding.so.0.0.1
index fb328a3..82d4117 100755
Binary files a/root/usr/lib/libdcerpc-binding.so.0.0.1 and b/root/usr/lib/libdcerpc-binding.so.0.0.1 differ
diff --git a/root/usr/lib/libdcerpc-samba-samba4.so b/root/usr/lib/libdcerpc-samba-samba4.so
index 6e5e582..22937a2 100755
Binary files a/root/usr/lib/libdcerpc-samba-samba4.so and b/root/usr/lib/libdcerpc-samba-samba4.so differ
diff --git a/root/usr/lib/libdevmapper.so.1.02 b/root/usr/lib/libdevmapper.so.1.02
old mode 100644
new mode 100755
index 4f3e8ad..5d9eb99
Binary files a/root/usr/lib/libdevmapper.so.1.02 and b/root/usr/lib/libdevmapper.so.1.02 differ
diff --git a/root/usr/lib/libe2p.so.2.3 b/root/usr/lib/libe2p.so.2.3
index 0703cb6..18ad540 100755
Binary files a/root/usr/lib/libe2p.so.2.3 and b/root/usr/lib/libe2p.so.2.3 differ
diff --git a/root/usr/lib/libevent-2.0.so.5 b/root/usr/lib/libevent-2.0.so.5
new file mode 120000
index 0000000..d2e369a
--- /dev/null
+++ b/root/usr/lib/libevent-2.0.so.5
@@ -0,0 +1 @@
+libevent-2.0.so.5.1.10
\ No newline at end of file
diff --git a/root/usr/lib/libevent-2.0.so.5.1.10 b/root/usr/lib/libevent-2.0.so.5.1.10
new file mode 100755
index 0000000..64756e5
Binary files /dev/null and b/root/usr/lib/libevent-2.0.so.5.1.10 differ
diff --git a/root/usr/lib/libevent-2.1.so.7 b/root/usr/lib/libevent-2.1.so.7
new file mode 120000
index 0000000..ec2bd64
--- /dev/null
+++ b/root/usr/lib/libevent-2.1.so.7
@@ -0,0 +1 @@
+libevent-2.1.so.7.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libevent-2.1.so.7.0.0 b/root/usr/lib/libevent-2.1.so.7.0.0
new file mode 100644
index 0000000..111f772
Binary files /dev/null and b/root/usr/lib/libevent-2.1.so.7.0.0 differ
diff --git a/root/usr/lib/libevents-samba4.so b/root/usr/lib/libevents-samba4.so
index a2cf338..ec8b9f5 100755
Binary files a/root/usr/lib/libevents-samba4.so and b/root/usr/lib/libevents-samba4.so differ
diff --git a/root/usr/lib/libexif.so.12.3.3 b/root/usr/lib/libexif.so.12.3.3
index 916042a..1aa88ba 100755
Binary files a/root/usr/lib/libexif.so.12.3.3 and b/root/usr/lib/libexif.so.12.3.3 differ
diff --git a/root/usr/lib/libexpat.so.1 b/root/usr/lib/libexpat.so.1
index 98b2541..470c482 120000
--- a/root/usr/lib/libexpat.so.1
+++ b/root/usr/lib/libexpat.so.1
@@ -1 +1 @@
-libexpat.so.1.6.8
\ No newline at end of file
+libexpat.so.1.6.9
\ No newline at end of file
diff --git a/root/usr/lib/libexpat.so.1.6.11 b/root/usr/lib/libexpat.so.1.6.11
new file mode 100755
index 0000000..2ee1ae9
Binary files /dev/null and b/root/usr/lib/libexpat.so.1.6.11 differ
diff --git a/root/usr/lib/libexpat.so.1.6.8 b/root/usr/lib/libexpat.so.1.6.9
similarity index 54%
rename from root/usr/lib/libexpat.so.1.6.8
rename to root/usr/lib/libexpat.so.1.6.9
index bbae90d..7060779 100755
Binary files a/root/usr/lib/libexpat.so.1.6.8 and b/root/usr/lib/libexpat.so.1.6.9 differ
diff --git a/root/usr/lib/libext2fs.so.2.4 b/root/usr/lib/libext2fs.so.2.4
index 51f5a8a..0024a1f 100755
Binary files a/root/usr/lib/libext2fs.so.2.4 and b/root/usr/lib/libext2fs.so.2.4 differ
diff --git a/root/usr/lib/libf2fs.so.6.0.0 b/root/usr/lib/libf2fs.so.6.0.0
index 453403e..3a50cfc 100755
Binary files a/root/usr/lib/libf2fs.so.6.0.0 and b/root/usr/lib/libf2fs.so.6.0.0 differ
diff --git a/root/usr/lib/libflag-mapping-samba4.so b/root/usr/lib/libflag-mapping-samba4.so
index cae04c3..ba34fe5 100755
Binary files a/root/usr/lib/libflag-mapping-samba4.so and b/root/usr/lib/libflag-mapping-samba4.so differ
diff --git a/root/usr/lib/libformw.so.6.1 b/root/usr/lib/libformw.so.6.1
index 89a3a78..54f0910 100755
Binary files a/root/usr/lib/libformw.so.6.1 and b/root/usr/lib/libformw.so.6.1 differ
diff --git a/root/usr/lib/libgcrypt.so.20 b/root/usr/lib/libgcrypt.so.20
index d89f6a3..1869e03 120000
--- a/root/usr/lib/libgcrypt.so.20
+++ b/root/usr/lib/libgcrypt.so.20
@@ -1 +1 @@
-libgcrypt.so.20.2.4
\ No newline at end of file
+libgcrypt.so.20.2.5
\ No newline at end of file
diff --git a/root/usr/lib/libgcrypt.so.20.2.5 b/root/usr/lib/libgcrypt.so.20.2.5
new file mode 100755
index 0000000..7cee741
Binary files /dev/null and b/root/usr/lib/libgcrypt.so.20.2.5 differ
diff --git a/root/usr/lib/libgenrand-samba4.so b/root/usr/lib/libgenrand-samba4.so
index 5831b88..3437fb5 100755
Binary files a/root/usr/lib/libgenrand-samba4.so and b/root/usr/lib/libgenrand-samba4.so differ
diff --git a/root/usr/lib/libgensec-samba4.so b/root/usr/lib/libgensec-samba4.so
index 74df918..32f0123 100755
Binary files a/root/usr/lib/libgensec-samba4.so and b/root/usr/lib/libgensec-samba4.so differ
diff --git a/root/usr/lib/libgmp.so.10.3.2 b/root/usr/lib/libgmp.so.10.3.2
index 531e869..38d4c88 100755
Binary files a/root/usr/lib/libgmp.so.10.3.2 and b/root/usr/lib/libgmp.so.10.3.2 differ
diff --git a/root/usr/lib/libgpext-samba4.so b/root/usr/lib/libgpext-samba4.so
index eb2d9b8..ffe1377 100755
Binary files a/root/usr/lib/libgpext-samba4.so and b/root/usr/lib/libgpext-samba4.so differ
diff --git a/root/usr/lib/libgpg-error.so.0 b/root/usr/lib/libgpg-error.so.0
index d042b01..7645e03 120000
--- a/root/usr/lib/libgpg-error.so.0
+++ b/root/usr/lib/libgpg-error.so.0
@@ -1 +1 @@
-libgpg-error.so.0.26.0
\ No newline at end of file
+libgpg-error.so.0.27.0
\ No newline at end of file
diff --git a/root/usr/lib/libgpg-error.so.0.27.0 b/root/usr/lib/libgpg-error.so.0.27.0
new file mode 100755
index 0000000..2a6d2fe
Binary files /dev/null and b/root/usr/lib/libgpg-error.so.0.27.0 differ
diff --git a/root/usr/lib/libgse-samba4.so b/root/usr/lib/libgse-samba4.so
index ddad112..763c326 100755
Binary files a/root/usr/lib/libgse-samba4.so and b/root/usr/lib/libgse-samba4.so differ
diff --git a/root/usr/lib/libgssapi-samba4.so.2 b/root/usr/lib/libgssapi-samba4.so.2
new file mode 120000
index 0000000..2a4409e
--- /dev/null
+++ b/root/usr/lib/libgssapi-samba4.so.2
@@ -0,0 +1 @@
+libgssapi-samba4.so.2.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libgssapi-samba4.so.2.0.0 b/root/usr/lib/libgssapi-samba4.so.2.0.0
new file mode 100755
index 0000000..ebc0d85
Binary files /dev/null and b/root/usr/lib/libgssapi-samba4.so.2.0.0 differ
diff --git a/root/usr/lib/libhcrypto-samba4.so.5 b/root/usr/lib/libhcrypto-samba4.so.5
new file mode 120000
index 0000000..a8e09ea
--- /dev/null
+++ b/root/usr/lib/libhcrypto-samba4.so.5
@@ -0,0 +1 @@
+libhcrypto-samba4.so.5.0.1
\ No newline at end of file
diff --git a/root/usr/lib/libhcrypto-samba4.so.5.0.1 b/root/usr/lib/libhcrypto-samba4.so.5.0.1
new file mode 100755
index 0000000..cff2053
Binary files /dev/null and b/root/usr/lib/libhcrypto-samba4.so.5.0.1 differ
diff --git a/root/usr/lib/libheimbase-samba4.so.1 b/root/usr/lib/libheimbase-samba4.so.1
new file mode 120000
index 0000000..c285c6f
--- /dev/null
+++ b/root/usr/lib/libheimbase-samba4.so.1
@@ -0,0 +1 @@
+libheimbase-samba4.so.1.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libheimbase-samba4.so.1.0.0 b/root/usr/lib/libheimbase-samba4.so.1.0.0
new file mode 100755
index 0000000..e7cc86d
Binary files /dev/null and b/root/usr/lib/libheimbase-samba4.so.1.0.0 differ
diff --git a/root/usr/lib/libhistory.so.8.0 b/root/usr/lib/libhistory.so.8.0
index 95a00ce..d6063ab 100755
Binary files a/root/usr/lib/libhistory.so.8.0 and b/root/usr/lib/libhistory.so.8.0 differ
diff --git a/root/usr/lib/libhogweed.so.5 b/root/usr/lib/libhogweed.so.5
new file mode 120000
index 0000000..57643c6
--- /dev/null
+++ b/root/usr/lib/libhogweed.so.5
@@ -0,0 +1 @@
+libhogweed.so.5.0
\ No newline at end of file
diff --git a/root/usr/lib/libhogweed.so.5.0 b/root/usr/lib/libhogweed.so.5.0
new file mode 100644
index 0000000..a778f60
Binary files /dev/null and b/root/usr/lib/libhogweed.so.5.0 differ
diff --git a/root/usr/lib/libhx509-samba4.so.5 b/root/usr/lib/libhx509-samba4.so.5
new file mode 120000
index 0000000..c99d9da
--- /dev/null
+++ b/root/usr/lib/libhx509-samba4.so.5
@@ -0,0 +1 @@
+libhx509-samba4.so.5.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libhx509-samba4.so.5.0.0 b/root/usr/lib/libhx509-samba4.so.5.0.0
new file mode 100755
index 0000000..857ff5e
Binary files /dev/null and b/root/usr/lib/libhx509-samba4.so.5.0.0 differ
diff --git a/root/usr/lib/libinterfaces-samba4.so b/root/usr/lib/libinterfaces-samba4.so
index 6368aae..76f40fb 100755
Binary files a/root/usr/lib/libinterfaces-samba4.so and b/root/usr/lib/libinterfaces-samba4.so differ
diff --git a/root/usr/lib/libiov-buf-samba4.so b/root/usr/lib/libiov-buf-samba4.so
index e0373f4..c0f50d5 100755
Binary files a/root/usr/lib/libiov-buf-samba4.so and b/root/usr/lib/libiov-buf-samba4.so differ
diff --git a/root/usr/lib/libip4tc.so.0 b/root/usr/lib/libip4tc.so.0
deleted file mode 120000
index 29570ee..0000000
--- a/root/usr/lib/libip4tc.so.0
+++ /dev/null
@@ -1 +0,0 @@
-libip4tc.so.0.1.0
\ No newline at end of file
diff --git a/root/usr/lib/libip4tc.so.0.1.0 b/root/usr/lib/libip4tc.so.0.1.0
deleted file mode 100755
index 8e10f01..0000000
Binary files a/root/usr/lib/libip4tc.so.0.1.0 and /dev/null differ
diff --git a/root/usr/lib/libip4tc.so.2 b/root/usr/lib/libip4tc.so.2
new file mode 120000
index 0000000..58617b5
--- /dev/null
+++ b/root/usr/lib/libip4tc.so.2
@@ -0,0 +1 @@
+libip4tc.so.2.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libip4tc.so.2.0.0 b/root/usr/lib/libip4tc.so.2.0.0
new file mode 100755
index 0000000..f4add4c
Binary files /dev/null and b/root/usr/lib/libip4tc.so.2.0.0 differ
diff --git a/root/usr/lib/libip6tc.so.0 b/root/usr/lib/libip6tc.so.0
deleted file mode 120000
index 936c4b6..0000000
--- a/root/usr/lib/libip6tc.so.0
+++ /dev/null
@@ -1 +0,0 @@
-libip6tc.so.0.1.0
\ No newline at end of file
diff --git a/root/usr/lib/libip6tc.so.0.1.0 b/root/usr/lib/libip6tc.so.0.1.0
deleted file mode 100755
index c9552a0..0000000
Binary files a/root/usr/lib/libip6tc.so.0.1.0 and /dev/null differ
diff --git a/root/usr/lib/libip6tc.so.2 b/root/usr/lib/libip6tc.so.2
new file mode 120000
index 0000000..4a42f6f
--- /dev/null
+++ b/root/usr/lib/libip6tc.so.2
@@ -0,0 +1 @@
+libip6tc.so.2.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libip6tc.so.2.0.0 b/root/usr/lib/libip6tc.so.2.0.0
new file mode 100755
index 0000000..bf87fc2
Binary files /dev/null and b/root/usr/lib/libip6tc.so.2.0.0 differ
diff --git a/root/usr/lib/libiptext.so b/root/usr/lib/libiptext.so
index 10e627d..3659aec 100755
Binary files a/root/usr/lib/libiptext.so and b/root/usr/lib/libiptext.so differ
diff --git a/root/usr/lib/libiptext4.so b/root/usr/lib/libiptext4.so
index c6a1279..66eef54 100755
Binary files a/root/usr/lib/libiptext4.so and b/root/usr/lib/libiptext4.so differ
diff --git a/root/usr/lib/libiptext6.so b/root/usr/lib/libiptext6.so
index f4e29ca..e2cff82 100755
Binary files a/root/usr/lib/libiptext6.so and b/root/usr/lib/libiptext6.so differ
diff --git a/root/usr/lib/libiwinfo.so b/root/usr/lib/libiwinfo.so
index 60997b1..cd9177f 100755
Binary files a/root/usr/lib/libiwinfo.so and b/root/usr/lib/libiwinfo.so differ
diff --git a/root/usr/lib/libjpeg.so.9.1.0 b/root/usr/lib/libjpeg.so.9.1.0
new file mode 100755
index 0000000..42ecd99
Binary files /dev/null and b/root/usr/lib/libjpeg.so.9.1.0 differ
diff --git a/root/usr/lib/libjpeg.so.9.3.0 b/root/usr/lib/libjpeg.so.9.3.0
index 2715b45..687cbdf 100755
Binary files a/root/usr/lib/libjpeg.so.9.3.0 and b/root/usr/lib/libjpeg.so.9.3.0 differ
diff --git a/root/usr/lib/libjson-c.so.2.0.2 b/root/usr/lib/libjson-c.so.2.0.2
index f627100..f831542 100755
Binary files a/root/usr/lib/libjson-c.so.2.0.2 and b/root/usr/lib/libjson-c.so.2.0.2 differ
diff --git a/root/usr/lib/libkeyutils.so.1.8 b/root/usr/lib/libkeyutils.so.1.8
index e47e481..6f68789 100755
Binary files a/root/usr/lib/libkeyutils.so.1.8 and b/root/usr/lib/libkeyutils.so.1.8 differ
diff --git a/root/usr/lib/libkrb5-samba4.so.26 b/root/usr/lib/libkrb5-samba4.so.26
new file mode 120000
index 0000000..bdb01b9
--- /dev/null
+++ b/root/usr/lib/libkrb5-samba4.so.26
@@ -0,0 +1 @@
+libkrb5-samba4.so.26.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libkrb5-samba4.so.26.0.0 b/root/usr/lib/libkrb5-samba4.so.26.0.0
new file mode 100755
index 0000000..5a7e7b8
Binary files /dev/null and b/root/usr/lib/libkrb5-samba4.so.26.0.0 differ
diff --git a/root/usr/lib/libkrb5samba-samba4.so b/root/usr/lib/libkrb5samba-samba4.so
index 4420570..cc7539f 100755
Binary files a/root/usr/lib/libkrb5samba-samba4.so and b/root/usr/lib/libkrb5samba-samba4.so differ
diff --git a/root/usr/lib/libldbsamba-samba4.so b/root/usr/lib/libldbsamba-samba4.so
index d92c3a6..7895842 100755
Binary files a/root/usr/lib/libldbsamba-samba4.so and b/root/usr/lib/libldbsamba-samba4.so differ
diff --git a/root/usr/lib/liblibcli-lsa3-samba4.so b/root/usr/lib/liblibcli-lsa3-samba4.so
index 5e67b97..d86c349 100755
Binary files a/root/usr/lib/liblibcli-lsa3-samba4.so and b/root/usr/lib/liblibcli-lsa3-samba4.so differ
diff --git a/root/usr/lib/liblibcli-netlogon3-samba4.so b/root/usr/lib/liblibcli-netlogon3-samba4.so
index 58f5a7a..8154135 100755
Binary files a/root/usr/lib/liblibcli-netlogon3-samba4.so and b/root/usr/lib/liblibcli-netlogon3-samba4.so differ
diff --git a/root/usr/lib/liblibsmb-samba4.so b/root/usr/lib/liblibsmb-samba4.so
index ecf98a2..cf4f805 100755
Binary files a/root/usr/lib/liblibsmb-samba4.so and b/root/usr/lib/liblibsmb-samba4.so differ
diff --git a/root/usr/lib/liblua.so.5.1.5 b/root/usr/lib/liblua.so.5.1.5
index f406cc9..65b0188 100644
Binary files a/root/usr/lib/liblua.so.5.1.5 and b/root/usr/lib/liblua.so.5.1.5 differ
diff --git a/root/usr/lib/liblucihttp.so.0.1 b/root/usr/lib/liblucihttp.so.0.1
index 62b47bb..170555c 100644
Binary files a/root/usr/lib/liblucihttp.so.0.1 and b/root/usr/lib/liblucihttp.so.0.1 differ
diff --git a/root/usr/lib/libmbedcrypto.so b/root/usr/lib/libmbedcrypto.so
new file mode 120000
index 0000000..c1ed9ff
--- /dev/null
+++ b/root/usr/lib/libmbedcrypto.so
@@ -0,0 +1 @@
+libmbedcrypto.so.1
\ No newline at end of file
diff --git a/root/usr/lib/libmbedcrypto.so.1 b/root/usr/lib/libmbedcrypto.so.1
new file mode 120000
index 0000000..5d99c2b
--- /dev/null
+++ b/root/usr/lib/libmbedcrypto.so.1
@@ -0,0 +1 @@
+libmbedcrypto.so.2.12.0
\ No newline at end of file
diff --git a/root/usr/lib/libmbedcrypto.so.2.12.0 b/root/usr/lib/libmbedcrypto.so.2.12.0
new file mode 100755
index 0000000..5c6eced
Binary files /dev/null and b/root/usr/lib/libmbedcrypto.so.2.12.0 differ
diff --git a/root/usr/lib/libmbedcrypto.so.2.16.3 b/root/usr/lib/libmbedcrypto.so.2.16.3
new file mode 100755
index 0000000..224cd13
Binary files /dev/null and b/root/usr/lib/libmbedcrypto.so.2.16.3 differ
diff --git a/root/usr/lib/libmbedcrypto.so.3 b/root/usr/lib/libmbedcrypto.so.3
index a26cf41..d1f524d 120000
--- a/root/usr/lib/libmbedcrypto.so.3
+++ b/root/usr/lib/libmbedcrypto.so.3
@@ -1 +1 @@
-libmbedcrypto.so.2.16.0
\ No newline at end of file
+libmbedcrypto.so.2.16.3
\ No newline at end of file
diff --git a/root/usr/lib/libmbedtls.so b/root/usr/lib/libmbedtls.so
new file mode 120000
index 0000000..3e26c40
--- /dev/null
+++ b/root/usr/lib/libmbedtls.so
@@ -0,0 +1 @@
+libmbedtls.so.10
\ No newline at end of file
diff --git a/root/usr/lib/libmbedtls.so.10 b/root/usr/lib/libmbedtls.so.10
new file mode 120000
index 0000000..33a0b36
--- /dev/null
+++ b/root/usr/lib/libmbedtls.so.10
@@ -0,0 +1 @@
+libmbedtls.so.2.12.0
\ No newline at end of file
diff --git a/root/usr/lib/libmbedtls.so.12 b/root/usr/lib/libmbedtls.so.12
index f3894b7..8fc77bc 120000
--- a/root/usr/lib/libmbedtls.so.12
+++ b/root/usr/lib/libmbedtls.so.12
@@ -1 +1 @@
-libmbedtls.so.2.16.0
\ No newline at end of file
+libmbedtls.so.2.16.3
\ No newline at end of file
diff --git a/root/usr/lib/libmbedtls.so.2.12.0 b/root/usr/lib/libmbedtls.so.2.12.0
new file mode 100755
index 0000000..1a5b2e6
Binary files /dev/null and b/root/usr/lib/libmbedtls.so.2.12.0 differ
diff --git a/root/usr/lib/libmbedtls.so.2.16.3 b/root/usr/lib/libmbedtls.so.2.16.3
new file mode 100755
index 0000000..06c9307
Binary files /dev/null and b/root/usr/lib/libmbedtls.so.2.16.3 differ
diff --git a/root/usr/lib/libmbedx509.so b/root/usr/lib/libmbedx509.so
new file mode 120000
index 0000000..44fc081
--- /dev/null
+++ b/root/usr/lib/libmbedx509.so
@@ -0,0 +1 @@
+libmbedx509.so.0
\ No newline at end of file
diff --git a/root/usr/lib/libmbedx509.so.0 b/root/usr/lib/libmbedx509.so.0
index 5ccb25f..f1c22db 120000
--- a/root/usr/lib/libmbedx509.so.0
+++ b/root/usr/lib/libmbedx509.so.0
@@ -1 +1 @@
-libmbedx509.so.2.16.0
\ No newline at end of file
+libmbedx509.so.2.16.3
\ No newline at end of file
diff --git a/root/usr/lib/libmbedx509.so.2.16.3 b/root/usr/lib/libmbedx509.so.2.16.3
new file mode 100755
index 0000000..fda3b59
Binary files /dev/null and b/root/usr/lib/libmbedx509.so.2.16.3 differ
diff --git a/root/usr/lib/libmenuw.so.6.1 b/root/usr/lib/libmenuw.so.6.1
index 3442b1e..57b81ed 100755
Binary files a/root/usr/lib/libmenuw.so.6.1 and b/root/usr/lib/libmenuw.so.6.1 differ
diff --git a/root/usr/lib/libmessages-dgm-samba4.so b/root/usr/lib/libmessages-dgm-samba4.so
index 4679b05..7a8958f 100755
Binary files a/root/usr/lib/libmessages-dgm-samba4.so and b/root/usr/lib/libmessages-dgm-samba4.so differ
diff --git a/root/usr/lib/libmessages-util-samba4.so b/root/usr/lib/libmessages-util-samba4.so
index 580d731..698d75a 100755
Binary files a/root/usr/lib/libmessages-util-samba4.so and b/root/usr/lib/libmessages-util-samba4.so differ
diff --git a/root/usr/lib/libminiupnpc.so.16 b/root/usr/lib/libminiupnpc.so.16
new file mode 100755
index 0000000..d38aab3
Binary files /dev/null and b/root/usr/lib/libminiupnpc.so.16 differ
diff --git a/root/usr/lib/libminiupnpc.so.17 b/root/usr/lib/libminiupnpc.so.17
deleted file mode 100755
index 56a5b7a..0000000
Binary files a/root/usr/lib/libminiupnpc.so.17 and /dev/null differ
diff --git a/root/usr/lib/libminiupnpc.so.17 b/root/usr/lib/libminiupnpc.so.17
new file mode 120000
index 0000000..9edbe28
--- /dev/null
+++ b/root/usr/lib/libminiupnpc.so.17
@@ -0,0 +1 @@
+libminiupnpc.so.2.1
\ No newline at end of file
diff --git a/root/usr/lib/libminiupnpc.so.2.1 b/root/usr/lib/libminiupnpc.so.2.1
new file mode 100644
index 0000000..9729ae7
Binary files /dev/null and b/root/usr/lib/libminiupnpc.so.2.1 differ
diff --git a/root/usr/lib/libmsghdr-samba4.so b/root/usr/lib/libmsghdr-samba4.so
index f9f2da3..5d0819b 100755
Binary files a/root/usr/lib/libmsghdr-samba4.so and b/root/usr/lib/libmsghdr-samba4.so differ
diff --git a/root/usr/lib/libmsrpc3-samba4.so b/root/usr/lib/libmsrpc3-samba4.so
index 52affb6..52cd9e4 100755
Binary files a/root/usr/lib/libmsrpc3-samba4.so and b/root/usr/lib/libmsrpc3-samba4.so differ
diff --git a/root/usr/lib/libnatpmp.so.1 b/root/usr/lib/libnatpmp.so.1
index f90a815..27abde8 100755
Binary files a/root/usr/lib/libnatpmp.so.1 and b/root/usr/lib/libnatpmp.so.1 differ
diff --git a/root/usr/lib/libncursesw.so.6.1 b/root/usr/lib/libncursesw.so.6.1
index 79d9d49..ab33780 100755
Binary files a/root/usr/lib/libncursesw.so.6.1 and b/root/usr/lib/libncursesw.so.6.1 differ
diff --git a/root/usr/lib/libndr-krb5pac.so.0.0.1 b/root/usr/lib/libndr-krb5pac.so.0.0.1
index 305660f..1aa03b7 100755
Binary files a/root/usr/lib/libndr-krb5pac.so.0.0.1 and b/root/usr/lib/libndr-krb5pac.so.0.0.1 differ
diff --git a/root/usr/lib/libndr-nbt.so.0.0.1 b/root/usr/lib/libndr-nbt.so.0.0.1
index 52f6817..735204f 100755
Binary files a/root/usr/lib/libndr-nbt.so.0.0.1 and b/root/usr/lib/libndr-nbt.so.0.0.1 differ
diff --git a/root/usr/lib/libndr-samba-samba4.so b/root/usr/lib/libndr-samba-samba4.so
index 77e0784..6f3ad80 100755
Binary files a/root/usr/lib/libndr-samba-samba4.so and b/root/usr/lib/libndr-samba-samba4.so differ
diff --git a/root/usr/lib/libndr-samba4.so b/root/usr/lib/libndr-samba4.so
index b60fb4b..997c3d3 100755
Binary files a/root/usr/lib/libndr-samba4.so and b/root/usr/lib/libndr-samba4.so differ
diff --git a/root/usr/lib/libndr-standard.so.0.0.1 b/root/usr/lib/libndr-standard.so.0.0.1
index d833cca..5a3f41e 100755
Binary files a/root/usr/lib/libndr-standard.so.0.0.1 and b/root/usr/lib/libndr-standard.so.0.0.1 differ
diff --git a/root/usr/lib/libndr.so.0.1.0 b/root/usr/lib/libndr.so.0.1.0
index 16f1d34..84d2f66 100755
Binary files a/root/usr/lib/libndr.so.0.1.0 and b/root/usr/lib/libndr.so.0.1.0 differ
diff --git a/root/usr/lib/libnet-keytab-samba4.so b/root/usr/lib/libnet-keytab-samba4.so
index a104fd1..0a6d033 100755
Binary files a/root/usr/lib/libnet-keytab-samba4.so and b/root/usr/lib/libnet-keytab-samba4.so differ
diff --git a/root/usr/lib/libnetapi.so.0 b/root/usr/lib/libnetapi.so.0
index 8f6341b..724d39d 100755
Binary files a/root/usr/lib/libnetapi.so.0 and b/root/usr/lib/libnetapi.so.0 differ
diff --git a/root/usr/lib/libnetif-samba4.so b/root/usr/lib/libnetif-samba4.so
index c2e0e66..6d3fda5 100755
Binary files a/root/usr/lib/libnetif-samba4.so and b/root/usr/lib/libnetif-samba4.so differ
diff --git a/root/usr/lib/libnettle.so.7 b/root/usr/lib/libnettle.so.7
new file mode 120000
index 0000000..2f42858
--- /dev/null
+++ b/root/usr/lib/libnettle.so.7
@@ -0,0 +1 @@
+libnettle.so.7.0
\ No newline at end of file
diff --git a/root/usr/lib/libnettle.so.7.0 b/root/usr/lib/libnettle.so.7.0
new file mode 100644
index 0000000..032fc50
Binary files /dev/null and b/root/usr/lib/libnettle.so.7.0 differ
diff --git a/root/usr/lib/libnfsidmap.so.1.0.0 b/root/usr/lib/libnfsidmap.so.1.0.0
index 98e082c..29570a6 100755
Binary files a/root/usr/lib/libnfsidmap.so.1.0.0 and b/root/usr/lib/libnfsidmap.so.1.0.0 differ
diff --git a/root/usr/lib/libnpa-tstream-samba4.so b/root/usr/lib/libnpa-tstream-samba4.so
index 9e24d57..3116636 100755
Binary files a/root/usr/lib/libnpa-tstream-samba4.so and b/root/usr/lib/libnpa-tstream-samba4.so differ
diff --git a/root/usr/lib/libogg.so.0.8.2 b/root/usr/lib/libogg.so.0.8.2
new file mode 100755
index 0000000..09ab1d7
Binary files /dev/null and b/root/usr/lib/libogg.so.0.8.2 differ
diff --git a/root/usr/lib/libogg.so.0.8.3 b/root/usr/lib/libogg.so.0.8.3
index e60c288..3c234da 100755
Binary files a/root/usr/lib/libogg.so.0.8.3 and b/root/usr/lib/libogg.so.0.8.3 differ
diff --git a/root/usr/lib/libpcre.so b/root/usr/lib/libpcre.so
index ed7f31d..53a1639 120000
--- a/root/usr/lib/libpcre.so
+++ b/root/usr/lib/libpcre.so
@@ -1 +1 @@
-libpcre.so.1.2.10
\ No newline at end of file
+libpcre.so.1.2.9
\ No newline at end of file
diff --git a/root/usr/lib/libpcre.so.1 b/root/usr/lib/libpcre.so.1
index ed7f31d..53a1639 120000
--- a/root/usr/lib/libpcre.so.1
+++ b/root/usr/lib/libpcre.so.1
@@ -1 +1 @@
-libpcre.so.1.2.10
\ No newline at end of file
+libpcre.so.1.2.9
\ No newline at end of file
diff --git a/root/usr/lib/libpcre.so.1.2.9 b/root/usr/lib/libpcre.so.1.2.9
new file mode 100755
index 0000000..0acadc7
Binary files /dev/null and b/root/usr/lib/libpcre.so.1.2.9 differ
diff --git a/root/usr/lib/libpcreposix.so.0 b/root/usr/lib/libpcreposix.so.0
index a1f76e9..72af995 120000
--- a/root/usr/lib/libpcreposix.so.0
+++ b/root/usr/lib/libpcreposix.so.0
@@ -1 +1 @@
-libpcreposix.so.0.0.6
\ No newline at end of file
+libpcreposix.so.0.0.5
\ No newline at end of file
diff --git a/root/usr/lib/libpcreposix.so.0.0.5 b/root/usr/lib/libpcreposix.so.0.0.5
new file mode 100755
index 0000000..b32c107
Binary files /dev/null and b/root/usr/lib/libpcreposix.so.0.0.5 differ
diff --git a/root/usr/lib/libpopt-samba3-cmdline-samba4.so b/root/usr/lib/libpopt-samba3-cmdline-samba4.so
index 00dcb90..e7d96e5 100755
Binary files a/root/usr/lib/libpopt-samba3-cmdline-samba4.so and b/root/usr/lib/libpopt-samba3-cmdline-samba4.so differ
diff --git a/root/usr/lib/libpopt-samba3-samba4.so b/root/usr/lib/libpopt-samba3-samba4.so
index d3c523d..ea15816 100755
Binary files a/root/usr/lib/libpopt-samba3-samba4.so and b/root/usr/lib/libpopt-samba3-samba4.so differ
diff --git a/root/usr/lib/libpopt.so.0.0.0 b/root/usr/lib/libpopt.so.0.0.0
index 82c219d..735bac5 100755
Binary files a/root/usr/lib/libpopt.so.0.0.0 and b/root/usr/lib/libpopt.so.0.0.0 differ
diff --git a/root/usr/lib/libprinting-migrate-samba4.so b/root/usr/lib/libprinting-migrate-samba4.so
index 7dcbcde..98e9548 100755
Binary files a/root/usr/lib/libprinting-migrate-samba4.so and b/root/usr/lib/libprinting-migrate-samba4.so differ
diff --git a/root/usr/lib/libreadline.so.8.0 b/root/usr/lib/libreadline.so.8.0
index 48ca923..8aaf2e4 100755
Binary files a/root/usr/lib/libreadline.so.8.0 and b/root/usr/lib/libreadline.so.8.0 differ
diff --git a/root/usr/lib/libreplace-samba4.so b/root/usr/lib/libreplace-samba4.so
new file mode 100755
index 0000000..bfcccfd
Binary files /dev/null and b/root/usr/lib/libreplace-samba4.so differ
diff --git a/root/usr/lib/libroken-samba4.so.19 b/root/usr/lib/libroken-samba4.so.19
new file mode 120000
index 0000000..03e07ba
--- /dev/null
+++ b/root/usr/lib/libroken-samba4.so.19
@@ -0,0 +1 @@
+libroken-samba4.so.19.0.1
\ No newline at end of file
diff --git a/root/usr/lib/libroken-samba4.so.19.0.1 b/root/usr/lib/libroken-samba4.so.19.0.1
new file mode 100755
index 0000000..c026254
Binary files /dev/null and b/root/usr/lib/libroken-samba4.so.19.0.1 differ
diff --git a/root/usr/lib/libsamba-cluster-support-samba4.so b/root/usr/lib/libsamba-cluster-support-samba4.so
index 85939ee..3e88145 100755
Binary files a/root/usr/lib/libsamba-cluster-support-samba4.so and b/root/usr/lib/libsamba-cluster-support-samba4.so differ
diff --git a/root/usr/lib/libsamba-credentials.so.0.0.1 b/root/usr/lib/libsamba-credentials.so.0.0.1
index 13bf6c1..b96cac3 100755
Binary files a/root/usr/lib/libsamba-credentials.so.0.0.1 and b/root/usr/lib/libsamba-credentials.so.0.0.1 differ
diff --git a/root/usr/lib/libsamba-debug-samba4.so b/root/usr/lib/libsamba-debug-samba4.so
index a86e982..4cacb96 100755
Binary files a/root/usr/lib/libsamba-debug-samba4.so and b/root/usr/lib/libsamba-debug-samba4.so differ
diff --git a/root/usr/lib/libsamba-errors.so.1 b/root/usr/lib/libsamba-errors.so.1
index 77e5a07..68a391b 100755
Binary files a/root/usr/lib/libsamba-errors.so.1 and b/root/usr/lib/libsamba-errors.so.1 differ
diff --git a/root/usr/lib/libsamba-hostconfig.so.0.0.1 b/root/usr/lib/libsamba-hostconfig.so.0.0.1
index 2b0de2d..7cf2e16 100755
Binary files a/root/usr/lib/libsamba-hostconfig.so.0.0.1 and b/root/usr/lib/libsamba-hostconfig.so.0.0.1 differ
diff --git a/root/usr/lib/libsamba-modules-samba4.so b/root/usr/lib/libsamba-modules-samba4.so
index 36c443d..9b8700a 100755
Binary files a/root/usr/lib/libsamba-modules-samba4.so and b/root/usr/lib/libsamba-modules-samba4.so differ
diff --git a/root/usr/lib/libsamba-passdb.so b/root/usr/lib/libsamba-passdb.so
index 78eddc8..809ed5e 120000
--- a/root/usr/lib/libsamba-passdb.so
+++ b/root/usr/lib/libsamba-passdb.so
@@ -1 +1 @@
-libsamba-passdb.so.0.27.1
\ No newline at end of file
+libsamba-passdb.so.0.27.2
\ No newline at end of file
diff --git a/root/usr/lib/libsamba-passdb.so.0 b/root/usr/lib/libsamba-passdb.so.0
index 78eddc8..809ed5e 120000
--- a/root/usr/lib/libsamba-passdb.so.0
+++ b/root/usr/lib/libsamba-passdb.so.0
@@ -1 +1 @@
-libsamba-passdb.so.0.27.1
\ No newline at end of file
+libsamba-passdb.so.0.27.2
\ No newline at end of file
diff --git a/root/usr/lib/libsamba-passdb.so.0.27.2 b/root/usr/lib/libsamba-passdb.so.0.27.2
new file mode 100755
index 0000000..acd1eda
Binary files /dev/null and b/root/usr/lib/libsamba-passdb.so.0.27.2 differ
diff --git a/root/usr/lib/libsamba-security-samba4.so b/root/usr/lib/libsamba-security-samba4.so
index 1612eb9..f9a620c 100755
Binary files a/root/usr/lib/libsamba-security-samba4.so and b/root/usr/lib/libsamba-security-samba4.so differ
diff --git a/root/usr/lib/libsamba-sockets-samba4.so b/root/usr/lib/libsamba-sockets-samba4.so
index 27f335d..b2f7250 100755
Binary files a/root/usr/lib/libsamba-sockets-samba4.so and b/root/usr/lib/libsamba-sockets-samba4.so differ
diff --git a/root/usr/lib/libsamba-util.so.0.0.1 b/root/usr/lib/libsamba-util.so.0.0.1
index 3f01514..17bbddf 100755
Binary files a/root/usr/lib/libsamba-util.so.0.0.1 and b/root/usr/lib/libsamba-util.so.0.0.1 differ
diff --git a/root/usr/lib/libsamba3-util-samba4.so b/root/usr/lib/libsamba3-util-samba4.so
index 7dfa8ca..2c913b8 100755
Binary files a/root/usr/lib/libsamba3-util-samba4.so and b/root/usr/lib/libsamba3-util-samba4.so differ
diff --git a/root/usr/lib/libsamdb-common-samba4.so b/root/usr/lib/libsamdb-common-samba4.so
index 080fb36..eb4a37f 100755
Binary files a/root/usr/lib/libsamdb-common-samba4.so and b/root/usr/lib/libsamdb-common-samba4.so differ
diff --git a/root/usr/lib/libsamdb.so.0.0.1 b/root/usr/lib/libsamdb.so.0.0.1
index 78f4035..f395b2d 100755
Binary files a/root/usr/lib/libsamdb.so.0.0.1 and b/root/usr/lib/libsamdb.so.0.0.1 differ
diff --git a/root/usr/lib/libsecrets3-samba4.so b/root/usr/lib/libsecrets3-samba4.so
index 2128aec..3f38bfb 100755
Binary files a/root/usr/lib/libsecrets3-samba4.so and b/root/usr/lib/libsecrets3-samba4.so differ
diff --git a/root/usr/lib/libserver-id-db-samba4.so b/root/usr/lib/libserver-id-db-samba4.so
index 252ea37..5c735ea 100755
Binary files a/root/usr/lib/libserver-id-db-samba4.so and b/root/usr/lib/libserver-id-db-samba4.so differ
diff --git a/root/usr/lib/libserver-role-samba4.so b/root/usr/lib/libserver-role-samba4.so
index 315ed41..2a67da2 100755
Binary files a/root/usr/lib/libserver-role-samba4.so and b/root/usr/lib/libserver-role-samba4.so differ
diff --git a/root/usr/lib/libsmartcols.so.1.1.0 b/root/usr/lib/libsmartcols.so.1.1.0
index 9e19c07..f58636f 100755
Binary files a/root/usr/lib/libsmartcols.so.1.1.0 and b/root/usr/lib/libsmartcols.so.1.1.0 differ
diff --git a/root/usr/lib/libsmb-transport-samba4.so b/root/usr/lib/libsmb-transport-samba4.so
index fa6959e..eab5da6 100755
Binary files a/root/usr/lib/libsmb-transport-samba4.so and b/root/usr/lib/libsmb-transport-samba4.so differ
diff --git a/root/usr/lib/libsmbclient-raw-samba4.so b/root/usr/lib/libsmbclient-raw-samba4.so
index f9988b8..930a21e 100755
Binary files a/root/usr/lib/libsmbclient-raw-samba4.so and b/root/usr/lib/libsmbclient-raw-samba4.so differ
diff --git a/root/usr/lib/libsmbclient.so.0.4.0 b/root/usr/lib/libsmbclient.so.0.4.0
index 7e3e883..0f86266 100755
Binary files a/root/usr/lib/libsmbclient.so.0.4.0 and b/root/usr/lib/libsmbclient.so.0.4.0 differ
diff --git a/root/usr/lib/libsmbconf.so.0 b/root/usr/lib/libsmbconf.so.0
index 9077ef4..98b632a 100755
Binary files a/root/usr/lib/libsmbconf.so.0 and b/root/usr/lib/libsmbconf.so.0 differ
diff --git a/root/usr/lib/libsmbd-base-samba4.so b/root/usr/lib/libsmbd-base-samba4.so
index 774bd6d..42abc3b 100755
Binary files a/root/usr/lib/libsmbd-base-samba4.so and b/root/usr/lib/libsmbd-base-samba4.so differ
diff --git a/root/usr/lib/libsmbd-conn-samba4.so b/root/usr/lib/libsmbd-conn-samba4.so
index de932db..197f66c 100755
Binary files a/root/usr/lib/libsmbd-conn-samba4.so and b/root/usr/lib/libsmbd-conn-samba4.so differ
diff --git a/root/usr/lib/libsmbd-shim-samba4.so b/root/usr/lib/libsmbd-shim-samba4.so
index 127b85b..bfaf4bd 100755
Binary files a/root/usr/lib/libsmbd-shim-samba4.so and b/root/usr/lib/libsmbd-shim-samba4.so differ
diff --git a/root/usr/lib/libsocket-blocking-samba4.so b/root/usr/lib/libsocket-blocking-samba4.so
index 7f487e2..d7db739 100755
Binary files a/root/usr/lib/libsocket-blocking-samba4.so and b/root/usr/lib/libsocket-blocking-samba4.so differ
diff --git a/root/usr/lib/libsqlite3.so.0.8.6 b/root/usr/lib/libsqlite3.so.0.8.6
index 7687279..0721cea 100755
Binary files a/root/usr/lib/libsqlite3.so.0.8.6 and b/root/usr/lib/libsqlite3.so.0.8.6 differ
diff --git a/root/usr/lib/libss.so.2.0 b/root/usr/lib/libss.so.2.0
index 5cda018..b3a3edd 100755
Binary files a/root/usr/lib/libss.so.2.0 and b/root/usr/lib/libss.so.2.0 differ
diff --git a/root/usr/lib/libssl.so.1.0.0 b/root/usr/lib/libssl.so.1.0.0
new file mode 100644
index 0000000..37cfd6b
Binary files /dev/null and b/root/usr/lib/libssl.so.1.0.0 differ
diff --git a/root/usr/lib/libssl.so.1.1 b/root/usr/lib/libssl.so.1.1
index 3b0f035..927072a 100644
Binary files a/root/usr/lib/libssl.so.1.1 and b/root/usr/lib/libssl.so.1.1 differ
diff --git a/root/usr/lib/libstdc++.so.6.0.24 b/root/usr/lib/libstdc++.so.6.0.24
index 207cf90..8d19d6b 100755
Binary files a/root/usr/lib/libstdc++.so.6.0.24 and b/root/usr/lib/libstdc++.so.6.0.24 differ
diff --git a/root/usr/lib/libstdc++.so.6.0.24-gdb.py b/root/usr/lib/libstdc++.so.6.0.24-gdb.py
index 3f84611..e88477e 100644
--- a/root/usr/lib/libstdc++.so.6.0.24-gdb.py
+++ b/root/usr/lib/libstdc++.so.6.0.24-gdb.py
@@ -19,8 +19,8 @@
import os
import os.path
-pythondir = '/builder/sunxi_cortexa53/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-7.4.0_musl/share/gcc-7.4.0/python'
-libdir = '/builder/sunxi_cortexa53/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-7.4.0_musl/aarch64-openwrt-linux-musl/lib'
+pythondir = '/builder/shared-workdir/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-7.5.0_musl/share/gcc-7.5.0/python'
+libdir = '/builder/shared-workdir/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-7.5.0_musl/aarch64-openwrt-linux-musl/lib'
# This file might be loaded when there is no current objfile. This
# can happen if the user loads it manually. In this case we don't
diff --git a/root/usr/lib/libsys-rw-samba4.so b/root/usr/lib/libsys-rw-samba4.so
index 0e348f2..4f3bf19 100755
Binary files a/root/usr/lib/libsys-rw-samba4.so and b/root/usr/lib/libsys-rw-samba4.so differ
diff --git a/root/usr/lib/libtalloc-report-samba4.so b/root/usr/lib/libtalloc-report-samba4.so
index 7ad7727..b6ebada 100755
Binary files a/root/usr/lib/libtalloc-report-samba4.so and b/root/usr/lib/libtalloc-report-samba4.so differ
diff --git a/root/usr/lib/libtdb-wrap-samba4.so b/root/usr/lib/libtdb-wrap-samba4.so
index fe9f134..7117ceb 100755
Binary files a/root/usr/lib/libtdb-wrap-samba4.so and b/root/usr/lib/libtdb-wrap-samba4.so differ
diff --git a/root/usr/lib/libtime-basic-samba4.so b/root/usr/lib/libtime-basic-samba4.so
index 3b8e9e6..6f3a885 100755
Binary files a/root/usr/lib/libtime-basic-samba4.so and b/root/usr/lib/libtime-basic-samba4.so differ
diff --git a/root/usr/lib/libtirpc.so.3.0.0 b/root/usr/lib/libtirpc.so.3.0.0
index 0453892..253030f 100755
Binary files a/root/usr/lib/libtirpc.so.3.0.0 and b/root/usr/lib/libtirpc.so.3.0.0 differ
diff --git a/root/usr/lib/libtrusts-util-samba4.so b/root/usr/lib/libtrusts-util-samba4.so
index 6c90c23..dc31ba1 100755
Binary files a/root/usr/lib/libtrusts-util-samba4.so and b/root/usr/lib/libtrusts-util-samba4.so differ
diff --git a/root/usr/lib/libuclient.so b/root/usr/lib/libuclient.so
index 969bb95..733bbc2 100644
Binary files a/root/usr/lib/libuclient.so and b/root/usr/lib/libuclient.so differ
diff --git a/root/usr/lib/libutil-cmdline-samba4.so b/root/usr/lib/libutil-cmdline-samba4.so
index b28cd13..a58802a 100755
Binary files a/root/usr/lib/libutil-cmdline-samba4.so and b/root/usr/lib/libutil-cmdline-samba4.so differ
diff --git a/root/usr/lib/libutil-reg-samba4.so b/root/usr/lib/libutil-reg-samba4.so
index 2488a73..f789e1d 100755
Binary files a/root/usr/lib/libutil-reg-samba4.so and b/root/usr/lib/libutil-reg-samba4.so differ
diff --git a/root/usr/lib/libutil-setid-samba4.so b/root/usr/lib/libutil-setid-samba4.so
index 68f52e9..1c75f9b 100755
Binary files a/root/usr/lib/libutil-setid-samba4.so and b/root/usr/lib/libutil-setid-samba4.so differ
diff --git a/root/usr/lib/libutil-tdb-samba4.so b/root/usr/lib/libutil-tdb-samba4.so
index 675d13d..794ac0f 100755
Binary files a/root/usr/lib/libutil-tdb-samba4.so and b/root/usr/lib/libutil-tdb-samba4.so differ
diff --git a/root/usr/lib/libuuid.so.1.3.0 b/root/usr/lib/libuuid.so.1.3.0
index d80b5d1..33007a2 100755
Binary files a/root/usr/lib/libuuid.so.1.3.0 and b/root/usr/lib/libuuid.so.1.3.0 differ
diff --git a/root/usr/lib/libvorbis.so.0.4.8 b/root/usr/lib/libvorbis.so.0.4.8
index 75c6a06..e8bac65 100755
Binary files a/root/usr/lib/libvorbis.so.0.4.8 and b/root/usr/lib/libvorbis.so.0.4.8 differ
diff --git a/root/usr/lib/libvorbisenc.so.2.0.11 b/root/usr/lib/libvorbisenc.so.2.0.11
index ad79a6c..2e248d8 100755
Binary files a/root/usr/lib/libvorbisenc.so.2.0.11 and b/root/usr/lib/libvorbisenc.so.2.0.11 differ
diff --git a/root/usr/lib/libvorbisfile.so.3.3.7 b/root/usr/lib/libvorbisfile.so.3.3.7
index ff62bc6..9473bdd 100755
Binary files a/root/usr/lib/libvorbisfile.so.3.3.7 and b/root/usr/lib/libvorbisfile.so.3.3.7 differ
diff --git a/root/usr/lib/libwbclient.so.0.14 b/root/usr/lib/libwbclient.so.0.14
index 23d3661..5aa2c4b 100755
Binary files a/root/usr/lib/libwbclient.so.0.14 and b/root/usr/lib/libwbclient.so.0.14 differ
diff --git a/root/usr/lib/libwinbind-client-samba4.so b/root/usr/lib/libwinbind-client-samba4.so
index e7dd4d0..46de7fa 100755
Binary files a/root/usr/lib/libwinbind-client-samba4.so and b/root/usr/lib/libwinbind-client-samba4.so differ
diff --git a/root/usr/lib/libwind-samba4.so.0 b/root/usr/lib/libwind-samba4.so.0
new file mode 120000
index 0000000..4f586a7
--- /dev/null
+++ b/root/usr/lib/libwind-samba4.so.0
@@ -0,0 +1 @@
+libwind-samba4.so.0.0.0
\ No newline at end of file
diff --git a/root/usr/lib/libwind-samba4.so.0.0.0 b/root/usr/lib/libwind-samba4.so.0.0.0
new file mode 100755
index 0000000..aaed329
Binary files /dev/null and b/root/usr/lib/libwind-samba4.so.0.0.0 differ
diff --git a/root/usr/lib/libwrap.so.0.7.6 b/root/usr/lib/libwrap.so.0.7.6
index 78fed9c..4e85038 100755
Binary files a/root/usr/lib/libwrap.so.0.7.6 and b/root/usr/lib/libwrap.so.0.7.6 differ
diff --git a/root/usr/lib/libxattr-tdb-samba4.so b/root/usr/lib/libxattr-tdb-samba4.so
index 725b9f7..8595f00 100755
Binary files a/root/usr/lib/libxattr-tdb-samba4.so and b/root/usr/lib/libxattr-tdb-samba4.so differ
diff --git a/root/usr/lib/libxtables.so.12.2.0 b/root/usr/lib/libxtables.so.12.2.0
index 78f8092..51fb579 100755
Binary files a/root/usr/lib/libxtables.so.12.2.0 and b/root/usr/lib/libxtables.so.12.2.0 differ
diff --git a/root/usr/lib/libz.so.1.2.11 b/root/usr/lib/libz.so.1.2.11
index 9cd10da..8ef606b 100644
Binary files a/root/usr/lib/libz.so.1.2.11 and b/root/usr/lib/libz.so.1.2.11 differ
diff --git a/root/usr/lib/lua/iwinfo.so b/root/usr/lib/lua/iwinfo.so
index e9fca39..548f0be 100755
Binary files a/root/usr/lib/lua/iwinfo.so and b/root/usr/lib/lua/iwinfo.so differ
diff --git a/root/usr/lib/lua/luci/cbi.lua b/root/usr/lib/lua/luci/cbi.lua
index 971830f..450e413 100644
--- a/root/usr/lib/lua/luci/cbi.lua
+++ b/root/usr/lib/lua/luci/cbi.lua
@@ -1347,6 +1347,18 @@ function AbstractValue.deplist2json(self, section, deplist)
return util.serialize_json(deps)
end
+-- Serialize choices
+function AbstractValue.choices(self)
+ if type(self.keylist) == "table" and #self.keylist > 0 then
+ local i, k, v = nil, nil, {}
+ for i, k in ipairs(self.keylist) do
+ v[k] = self.vallist[i] or k
+ end
+ return v
+ end
+ return nil
+end
+
-- Generates the unique CBID
function AbstractValue.cbid(self, section)
return "cbid."..self.map.config.."."..section.."."..self.option
diff --git a/root/usr/lib/lua/luci/cbi/datatypes.lua b/root/usr/lib/lua/luci/cbi/datatypes.lua
index b4206e9..c1cf01f 100644
--- a/root/usr/lib/lua/luci/cbi/datatypes.lua
+++ b/root/usr/lib/lua/luci/cbi/datatypes.lua
@@ -132,6 +132,10 @@ function ip6prefix(val)
return ( val and val >= 0 and val <= 128 )
end
+function cidr(val)
+ return cidr4(val) or cidr6(val)
+end
+
function cidr4(val)
local ip, mask = val:match("^([^/]+)/([^/]+)$")
@@ -414,7 +418,7 @@ function maxlength(val, max)
end
function phonedigit(val)
- return (val:match("^[0-9\*#!%.]+$") ~= nil)
+ return (val:match("^[0-9%*#!%.]+$") ~= nil)
end
function timehhmmss(val)
diff --git a/root/usr/lib/lua/luci/controller/admin/filebrowser.lua b/root/usr/lib/lua/luci/controller/admin/filebrowser.lua
deleted file mode 100644
index 2572615..0000000
--- a/root/usr/lib/lua/luci/controller/admin/filebrowser.lua
+++ /dev/null
@@ -1,9 +0,0 @@
--- Copyright 2008 Steven Barth
--- Copyright 2008 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.admin.filebrowser", package.seeall)
-
-function index()
- entry( {"admin", "filebrowser"}, template("cbi/filebrowser") ).leaf = true
-end
diff --git a/root/usr/lib/lua/luci/controller/admin/index.lua b/root/usr/lib/lua/luci/controller/admin/index.lua
index 1f7db0c..0cebfa4 100644
--- a/root/usr/lib/lua/luci/controller/admin/index.lua
+++ b/root/usr/lib/lua/luci/controller/admin/index.lua
@@ -50,6 +50,13 @@ function index()
-- system/system is from mod-admin-full
toplevel_page(page, "admin/system/system", alias("admin", "system", "system"))
+ -- Only used if applications add items
+ page = node("admin", "vpn")
+ page.title = _("VPN")
+ page.order = 30
+ page.index = true
+ toplevel_page(page, false, false)
+
-- Only used if applications add items
page = node("admin", "services")
page.title = _("Services")
@@ -64,30 +71,13 @@ function index()
page.index = true
toplevel_page(page, false, false)
- if nixio.fs.access("/etc/config/dhcp") then
- page = entry({"admin", "dhcplease_status"}, call("lease_status"), nil)
- page.leaf = true
- end
-
- local has_wifi = false
-
- uci:foreach("wireless", "wifi-device",
- function(s)
- has_wifi = true
- return false
- end)
-
- if has_wifi then
- page = entry({"admin", "wireless_assoclist"}, call("wifi_assoclist"), nil)
- page.leaf = true
-
- page = entry({"admin", "wireless_deauth"}, post("wifi_deauth"), nil)
- page.leaf = true
- end
-
page = entry({"admin", "translations"}, call("action_translations"), nil)
page.leaf = true
+ page = entry({"admin", "ubus"}, call("action_ubus"), nil)
+ page.sysauth = false
+ page.leaf = true
+
-- Logout is last
entry({"admin", "logout"}, call("action_logout"), _("Logout"), 999)
end
@@ -129,36 +119,145 @@ function action_translations(lang)
http.write_json(i18n.dump())
end
+local function ubus_reply(id, data, code, errmsg)
+ local reply = { jsonrpc = "2.0", id = id }
+ if errmsg then
+ reply.error = {
+ code = code,
+ message = errmsg
+ }
+ elseif type(code) == "table" then
+ reply.result = code
+ else
+ reply.result = { code, data }
+ end
-function lease_status()
- local s = require "luci.tools.status"
+ return reply
+end
- luci.http.prepare_content("application/json")
- luci.http.write('[')
- luci.http.write_json(s.dhcp_leases())
- luci.http.write(',')
- luci.http.write_json(s.dhcp6_leases())
- luci.http.write(']')
+local ubus_types = {
+ nil,
+ "array",
+ "object",
+ "string",
+ nil, -- INT64
+ "number",
+ nil, -- INT16,
+ "boolean",
+ "double"
+}
+
+local function ubus_access(sid, obj, fun)
+ local res, code = luci.util.ubus("session", "access", {
+ ubus_rpc_session = sid,
+ scope = "ubus",
+ object = obj,
+ ["function"] = fun
+ })
+
+ return (type(res) == "table" and res.access == true)
end
-function wifi_assoclist()
- local s = require "luci.tools.status"
+local function ubus_request(req)
+ if type(req) ~= "table" or type(req.method) ~= "string" or req.jsonrpc ~= "2.0" or req.id == nil then
+ return ubus_reply(nil, nil, -32600, "Invalid request")
- luci.http.prepare_content("application/json")
- luci.http.write_json(s.wifi_assoclist())
+ elseif req.method == "call" then
+ if type(req.params) ~= "table" or #req.params < 3 then
+ return ubus_reply(nil, nil, -32600, "Invalid parameters")
+ end
+
+ local sid, obj, fun, arg =
+ req.params[1], req.params[2], req.params[3], req.params[4] or {}
+ if type(arg) ~= "table" or arg.ubus_rpc_session ~= nil then
+ return ubus_reply(req.id, nil, -32602, "Invalid parameters")
+ end
+
+ if sid == "00000000000000000000000000000000" and luci.dispatcher.context.authsession then
+ sid = luci.dispatcher.context.authsession
+ end
+
+ if not ubus_access(sid, obj, fun) then
+ return ubus_reply(req.id, nil, -32002, "Access denied")
+ end
+
+ arg.ubus_rpc_session = sid
+
+ local res, code = luci.util.ubus(obj, fun, arg)
+ return ubus_reply(req.id, res, code or 0)
+
+ elseif req.method == "list" then
+ if req.params == nil or (type(req.params) == "table" and #req.params == 0) then
+ local objs = luci.util.ubus()
+ return ubus_reply(req.id, nil, objs)
+
+ elseif type(req.params) == "table" then
+ local n, rv = nil, {}
+ for n = 1, #req.params do
+ if type(req.params[n]) ~= "string" then
+ return ubus_reply(req.id, nil, -32602, "Invalid parameters")
+ end
+
+ local sig = luci.util.ubus(req.params[n])
+ if sig and type(sig) == "table" then
+ rv[req.params[n]] = {}
+
+ local m, p
+ for m, p in pairs(sig) do
+ if type(p) == "table" then
+ rv[req.params[n]][m] = {}
+
+ local pn, pt
+ for pn, pt in pairs(p) do
+ rv[req.params[n]][m][pn] = ubus_types[pt] or "unknown"
+ end
+ end
+ end
+ end
+ end
+ return ubus_reply(req.id, nil, rv)
+
+ else
+ return ubus_reply(req.id, nil, -32602, "Invalid parameters")
+ end
+ end
+
+ return ubus_reply(req.id, nil, -32601, "Method not found")
end
-function wifi_deauth()
- local iface = luci.http.formvalue("iface")
- local bssid = luci.http.formvalue("bssid")
+function action_ubus()
+ local parser = require "luci.jsonc".new()
- if iface and bssid then
- luci.util.ubus("hostapd.%s" % iface, "del_client", {
- addr = bssid,
- deauth = true,
- reason = 5,
- ban_time = 60000
- })
+ luci.http.context.request:setfilehandler(function(_, s)
+ if not s then
+ return nil
+ end
+
+ local ok, err = parser:parse(s)
+ return (not err or nil)
+ end)
+
+ luci.http.context.request:content()
+
+ local json = parser:get()
+ if json == nil or type(json) ~= "table" then
+ luci.http.prepare_content("application/json")
+ luci.http.write_json(ubus_reply(nil, nil, -32700, "Parse error"))
+ return
+ end
+
+ local response
+ if #json == 0 then
+ response = ubus_request(json)
+ else
+ response = {}
+
+ local _, request
+ for _, request in ipairs(json) do
+ response[_] = ubus_request(request)
+ end
end
- luci.http.status(200, "OK")
+
+ luci.http.prepare_content("application/json")
+ luci.http.write_json(response)
end
diff --git a/root/usr/lib/lua/luci/controller/admin/network.lua b/root/usr/lib/lua/luci/controller/admin/network.lua
index 1da5eac..bd00235 100644
--- a/root/usr/lib/lua/luci/controller/admin/network.lua
+++ b/root/usr/lib/lua/luci/controller/admin/network.lua
@@ -5,116 +5,37 @@
module("luci.controller.admin.network", package.seeall)
function index()
- local uci = require("luci.model.uci").cursor()
local page
-- if page.inreq then
- local has_switch = false
-
- uci:foreach("network", "switch",
- function(s)
- has_switch = true
- return false
- end)
-
- if has_switch then
- page = node("admin", "network", "vlan")
- page.target = cbi("admin_network/vlan")
- page.title = _("Switch")
- page.order = 20
-
- page = entry({"admin", "network", "switch_status"}, call("switch_status"), nil)
- page.leaf = true
- end
-
-
- local has_wifi = false
-
- uci:foreach("wireless", "wifi-device",
- function(s)
- has_wifi = true
- return false
- end)
-
- if has_wifi then
- page = entry({"admin", "network", "wireless_join"}, post("wifi_join"), nil)
- page.leaf = true
-
- page = entry({"admin", "network", "wireless_add"}, post("wifi_add"), nil)
- page.leaf = true
-
- page = entry({"admin", "network", "wireless_status"}, call("wifi_status"), nil)
- page.leaf = true
-
- page = entry({"admin", "network", "wireless_reconnect"}, post("wifi_reconnect"), nil)
- page.leaf = true
-
- page = entry({"admin", "network", "wireless_scan_trigger"}, post("wifi_scan_trigger"), nil)
- page.leaf = true
-
- page = entry({"admin", "network", "wireless_scan_results"}, call("wifi_scan_results"), nil)
- page.leaf = true
-
- page = entry({"admin", "network", "wireless"}, arcombine(cbi("admin_network/wifi_overview"), cbi("admin_network/wifi")), _("Wireless"), 15)
- page.leaf = true
- page.subindex = true
+ page = entry({"admin", "network", "switch"}, view("network/switch"), _("Switch"), 20)
+ page.uci_depends = { network = { ["@switch[0]"] = "switch" } }
- if page.inreq then
- local wdev
- local net = require "luci.model.network".init(uci)
- for _, wdev in ipairs(net:get_wifidevs()) do
- local wnet
- for _, wnet in ipairs(wdev:get_wifinets()) do
- entry(
- {"admin", "network", "wireless", wnet:id()},
- alias("admin", "network", "wireless"),
- wdev:name() .. ": " .. wnet:shortname()
- )
- end
- end
- end
- end
-
-
- page = entry({"admin", "network", "iface_add"}, form("admin_network/iface_add"), nil)
- page.leaf = true
-
- page = entry({"admin", "network", "iface_status"}, call("iface_status"), nil)
+ page = entry({"admin", "network", "wireless"}, view("network/wireless"), _('Wireless'), 15)
+ page.uci_depends = { wireless = { ["@wifi-device[0]"] = "wifi-device" } }
page.leaf = true
- page = entry({"admin", "network", "iface_reconnect"}, post("iface_reconnect"), nil)
+ page = entry({"admin", "network", "remote_addr"}, call("remote_addr"), nil)
page.leaf = true
- page = entry({"admin", "network", "network"}, arcombine(cbi("admin_network/network"), cbi("admin_network/ifaces")), _("Interfaces"), 10)
+ page = entry({"admin", "network", "network"}, view("network/interfaces"), _("Interfaces"), 10)
page.leaf = true
page.subindex = true
- if page.inreq then
- uci:foreach("network", "interface",
- function (section)
- local ifc = section[".name"]
- if ifc ~= "loopback" then
- entry({"admin", "network", "network", ifc},
- true, ifc:upper())
- end
- end)
- end
-
-
- if nixio.fs.access("/etc/config/dhcp") then
- page = node("admin", "network", "dhcp")
- page.target = cbi("admin_network/dhcp")
- page.title = _("DHCP and DNS")
- page.order = 30
+ page = node("admin", "network", "dhcp")
+ page.uci_depends = { dhcp = true }
+ page.target = view("network/dhcp")
+ page.title = _("DHCP and DNS")
+ page.order = 30
- page = node("admin", "network", "hosts")
- page.target = cbi("admin_network/hosts")
- page.title = _("Hostnames")
- page.order = 40
- end
+ page = node("admin", "network", "hosts")
+ page.uci_depends = { dhcp = true }
+ page.target = view("network/hosts")
+ page.title = _("Hostnames")
+ page.order = 40
page = node("admin", "network", "routes")
- page.target = cbi("admin_network/routes")
+ page.target = view("network/routes")
page.title = _("Static Routes")
page.order = 50
@@ -140,239 +61,67 @@ function index()
-- end
end
-function wifi_join()
- local tpl = require "luci.template"
- local http = require "luci.http"
- local dev = http.formvalue("device")
- local ssid = http.formvalue("join")
-
- if dev and ssid then
- local cancel = (http.formvalue("cancel") or http.formvalue("cbi.cancel"))
- if not cancel then
- local cbi = require "luci.cbi"
- local map = luci.cbi.load("admin_network/wifi_add")[1]
-
- if map:parse() ~= cbi.FORM_DONE then
- tpl.render("header")
- map:render()
- tpl.render("footer")
- end
-
- return
- end
- end
-
- tpl.render("admin_network/wifi_join")
-end
-
-function wifi_add()
- local dev = luci.http.formvalue("device")
- local ntm = require "luci.model.network".init()
-
- dev = dev and ntm:get_wifidev(dev)
-
- if dev then
- local net = dev:add_wifinet({
- mode = "ap",
- ssid = "OpenWrt",
- encryption = "none",
- disabled = 1
- })
-
- ntm:save("wireless")
- luci.http.redirect(net:adminlink())
- end
-end
-
-function iface_status(ifaces)
- local netm = require "luci.model.network".init()
- local rv = { }
-
- local iface
- for iface in ifaces:gmatch("[%w%.%-_]+") do
- local net = netm:get_network(iface)
- local device = net and net:get_interface()
- if device then
- local data = {
- id = iface,
- desc = net:get_i18n(),
- proto = net:proto(),
- uptime = net:uptime(),
- gwaddr = net:gwaddr(),
- ipaddrs = net:ipaddrs(),
- ip6addrs = net:ip6addrs(),
- dnsaddrs = net:dnsaddrs(),
- ip6prefix = net:ip6prefix(),
- errors = net:errors(),
- name = device:shortname(),
- type = device:type(),
- typename = device:get_type_i18n(),
- ifname = device:name(),
- macaddr = device:mac(),
- is_up = net:is_up() and device:is_up(),
- is_alias = net:is_alias(),
- is_dynamic = net:is_dynamic(),
- rx_bytes = device:rx_bytes(),
- tx_bytes = device:tx_bytes(),
- rx_packets = device:rx_packets(),
- tx_packets = device:tx_packets(),
-
- subdevices = { }
- }
-
- for _, device in ipairs(net:get_interfaces() or {}) do
- data.subdevices[#data.subdevices+1] = {
- name = device:shortname(),
- type = device:type(),
- typename = device:get_type_i18n(),
- ifname = device:name(),
- macaddr = device:mac(),
- is_up = device:is_up(),
- rx_bytes = device:rx_bytes(),
- tx_bytes = device:tx_bytes(),
- rx_packets = device:rx_packets(),
- tx_packets = device:tx_packets(),
- }
- end
-
- rv[#rv+1] = data
- else
- rv[#rv+1] = {
- id = iface,
- name = iface,
- type = "ethernet"
- }
- end
- end
-
- if #rv > 0 then
- luci.http.prepare_content("application/json")
- luci.http.write_json(rv)
- return
- end
-
- luci.http.status(404, "No such device")
-end
-
-function iface_reconnect(iface)
- local netmd = require "luci.model.network".init()
- local net = netmd:get_network(iface)
- if net then
- luci.sys.call("env -i /sbin/ifup %s >/dev/null 2>/dev/null"
- % luci.util.shellquote(iface))
- luci.http.status(200, "Reconnected")
- return
- end
-
- luci.http.status(404, "No such interface")
-end
-
-function wifi_status(devs)
- local s = require "luci.tools.status"
- local rv = { }
-
- if type(devs) == "string" then
- local dev
- for dev in devs:gmatch("[%w%.%-]+") do
- rv[#rv+1] = s.wifi_network(dev)
- end
- end
-
- if #rv > 0 then
- luci.http.prepare_content("application/json")
- luci.http.write_json(rv)
- return
- end
-
- luci.http.status(404, "No such device")
-end
-
-function wifi_reconnect(radio)
- local rc = luci.sys.call("env -i /sbin/wifi up %s" % luci.util.shellquote(radio))
-
- if rc == 0 then
- luci.http.status(200, "Reconnected")
- else
- luci.http.status(500, "Error")
- end
-end
-
-local function _wifi_get_scan_results(cache_key)
- local results = luci.util.ubus("session", "get", {
- ubus_rpc_session = luci.model.uci:get_session_id(),
- keys = { cache_key }
- })
-
- if type(results) == "table" and
- type(results.values) == "table" and
- type(results.values[cache_key]) == "table"
- then
- return results.values[cache_key]
+local function addr2dev(addr, src)
+ local ip = require "luci.ip"
+ local route = ip.route(addr, src)
+ if not src and route and route.src then
+ route = ip.route(addr, route.src:string())
end
+ return route and route.dev
+end
+
+function remote_addr()
+ local uci = require "luci.model.uci"
+ local peer = luci.http.getenv("REMOTE_ADDR")
+ local serv = luci.http.getenv("SERVER_ADDR")
+ local device = addr2dev(peer, serv)
+ local ifaces = luci.util.ubus("network.interface", "dump")
+ local indevs = {}
+ local inifs = {}
+
+ local result = {
+ remote_addr = peer,
+ server_addr = serv,
+ inbound_devices = {},
+ inbound_interfaces = {}
+ }
+
+ if type(ifaces) == "table" and type(ifaces.interface) == "table" then
+ for _, iface in ipairs(ifaces.interface) do
+ if type(iface) == "table" then
+ if iface.device == device or iface.l3_device == device then
+ inifs[iface.interface] = true
+ indevs[device] = true
+ end
- return { }
-end
-
-function wifi_scan_trigger(radio, update)
- local iw = radio and luci.sys.wifi.getiwinfo(radio)
-
- if not iw then
- luci.http.status(404, "No such radio device")
- return
- end
-
- luci.http.status(204, "Scan scheduled")
-
- if nixio.fork() == 0 then
- io.stderr:close()
- io.stdout:close()
-
- local _, bss
- local data, bssids = { }, { }
- local cache_key = "scan_%s" % radio
-
- luci.util.ubus("session", "set", {
- ubus_rpc_session = luci.model.uci:get_session_id(),
- values = { [cache_key] = nil }
- })
-
- for _, bss in ipairs(iw.scanlist or { }) do
- data[_] = bss
- bssids[bss.bssid] = bss
- end
-
- if update then
- for _, bss in ipairs(_wifi_get_scan_results(cache_key)) do
- if not bssids[bss.bssid] then
- bss.stale = true
- data[#data + 1] = bss
+ local peeraddr = uci:get("network", iface.interface, "peeraddr")
+ for _, ai in ipairs(peeraddr and nixio.getaddrinfo(peeraddr) or {}) do
+ local peerdev = addr2dev(ai.address)
+ if peerdev then
+ for _, iface in ipairs(ifaces.interface) do
+ if type(iface) == "table" and
+ (iface.device == peerdev or iface.l3_device == peerdev)
+ then
+ inifs[iface.interface] = true
+ indevs[peerdev] = true
+ end
+ end
+ end
end
end
end
-
- luci.util.ubus("session", "set", {
- ubus_rpc_session = luci.model.uci:get_session_id(),
- values = { [cache_key] = data }
- })
end
-end
-
-function wifi_scan_results(radio)
- local results = radio and _wifi_get_scan_results("scan_%s" % radio)
- if results and #results > 0 then
- luci.http.prepare_content("application/json")
- luci.http.write_json(results)
- else
- luci.http.status(404, "No wireless scan results")
+ for k in pairs(inifs) do
+ result.inbound_interfaces[#result.inbound_interfaces + 1] = k
end
-end
-function switch_status(switches)
- local s = require "luci.tools.status"
+ for k in pairs(indevs) do
+ result.inbound_devices[#result.inbound_devices + 1] = k
+ end
luci.http.prepare_content("application/json")
- luci.http.write_json(s.switch_status(switches))
+ luci.http.write_json(result)
end
function diag_command(cmd, addr)
diff --git a/root/usr/lib/lua/luci/controller/admin/status.lua b/root/usr/lib/lua/luci/controller/admin/status.lua
index 0d955c9..6f84149 100644
--- a/root/usr/lib/lua/luci/controller/admin/status.lua
+++ b/root/usr/lib/lua/luci/controller/admin/status.lua
@@ -5,6 +5,8 @@
module("luci.controller.admin.status", package.seeall)
function index()
+ local page
+
entry({"admin", "status", "overview"}, template("admin_status/index"), _("Overview"), 1)
entry({"admin", "status", "iptables"}, template("admin_status/iptables"), _("Firewall"), 2).leaf = true
@@ -14,23 +16,14 @@ function index()
entry({"admin", "status", "routes"}, template("admin_status/routes"), _("Routes"), 3)
entry({"admin", "status", "syslog"}, call("action_syslog"), _("System Log"), 4)
entry({"admin", "status", "dmesg"}, call("action_dmesg"), _("Kernel Log"), 5)
- entry({"admin", "status", "processes"}, form("admin_status/processes"), _("Processes"), 6)
+ entry({"admin", "status", "processes"}, view("status/processes"), _("Processes"), 6)
entry({"admin", "status", "realtime"}, alias("admin", "status", "realtime", "load"), _("Realtime Graphs"), 7)
- entry({"admin", "status", "realtime", "load"}, template("admin_status/load"), _("Load"), 1).leaf = true
- entry({"admin", "status", "realtime", "load_status"}, call("action_load")).leaf = true
-
- entry({"admin", "status", "realtime", "bandwidth"}, template("admin_status/bandwidth"), _("Traffic"), 2).leaf = true
- entry({"admin", "status", "realtime", "bandwidth_status"}, call("action_bandwidth")).leaf = true
-
- if nixio.fs.access("/etc/config/wireless") then
- entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3).leaf = true
- entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless")).leaf = true
- end
-
- entry({"admin", "status", "realtime", "connections"}, template("admin_status/connections"), _("Connections"), 4).leaf = true
- entry({"admin", "status", "realtime", "connections_status"}, call("action_connections")).leaf = true
+ entry({"admin", "status", "realtime", "load"}, view("status/load"), _("Load"), 1)
+ entry({"admin", "status", "realtime", "bandwidth"}, view("status/bandwidth"), _("Traffic"), 2)
+ entry({"admin", "status", "realtime", "wireless"}, view("status/wireless"), _("Wireless"), 3).uci_depends = { wireless = true }
+ entry({"admin", "status", "realtime", "connections"}, view("status/connections"), _("Connections"), 4)
entry({"admin", "status", "nameinfo"}, call("action_nameinfo")).leaf = true
end
@@ -79,97 +72,3 @@ function action_iptables()
luci.http.redirect(luci.dispatcher.build_url("admin/status/iptables"))
end
-
-function action_bandwidth(iface)
- luci.http.prepare_content("application/json")
-
- local bwc = io.popen("luci-bwc -i %s 2>/dev/null"
- % luci.util.shellquote(iface))
-
- if bwc then
- luci.http.write("[")
-
- while true do
- local ln = bwc:read("*l")
- if not ln then break end
- luci.http.write(ln)
- end
-
- luci.http.write("]")
- bwc:close()
- end
-end
-
-function action_wireless(iface)
- luci.http.prepare_content("application/json")
-
- local bwc = io.popen("luci-bwc -r %s 2>/dev/null"
- % luci.util.shellquote(iface))
-
- if bwc then
- luci.http.write("[")
-
- while true do
- local ln = bwc:read("*l")
- if not ln then break end
- luci.http.write(ln)
- end
-
- luci.http.write("]")
- bwc:close()
- end
-end
-
-function action_load()
- luci.http.prepare_content("application/json")
-
- local bwc = io.popen("luci-bwc -l 2>/dev/null")
- if bwc then
- luci.http.write("[")
-
- while true do
- local ln = bwc:read("*l")
- if not ln then break end
- luci.http.write(ln)
- end
-
- luci.http.write("]")
- bwc:close()
- end
-end
-
-function action_connections()
- local sys = require "luci.sys"
-
- luci.http.prepare_content("application/json")
-
- luci.http.write('{ "connections": ')
- luci.http.write_json(sys.net.conntrack())
-
- local bwc = io.popen("luci-bwc -c 2>/dev/null")
- if bwc then
- luci.http.write(', "statistics": [')
-
- while true do
- local ln = bwc:read("*l")
- if not ln then break end
- luci.http.write(ln)
- end
-
- luci.http.write("]")
- bwc:close()
- end
-
- luci.http.write(" }")
-end
-
-function action_nameinfo(...)
- local util = require "luci.util"
-
- luci.http.prepare_content("application/json")
- luci.http.write_json(util.ubus("network.rrdns", "lookup", {
- addrs = { ... },
- timeout = 5000,
- limit = 1000
- }) or { })
-end
diff --git a/root/usr/lib/lua/luci/controller/admin/system.lua b/root/usr/lib/lua/luci/controller/admin/system.lua
index 8791c00..1e0bebb 100644
--- a/root/usr/lib/lua/luci/controller/admin/system.lua
+++ b/root/usr/lib/lua/luci/controller/admin/system.lua
@@ -5,335 +5,27 @@
module("luci.controller.admin.system", package.seeall)
function index()
- local fs = require "nixio.fs"
-
- entry({"admin", "system", "system"}, cbi("admin_system/system"), _("System"), 1)
- entry({"admin", "system", "clock_status"}, post_on({ set = true }, "action_clock_status"))
+ entry({"admin", "system", "system"}, view("system/system"), _("System"), 1)
entry({"admin", "system", "admin"}, firstchild(), _("Administration"), 2)
- entry({"admin", "system", "admin", "password"}, template("admin_system/password"), _("Router Password"), 1)
- entry({"admin", "system", "admin", "password", "json"}, post("action_password"))
-
- if fs.access("/etc/config/dropbear") then
- entry({"admin", "system", "admin", "dropbear"}, cbi("admin_system/dropbear"), _("SSH Access"), 2)
- entry({"admin", "system", "admin", "sshkeys"}, template("admin_system/sshkeys"), _("SSH-Keys"), 3)
- entry({"admin", "system", "admin", "sshkeys", "json"}, post_on({ keys = true }, "action_sshkeys"))
- end
-
- entry({"admin", "system", "startup"}, form("admin_system/startup"), _("Startup"), 45)
- entry({"admin", "system", "crontab"}, form("admin_system/crontab"), _("Scheduled Tasks"), 46)
-
- if fs.access("/sbin/block") and fs.access("/etc/config/fstab") then
- entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), _("Mount Points"), 50)
- entry({"admin", "system", "fstab", "mount"}, cbi("admin_system/fstab/mount"), nil).leaf = true
- entry({"admin", "system", "fstab", "swap"}, cbi("admin_system/fstab/swap"), nil).leaf = true
- end
-
- local nodes, number = fs.glob("/sys/class/leds/*/trigger")
- if number > 0 then
- entry({"admin", "system", "leds"}, cbi("admin_system/leds"), _("LED Configuration"), 60)
- end
-
- entry({"admin", "system", "flashops"}, call("action_flashops"), _("Backup / Flash Firmware"), 70)
- entry({"admin", "system", "flashops", "reset"}, post("action_reset"))
- entry({"admin", "system", "flashops", "backup"}, post("action_backup"))
- entry({"admin", "system", "flashops", "backupmtdblock"}, post("action_backupmtdblock"))
- entry({"admin", "system", "flashops", "backupfiles"}, form("admin_system/backupfiles"))
-
- -- call() instead of post() due to upload handling!
- entry({"admin", "system", "flashops", "restore"}, call("action_restore"))
- entry({"admin", "system", "flashops", "sysupgrade"}, call("action_sysupgrade"))
-
- entry({"admin", "system", "reboot"}, template("admin_system/reboot"), _("Reboot"), 90)
- entry({"admin", "system", "reboot", "call"}, post("action_reboot"))
-end
-
-function action_clock_status()
- local set = tonumber(luci.http.formvalue("set"))
- if set ~= nil and set > 0 then
- local date = os.date("*t", set)
- if date then
- luci.sys.call("date -s '%04d-%02d-%02d %02d:%02d:%02d'" %{
- date.year, date.month, date.day, date.hour, date.min, date.sec
- })
- luci.sys.call("/etc/init.d/sysfixtime restart")
- end
- end
-
- luci.http.prepare_content("application/json")
- luci.http.write_json({ timestring = os.date("%c") })
-end
-
-local function image_supported(image)
- return (os.execute("sysupgrade -T %q >/dev/null" % image) == 0)
-end
-
-local function image_checksum(image)
- return (luci.sys.exec("md5sum %q" % image):match("^([^%s]+)"))
-end
-
-local function image_sha256_checksum(image)
- return (luci.sys.exec("sha256sum %q" % image):match("^([^%s]+)"))
-end
-
-local function supports_sysupgrade()
- return nixio.fs.access("/lib/upgrade/platform.sh")
-end
-
-local function supports_reset()
- return (os.execute([[grep -sq "^overlayfs:/overlay / overlay " /proc/mounts]]) == 0)
-end
-
-local function storage_size()
- local size = 0
- if nixio.fs.access("/proc/mtd") then
- for l in io.lines("/proc/mtd") do
- local d, s, e, n = l:match('^([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+"([^%s]+)"')
- if n == "linux" or n == "firmware" then
- size = tonumber(s, 16)
- break
- end
- end
- elseif nixio.fs.access("/proc/partitions") then
- for l in io.lines("/proc/partitions") do
- local x, y, b, n = l:match('^%s*(%d+)%s+(%d+)%s+([^%s]+)%s+([^%s]+)')
- if b and n and not n:match('[0-9]') then
- size = tonumber(b) * 1024
- break
- end
- end
- end
- return size
-end
-
-
-function action_flashops()
- --
- -- Overview
- --
- luci.template.render("admin_system/flashops", {
- reset_avail = supports_reset(),
- upgrade_avail = supports_sysupgrade()
- })
-end
-
-function action_sysupgrade()
- local fs = require "nixio.fs"
- local http = require "luci.http"
- local image_tmp = "/tmp/firmware.img"
-
- local fp
- http.setfilehandler(
- function(meta, chunk, eof)
- if not fp and meta and meta.name == "image" then
- fp = io.open(image_tmp, "w")
- end
- if fp and chunk then
- fp:write(chunk)
- end
- if fp and eof then
- fp:close()
- end
- end
- )
+ entry({"admin", "system", "admin", "password"}, view("system/password"), _("Router Password"), 1)
- if not luci.dispatcher.test_post_security() then
- fs.unlink(image_tmp)
- return
- end
+ entry({"admin", "system", "admin", "dropbear"}, view("system/dropbear"), _("SSH Access"), 2)
+ .uci_depends = { dropbear = true }
- --
- -- Cancel firmware flash
- --
- if http.formvalue("cancel") then
- fs.unlink(image_tmp)
- http.redirect(luci.dispatcher.build_url('admin/system/flashops'))
- return
- end
+ entry({"admin", "system", "admin", "sshkeys"}, view("system/sshkeys"), _("SSH-Keys"), 3)
+ .uci_depends = { dropbear = true }
- --
- -- Initiate firmware flash
- --
- local step = tonumber(http.formvalue("step")) or 1
- if step == 1 then
- local force = http.formvalue("force")
- if image_supported(image_tmp) or force then
- luci.template.render("admin_system/upgrade", {
- checksum = image_checksum(image_tmp),
- sha256ch = image_sha256_checksum(image_tmp),
- storage = storage_size(),
- size = (fs.stat(image_tmp, "size") or 0),
- keep = (not not http.formvalue("keep")),
- force = (not not http.formvalue("force"))
- })
- else
- fs.unlink(image_tmp)
- luci.template.render("admin_system/flashops", {
- reset_avail = supports_reset(),
- upgrade_avail = supports_sysupgrade(),
- image_invalid = true
- })
- end
+ entry({"admin", "system", "startup"}, view("system/startup"), _("Startup"), 45)
+ entry({"admin", "system", "crontab"}, view("system/crontab"), _("Scheduled Tasks"), 46)
- --
- -- Start sysupgrade flash
- --
- elseif step == 2 then
- local keep = (http.formvalue("keep") == "1") and "" or "-n"
- local force = (http.formvalue("force") == "1") and "-F" or ""
- luci.template.render("admin_system/applyreboot", {
- title = luci.i18n.translate("Flashing..."),
- msg = luci.i18n.translate("The system is flashing now. DO NOT POWER OFF THE DEVICE! Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
- addr = (#keep > 0) and (#force > 0) and "192.168.1.1" or nil
- })
- luci.sys.process.exec({ "/bin/sh", "-c","sleep 1; killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %s %q" %{ keep, force, image_tmp } }, nil, nil, true)
- end
-end
-
-function action_backup()
- luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s.tar.gz"'
- %{ luci.sys.hostname(), os.date("%Y-%m-%d") })
-
- luci.http.prepare_content("application/x-targz")
- luci.sys.process.exec({ "/sbin/sysupgrade", "--create-backup", "-" }, luci.http.write)
-end
-
-function action_backupmtdblock()
- local mv = luci.http.formvalue("mtdblockname") or ""
- local m, n = mv:match('^([^%s%./"]+)/%d+/(%d+)$')
-
- if not m and n then
- luci.http.status(400, "Bad Request")
- return
- end
-
- luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s-%s.bin"'
- %{ luci.sys.hostname(), m, os.date("%Y-%m-%d") })
-
- luci.http.prepare_content("application/octet-stream")
- luci.sys.process.exec({ "/bin/dd", "if=/dev/mtd%s" % n, "conv=fsync,notrunc" }, luci.http.write)
-end
-
-function action_restore()
- local fs = require "nixio.fs"
- local http = require "luci.http"
- local archive_tmp = "/tmp/restore.tar.gz"
-
- local fp
- http.setfilehandler(
- function(meta, chunk, eof)
- if not fp and meta and meta.name == "archive" then
- fp = io.open(archive_tmp, "w")
- end
- if fp and chunk then
- fp:write(chunk)
- end
- if fp and eof then
- fp:close()
- end
- end
- )
-
- if not luci.dispatcher.test_post_security() then
- fs.unlink(archive_tmp)
- return
- end
-
- local upload = http.formvalue("archive")
- if upload and #upload > 0 then
- if os.execute("gunzip -t %q >/dev/null 2>&1" % archive_tmp) == 0 then
- luci.template.render("admin_system/applyreboot")
- os.execute("tar -C / -xzf %q >/dev/null 2>&1" % archive_tmp)
- luci.sys.reboot()
- else
- luci.template.render("admin_system/flashops", {
- reset_avail = supports_reset(),
- upgrade_avail = supports_sysupgrade(),
- backup_invalid = true
- })
- end
- return
- end
-
- http.redirect(luci.dispatcher.build_url('admin/system/flashops'))
-end
+ entry({"admin", "system", "mounts"}, view("system/mounts"), _("Mount Points"), 50)
+ .file_depends = { "/sbin/block" }
-function action_reset()
- if supports_reset() then
- luci.template.render("admin_system/applyreboot", {
- title = luci.i18n.translate("Erasing..."),
- msg = luci.i18n.translate("The system is erasing the configuration partition now and will reboot itself when finished."),
- addr = "192.168.1.1"
- })
+ entry({"admin", "system", "leds"}, view("system/leds"), _("LED Configuration"), 60)
+ .file_depends = { "/sys/class/leds" }
- luci.sys.process.exec({ "/bin/sh", "-c", "sleep 1; killall dropbear uhttpd; sleep 1; jffs2reset -y && reboot" }, nil, nil, true)
- return
- end
-
- http.redirect(luci.dispatcher.build_url('admin/system/flashops'))
-end
-
-function action_password()
- local password = luci.http.formvalue("password")
- if not password then
- luci.http.status(400, "Bad Request")
- return
- end
-
- luci.http.prepare_content("application/json")
- luci.http.write_json({ code = luci.sys.user.setpasswd("root", password) })
-end
-
-function action_sshkeys()
- local keys = luci.http.formvalue("keys")
- if keys then
- keys = luci.jsonc.parse(keys)
- if not keys or type(keys) ~= "table" then
- luci.http.status(400, "Bad Request")
- return
- end
-
- local fd, err = io.open("/etc/dropbear/authorized_keys", "w")
- if not fd then
- luci.http.status(503, err)
- return
- end
-
- local _, k
- for _, k in ipairs(keys) do
- if type(k) == "string" and k:match("^%w+%-") then
- fd:write(k)
- fd:write("\n")
- end
- end
-
- fd:close()
- end
-
- local fd, err = io.open("/etc/dropbear/authorized_keys", "r")
- if not fd then
- luci.http.status(503, err)
- return
- end
-
- local rv = {}
- while true do
- local ln = fd:read("*l")
- if not ln then
- break
- elseif ln:match("^[%w%-]+%s+[A-Za-z0-9+/=]+$") or
- ln:match("^[%w%-]+%s+[A-Za-z0-9+/=]+%s")
- then
- rv[#rv+1] = ln
- end
- end
-
- fd:close()
-
- luci.http.prepare_content("application/json")
- luci.http.write_json(rv)
-end
+ entry({"admin", "system", "flash"}, view("system/flash"), _("Backup / Flash Firmware"), 70)
-function action_reboot()
- luci.sys.reboot()
+ entry({"admin", "system", "reboot"}, view("system/reboot"), _("Reboot"), 90)
end
diff --git a/root/usr/lib/lua/luci/controller/admin/uci.lua b/root/usr/lib/lua/luci/controller/admin/uci.lua
index 1d955dd..6b19c62 100644
--- a/root/usr/lib/lua/luci/controller/admin/uci.lua
+++ b/root/usr/lib/lua/luci/controller/admin/uci.lua
@@ -1,5 +1,5 @@
-- Copyright 2008 Steven Barth
--- Copyright 2010-2015 Jo-Philipp Wich
+-- Copyright 2010-2019 Jo-Philipp Wich
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.admin.uci", package.seeall)
@@ -9,8 +9,7 @@ function index()
or table.concat(luci.dispatcher.context.request, "/")
entry({"admin", "uci"}, nil, _("Configuration"))
- entry({"admin", "uci", "changes"}, post_on({ trigger_apply = true }, "action_changes"), _("Changes"), 40).query = {redir=redir}
- entry({"admin", "uci", "revert"}, post("action_revert"), _("Revert"), 30).query = {redir=redir}
+ entry({"admin", "uci", "revert"}, post("action_revert"), nil)
local node
local authen = function(checkpass, allowed_users)
@@ -31,34 +30,6 @@ function index()
end
-function action_changes()
- local uci = require "luci.model.uci"
- local changes = uci:changes()
-
- luci.template.render("admin_uci/changes", {
- changes = next(changes) and changes,
- timeout = timeout,
- trigger_apply = luci.http.formvalue("trigger_apply") and true or false
- })
-end
-
-function action_revert()
- local uci = require "luci.model.uci"
- local changes = uci:changes()
-
- -- Collect files to be reverted
- local r, tbl
- for r, tbl in pairs(changes) do
- uci:revert(r)
- end
-
- luci.template.render("admin_uci/revert", {
- changes = next(changes) and changes,
- trigger_revert = true
- })
-end
-
-
local function ubus_state_to_http(errstr)
local map = {
["Invalid command"] = 400,
@@ -107,3 +78,19 @@ function action_confirm()
local _, errstr = uci:confirm(token)
ubus_state_to_http(errstr)
end
+
+function action_revert()
+ local uci = require "luci.model.uci"
+ local changes = uci:changes()
+
+ -- Collect files to be reverted
+ local _, errstr, r, tbl
+ for r, tbl in pairs(changes) do
+ _, errstr = uci:revert(r)
+ if errstr then
+ break
+ end
+ end
+
+ ubus_state_to_http(errstr or "OK")
+end
diff --git a/root/usr/lib/lua/luci/controller/aria2.lua b/root/usr/lib/lua/luci/controller/aria2.lua
index 56172ec..4891727 100644
--- a/root/usr/lib/lua/luci/controller/aria2.lua
+++ b/root/usr/lib/lua/luci/controller/aria2.lua
@@ -1,15 +1,11 @@
---[[
-LuCI - Lua Configuration Interface - aria2 support
+-- Copyright 2016-2019 Xingwang Liao
+-- Licensed to the public under the MIT License.
-Copyright 2014-2015 nanpuyue
-Modified by kuoruan
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-]]--
+local fs = require "nixio.fs"
+local sys = require "luci.sys"
+local http = require "luci.http"
+local util = require "luci.util"
+local uci = require "luci.model.uci".cursor()
module("luci.controller.aria2", package.seeall)
@@ -18,26 +14,48 @@ function index()
return
end
- local page = entry({"admin", "services", "aria2"}, cbi("aria2"), _("Aria2 Settings"))
- page.dependent = true
+ entry({"admin", "services", "aria2"},
+ firstchild(), _("Aria2")).dependent = false
- entry({"admin", "services", "aria2", "status"}, call("status")).leaf = true
+ entry({"admin", "services", "aria2", "config"},
+ cbi("aria2/config"), _("Configuration"), 1)
-end
+ entry({"admin", "services", "aria2", "file"},
+ form("aria2/files"), _("Files"), 2)
+
+ entry({"admin", "services", "aria2", "log"},
+ firstchild(), _("Log"), 3)
-function status()
- local sys = require "luci.sys"
- local ipkg = require "luci.model.ipkg"
- local http = require "luci.http"
- local uci = require "luci.model.uci".cursor()
+ entry({"admin", "services", "aria2", "log", "view"},
+ template("aria2/log_template"))
+
+ entry({"admin", "services", "aria2", "log", "read"},
+ call("action_log_read"))
+
+ entry({"admin", "services", "aria2", "status"},
+ call("action_status"))
+
+end
+function action_status()
local status = {
- running = (sys.call("pidof aria2c > /dev/null") == 0),
- yaaw = ipkg.installed("yaaw"),
- webui = ipkg.installed("webui-aria2"),
- ariang = (ipkg.installed("ariang") or ipkg.installed("ariang-nginx"))
+ running = (sys.call("pidof aria2c >/dev/null") == 0)
}
http.prepare_content("application/json")
http.write_json(status)
end
+
+function action_log_read()
+ local data = { log = "", syslog = "" }
+
+ local log_file = uci:get("aria2", "main", "log") or "/var/log/aria2.log"
+ if fs.access(log_file) then
+ data.log = util.trim(sys.exec("tail -n 50 %s | sed 'x;1!H;$!d;x'" % log_file))
+ end
+
+ data.syslog = util.trim(sys.exec("logread | grep aria2 | tail -n 50 | sed 'x;1!H;$!d;x'"))
+
+ http.prepare_content("application/json")
+ http.write_json(data)
+end
diff --git a/root/usr/lib/lua/luci/controller/firewall.lua b/root/usr/lib/lua/luci/controller/firewall.lua
index 4fe7770..5f8cb6e 100644
--- a/root/usr/lib/lua/luci/controller/firewall.lua
+++ b/root/usr/lib/lua/luci/controller/firewall.lua
@@ -6,18 +6,14 @@ function index()
_("Firewall"), 60)
entry({"admin", "network", "firewall", "zones"},
- arcombine(cbi("firewall/zones"), cbi("firewall/zone-details")),
- _("General Settings"), 10).leaf = true
+ view("firewall/zones"), _("General Settings"), 10)
entry({"admin", "network", "firewall", "forwards"},
- arcombine(cbi("firewall/forwards"), cbi("firewall/forward-details")),
- _("Port Forwards"), 20).leaf = true
+ view("firewall/forwards"), _("Port Forwards"), 20)
entry({"admin", "network", "firewall", "rules"},
- arcombine(cbi("firewall/rules"), cbi("firewall/rule-details")),
- _("Traffic Rules"), 30).leaf = true
+ view("firewall/rules"), _("Traffic Rules"), 30)
entry({"admin", "network", "firewall", "custom"},
- form("firewall/custom"),
- _("Custom Rules"), 40).leaf = true
+ view("firewall/custom"), _("Custom Rules"), 40).leaf = true
end
diff --git a/root/usr/lib/lua/luci/controller/opkg.lua b/root/usr/lib/lua/luci/controller/opkg.lua
index 74aa166..29c9a08 100644
--- a/root/usr/lib/lua/luci/controller/opkg.lua
+++ b/root/usr/lib/lua/luci/controller/opkg.lua
@@ -12,12 +12,25 @@ function index()
end
function action_list(mode)
+ local util = require "luci.util"
local cmd
if mode == "installed" then
cmd = { "/bin/cat", "/usr/lib/opkg/status" }
else
- cmd = { "/bin/sh", "-c", [[find /tmp/opkg-lists/ -type f '!' -name '*.sig' | xargs -r gzip -cd]] }
+ local lists_dir = nil
+
+ local fd = io.popen([[sed -rne 's#^lists_dir \S+ (\S+)#\1#p' /etc/opkg.conf /etc/opkg/*.conf 2>/dev/null]], "r")
+ if fd then
+ lists_dir = fd:read("*l")
+ fd:close()
+ end
+
+ if not lists_dir or #lists_dir == "" then
+ lists_dir = "/tmp/opkg-lists"
+ end
+
+ cmd = { "/bin/sh", "-c", [[find %s -type f '!' -name '*.sig' | xargs -r gzip -cd]] % util.shellquote(lists_dir) }
end
luci.http.prepare_content("text/plain; charset=utf-8")
@@ -26,13 +39,17 @@ end
function action_exec(command, package)
local sys = require "luci.sys"
- local cmd = { "/bin/opkg", "--force-removal-of-dependent-packages", "--force-overwrite" }
+ local cmd = { "/bin/opkg", "--force-removal-of-dependent-packages" }
local pkg = luci.http.formvalue("package")
if luci.http.formvalue("autoremove") == "true" then
cmd[#cmd + 1] = "--autoremove"
end
+ if luci.http.formvalue("overwrite") == "true" then
+ cmd[#cmd + 1] = "--force-overwrite"
+ end
+
cmd[#cmd + 1] = command
if pkg then
diff --git a/root/usr/lib/lua/luci/controller/samba4.lua b/root/usr/lib/lua/luci/controller/samba4.lua
index 8ad0e52..03c5355 100644
--- a/root/usr/lib/lua/luci/controller/samba4.lua
+++ b/root/usr/lib/lua/luci/controller/samba4.lua
@@ -7,8 +7,5 @@ function index()
return
end
- local page
-
- page = entry({"admin", "services", "samba4"}, cbi("samba4"), _("Network Shares"))
- page.dependent = true
+ entry({"admin", "services", "samba4"}, view("samba4"), _("Network Shares")).dependent = true
end
diff --git a/root/usr/lib/lua/luci/dispatcher.lua b/root/usr/lib/lua/luci/dispatcher.lua
index 626a46d..b43b94f 100644
--- a/root/usr/lib/lua/luci/dispatcher.lua
+++ b/root/usr/lib/lua/luci/dispatcher.lua
@@ -62,9 +62,73 @@ function _ordered_children(node)
return children
end
+local function dependencies_satisfied(node)
+ if type(node.file_depends) == "table" then
+ for _, file in ipairs(node.file_depends) do
+ local ftype = fs.stat(file, "type")
+ if ftype == "dir" then
+ local empty = true
+ for e in (fs.dir(file) or function() end) do
+ empty = false
+ end
+ if empty then
+ return false
+ end
+ elseif ftype == nil then
+ return false
+ end
+ end
+ end
+
+ if type(node.uci_depends) == "table" then
+ for config, expect_sections in pairs(node.uci_depends) do
+ if type(expect_sections) == "table" then
+ for section, expect_options in pairs(expect_sections) do
+ if type(expect_options) == "table" then
+ for option, expect_value in pairs(expect_options) do
+ local val = uci:get(config, section, option)
+ if expect_value == true and val == nil then
+ return false
+ elseif type(expect_value) == "string" then
+ if type(val) == "table" then
+ local found = false
+ for _, subval in ipairs(val) do
+ if subval == expect_value then
+ found = true
+ end
+ end
+ if not found then
+ return false
+ end
+ elseif val ~= expect_value then
+ return false
+ end
+ end
+ end
+ else
+ local val = uci:get(config, section)
+ if expect_options == true and val == nil then
+ return false
+ elseif type(expect_options) == "string" and val ~= expect_options then
+ return false
+ end
+ end
+ end
+ elseif expect_sections == true then
+ if not uci:get_first(config) then
+ return false
+ end
+ end
+ end
+ end
+
+ return true
+end
+
function node_visible(node)
if node then
return not (
+ (not dependencies_satisfied(node)) or
(not node.title or #node.title == 0) or
(not node.target or node.hidden == true) or
(type(node.target) == "table" and node.target.type == "firstchild" and
@@ -149,7 +213,11 @@ function httpdispatch(request, prefix)
--context._disable_memtrace()
end
-local function require_post_security(target)
+local function require_post_security(target, args)
+ if type(target) == "table" and target.type == "arcombine" and type(target.targets) == "table" then
+ return require_post_security((type(args) == "table" and #args > 0) and target.targets[2] or target.targets[1], args)
+ end
+
if type(target) == "table" then
if type(target.post) == "table" then
local param_name, required_val, request_val
@@ -470,7 +538,7 @@ function dispatch(request)
return
end
- if c and require_post_security(c.target) then
+ if c and require_post_security(c.target, args) then
if not test_post_security(c) then
return
end
@@ -857,6 +925,15 @@ function template(name)
end
+local _view = function(self, ...)
+ require "luci.template".render("view", { view = self.view })
+end
+
+function view(name)
+ return {type = "view", view = name, target = _view}
+end
+
+
local function _cbi(self, ...)
local cbi = require "luci.cbi"
local tpl = require "luci.template"
diff --git a/root/usr/lib/lua/luci/i18n/aria2.zh-cn.lmo b/root/usr/lib/lua/luci/i18n/aria2.zh-cn.lmo
index e7da89a..7462903 100644
Binary files a/root/usr/lib/lua/luci/i18n/aria2.zh-cn.lmo and b/root/usr/lib/lua/luci/i18n/aria2.zh-cn.lmo differ
diff --git a/root/usr/lib/lua/luci/i18n/base.zh-cn.lmo b/root/usr/lib/lua/luci/i18n/base.zh-cn.lmo
index bff2963..45bbea6 100644
Binary files a/root/usr/lib/lua/luci/i18n/base.zh-cn.lmo and b/root/usr/lib/lua/luci/i18n/base.zh-cn.lmo differ
diff --git a/root/usr/lib/lua/luci/i18n/firewall.zh-cn.lmo b/root/usr/lib/lua/luci/i18n/firewall.zh-cn.lmo
new file mode 100644
index 0000000..819547a
Binary files /dev/null and b/root/usr/lib/lua/luci/i18n/firewall.zh-cn.lmo differ
diff --git a/root/usr/lib/lua/luci/i18n/minidlna.zh-cn.lmo b/root/usr/lib/lua/luci/i18n/minidlna.zh-cn.lmo
index 6a8fc48..2b86833 100644
Binary files a/root/usr/lib/lua/luci/i18n/minidlna.zh-cn.lmo and b/root/usr/lib/lua/luci/i18n/minidlna.zh-cn.lmo differ
diff --git a/root/usr/lib/lua/luci/i18n/samba.zh-cn.lmo b/root/usr/lib/lua/luci/i18n/samba.zh-cn.lmo
new file mode 100644
index 0000000..8937249
Binary files /dev/null and b/root/usr/lib/lua/luci/i18n/samba.zh-cn.lmo differ
diff --git a/root/usr/lib/lua/luci/i18n/samba4.zh-cn.lmo b/root/usr/lib/lua/luci/i18n/samba4.zh-cn.lmo
index 34e6dd4..dab4fd5 100644
Binary files a/root/usr/lib/lua/luci/i18n/samba4.zh-cn.lmo and b/root/usr/lib/lua/luci/i18n/samba4.zh-cn.lmo differ
diff --git a/root/usr/lib/lua/luci/ip.so b/root/usr/lib/lua/luci/ip.so
index d3e1408..1220051 100755
Binary files a/root/usr/lib/lua/luci/ip.so and b/root/usr/lib/lua/luci/ip.so differ
diff --git a/root/usr/lib/lua/luci/jsonc.so b/root/usr/lib/lua/luci/jsonc.so
index 8e786d0..2cb96d0 100755
Binary files a/root/usr/lib/lua/luci/jsonc.so and b/root/usr/lib/lua/luci/jsonc.so differ
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/dhcp.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/dhcp.lua
deleted file mode 100644
index 0be1b3f..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/dhcp.lua
+++ /dev/null
@@ -1,344 +0,0 @@
--- Copyright 2008 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-local ipc = require "luci.ip"
-local sys = require "luci.sys"
-local o
-require "luci.util"
-
-m = Map("dhcp", translate("DHCP and DNS"),
- translate("Dnsmasq is a combined DHCP-Server and DNS-" ..
- "Forwarder for NAT " ..
- "firewalls"))
-
-s = m:section(TypedSection, "dnsmasq", translate("Server Settings"))
-s.anonymous = true
-s.addremove = false
-
-s:tab("general", translate("General Settings"))
-s:tab("files", translate("Resolv and Hosts Files"))
-s:tab("tftp", translate("TFTP Settings"))
-s:tab("advanced", translate("Advanced Settings"))
-
-s:taboption("general", Flag, "domainneeded",
- translate("Domain required"),
- translate("Don't forward DNS-Requests without " ..
- "DNS-Name"))
-
-s:taboption("general", Flag, "authoritative",
- translate("Authoritative"),
- translate("This is the only DHCP" ..
- "abbr> in the local network"))
-
-
-s:taboption("files", Flag, "readethers",
- translate("Use /etc/ethers"),
- translate("Read /etc/ethers to configure the DHCP-Server"))
-
-s:taboption("files", Value, "leasefile",
- translate("Leasefile"),
- translate("file where given DHCP" ..
- "abbr>-leases will be stored"))
-
-s:taboption("files", Flag, "noresolv",
- translate("Ignore resolve file")).optional = true
-
-rf = s:taboption("files", Value, "resolvfile",
- translate("Resolve file"),
- translate("local DNS file"))
-
-rf:depends("noresolv", "")
-rf.optional = true
-
-
-s:taboption("files", Flag, "nohosts",
- translate("Ignore /etc/hosts")).optional = true
-
-s:taboption("files", DynamicList, "addnhosts",
- translate("Additional Hosts files")).optional = true
-
-qu = s:taboption("advanced", Flag, "quietdhcp",
- translate("Suppress logging"),
- translate("Suppress logging of the routine operation of these protocols"))
-qu.optional = true
-
-se = s:taboption("advanced", Flag, "sequential_ip",
- translate("Allocate IP sequentially"),
- translate("Allocate IP addresses sequentially, starting from the lowest available address"))
-se.optional = true
-
-bp = s:taboption("advanced", Flag, "boguspriv",
- translate("Filter private"),
- translate("Do not forward reverse lookups for local networks"))
-bp.default = bp.enabled
-
-s:taboption("advanced", Flag, "filterwin2k",
- translate("Filter useless"),
- translate("Do not forward requests that cannot be answered by public name servers"))
-
-
-s:taboption("advanced", Flag, "localise_queries",
- translate("Localise queries"),
- translate("Localise hostname depending on the requesting subnet if multiple IPs are available"))
-
-local have_dnssec_support = luci.util.checklib("/usr/sbin/dnsmasq", "libhogweed.so")
-
-if have_dnssec_support then
- o = s:taboption("advanced", Flag, "dnssec",
- translate("DNSSEC"))
- o.optional = true
-
- o = s:taboption("advanced", Flag, "dnsseccheckunsigned",
- translate("DNSSEC check unsigned"),
- translate("Requires upstream supports DNSSEC; verify unsigned domain responses really come from unsigned domains"))
- o.optional = true
-end
-
-s:taboption("general", Value, "local",
- translate("Local server"),
- translate("Local domain specification. Names matching this domain are never forwarded and are resolved from DHCP or hosts files only"))
-
-s:taboption("general", Value, "domain",
- translate("Local domain"),
- translate("Local domain suffix appended to DHCP names and hosts file entries"))
-
-s:taboption("advanced", Flag, "expandhosts",
- translate("Expand hosts"),
- translate("Add local domain suffix to names served from hosts files"))
-
-s:taboption("advanced", Flag, "nonegcache",
- translate("No negative cache"),
- translate("Do not cache negative replies, e.g. for not existing domains"))
-
-s:taboption("advanced", Value, "serversfile",
- translate("Additional servers file"),
- translate("This file may contain lines like 'server=/domain/1.2.3.4' or 'server=1.2.3.4' for"..
- "domain-specific or full upstream DNS servers."))
-
-s:taboption("advanced", Flag, "strictorder",
- translate("Strict order"),
- translate("DNS servers will be queried in the " ..
- "order of the resolvfile")).optional = true
-
-s:taboption("advanced", Flag, "allservers",
- translate("All Servers"),
- translate("Query all available upstream DNS servers")).optional = true
-
-bn = s:taboption("advanced", DynamicList, "bogusnxdomain", translate("Bogus NX Domain Override"),
- translate("List of hosts that supply bogus NX domain results"))
-
-bn.optional = true
-bn.placeholder = "67.215.65.132"
-
-
-s:taboption("general", Flag, "logqueries",
- translate("Log queries"),
- translate("Write received DNS requests to syslog")).optional = true
-
-df = s:taboption("general", DynamicList, "server", translate("DNS forwardings"),
- translate("List of DNS " ..
- "servers to forward requests to"))
-
-df.optional = true
-df.placeholder = "/example.org/10.1.2.3"
-
-
-rp = s:taboption("general", Flag, "rebind_protection",
- translate("Rebind protection"),
- translate("Discard upstream RFC1918 responses"))
-
-rp.rmempty = false
-
-
-rl = s:taboption("general", Flag, "rebind_localhost",
- translate("Allow localhost"),
- translate("Allow upstream responses in the 127.0.0.0/8 range, e.g. for RBL services"))
-
-rl:depends("rebind_protection", "1")
-
-
-rd = s:taboption("general", DynamicList, "rebind_domain",
- translate("Domain whitelist"),
- translate("List of domains to allow RFC1918 responses for"))
-rd.optional = true
-
-rd:depends("rebind_protection", "1")
-rd.datatype = "host(1)"
-rd.placeholder = "ihost.netflix.com"
-
-
-pt = s:taboption("advanced", Value, "port",
- translate("DNS server port"),
- translate("Listening port for inbound DNS queries"))
-
-pt.optional = true
-pt.datatype = "port"
-pt.placeholder = 53
-
-
-qp = s:taboption("advanced", Value, "queryport",
- translate("DNS query port"),
- translate("Fixed source port for outbound DNS queries"))
-
-qp.optional = true
-qp.datatype = "port"
-qp.placeholder = translate("any")
-
-
-lm = s:taboption("advanced", Value, "dhcpleasemax",
- translate("Max. DHCP leases"),
- translate("Maximum allowed number of active DHCP leases"))
-
-lm.optional = true
-lm.datatype = "uinteger"
-lm.placeholder = translate("unlimited")
-
-
-em = s:taboption("advanced", Value, "ednspacket_max",
- translate("Max. EDNS0 packet size"),
- translate("Maximum allowed size of EDNS.0 UDP packets"))
-
-em.optional = true
-em.datatype = "uinteger"
-em.placeholder = 1280
-
-
-cq = s:taboption("advanced", Value, "dnsforwardmax",
- translate("Max. concurrent queries"),
- translate("Maximum allowed number of concurrent DNS queries"))
-
-cq.optional = true
-cq.datatype = "uinteger"
-cq.placeholder = 150
-
-cs = s:taboption("advanced", Value, "cachesize",
- translate("Size of DNS query cache"),
- translate("Number of cached DNS entries (max is 10000, 0 is no caching)"))
-cs.optional = true
-cs.datatype = "range(0,10000)"
-cs.placeholder = 150
-
-s:taboption("tftp", Flag, "enable_tftp",
- translate("Enable TFTP server")).optional = true
-
-tr = s:taboption("tftp", Value, "tftp_root",
- translate("TFTP server root"),
- translate("Root directory for files served via TFTP"))
-
-tr.optional = true
-tr:depends("enable_tftp", "1")
-tr.placeholder = "/"
-
-
-db = s:taboption("tftp", Value, "dhcp_boot",
- translate("Network boot image"),
- translate("Filename of the boot image advertised to clients"))
-
-db.optional = true
-db:depends("enable_tftp", "1")
-db.placeholder = "pxelinux.0"
-
-o = s:taboption("general", Flag, "localservice",
- translate("Local Service Only"),
- translate("Limit DNS service to subnets interfaces on which we are serving DNS."))
-o.optional = false
-o.rmempty = false
-
-o = s:taboption("general", Flag, "nonwildcard",
- translate("Non-wildcard"),
- translate("Bind dynamically to interfaces rather than wildcard address (recommended as linux default)"))
-o.optional = false
-o.rmempty = true
-
-o = s:taboption("general", DynamicList, "interface",
- translate("Listen Interfaces"),
- translate("Limit listening to these interfaces, and loopback."))
-o.optional = true
-
-o = s:taboption("general", DynamicList, "notinterface",
- translate("Exclude interfaces"),
- translate("Prevent listening on these interfaces."))
-o.optional = true
-
-m:section(SimpleSection).template = "lease_status"
-
-s = m:section(TypedSection, "host", translate("Static Leases"),
- translate("Static leases are used to assign fixed IP addresses and symbolic hostnames to " ..
- "DHCP clients. They are also required for non-dynamic interface configurations where " ..
- "only hosts with a corresponding lease are served.") .. " " ..
- translate("Use the Add Button to add a new lease entry. The MAC-Address " ..
- "identifies the host, the IPv4-Address specifies the fixed address to " ..
- "use, and the Hostname is assigned as a symbolic name to the requesting host. " ..
- "The optional Lease time can be used to set non-standard host-specific " ..
- "lease time, e.g. 12h, 3d or infinite."))
-
-s.addremove = true
-s.anonymous = true
-s.template = "cbi/tblsection"
-
-name = s:option(Value, "name", translate("Hostname"))
-name.datatype = "hostname('strict')"
-name.rmempty = true
-
-function name.write(self, section, value)
- Value.write(self, section, value)
- m:set(section, "dns", "1")
-end
-
-function name.remove(self, section)
- Value.remove(self, section)
- m:del(section, "dns")
-end
-
-mac = s:option(Value, "mac", translate("MAC-Address"))
-mac.datatype = "list(unique(macaddr))"
-mac.rmempty = true
-
-function mac.cfgvalue(self, section)
- local val = Value.cfgvalue(self, section)
- return ipc.checkmac(val) or val
-end
-
-ip = s:option(Value, "ip", translate("IPv4-Address"))
-ip.datatype = "or(ip4addr,'ignore')"
-
-time = s:option(Value, "leasetime", translate("Lease time"))
-time.rmempty = true
-
-duid = s:option(Value, "duid", translate("DUID"))
-duid.datatype = "and(rangelength(20,36),hexstring)"
-fp = io.open("/var/hosts/odhcpd")
-if fp then
- for line in fp:lines() do
- local net_val, duid_val = string.match(line, "# (%S+)%s+(%S+)")
- if duid_val then
- duid:value(duid_val, duid_val)
- end
- end
- fp:close()
-end
-
-hostid = s:option(Value, "hostid", translate("IPv6-Suffix (hex)"))
-
-sys.net.host_hints(function(m, v4, v6, name)
- if m and v4 then
- ip:value(v4)
- mac:value(m, "%s (%s)" %{ m, name or v4 })
- end
-end)
-
-function ip.validate(self, value, section)
- local m = mac:formvalue(section) or ""
- local n = name:formvalue(section) or ""
- if value and #n == 0 and #m == 0 then
- return nil, translate("One of hostname or mac address must be specified!")
- end
- return Value.validate(self, value, section)
-end
-
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/hosts.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/hosts.lua
deleted file mode 100644
index 46945af..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/hosts.lua
+++ /dev/null
@@ -1,31 +0,0 @@
--- Copyright 2008 Steven Barth
--- Copyright 2010-2015 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local ipc = require "luci.ip"
-local sys = require "luci.sys"
-
-m = Map("dhcp", translate("Hostnames"))
-
-s = m:section(TypedSection, "domain", translate("Host entries"))
-s.addremove = true
-s.anonymous = true
-s.template = "cbi/tblsection"
-
-hn = s:option(Value, "name", translate("Hostname"))
-hn.datatype = "hostname"
-hn.rmempty = true
-
-ip = s:option(Value, "ip", translate("IP address"))
-ip.datatype = "ipaddr"
-ip.rmempty = true
-
-sys.net.host_hints(function(mac, v4, v6, name)
- v6 = v6 and ipc.IPv6(v6)
-
- if v4 or (v6 and not v6:is6linklocal()) then
- ip:value(tostring(v4 or v6), "%s (%s)" %{ tostring(v4 or v6), name or mac })
- end
-end)
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/iface_add.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/iface_add.lua
deleted file mode 100644
index ca66e9f..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/iface_add.lua
+++ /dev/null
@@ -1,101 +0,0 @@
--- Copyright 2009-2010 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local nw = require "luci.model.network".init()
-local fw = require "luci.model.firewall".init()
-local utl = require "luci.util"
-local uci = require "luci.model.uci".cursor()
-
-m = SimpleForm("network", translate("Create Interface"))
-m.redirect = luci.dispatcher.build_url("admin/network/network")
-m.reset = false
-
-function m.on_cancel()
- luci.http.redirect(luci.dispatcher.build_url("admin/network/network"))
-end
-
-newnet = m:field(Value, "_netname", translate("Name of the new interface"),
- translate("The allowed characters are: A-Z, a-z, " ..
- "0-9 and _"
- ))
-
-newnet:depends("_attach", "")
-newnet.default = arg[1] and "net_" .. arg[1]:gsub("[^%w_]+", "_")
-newnet.datatype = "and(uciname,maxlength(15))"
-
-advice = m:field(DummyValue, "d1", translate("Note: interface name length"),
- translate("Maximum length of the name is 15 characters including " ..
- "the automatic protocol/bridge prefix (br-, 6in4-, pppoe- etc.)"
- ))
-
-newproto = m:field(ListValue, "_netproto", translate("Protocol of the new interface"))
-
-netbridge = m:field(Flag, "_bridge", translate("Create a bridge over multiple interfaces"))
-
-
-sifname = m:field(Value, "_ifname", translate("Cover the following interface"))
-
-sifname.widget = "radio"
-sifname.template = "cbi/network_ifacelist"
-sifname.nobridges = true
-
-
-mifname = m:field(Value, "_ifnames", translate("Cover the following interfaces"))
-
-mifname.widget = "checkbox"
-mifname.template = "cbi/network_ifacelist"
-mifname.nobridges = true
-
-
-local _, p
-for _, p in ipairs(nw:get_protocols()) do
- if p:is_installed() then
- newproto:value(p:proto(), p:get_i18n())
- if not p:is_virtual() then netbridge:depends("_netproto", p:proto()) end
- if not p:is_floating() then
- sifname:depends({ _bridge = "", _netproto = p:proto()})
- mifname:depends({ _bridge = "1", _netproto = p:proto()})
- end
- end
-end
-
-function newproto.validate(self, value, section)
- local name = newnet:formvalue(section)
- if not name or #name == 0 then
- newnet:add_error(section, translate("No network name specified"))
- elseif m:get(name) then
- newnet:add_error(section, translate("The given network name is not unique"))
- end
-
- local proto = nw:get_protocol(value)
- if proto and not proto:is_floating() then
- local br = (netbridge:formvalue(section) == "1")
- local ifn = br and mifname:formvalue(section) or sifname:formvalue(section)
- for ifn in utl.imatch(ifn) do
- return value
- end
- return nil, translate("The selected protocol needs a device assigned")
- end
- return value
-end
-
-function newproto.write(self, section, value)
- local name = newnet:formvalue(section)
- if name and #name > 0 then
- local br = (netbridge:formvalue(section) == "1") and "bridge" or nil
- local net = nw:add_network(name, { proto = value, type = br })
- if net then
- local ifn
- for ifn in utl.imatch(
- br and mifname:formvalue(section) or sifname:formvalue(section)
- ) do
- net:add_interface(ifn)
- end
- nw:save("network")
- nw:save("wireless")
- end
- luci.http.redirect(luci.dispatcher.build_url("admin/network/network", name))
- end
-end
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/ifaces.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/ifaces.lua
deleted file mode 100644
index 5b23079..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/ifaces.lua
+++ /dev/null
@@ -1,563 +0,0 @@
--- Copyright 2008 Steven Barth
--- Copyright 2008-2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local ut = require "luci.util"
-local pt = require "luci.tools.proto"
-local nw = require "luci.model.network"
-local fw = require "luci.model.firewall"
-
-arg[1] = arg[1] or ""
-
-local has_dnsmasq = fs.access("/etc/config/dhcp")
-local has_firewall = fs.access("/etc/config/firewall")
-
-m = Map("network", translate("Interfaces") .. " - " .. arg[1]:upper(), translate("On this page you can configure the network interfaces. You can bridge several interfaces by ticking the \"bridge interfaces\" field and enter the names of several network interfaces separated by spaces. You can also use VLAN notation INTERFACE.VLANNR (e.g.: eth0.1)."))
-m.redirect = luci.dispatcher.build_url("admin", "network", "network")
-m:chain("wireless")
-m:chain("luci")
-
-if has_firewall then
- m:chain("firewall")
-end
-
-nw.init(m.uci)
-fw.init(m.uci)
-
-
-local net = nw:get_network(arg[1])
-
-local function set_ifstate(name, option, value)
- local found = false
-
- m.uci:foreach("luci", "ifstate", function (s)
- if s.interface == name then
- m.uci:set("luci", s[".name"], option, value)
- found = true
- return false
- end
- end)
-
- if not found then
- local sid = m.uci:add("luci", "ifstate")
- m.uci:set("luci", sid, "interface", name)
- m.uci:set("luci", sid, option, value)
- end
-
- m.uci:save("luci")
-end
-
-local function get_ifstate(name, option)
- local val
-
- m.uci:foreach("luci", "ifstate", function (s)
- if s.interface == name then
- val = s[option]
- return false
- end
- end)
-
- return val
-end
-
-local function backup_ifnames(is_bridge)
- if not net:is_floating() and not get_ifstate(net:name(), "ifname") then
- local ifcs = net:get_interfaces() or { net:get_interface() }
- if ifcs then
- local _, ifn
- local ifns = { }
- for _, ifn in ipairs(ifcs) do
- local wif = ifn:get_wifinet()
- ifns[#ifns+1] = wif and wif:id() or ifn:name()
- end
- if #ifns > 0 then
- set_ifstate(net:name(), "ifname", table.concat(ifns, " "))
- set_ifstate(net:name(), "bridge", tostring(net:is_bridge()))
- end
- end
- end
-end
-
-
--- redirect to overview page if network does not exist anymore (e.g. after a revert)
-if not net then
- luci.http.redirect(luci.dispatcher.build_url("admin/network/network"))
- return
-end
-
--- protocol switch was requested, rebuild interface config and reload page
-if m:formvalue("cbid.network.%s._switch" % net:name()) then
- -- get new protocol
- local ptype = m:formvalue("cbid.network.%s.proto" % net:name()) or "-"
- local proto = nw:get_protocol(ptype, net:name())
- if proto then
- -- backup default
- backup_ifnames()
-
- -- if current proto is not floating and target proto is not floating,
- -- then attempt to retain the ifnames
- --error(net:proto() .. " > " .. proto:proto())
- if not net:is_floating() and not proto:is_floating() then
- -- if old proto is a bridge and new proto not, then clip the
- -- interface list to the first ifname only
- if net:is_bridge() and proto:is_virtual() then
- local _, ifn
- local first = true
- for _, ifn in ipairs(net:get_interfaces() or { net:get_interface() }) do
- if first then
- first = false
- else
- net:del_interface(ifn)
- end
- end
- m:del(net:name(), "type")
- end
-
- -- if the current proto is floating, the target proto not floating,
- -- then attempt to restore ifnames from backup
- elseif net:is_floating() and not proto:is_floating() then
- -- if we have backup data, then re-add all orphaned interfaces
- -- from it and restore the bridge choice
- local br = (get_ifstate(net:name(), "bridge") == "true")
- local ifn
- local ifns = { }
- for ifn in ut.imatch(get_ifstate(net:name(), "ifname")) do
- ifn = nw:get_interface(ifn)
- if ifn and not ifn:get_network() then
- proto:add_interface(ifn)
- if not br then
- break
- end
- end
- end
- if br then
- m:set(net:name(), "type", "bridge")
- end
-
- -- in all other cases clear the ifnames
- else
- local _, ifc
- for _, ifc in ipairs(net:get_interfaces() or { net:get_interface() }) do
- net:del_interface(ifc)
- end
- m:del(net:name(), "type")
- end
-
- -- clear options
- local k, v
- for k, v in pairs(m:get(net:name())) do
- if k:sub(1,1) ~= "." and
- k ~= "type" and
- k ~= "ifname"
- then
- m:del(net:name(), k)
- end
- end
-
- -- set proto
- m:set(net:name(), "proto", proto:proto())
- m.uci:save("network")
- m.uci:save("wireless")
-
- -- reload page
- luci.http.redirect(luci.dispatcher.build_url("admin/network/network", arg[1]))
- return
- end
-end
-
--- dhcp setup was requested, create section and reload page
-if m:formvalue("cbid.dhcp._enable._enable") then
- m.uci:section("dhcp", "dhcp", arg[1], {
- interface = arg[1],
- start = "100",
- limit = "150",
- leasetime = "12h"
- })
-
- m.uci:save("dhcp")
- luci.http.redirect(luci.dispatcher.build_url("admin/network/network", arg[1]))
- return
-end
-
-local ifc = net:get_interface()
-
-s = m:section(NamedSection, arg[1], "interface", translate("Common Configuration"))
-s.addremove = false
-
-s:tab("general", translate("General Setup"))
-s:tab("advanced", translate("Advanced Settings"))
-s:tab("physical", translate("Physical Settings"))
-
-if has_firewall then
- s:tab("firewall", translate("Firewall Settings"))
-end
-
-
-st = s:taboption("general", DummyValue, "__status", translate("Status"))
-
-local function set_status()
- -- if current network is empty, print a warning
- if not net:is_floating() and net:is_empty() then
- st.template = "cbi/dvalue"
- st.network = nil
- st.value = translate("There is no device assigned yet, please attach a network device in the \"Physical Settings\" tab")
- else
- st.template = "admin_network/iface_status"
- st.network = arg[1]
- st.value = nil
- end
-end
-
-m.on_init = set_status
-m.on_after_save = set_status
-
-
-p = s:taboption("general", ListValue, "proto", translate("Protocol"))
-p.default = net:proto()
-
-
-if not net:is_installed() then
- p_install = s:taboption("general", Button, "_install")
- p_install.title = translate("Protocol support is not installed")
- p_install.inputtitle = translate("Install package %q" % net:opkg_package())
- p_install.inputstyle = "apply"
- p_install:depends("proto", net:proto())
-
- function p_install.write()
- return luci.http.redirect(
- luci.dispatcher.build_url("admin/system/opkg") ..
- "?query=%s" % net:opkg_package()
- )
- end
-end
-
-
-p_switch = s:taboption("general", Button, "_switch")
-p_switch.title = translate("Really switch protocol?")
-p_switch.inputtitle = translate("Switch protocol")
-p_switch.inputstyle = "apply"
-
-local _, pr
-for _, pr in ipairs(nw:get_protocols()) do
- p:value(pr:proto(), pr:get_i18n())
- if pr:proto() ~= net:proto() then
- p_switch:depends("proto", pr:proto())
- end
-end
-
-
-auto = s:taboption("advanced", Flag, "auto", translate("Bring up on boot"))
-auto.default = (net:proto() == "none") and auto.disabled or auto.enabled
-
-delegate = s:taboption("advanced", Flag, "delegate", translate("Use builtin IPv6-management"))
-delegate.default = delegate.enabled
-
-force_link = s:taboption("advanced", Flag, "force_link",
- translate("Force link"),
- translate("Set interface properties regardless of the link carrier (If set, carrier sense events do not invoke hotplug handlers)."))
-
-force_link.default = (net:proto() == "static") and force_link.enabled or force_link.disabled
-
-
-if not net:is_virtual() then
- br = s:taboption("physical", Flag, "type", translate("Bridge interfaces"), translate("creates a bridge over specified interface(s)"))
- br.enabled = "bridge"
- br.rmempty = true
- br:depends("proto", "static")
- br:depends("proto", "dhcp")
- br:depends("proto", "none")
-
- stp = s:taboption("physical", Flag, "stp", translate("Enable STP"),
- translate("Enables the Spanning Tree Protocol on this bridge"))
- stp:depends("type", "bridge")
- stp.rmempty = true
-
- igmp = s:taboption("physical", Flag, "igmp_snooping", translate("Enable IGMP snooping"),
- translate("Enables IGMP snooping on this bridge"))
- igmp:depends("type", "bridge")
- igmp.rmempty = true
-end
-
-
-if not net:is_floating() then
- ifname_single = s:taboption("physical", Value, "ifname_single", translate("Interface"))
- ifname_single.template = "cbi/network_ifacelist"
- ifname_single.widget = "radio"
- ifname_single.nobridges = net:is_bridge()
- ifname_single.noaliases = false
- ifname_single.rmempty = false
- ifname_single.network = arg[1]
- ifname_single:depends("type", "")
-
- function ifname_single.cfgvalue(self, s)
- -- let the template figure out the related ifaces through the network model
- return nil
- end
-
- function ifname_single.write(self, s, val)
- local _, i
- local new_ifs = { }
- local old_ifs = { }
-
- local alias = net:is_alias()
-
- if alias then
- old_ifs[1] = '@' .. alias
- else
- for _, i in ipairs(net:get_interfaces() or { net:get_interface() }) do
- old_ifs[#old_ifs+1] = i:name()
- end
- end
-
- for i in ut.imatch(val) do
- new_ifs[#new_ifs+1] = i
-
- -- if this is not a bridge, only assign first interface
- if self.option == "ifname_single" then
- break
- end
- end
-
- table.sort(old_ifs)
- table.sort(new_ifs)
-
- for i = 1, math.max(#old_ifs, #new_ifs) do
- if old_ifs[i] ~= new_ifs[i] then
- backup_ifnames()
- for i = 1, #old_ifs do
- net:del_interface(old_ifs[i])
- end
- for i = 1, #new_ifs do
- net:add_interface(new_ifs[i])
- end
- break
- end
- end
- end
-end
-
-
-if not net:is_virtual() then
- ifname_multi = s:taboption("physical", Value, "ifname_multi", translate("Interface"))
- ifname_multi.template = "cbi/network_ifacelist"
- ifname_multi.nobridges = net:is_bridge()
- ifname_multi.noaliases = true
- ifname_multi.rmempty = false
- ifname_multi.network = arg[1]
- ifname_multi.widget = "checkbox"
- ifname_multi:depends("type", "bridge")
- ifname_multi.cfgvalue = ifname_single.cfgvalue
- ifname_multi.write = ifname_single.write
-end
-
-
-if has_firewall then
- fwzone = s:taboption("firewall", Value, "_fwzone",
- translate("Create / Assign firewall-zone"),
- translate("Choose the firewall zone you want to assign to this interface. Select unspecified to remove the interface from the associated zone or fill out the create field to define a new zone and attach the interface to it."))
-
- fwzone.template = "cbi/firewall_zonelist"
- fwzone.network = arg[1]
-
- function fwzone.cfgvalue(self, section)
- self.iface = section
- local z = fw:get_zone_by_network(section)
- return z and z:name()
- end
-
- function fwzone.write(self, section, value)
- local zone = fw:get_zone(value) or fw:add_zone(value)
- if zone then
- fw:del_network(section)
- zone:add_network(section)
- end
- end
-
- function fwzone.remove(self, section)
- fw:del_network(section)
- end
-end
-
-
-function p.write() end
-function p.remove() end
-function p.validate(self, value, section)
- if value == net:proto() then
- if not net:is_floating() and net:is_empty() then
- local ifn = ((br and (br:formvalue(section) == "bridge"))
- and ifname_multi:formvalue(section)
- or ifname_single:formvalue(section))
-
- for ifn in ut.imatch(ifn) do
- return value
- end
- return nil, translate("The selected protocol needs a device assigned")
- end
- end
- return value
-end
-
-
-local form, ferr = loadfile(
- ut.libpath() .. "/model/cbi/admin_network/proto_%s.lua" % net:proto()
-)
-
-if not form then
- s:taboption("general", DummyValue, "_error",
- translate("Missing protocol extension for proto %q" % net:proto())
- ).value = ferr
-else
- setfenv(form, getfenv(1))(m, s, net)
-end
-
-
-local _, field
-for _, field in ipairs(s.children) do
- if field ~= st and field ~= p and field ~= p_install and field ~= p_switch then
- if next(field.deps) then
- local _, dep
- for _, dep in ipairs(field.deps) do
- dep.proto = net:proto()
- end
- else
- field:depends("proto", net:proto())
- end
- end
-end
-
-
---
--- Display DNS settings if dnsmasq is available
---
-
-if has_dnsmasq and net:proto() == "static" then
- m2 = Map("dhcp", "", "")
-
- local has_section = false
-
- m2.uci:foreach("dhcp", "dhcp", function(s)
- if s.interface == arg[1] then
- has_section = true
- return false
- end
- end)
-
- if not has_section and has_dnsmasq then
-
- s = m2:section(TypedSection, "dhcp", translate("DHCP Server"))
- s.anonymous = true
- s.cfgsections = function() return { "_enable" } end
-
- x = s:option(Button, "_enable")
- x.title = translate("No DHCP Server configured for this interface")
- x.inputtitle = translate("Setup DHCP Server")
- x.inputstyle = "apply"
-
- elseif has_section then
-
- s = m2:section(TypedSection, "dhcp", translate("DHCP Server"))
- s.addremove = false
- s.anonymous = true
- s:tab("general", translate("General Setup"))
- s:tab("advanced", translate("Advanced Settings"))
- s:tab("ipv6", translate("IPv6 Settings"))
-
- function s.filter(self, section)
- return m2.uci:get("dhcp", section, "interface") == arg[1]
- end
-
- local ignore = s:taboption("general", Flag, "ignore",
- translate("Ignore interface"),
- translate("Disable DHCP for " ..
- "this interface."))
-
- local start = s:taboption("general", Value, "start", translate("Start"),
- translate("Lowest leased address as offset from the network address."))
- start.optional = true
- start.datatype = "or(uinteger,ip4addr)"
- start.default = "100"
-
- local limit = s:taboption("general", Value, "limit", translate("Limit"),
- translate("Maximum number of leased addresses."))
- limit.optional = true
- limit.datatype = "uinteger"
- limit.default = "150"
-
- local ltime = s:taboption("general", Value, "leasetime", translate("Lease time"),
- translate("Expiry time of leased addresses, minimum is 2 minutes (2m)."))
- ltime.rmempty = true
- ltime.default = "12h"
-
- local dd = s:taboption("advanced", Flag, "dynamicdhcp",
- translate("Dynamic DHCP"),
- translate("Dynamically allocate DHCP addresses for clients. If disabled, only " ..
- "clients having static leases will be served."))
- dd.default = dd.enabled
-
- s:taboption("advanced", Flag, "force", translate("Force"),
- translate("Force DHCP on this network even if another server is detected."))
-
- -- XXX: is this actually useful?
- --s:taboption("advanced", Value, "name", translate("Name"),
- -- translate("Define a name for this network."))
-
- mask = s:taboption("advanced", Value, "netmask",
- translate("IPv4-Netmask"),
- translate("Override the netmask sent to clients. Normally it is calculated " ..
- "from the subnet that is served."))
-
- mask.optional = true
- mask.datatype = "ip4addr"
-
- s:taboption("advanced", DynamicList, "dhcp_option", translate("DHCP-Options"),
- translate("Define additional DHCP options, for example \"6,192.168.2.1," ..
- "192.168.2.2\" which advertises different DNS servers to clients."))
-
- for i, n in ipairs(s.children) do
- if n ~= ignore then
- n:depends("ignore", "")
- end
- end
-
- o = s:taboption("ipv6", ListValue, "ra", translate("Router Advertisement-Service"))
- o:value("", translate("disabled"))
- o:value("server", translate("server mode"))
- o:value("relay", translate("relay mode"))
- o:value("hybrid", translate("hybrid mode"))
-
- o = s:taboption("ipv6", ListValue, "dhcpv6", translate("DHCPv6-Service"))
- o:value("", translate("disabled"))
- o:value("server", translate("server mode"))
- o:value("relay", translate("relay mode"))
- o:value("hybrid", translate("hybrid mode"))
-
- o = s:taboption("ipv6", ListValue, "ndp", translate("NDP-Proxy"))
- o:value("", translate("disabled"))
- o:value("relay", translate("relay mode"))
- o:value("hybrid", translate("hybrid mode"))
-
- o = s:taboption("ipv6", ListValue, "ra_management", translate("DHCPv6-Mode"),
- translate("Default is stateless + stateful"))
- o:value("0", translate("stateless"))
- o:value("1", translate("stateless + stateful"))
- o:value("2", translate("stateful-only"))
- o:depends("dhcpv6", "server")
- o:depends("dhcpv6", "hybrid")
- o.default = "1"
-
- o = s:taboption("ipv6", Flag, "ra_default", translate("Always announce default router"),
- translate("Announce as default router even if no public prefix is available."))
- o:depends("ra", "server")
- o:depends("ra", "hybrid")
-
- s:taboption("ipv6", DynamicList, "dns", translate("Announced DNS servers"))
- s:taboption("ipv6", DynamicList, "domain", translate("Announced DNS domains"))
-
- else
- m2 = nil
- end
-end
-
-
-return m, m2
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/network.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/network.lua
deleted file mode 100644
index b98086d..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/network.lua
+++ /dev/null
@@ -1,202 +0,0 @@
--- Copyright 2008 Steven Barth
--- Copyright 2008 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local tpl = require "luci.template"
-local ntm = require "luci.model.network".init()
-local fwm = require "luci.model.firewall".init()
-local json = require "luci.jsonc"
-
-m = Map("network", translate("Interfaces"))
-m:chain("wireless")
-m:chain("firewall")
-m:chain("dhcp")
-m.pageaction = false
-
-
-local _, net
-local ifaces, netlist = { }, { }
-
-for _, net in ipairs(ntm:get_networks()) do
- if net:name() ~= "loopback" then
- local zn = net:zonename()
- local z = zn and fwm:get_zone(zn) or fwm:get_zone_by_network(net:name())
-
- local w = 1
- if net:is_alias() then
- w = 2
- elseif net:is_dynamic() then
- w = 3
- end
-
- ifaces[#ifaces+1] = net:name()
- netlist[#netlist+1] = {
- net:name(), z and z:name() or "-", z, net, w
- }
- end
-end
-
-table.sort(netlist,
- function(a, b)
- if a[2] ~= b[2] then
- return a[2] < b[2]
- elseif a[5] ~= b[5] then
- return a[5] < b[5]
- else
- return a[1] < b[1]
- end
- end)
-
-s = m:section(TypedSection, "interface", translate("Interface Overview"))
-s.template = "admin_network/iface_overview"
-s.netlist = netlist
-
-function s.cfgsections(self)
- local _, net, sl = nil, nil, { }
-
- for _, net in ipairs(netlist) do
- sl[#sl+1] = net[1]
- end
-
- return sl
-end
-
-o = s:option(Value, "__disable__")
-
-function o.write(self, sid, value)
- if value ~= "1" then
- m:set(sid, "auto", "")
- else
- m:set(sid, "auto", "0")
- end
-end
-
-o.remove = o.write
-
-o = s:option(Value, "__delete__")
-
-function o.write(self, sid, value)
- ntm:del_network(sid)
-end
-
-
-if fs.access("/etc/init.d/dsl_control") then
- local ok, boarddata = pcall(json.parse, fs.readfile("/etc/board.json"))
- local modemtype = (ok == true)
- and (type(boarddata) == "table")
- and (type(boarddata.dsl) == "table")
- and (type(boarddata.dsl.modem) == "table")
- and boarddata.dsl.modem.type
-
- dsl = m:section(TypedSection, "dsl", translate("DSL"))
- dsl.anonymous = true
-
- annex = dsl:option(ListValue, "annex", translate("Annex"))
- annex:value("a", translate("Annex A + L + M (all)"))
- annex:value("b", translate("Annex B (all)"))
- annex:value("j", translate("Annex J (all)"))
- annex:value("m", translate("Annex M (all)"))
- annex:value("bdmt", translate("Annex B G.992.1"))
- annex:value("b2", translate("Annex B G.992.3"))
- annex:value("b2p", translate("Annex B G.992.5"))
- annex:value("at1", translate("ANSI T1.413"))
- annex:value("admt", translate("Annex A G.992.1"))
- annex:value("alite", translate("Annex A G.992.2"))
- annex:value("a2", translate("Annex A G.992.3"))
- annex:value("a2p", translate("Annex A G.992.5"))
- annex:value("l", translate("Annex L G.992.3 POTS 1"))
- annex:value("m2", translate("Annex M G.992.3"))
- annex:value("m2p", translate("Annex M G.992.5"))
-
- tone = dsl:option(ListValue, "tone", translate("Tone"))
- tone:value("", translate("auto"))
- tone:value("a", translate("A43C + J43 + A43"))
- tone:value("av", translate("A43C + J43 + A43 + V43"))
- tone:value("b", translate("B43 + B43C"))
- tone:value("bv", translate("B43 + B43C + V43"))
-
- if modemtype == "vdsl" then
- xfer_mode = dsl:option(ListValue, "xfer_mode", translate("Encapsulation mode"))
- xfer_mode:value("", translate("auto"))
- xfer_mode:value("atm", translate("ATM (Asynchronous Transfer Mode)"))
- xfer_mode:value("ptm", translate("PTM/EFM (Packet Transfer Mode)"))
-
- line_mode = dsl:option(ListValue, "line_mode", translate("DSL line mode"))
- line_mode:value("", translate("auto"))
- line_mode:value("adsl", translate("ADSL"))
- line_mode:value("vdsl", translate("VDSL"))
-
- ds_snr = dsl:option(ListValue, "ds_snr_offset", translate("Downstream SNR offset"))
- ds_snr.default = "0"
- for i = -100, 100, 5 do
- ds_snr:value(i, translatef("%.1f dB", i / 10))
- end
- end
-
- firmware = dsl:option(Value, "firmware", translate("Firmware File"))
-
- m.pageaction = true
-end
-
--- Show ATM bridge section if we have the capabilities
-if fs.access("/usr/sbin/br2684ctl") then
- atm = m:section(TypedSection, "atm-bridge", translate("ATM Bridges"),
- translate("ATM bridges expose encapsulated ethernet in AAL5 " ..
- "connections as virtual Linux network interfaces which can " ..
- "be used in conjunction with DHCP or PPP to dial into the " ..
- "provider network."))
-
- atm.addremove = true
- atm.anonymous = true
-
- atm.create = function(self, section)
- local sid = TypedSection.create(self, section)
- local max_unit = -1
-
- m.uci:foreach("network", "atm-bridge",
- function(s)
- local u = tonumber(s.unit)
- if u ~= nil and u > max_unit then
- max_unit = u
- end
- end)
-
- m.uci:set("network", sid, "unit", max_unit + 1)
- m.uci:set("network", sid, "atmdev", 0)
- m.uci:set("network", sid, "encaps", "llc")
- m.uci:set("network", sid, "payload", "bridged")
- m.uci:set("network", sid, "vci", 35)
- m.uci:set("network", sid, "vpi", 8)
-
- return sid
- end
-
- atm:tab("general", translate("General Setup"))
- atm:tab("advanced", translate("Advanced Settings"))
-
- vci = atm:taboption("general", Value, "vci", translate("ATM Virtual Channel Identifier (VCI)"))
- vpi = atm:taboption("general", Value, "vpi", translate("ATM Virtual Path Identifier (VPI)"))
- encaps = atm:taboption("general", ListValue, "encaps", translate("Encapsulation mode"))
- encaps:value("llc", translate("LLC"))
- encaps:value("vc", translate("VC-Mux"))
-
- atmdev = atm:taboption("advanced", Value, "atmdev", translate("ATM device number"))
- unit = atm:taboption("advanced", Value, "unit", translate("Bridge unit number"))
- payload = atm:taboption("advanced", ListValue, "payload", translate("Forwarding mode"))
- payload:value("bridged", translate("bridged"))
- payload:value("routed", translate("routed"))
- m.pageaction = true
-end
-
-local network = require "luci.model.network"
-if network:has_ipv6() then
- local s = m:section(NamedSection, "globals", "globals", translate("Global network options"))
- local o = s:option(Value, "ula_prefix", translate("IPv6 ULA-Prefix"))
- o.datatype = "ip6addr"
- o.rmempty = true
- m.pageaction = true
-end
-
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_464xlat.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_464xlat.lua
deleted file mode 100644
index 5a37582..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_464xlat.lua
+++ /dev/null
@@ -1,33 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Copyright 2013 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-local tunlink, defaultroute, metric, mtu
-
-section:taboption("general", Value, "ip6prefix",
- translate("NAT64 Prefix"), translate("Leave empty to autodetect"))
-
-tunlink = section:taboption("advanced", DynamicList, "tunlink", translate("Tunnel Link"))
-tunlink.template = "cbi/network_netlist"
-tunlink.nocreate = true
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
-mtu.placeholder = "1280"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6in4.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6in4.lua
deleted file mode 100644
index 3c9f41f..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6in4.lua
+++ /dev/null
@@ -1,102 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local ipaddr, peeraddr, ip6addr, tunnelid, username, password
-local defaultroute, metric, ttl, mtu
-
-
-ipaddr = s:taboption("general", Value, "ipaddr",
- translate("Local IPv4 address"),
- translate("Leave empty to use the current WAN address"))
-
-ipaddr.datatype = "ip4addr"
-
-
-peeraddr = s:taboption("general", Value, "peeraddr",
- translate("Remote IPv4 address"),
- translate("This is usually the address of the nearest PoP operated by the tunnel broker"))
-
-peeraddr.rmempty = false
-peeraddr.datatype = "ip4addr"
-
-
-ip6addr = s:taboption("general", Value, "ip6addr",
- translate("Local IPv6 address"),
- translate("This is the local endpoint address assigned by the tunnel broker, it usually ends with ...:2/64"))
-
-ip6addr.datatype = "ip6addr"
-
-
-local ip6prefix = s:taboption("general", Value, "ip6prefix",
- translate("IPv6 routed prefix"),
- translate("This is the prefix routed to you by the tunnel broker for use by clients"))
-
-ip6prefix.datatype = "list(ip6addr)"
-
-
-local update = section:taboption("general", Flag, "_update",
- translate("Dynamic tunnel"),
- translate("Enable HE.net dynamic endpoint update"))
-
-update.enabled = "1"
-update.disabled = "0"
-
-function update.write() end
-function update.remove() end
-function update.cfgvalue(self, section)
- return (tonumber(m:get(section, "tunnelid")) ~= nil)
- and self.enabled or self.disabled
-end
-
-
-tunnelid = section:taboption("general", Value, "tunnelid", translate("Tunnel ID"))
-tunnelid.datatype = "uinteger"
-tunnelid:depends("_update", update.enabled)
-
-
-username = section:taboption("general", Value, "username",
- translate("HE.net username"),
- translate("This is the plain username for logging into the account"))
-
-username:depends("_update", update.enabled)
-username.validate = function(self, val, sid)
- if type(val) == "string" and #val == 32 and val:match("^[a-fA-F0-9]+$") then
- return nil, translate("The HE.net endpoint update configuration changed, you must now use the plain username instead of the user ID!")
- end
- return val
-end
-
-
-password = section:taboption("general", Value, "password",
- translate("HE.net password"),
- translate("This is either the \"Update Key\" configured for the tunnel or the account password if no update key has been configured"))
-
-password.password = true
-password:depends("_update", update.enabled)
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
-ttl.placeholder = "64"
-ttl.datatype = "range(1,255)"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
-mtu.placeholder = "1280"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6rd.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6rd.lua
deleted file mode 100644
index 708a9c5..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6rd.lua
+++ /dev/null
@@ -1,72 +0,0 @@
--- Copyright 2011-2012 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local ipaddr, peeraddr, ip6addr, tunnelid, username, password
-local defaultroute, metric, ttl, mtu
-
-
-ipaddr = s:taboption("general", Value, "ipaddr",
- translate("Local IPv4 address"),
- translate("Leave empty to use the current WAN address"))
-
-ipaddr.datatype = "ip4addr"
-
-
-peeraddr = s:taboption("general", Value, "peeraddr",
- translate("Remote IPv4 address"),
- translate("This IPv4 address of the relay"))
-
-peeraddr.rmempty = false
-peeraddr.datatype = "ip4addr"
-
-
-ip6addr = s:taboption("general", Value, "ip6prefix",
- translate("IPv6 prefix"),
- translate("The IPv6 prefix assigned to the provider, usually ends with ::"))
-
-ip6addr.rmempty = false
-ip6addr.datatype = "ip6addr"
-
-
-ip6prefixlen = s:taboption("general", Value, "ip6prefixlen",
- translate("IPv6 prefix length"),
- translate("The length of the IPv6 prefix in bits"))
-
-ip6prefixlen.placeholder = "16"
-ip6prefixlen.datatype = "range(0,128)"
-
-
-ip6prefixlen = s:taboption("general", Value, "ip4prefixlen",
- translate("IPv4 prefix length"),
- translate("The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses."))
-
-ip6prefixlen.placeholder = "0"
-ip6prefixlen.datatype = "range(0,32)"
-
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
-ttl.placeholder = "64"
-ttl.datatype = "range(1,255)"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
-mtu.placeholder = "1280"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6to4.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6to4.lua
deleted file mode 100644
index 50a7069..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_6to4.lua
+++ /dev/null
@@ -1,37 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local ipaddr, defaultroute, metric, ttl, mtu
-
-
-ipaddr = section:taboption("general", Value, "ipaddr",
- translate("Local IPv4 address"),
- translate("Leave empty to use the current WAN address"))
-
-ipaddr.datatype = "ip4addr"
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
-ttl.placeholder = "64"
-ttl.datatype = "range(1,255)"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
-mtu.placeholder = "1280"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dhcp.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dhcp.lua
deleted file mode 100644
index 6e04465..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dhcp.lua
+++ /dev/null
@@ -1,68 +0,0 @@
--- Copyright 2011-2012 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-local ifc = net:get_interface()
-
-local hostname, accept_ra, send_rs
-local bcast, defaultroute, peerdns, dns, metric, clientid, vendorclass
-
-
-hostname = section:taboption("general", Value, "hostname",
- translate("Hostname to send when requesting DHCP"))
-
-hostname.placeholder = luci.sys.hostname()
-hostname.datatype = "hostname"
-
-
-bcast = section:taboption("advanced", Flag, "broadcast",
- translate("Use broadcast flag"),
- translate("Required for certain ISPs, e.g. Charter with DOCSIS 3"))
-
-bcast.default = bcast.disabled
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-peerdns = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-
-peerdns.default = peerdns.enabled
-
-
-dns = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns:depends("peerdns", "")
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-
-
-clientid = section:taboption("advanced", Value, "clientid",
- translate("Client ID to send when requesting DHCP"))
-clientid.datatype = "hexstring"
-
-
-vendorclass = section:taboption("advanced", Value, "vendorid",
- translate("Vendor Class to send when requesting DHCP"))
-
-
-luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dhcpv6.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dhcpv6.lua
deleted file mode 100644
index 49281ee..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dhcpv6.lua
+++ /dev/null
@@ -1,58 +0,0 @@
--- Copyright 2013 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-
-local o = section:taboption("general", ListValue, "reqaddress",
- translate("Request IPv6-address"))
-o:value("try")
-o:value("force")
-o:value("none", "disabled")
-o.default = "try"
-
-
-o = section:taboption("general", Value, "reqprefix",
- translate("Request IPv6-prefix of length"))
-o:value("auto", translate("Automatic"))
-o:value("no", translate("disabled"))
-o:value("48")
-o:value("52")
-o:value("56")
-o:value("60")
-o:value("64")
-o.default = "auto"
-
-
-o = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-o.default = o.enabled
-
-
-o = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-o.default = o.enabled
-
-
-o = section:taboption("advanced", Value, "ip6prefix",
- translate("Custom delegated IPv6-prefix"))
-o.dataype = "list(ip6addr)"
-
-
-o = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-o:depends("peerdns", "")
-o.datatype = "list(ip6addr)"
-o.cast = "string"
-
-
-o = section:taboption("advanced", Value, "clientid",
- translate("Client ID to send when requesting DHCP"))
-
-luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
-
-o = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-o.placeholder = "1500"
-o.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dslite.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dslite.lua
deleted file mode 100644
index eca9750..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_dslite.lua
+++ /dev/null
@@ -1,53 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Copyright 2013 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local peeraddr, ip6addr
-local tunlink, defaultroute, metric, ttl, mtu
-
-
-
-
-peeraddr = section:taboption("general", Value, "peeraddr",
- translate("DS-Lite AFTR address"))
-
-peeraddr.rmempty = false
-peeraddr.datatype = "or(hostname,ip6addr)"
-
-ip6addr = section:taboption("general", Value, "ip6addr",
- translate("Local IPv6 address"),
- translate("Leave empty to use the current WAN address"))
-
-ip6addr.datatype = "ip6addr"
-
-
-tunlink = section:taboption("advanced", DynamicList, "tunlink", translate("Tunnel Link"))
-tunlink.template = "cbi/network_netlist"
-tunlink.nocreate = true
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
-ttl.placeholder = "64"
-ttl.datatype = "range(1,255)"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
-mtu.placeholder = "1280"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_l2tp.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_l2tp.lua
deleted file mode 100644
index 604f019..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_l2tp.lua
+++ /dev/null
@@ -1,61 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local server, username, password
-local ipv6, defaultroute, metric, peerdns, dns, mtu
-
-
-server = section:taboption("general", Value, "server", translate("L2TP Server"))
-server.datatype = "or(host(1), hostport(1))"
-
-
-username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
-
-
-password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
-password.password = true
-
-if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", ListValue, "ipv6",
- translate("Obtain IPv6-Address"),
- translate("Enable IPv6 negotiation on the PPP link"))
- ipv6:value("auto", translate("Automatic"))
- ipv6:value("0", translate("Disabled"))
- ipv6:value("1", translate("Manual"))
- ipv6.default = "auto"
-end
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-peerdns = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-
-peerdns.default = peerdns.enabled
-
-
-dns = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns:depends("peerdns", "")
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_map.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_map.lua
deleted file mode 100644
index 37d4ec9..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_map.lua
+++ /dev/null
@@ -1,88 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Copyright 2013 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local peeraddr, ip6addr
-local tunlink, defaultroute, metric, ttl, mtu
-
-
-maptype = section:taboption("general", ListValue, "type", translate("Type"))
-maptype:value("map-e", "MAP-E")
-maptype:value("map-t", "MAP-T")
-maptype:value("lw4o6", "LW4over6")
-
-
-peeraddr = section:taboption("general", Value, "peeraddr",
- translate("BR / DMR / AFTR"))
-
-peeraddr.rmempty = false
-peeraddr.datatype = "ip6addr"
-
-
-ipaddr = section:taboption("general", Value, "ipaddr",
- translate("IPv4 prefix"))
-ipaddr.datatype = "ip4addr"
-
-
-ip4prefixlen = s:taboption("general", Value, "ip4prefixlen",
- translate("IPv4 prefix length"),
- translate("The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses."))
-
-ip4prefixlen.placeholder = "32"
-ip4prefixlen.datatype = "range(0,32)"
-
-ip6addr = s:taboption("general", Value, "ip6prefix",
- translate("IPv6 prefix"),
- translate("The IPv6 prefix assigned to the provider, usually ends with ::"))
-
-ip6addr.rmempty = false
-ip6addr.datatype = "ip6addr"
-
-
-ip6prefixlen = s:taboption("general", Value, "ip6prefixlen",
- translate("IPv6 prefix length"),
- translate("The length of the IPv6 prefix in bits"))
-
-ip6prefixlen.placeholder = "16"
-ip6prefixlen.datatype = "range(0,64)"
-
-
-s:taboption("general", Value, "ealen",
- translate("EA-bits length")).datatype = "range(0,48)"
-
-s:taboption("general", Value, "psidlen",
- translate("PSID-bits length")).datatype = "range(0,16)"
-
-s:taboption("general", Value, "offset",
- translate("PSID offset")).datatype = "range(0,16)"
-
-tunlink = section:taboption("advanced", DynamicList, "tunlink", translate("Tunnel Link"))
-tunlink.template = "cbi/network_netlist"
-tunlink.nocreate = true
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
-ttl.placeholder = "64"
-ttl.datatype = "range(1,255)"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
-mtu.placeholder = "1280"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_none.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_none.lua
deleted file mode 100644
index 6fdded9..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_none.lua
+++ /dev/null
@@ -1,4 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_ppp.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_ppp.lua
deleted file mode 100644
index 5f468bc..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_ppp.lua
+++ /dev/null
@@ -1,127 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local device, username, password
-local ipv6, defaultroute, metric, peerdns, dns,
- keepalive_failure, keepalive_interval, demand, mtu
-
-
-device = section:taboption("general", Value, "device", translate("Modem device"))
-device.rmempty = false
-
-local device_suggestions = nixio.fs.glob("/dev/tty*S*")
- or nixio.fs.glob("/dev/tts/*")
-
-if device_suggestions then
- local node
- for node in device_suggestions do
- device:value(node)
- end
-end
-
-
-username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
-
-
-password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
-password.password = true
-
-
-if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", ListValue, "ipv6",
- translate("Obtain IPv6-Address"),
- translate("Enable IPv6 negotiation on the PPP link"))
- ipv6:value("auto", translate("Automatic"))
- ipv6:value("0", translate("Disabled"))
- ipv6:value("1", translate("Manual"))
- ipv6.default = "auto"
-end
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-peerdns = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-
-peerdns.default = peerdns.enabled
-
-
-dns = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns:depends("peerdns", "")
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure",
- translate("LCP echo failure threshold"),
- translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures"))
-
-function keepalive_failure.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^(%d+)[ ,]+%d+") or v)
- end
-end
-
-keepalive_failure.placeholder = "0"
-keepalive_failure.datatype = "uinteger"
-
-
-keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval",
- translate("LCP echo interval"),
- translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold"))
-
-function keepalive_interval.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^%d+[ ,]+(%d+)"))
- end
-end
-
-function keepalive_interval.write(self, section, value)
- local f = tonumber(keepalive_failure:formvalue(section)) or 0
- local i = tonumber(value) or 5
- if i < 1 then i = 1 end
- if f > 0 then
- m:set(section, "keepalive", "%d %d" %{ f, i })
- else
- m:set(section, "keepalive", "0")
- end
-end
-
-keepalive_interval.remove = keepalive_interval.write
-keepalive_failure.write = keepalive_interval.write
-keepalive_failure.remove = keepalive_interval.write
-keepalive_interval.placeholder = "5"
-keepalive_interval.datatype = "min(1)"
-
-
-demand = section:taboption("advanced", Value, "demand",
- translate("Inactivity timeout"),
- translate("Close inactive connection after the given amount of seconds, use 0 to persist connection"))
-
-demand.placeholder = "0"
-demand.datatype = "uinteger"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pppoa.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pppoa.lua
deleted file mode 100644
index 004fd7e..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pppoa.lua
+++ /dev/null
@@ -1,133 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local encaps, atmdev, vci, vpi, username, password
-local ipv6, defaultroute, metric, peerdns, dns,
- keepalive_failure, keepalive_interval, demand, mtu
-
-
-encaps = section:taboption("general", ListValue, "encaps", translate("PPPoA Encapsulation"))
-encaps:value("vc", "VC-Mux")
-encaps:value("llc", "LLC")
-
-
-atmdev = section:taboption("general", Value, "atmdev", translate("ATM device number"))
-atmdev.default = "0"
-atmdev.datatype = "uinteger"
-
-
-vci = section:taboption("general", Value, "vci", translate("ATM Virtual Channel Identifier (VCI)"))
-vci.default = "35"
-vci.datatype = "uinteger"
-
-
-vpi = section:taboption("general", Value, "vpi", translate("ATM Virtual Path Identifier (VPI)"))
-vpi.default = "8"
-vpi.datatype = "uinteger"
-
-
-username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
-
-
-password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
-password.password = true
-
-
-if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", ListValue, "ipv6",
- translate("Obtain IPv6-Address"),
- translate("Enable IPv6 negotiation on the PPP link"))
- ipv6:value("auto", translate("Automatic"))
- ipv6:value("0", translate("Disabled"))
- ipv6:value("1", translate("Manual"))
- ipv6.default = "auto"
-end
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-peerdns = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-
-peerdns.default = peerdns.enabled
-
-
-dns = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns:depends("peerdns", "")
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure",
- translate("LCP echo failure threshold"),
- translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures"))
-
-function keepalive_failure.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^(%d+)[ ,]+%d+") or v)
- end
-end
-
-keepalive_failure.placeholder = "0"
-keepalive_failure.datatype = "uinteger"
-
-
-keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval",
- translate("LCP echo interval"),
- translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold"))
-
-function keepalive_interval.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^%d+[ ,]+(%d+)"))
- end
-end
-
-function keepalive_interval.write(self, section, value)
- local f = tonumber(keepalive_failure:formvalue(section)) or 0
- local i = tonumber(value) or 5
- if i < 1 then i = 1 end
- if f > 0 then
- m:set(section, "keepalive", "%d %d" %{ f, i })
- else
- m:set(section, "keepalive", "0")
- end
-end
-
-keepalive_interval.remove = keepalive_interval.write
-keepalive_failure.write = keepalive_interval.write
-keepalive_failure.remove = keepalive_interval.write
-keepalive_interval.placeholder = "5"
-keepalive_interval.datatype = "min(1)"
-
-
-demand = section:taboption("advanced", Value, "demand",
- translate("Inactivity timeout"),
- translate("Close inactive connection after the given amount of seconds, use 0 to persist connection"))
-
-demand.placeholder = "0"
-demand.datatype = "uinteger"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pppoe.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pppoe.lua
deleted file mode 100644
index 063d8c0..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pppoe.lua
+++ /dev/null
@@ -1,135 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local username, password, ac, service
-local ipv6, defaultroute, metric, peerdns, dns,
- keepalive_failure, keepalive_interval, demand, mtu
-
-
-username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
-
-
-password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
-password.password = true
-
-
-ac = section:taboption("general", Value, "ac",
- translate("Access Concentrator"),
- translate("Leave empty to autodetect"))
-
-ac.placeholder = translate("auto")
-
-
-service = section:taboption("general", Value, "service",
- translate("Service Name"),
- translate("Leave empty to autodetect"))
-
-service.placeholder = translate("auto")
-
-
-if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", ListValue, "ipv6",
- translate("Obtain IPv6-Address"),
- translate("Enable IPv6 negotiation on the PPP link"))
- ipv6:value("auto", translate("Automatic"))
- ipv6:value("0", translate("Disabled"))
- ipv6:value("1", translate("Manual"))
- ipv6.default = "auto"
-end
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-peerdns = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-
-peerdns.default = peerdns.enabled
-
-
-dns = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns:depends("peerdns", "")
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure",
- translate("LCP echo failure threshold"),
- translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures"))
-
-function keepalive_failure.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^(%d+)[ ,]+%d+") or v)
- end
-end
-
-keepalive_failure.placeholder = "0"
-keepalive_failure.datatype = "uinteger"
-
-
-keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval",
- translate("LCP echo interval"),
- translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold"))
-
-function keepalive_interval.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^%d+[ ,]+(%d+)"))
- end
-end
-
-function keepalive_interval.write(self, section, value)
- local f = tonumber(keepalive_failure:formvalue(section)) or 0
- local i = tonumber(value) or 5
- if i < 1 then i = 1 end
- if f > 0 then
- m:set(section, "keepalive", "%d %d" %{ f, i })
- else
- m:set(section, "keepalive", "0")
- end
-end
-
-keepalive_interval.remove = keepalive_interval.write
-keepalive_failure.write = keepalive_interval.write
-keepalive_failure.remove = keepalive_interval.write
-keepalive_interval.placeholder = "5"
-keepalive_interval.datatype = "min(1)"
-
-
-host_uniq = section:taboption("advanced", Value, "host_uniq",
- translate("Host-Uniq tag content"),
- translate("Raw hex-encoded bytes. Leave empty unless your ISP require this"))
-
-host_uniq.placeholder = translate("auto")
-host_uniq.datatype = "hexstring"
-
-
-demand = section:taboption("advanced", Value, "demand",
- translate("Inactivity timeout"),
- translate("Close inactive connection after the given amount of seconds, use 0 to persist connection"))
-
-demand.placeholder = "0"
-demand.datatype = "uinteger"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pptp.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pptp.lua
deleted file mode 100644
index 6a828ef..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_pptp.lua
+++ /dev/null
@@ -1,106 +0,0 @@
--- Copyright 2011-2012 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-
-local server, username, password
-local defaultroute, metric, peerdns, dns,
- keepalive_failure, keepalive_interval, demand, mtu
-
-
-server = section:taboption("general", Value, "server", translate("VPN Server"))
-server.datatype = "host(0)"
-
-
-username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
-
-
-password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
-password.password = true
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-metric:depends("defaultroute", defaultroute.enabled)
-
-
-peerdns = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-
-peerdns.default = peerdns.enabled
-
-
-dns = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns:depends("peerdns", "")
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure",
- translate("LCP echo failure threshold"),
- translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures"))
-
-function keepalive_failure.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^(%d+)[ ,]+%d+") or v)
- end
-end
-
-keepalive_failure.placeholder = "0"
-keepalive_failure.datatype = "uinteger"
-
-
-keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval",
- translate("LCP echo interval"),
- translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold"))
-
-function keepalive_interval.cfgvalue(self, section)
- local v = m:get(section, "keepalive")
- if v and #v > 0 then
- return tonumber(v:match("^%d+[ ,]+(%d+)"))
- end
-end
-
-function keepalive_interval.write(self, section, value)
- local f = tonumber(keepalive_failure:formvalue(section)) or 0
- local i = tonumber(value) or 5
- if i < 1 then i = 1 end
- if f > 0 then
- m:set(section, "keepalive", "%d %d" %{ f, i })
- else
- m:set(section, "keepalive", "0")
- end
-end
-
-keepalive_interval.remove = keepalive_interval.write
-keepalive_failure.write = keepalive_interval.write
-keepalive_failure.remove = keepalive_interval.write
-keepalive_interval.placeholder = "5"
-keepalive_interval.datatype = "min(1)"
-
-
-demand = section:taboption("advanced", Value, "demand",
- translate("Inactivity timeout"),
- translate("Close inactive connection after the given amount of seconds, use 0 to persist connection"))
-
-demand.placeholder = "0"
-demand.datatype = "uinteger"
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_static.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/proto_static.lua
deleted file mode 100644
index 246d2c0..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/proto_static.lua
+++ /dev/null
@@ -1,167 +0,0 @@
--- Copyright 2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local map, section, net = ...
-local ifc = net:get_interface()
-
-local netmask, gateway, broadcast, dns, accept_ra, send_rs, ip6addr, ip6gw
-local mtu, metric, usecidr, ipaddr_single, ipaddr_multi
-
-
-local function is_cidr(s)
- return (type(s) == "string" and luci.ip.IPv4(s) and s:find("/"))
-end
-
-usecidr = section:taboption("general", Value, "ipaddr_usecidr")
-usecidr.forcewrite = true
-
-usecidr.cfgvalue = function(self, section)
- local cfgvalue = self.map:get(section, "ipaddr")
- return (type(cfgvalue) == "table" or is_cidr(cfgvalue)) and "1" or "0"
-end
-
-usecidr.render = function(self, section, scope)
- luci.template.Template(nil, [[
- />
- ]]):render({
- cbid = self:cbid(section),
- value = self:cfgvalue(section)
- })
-end
-
-usecidr.write = function(self, section)
- local cfgvalue = self.map:get(section, "ipaddr")
- local formvalue = (self:formvalue(section) == "1") and ipaddr_multi:formvalue(section) or ipaddr_single:formvalue(section)
- local equal = (cfgvalue == formvalue)
-
- if not equal and type(cfgvalue) == "table" and type(formvalue) == "table" and #cfgvalue == #formvalue then
- equal = true
-
- local _, v
- for _, v in ipairs(cfgvalue) do
- if v ~= formvalue[_] then
- equal = false
- break
- end
- end
- end
-
- if not equal then
- self.map:set(section, "ipaddr", formvalue or "")
- end
-
- return not equal
-end
-
-
-ipaddr_multi = section:taboption("general", DynamicList, "ipaddrs", translate("IPv4 address"))
-ipaddr_multi:depends("ipaddr_usecidr", "1")
-ipaddr_multi.datatype = "or(cidr4,ipnet4)"
-ipaddr_multi.placeholder = translate("Add IPv4 address…")
-
-ipaddr_multi.alias = "ipaddr"
-ipaddr_multi.write = function() end
-ipaddr_multi.remove = function() end
-ipaddr_multi.cfgvalue = function(self, section)
- local addr = self.map:get(section, "ipaddr")
- local mask = self.map:get(section, "netmask")
-
- if is_cidr(addr) then
- return { addr }
- elseif type(addr) == "string" and
- type(mask) == "string" and
- #addr > 0 and #mask > 0
- then
- return { "%s/%s" %{ addr, mask } }
- elseif type(addr) == "table" then
- return addr
- else
- return {}
- end
-end
-
-
-ipaddr_single = section:taboption("general", Value, "ipaddr", translate("IPv4 address"))
-ipaddr_single:depends("ipaddr_usecidr", "0")
-ipaddr_single.datatype = "ip4addr"
-ipaddr_single.template = "cbi/ipaddr"
-ipaddr_single.write = function() end
-ipaddr_single.remove = function() end
-
-
-netmask = section:taboption("general", Value, "netmask", translate("IPv4 netmask"))
-netmask:depends("ipaddr_usecidr", "0")
-netmask.datatype = "ip4addr"
-netmask:value("255.255.255.0")
-netmask:value("255.255.0.0")
-netmask:value("255.0.0.0")
-
-
-gateway = section:taboption("general", Value, "gateway", translate("IPv4 gateway"))
-gateway.datatype = "ip4addr"
-
-
-broadcast = section:taboption("general", Value, "broadcast", translate("IPv4 broadcast"))
-broadcast.datatype = "ip4addr"
-
-
-dns = section:taboption("general", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-if luci.model.network:has_ipv6() then
-
- local ip6assign = section:taboption("general", Value, "ip6assign", translate("IPv6 assignment length"),
- translate("Assign a part of given length of every public IPv6-prefix to this interface"))
- ip6assign:value("", translate("disabled"))
- ip6assign:value("64")
- ip6assign.datatype = "max(64)"
-
- local ip6hint = section:taboption("general", Value, "ip6hint", translate("IPv6 assignment hint"),
- translate("Assign prefix parts using this hexadecimal subprefix ID for this interface."))
- for i=33,64 do ip6hint:depends("ip6assign", i) end
-
- ip6addr = section:taboption("general", DynamicList, "ip6addr", translate("IPv6 address"))
- ip6addr.datatype = "ip6addr"
- ip6addr.placeholder = translate("Add IPv6 address…")
- ip6addr:depends("ip6assign", "")
-
-
- ip6gw = section:taboption("general", Value, "ip6gw", translate("IPv6 gateway"))
- ip6gw.datatype = "ip6addr"
- ip6gw:depends("ip6assign", "")
-
-
- local ip6prefix = s:taboption("general", Value, "ip6prefix", translate("IPv6 routed prefix"),
- translate("Public prefix routed to this device for distribution to clients."))
- ip6prefix.datatype = "ip6addr"
- ip6prefix:depends("ip6assign", "")
-
- local ip6ifaceid = s:taboption("general", Value, "ip6ifaceid", translate("IPv6 suffix"),
- translate("Optional. Allowed values: 'eui64', 'random', fixed value like '::1' " ..
- "or '::1:2'. When IPv6 prefix (like 'a:b:c:d::') is received from a " ..
- "delegating server, use the suffix (like '::1') to form the IPv6 address " ..
- "('a:b:c:d::1') for the interface."))
- ip6ifaceid.datatype = "ip6hostid"
- ip6ifaceid.placeholder = "::1"
- ip6ifaceid.rmempty = true
-
-end
-
-
-luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/routes.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/routes.lua
deleted file mode 100644
index 1970f36..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/routes.lua
+++ /dev/null
@@ -1,102 +0,0 @@
--- Copyright 2008 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-local wa = require "luci.tools.webadmin"
-local fs = require "nixio.fs"
-
-m = Map("network",
- translate("Routes"),
- translate("Routes specify over which interface and gateway a certain host or network " ..
- "can be reached."))
-
-s = m:section(TypedSection, "route", translate("Static IPv4 Routes"))
-s.addremove = true
-s.anonymous = true
-
-s.template = "cbi/tblsection"
-
-iface = s:option(ListValue, "interface", translate("Interface"))
-wa.cbi_add_networks(iface)
-
-t = s:option(Value, "target", translate("Target"), translate("Host-IP or Network"))
-t.datatype = "ip4addr"
-t.rmempty = false
-
-n = s:option(Value, "netmask", translate("IPv4-Netmask"), translate("if target is a network"))
-n.placeholder = "255.255.255.255"
-n.datatype = "ip4addr"
-n.rmempty = true
-
-g = s:option(Value, "gateway", translate("IPv4-Gateway"))
-g.datatype = "ip4addr"
-g.rmempty = true
-
-metric = s:option(Value, "metric", translate("Metric"))
-metric.placeholder = 0
-metric.datatype = "range(0,255)"
-metric.size = 5
-metric.rmempty = true
-
-mtu = s:option(Value, "mtu", translate("MTU"))
-mtu.placeholder = 1500
-mtu.datatype = "range(64,9000)"
-mtu.size = 5
-mtu.rmempty = true
-
-routetype = s:option(Value, "type", translate("Route type"))
-routetype:value("", "unicast")
-routetype:value("local", "local")
-routetype:value("broadcast", "broadcast")
-routetype:value("multicast", "multicast")
-routetype:value("unreachable", "unreachable")
-routetype:value("prohibit", "prohibit")
-routetype:value("blackhole", "blackhole")
-routetype:value("anycast", "anycast")
-routetype.default = ""
-routetype.rmempty = true
-
-if fs.access("/proc/net/ipv6_route") then
- s = m:section(TypedSection, "route6", translate("Static IPv6 Routes"))
- s.addremove = true
- s.anonymous = true
-
- s.template = "cbi/tblsection"
-
- iface = s:option(ListValue, "interface", translate("Interface"))
- wa.cbi_add_networks(iface)
-
- t = s:option(Value, "target", translate("Target"), translate("IPv6-Address or Network (CIDR)"))
- t.datatype = "ip6addr"
- t.rmempty = false
-
- g = s:option(Value, "gateway", translate("IPv6-Gateway"))
- g.datatype = "ip6addr"
- g.rmempty = true
-
- metric = s:option(Value, "metric", translate("Metric"))
- metric.placeholder = 0
- metric.datatype = "range(0,65535)" -- XXX: not sure
- metric.size = 5
- metric.rmempty = true
-
- mtu = s:option(Value, "mtu", translate("MTU"))
- mtu.placeholder = 1500
- mtu.datatype = "range(64,9000)"
- mtu.size = 5
- mtu.rmempty = true
-
- routetype = s:option(Value, "type", translate("Route type"))
- routetype:value("", "unicast")
- routetype:value("local", "local")
- routetype:value("broadcast", "broadcast")
- routetype:value("multicast", "multicast")
- routetype:value("unreachable", "unreachable")
- routetype:value("prohibit", "prohibit")
- routetype:value("blackhole", "blackhole")
- routetype:value("anycast", "anycast")
- routetype.default = ""
- routetype.rmempty = true
-end
-
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/vlan.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/vlan.lua
deleted file mode 100644
index d79b3c4..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/vlan.lua
+++ /dev/null
@@ -1,364 +0,0 @@
--- Copyright 2008 Steven Barth
--- Copyright 2010-2011 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-m = Map("network", translate("Switch"), translate("The network ports on this device can be combined to several VLANs in which computers can communicate directly with each other. VLANs are often used to separate different network segments. Often there is by default one Uplink port for a connection to the next greater network like the internet and other ports for a local network."))
-
-local fs = require "nixio.fs"
-local ut = require "luci.util"
-local nw = require "luci.model.network"
-local switches = { }
-
-nw.init(m.uci)
-
-local topologies = nw:get_switch_topologies() or {}
-
-local update_interfaces = function(old_ifname, new_ifname)
- local info = { }
-
- m.uci:foreach("network", "interface", function(section)
- local old_ifnames = section.ifname
- local new_ifnames = { }
- local cur_ifname
- local changed = false
- for cur_ifname in luci.util.imatch(old_ifnames) do
- if cur_ifname == old_ifname then
- new_ifnames[#new_ifnames+1] = new_ifname
- changed = true
- else
- new_ifnames[#new_ifnames+1] = cur_ifname
- end
- end
- if changed then
- m.uci:set("network", section[".name"], "ifname", table.concat(new_ifnames, " "))
-
- info[#info+1] = translatef("Interface %q device auto-migrated from %q to %q.",
- section[".name"], old_ifname, new_ifname)
- end
- end)
-
- if #info > 0 then
- m.message = (m.message and m.message .. "\n" or "") .. table.concat(info, "\n")
- end
-end
-
-m.uci:foreach("network", "switch",
- function(x)
- local sid = x['.name']
- local switch_name = x.name or sid
- local has_vlan = nil
- local has_learn = nil
- local has_vlan4k = nil
- local has_jumbo3 = nil
- local has_mirror = nil
- local min_vid = 0
- local max_vid = 16
- local num_vlans = 16
-
- local switch_title
- local enable_vlan4k = false
-
- local topo = topologies[switch_name]
-
- if not topo then
- m.message = translatef("Switch %q has an unknown topology - the VLAN settings might not be accurate.", switch_name)
- topo = {
- ports = {
- { num = 0, label = "Port 1" },
- { num = 1, label = "Port 2" },
- { num = 2, label = "Port 3" },
- { num = 3, label = "Port 4" },
- { num = 4, label = "Port 5" },
- { num = 5, label = "CPU (eth0)", tagged = false }
- }
- }
- end
-
- -- Parse some common switch properties from swconfig help output.
- local swc = io.popen("swconfig dev %s help 2>/dev/null" % ut.shellquote(switch_name))
- if swc then
-
- local is_port_attr = false
- local is_vlan_attr = false
-
- while true do
- local line = swc:read("*l")
- if not line then break end
-
- if line:match("^%s+%-%-vlan") then
- is_vlan_attr = true
-
- elseif line:match("^%s+%-%-port") then
- is_vlan_attr = false
- is_port_attr = true
-
- elseif line:match("cpu @") then
- switch_title = line:match("^switch%d: %w+%((.-)%)")
- num_vlans = tonumber(line:match("vlans: (%d+)")) or 16
- min_vid = 1
-
- elseif line:match(": pvid") or line:match(": tag") or line:match(": vid") then
- if is_vlan_attr then has_vlan4k = line:match(": (%w+)") end
-
- elseif line:match(": enable_vlan4k") then
- enable_vlan4k = true
-
- elseif line:match(": enable_vlan") then
- has_vlan = "enable_vlan"
-
- elseif line:match(": enable_learning") then
- has_learn = "enable_learning"
-
- elseif line:match(": enable_mirror_rx") then
- has_mirror = "enable_mirror_rx"
-
- elseif line:match(": max_length") then
- has_jumbo3 = "max_length"
- end
- end
-
- swc:close()
- end
-
-
- -- Switch properties
- s = m:section(NamedSection, x['.name'], "switch",
- switch_title and translatef("Switch %q (%s)", switch_name, switch_title)
- or translatef("Switch %q", switch_name))
-
- s.addremove = false
-
- if has_vlan then
- s:option(Flag, has_vlan, translate("Enable VLAN functionality"))
- end
-
- if has_learn then
- x = s:option(Flag, has_learn, translate("Enable learning and aging"))
- x.default = x.enabled
- end
-
- if has_jumbo3 then
- x = s:option(Flag, has_jumbo3, translate("Enable Jumbo Frame passthrough"))
- x.enabled = "3"
- x.rmempty = true
- end
-
- -- Does this switch support port mirroring?
- if has_mirror then
- s:option(Flag, "enable_mirror_rx", translate("Enable mirroring of incoming packets"))
- s:option(Flag, "enable_mirror_tx", translate("Enable mirroring of outgoing packets"))
-
- local sp = s:option(ListValue, "mirror_source_port", translate("Mirror source port"))
- local mp = s:option(ListValue, "mirror_monitor_port", translate("Mirror monitor port"))
-
- sp:depends("enable_mirror_tx", "1")
- sp:depends("enable_mirror_rx", "1")
-
- mp:depends("enable_mirror_tx", "1")
- mp:depends("enable_mirror_rx", "1")
-
- local _, pt
- for _, pt in ipairs(topo.ports) do
- sp:value(pt.num, pt.label)
- mp:value(pt.num, pt.label)
- end
- end
-
- -- VLAN table
- s = m:section(TypedSection, "switch_vlan",
- switch_title and translatef("VLANs on %q (%s)", switch_name, switch_title)
- or translatef("VLANs on %q", switch_name))
-
- s.template = "cbi/tblsection"
- s.addremove = true
- s.anonymous = true
-
- -- Filter by switch
- s.filter = function(self, section)
- local device = m:get(section, "device")
- return (device and device == switch_name)
- end
-
- -- Override cfgsections callback to enforce row ordering by vlan id.
- s.cfgsections = function(self)
- local osections = TypedSection.cfgsections(self)
- local sections = { }
- local section
-
- for _, section in luci.util.spairs(
- osections,
- function(a, b)
- return (tonumber(m:get(osections[a], has_vlan4k or "vlan")) or 9999)
- < (tonumber(m:get(osections[b], has_vlan4k or "vlan")) or 9999)
- end
- ) do
- sections[#sections+1] = section
- end
-
- return sections
- end
-
- -- When creating a new vlan, preset it with the highest found vid + 1.
- s.create = function(self, section, origin)
- -- Filter by switch
- if m:get(origin, "device") ~= switch_name then
- return
- end
-
- local sid = TypedSection.create(self, section)
-
- local max_nr = 0
- local max_id = 0
-
- m.uci:foreach("network", "switch_vlan",
- function(s)
- if s.device == switch_name then
- local nr = tonumber(s.vlan)
- local id = has_vlan4k and tonumber(s[has_vlan4k])
- if nr ~= nil and nr > max_nr then max_nr = nr end
- if id ~= nil and id > max_id then max_id = id end
- end
- end)
-
- m:set(sid, "device", switch_name)
- m:set(sid, "vlan", max_nr + 1)
-
- if has_vlan4k then
- m:set(sid, has_vlan4k, max_id + 1)
- end
-
- return sid
- end
-
-
- local port_opts = { }
- local untagged = { }
-
- -- Parse current tagging state from the "ports" option.
- local portvalue = function(self, section)
- local pt
- for pt in (m:get(section, "ports") or ""):gmatch("%w+") do
- local pc, tu = pt:match("^(%d+)([tu]*)")
- if pc == self.option then return (#tu > 0) and tu or "u" end
- end
- return ""
- end
-
- -- Validate port tagging. Ensure that a port is only untagged once,
- -- bail out if not.
- local portvalidate = function(self, value, section)
- -- ensure that the ports appears untagged only once
- if value == "u" then
- if not untagged[self.option] then
- untagged[self.option] = true
- else
- return nil,
- translatef("%s is untagged in multiple VLANs!", self.title)
- end
- end
- return value
- end
-
-
- local vid = s:option(Value, has_vlan4k or "vlan", "VLAN ID")
- local mx_vid = has_vlan4k and 4094 or (num_vlans - 1)
-
- vid.rmempty = false
- vid.forcewrite = true
- vid.vlan_used = { }
- vid.datatype = "and(uinteger,range("..min_vid..","..mx_vid.."))"
-
- -- Validate user provided VLAN ID, make sure its within the bounds
- -- allowed by the switch.
- vid.validate = function(self, value, section)
- local v = tonumber(value)
- local m = has_vlan4k and 4094 or (num_vlans - 1)
- if v ~= nil and v >= min_vid and v <= m then
- if not self.vlan_used[v] then
- self.vlan_used[v] = true
- return value
- else
- return nil,
- translatef("Invalid VLAN ID given! Only unique IDs are allowed")
- end
- else
- return nil,
- translatef("Invalid VLAN ID given! Only IDs between %d and %d are allowed.", min_vid, m)
- end
- end
-
- -- When writing the "vid" or "vlan" option, serialize the port states
- -- as well and write them as "ports" option to uci.
- vid.write = function(self, section, new_vid)
- local o
- local p = { }
- for _, o in ipairs(port_opts) do
- local new_tag = o:formvalue(section)
- if new_tag == "t" then
- p[#p+1] = o.option .. new_tag
- elseif new_tag == "u" then
- p[#p+1] = o.option
- end
-
- if o.info and o.info.device then
- local old_tag = o:cfgvalue(section)
- local old_vid = self:cfgvalue(section)
- if old_tag ~= new_tag or old_vid ~= new_vid then
- local old_ifname = (old_tag == "u") and o.info.device
- or "%s.%s" %{ o.info.device, old_vid }
-
- local new_ifname = (new_tag == "u") and o.info.device
- or "%s.%s" %{ o.info.device, new_vid }
-
- if old_ifname ~= new_ifname then
- update_interfaces(old_ifname, new_ifname)
- end
- end
- end
- end
-
- if enable_vlan4k then
- m:set(sid, "enable_vlan4k", "1")
- end
-
- m:set(section, "ports", table.concat(p, " "))
- return Value.write(self, section, new_vid)
- end
-
- -- Fallback to "vlan" option if "vid" option is supported but unset.
- vid.cfgvalue = function(self, section)
- return m:get(section, has_vlan4k or "vlan")
- or m:get(section, "vlan")
- end
-
- local _, pt
- for _, pt in ipairs(topo.ports) do
- local po = s:option(ListValue, tostring(pt.num), pt.label)
-
- po:value("", translate("off"))
-
- if not pt.tagged then
- po:value("u", translate("untagged"))
- end
-
- po:value("t", translate("tagged"))
-
- po.cfgvalue = portvalue
- po.validate = portvalidate
- po.write = function() end
- po.info = pt
-
- port_opts[#port_opts+1] = po
- end
-
- table.sort(port_opts, function(a, b) return a.option < b.option end)
- switches[#switches+1] = switch_name
- end
-)
-
--- Switch status template
-s = m:section(SimpleSection)
-s.template = "admin_network/switch_status"
-s.switches = switches
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua
deleted file mode 100644
index 7b7fc0f..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua
+++ /dev/null
@@ -1,1203 +0,0 @@
--- Copyright 2008 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-local wa = require "luci.tools.webadmin"
-local nw = require "luci.model.network"
-local ut = require "luci.util"
-local nt = require "luci.sys".net
-local fs = require "nixio.fs"
-
-local acct_port, acct_secret, acct_server, anonymous_identity, ant1, ant2,
- auth, auth_port, auth_secret, auth_server, bssid, cacert, cacert2,
- cc, ch, cipher, clientcert, clientcert2, ea, eaptype, en, encr,
- ft_protocol, ft_psk_generate_local, hidden, htmode, identity,
- ieee80211r, ieee80211w, ifname, isolate, key_retries,
- legacyrates, max_timeout, meshfwd, meshid, ml, mobility_domain, mode,
- mp, nasid, network, password, pmk_r1_push, privkey, privkey2, privkeypwd,
- privkeypwd2, r0_key_lifetime, r0kh, r1_key_holder, r1kh,
- reassociation_deadline, retry_timeout, ssid, st, tp, wepkey, wepslot,
- wmm, wpakey, wps, disassoc_low_ack, short_preamble, beacon_int, dtim_period,
- wparekey, inactivitypool, maxinactivity, listeninterval,
- dae_client, dae_port, dae_port
-
-
-arg[1] = arg[1] or ""
-
-m = Map("wireless", "",
- translate("The Device Configuration section covers physical settings of the radio " ..
- "hardware such as channel, transmit power or antenna selection which are shared among all " ..
- "defined wireless networks (if the radio hardware is multi-SSID capable). Per network settings " ..
- "like encryption or operation mode are grouped in the Interface Configuration."))
-
-m:chain("network")
-m:chain("firewall")
-m.redirect = luci.dispatcher.build_url("admin/network/wireless")
-
-nw.init(m.uci)
-
-local wnet = nw:get_wifinet(arg[1])
-local wdev = wnet and wnet:get_device()
-
--- redirect to overview page if network does not exist anymore (e.g. after a revert)
-if not wnet or not wdev then
- luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
- return
-end
-
-local function txpower_list(iw)
- local list = iw.txpwrlist or { }
- local off = tonumber(iw.txpower_offset) or 0
- local new = { }
- local prev = -1
- local _, val
- for _, val in ipairs(list) do
- local dbm = val.dbm + off
- local mw = math.floor(10 ^ (dbm / 10))
- if mw ~= prev then
- prev = mw
- new[#new+1] = {
- display_dbm = dbm,
- display_mw = mw,
- driver_dbm = val.dbm,
- driver_mw = val.mw
- }
- end
- end
- return new
-end
-
-local function txpower_current(pwr, list)
- pwr = tonumber(pwr)
- if pwr ~= nil then
- local _, item
- for _, item in ipairs(list) do
- if item.driver_dbm >= pwr then
- return item.driver_dbm
- end
- end
- end
- return pwr or ""
-end
-
-local iw = luci.sys.wifi.getiwinfo(arg[1])
-local hw_modes = iw.hwmodelist or { }
-local tx_power_list = txpower_list(iw)
-local tx_power_cur = txpower_current(wdev:get("txpower"), tx_power_list)
-
--- wireless toggle was requested, commit and reload page
-function m.parse(map)
- local new_cc = m:formvalue("cbid.wireless.%s.country" % wdev:name())
- local old_cc = m:get(wdev:name(), "country")
-
- if m:formvalue("cbid.wireless.%s.__toggle" % wdev:name()) then
- if wdev:get("disabled") == "1" or wnet:get("disabled") == "1" then
- wnet:set("disabled", nil)
- else
- wnet:set("disabled", "1")
- end
- wdev:set("disabled", nil)
- m.apply_needed = true
- m.redirect = nil
- end
-
- Map.parse(map)
-
- if m:get(wdev:name(), "type") == "mac80211" and new_cc and new_cc ~= old_cc then
- luci.sys.call("iw reg set %s" % ut.shellquote(new_cc))
-
- local old_ch = tonumber(m:formvalue("cbid.wireless.%s._mode_freq.channel" % wdev:name()) or "")
- if old_ch then
- local _, c, new_ch
- for _, c in ipairs(iw.freqlist) do
- if c.channel > old_ch or (old_ch <= 14 and c.channel > 14) then
- break
- end
- new_ch = c.channel
- end
- if new_ch ~= old_ch then
- wdev:set("channel", new_ch)
- m.message = translatef("Channel %d is not available in the %s regulatory domain and has been auto-adjusted to %d.",
- old_ch, new_cc, new_ch)
- end
- end
- end
-
- if wdev:get("disabled") == "1" or wnet:get("disabled") == "1" then
- en.title = translate("Wireless network is disabled")
- en.inputtitle = translate("Enable")
- en.inputstyle = "apply"
- else
- en.title = translate("Wireless network is enabled")
- en.inputtitle = translate("Disable")
- en.inputstyle = "reset"
- end
-end
-
-m.title = luci.util.pcdata(wnet:get_i18n())
-
-s = m:section(NamedSection, wdev:name(), "wifi-device", translate("Device Configuration"))
-s.addremove = false
-
-s:tab("general", translate("General Setup"))
-s:tab("macfilter", translate("MAC-Filter"))
-s:tab("advanced", translate("Advanced Settings"))
-
-st = s:taboption("general", DummyValue, "__status", translate("Status"))
-st.template = "admin_network/wifi_status"
-st.ifname = arg[1]
-
-en = s:taboption("general", Button, "__toggle")
-
-local hwtype = wdev:get("type")
-
--- NanoFoo
-local nsantenna = wdev:get("antenna")
-
--- Check whether there are client interfaces on the same radio,
--- if yes, lock the channel choice as these stations will dicatate the freq
-local found_sta = nil
-local _, net
-if wnet:mode() ~= "sta" then
- for _, net in ipairs(wdev:get_wifinets()) do
- if net:mode() == "sta" and net:get("disabled") ~= "1" then
- if not found_sta then
- found_sta = {}
- found_sta.channel = net:channel()
- found_sta.names = {}
- end
- found_sta.names[#found_sta.names+1] = net:shortname()
- end
- end
-end
-
-if found_sta then
- ch = s:taboption("general", DummyValue, "choice", translate("Channel"))
- ch.value = translatef("Locked to channel %s used by: %s",
- found_sta.channel or "(auto)", table.concat(found_sta.names, ", "))
-else
- ch = s:taboption("general", Value, "_mode_freq", ' '..translate("Operating frequency"))
- ch.iwinfo = iw
- ch.template = "cbi/wireless_modefreq"
-
- function ch.cfgvalue(self, section)
- return {
- m:get(section, "hwmode") or "",
- m:get(section, "channel") or "auto",
- m:get(section, "htmode") or ""
- }
- end
-
- function ch.formvalue(self, section)
- return {
- m:formvalue(self:cbid(section) .. ".band") or (hw_modes.g and "11g" or "11a"),
- m:formvalue(self:cbid(section) .. ".channel") or "auto",
- m:formvalue(self:cbid(section) .. ".htmode") or ""
- }
- end
-
- function ch.write(self, section, value)
- m:set(section, "hwmode", value[1])
- m:set(section, "channel", value[2])
- m:set(section, "htmode", value[3])
- end
-end
-
-------------------- MAC80211 Device ------------------
-
-if hwtype == "mac80211" then
- if #tx_power_list > 0 then
- tp = s:taboption("general", ListValue,
- "txpower", translate("Transmit Power"), "dBm")
- tp.rmempty = true
- tp.default = tx_power_cur
- function tp.cfgvalue(...)
- return txpower_current(Value.cfgvalue(...), tx_power_list)
- end
-
- tp:value("", translate("auto"))
- for _, p in ipairs(tx_power_list) do
- tp:value(p.driver_dbm, "%i dBm (%i mW)"
- %{ p.display_dbm, p.display_mw })
- end
- end
-
- local cl = iw and iw.countrylist
- if cl and #cl > 0 then
- cc = s:taboption("advanced", ListValue, "country", translate("Country Code"), translate("Use ISO/IEC 3166 alpha2 country codes."))
- cc.default = tostring(iw and iw.country or "00")
- for _, c in ipairs(cl) do
- cc:value(c.alpha2, "%s - %s" %{ c.alpha2, c.name })
- end
- else
- s:taboption("advanced", Value, "country", translate("Country Code"), translate("Use ISO/IEC 3166 alpha2 country codes."))
- end
-
- legacyrates = s:taboption("advanced", Flag, "legacy_rates", translate("Allow legacy 802.11b rates"))
- legacyrates.rmempty = false
- legacyrates.default = "1"
-
- s:taboption("advanced", Value, "distance", translate("Distance Optimization"),
- translate("Distance to farthest network member in meters."))
-
- -- external antenna profiles
- local eal = iw and iw.extant
- if eal and #eal > 0 then
- ea = s:taboption("advanced", ListValue, "extant", translate("Antenna Configuration"))
- for _, eap in ipairs(eal) do
- ea:value(eap.id, "%s (%s)" %{ eap.name, eap.description })
- if eap.selected then
- ea.default = eap.id
- end
- end
- end
-
- s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
- s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
-
- s:taboption("advanced", Flag, "noscan", translate("Force 40MHz mode"),
- translate("Always use 40MHz channels even if the secondary channel overlaps. Using this option does not comply with IEEE 802.11n-2009!")).optional = true
-
- beacon_int = s:taboption("advanced", Value, "beacon_int", translate("Beacon Interval"))
- beacon_int.optional = true
- beacon_int.placeholder = 100
- beacon_int.datatype = "range(15,65535)"
-end
-
-
-------------------- Broadcom Device ------------------
-
-if hwtype == "broadcom" then
- tp = s:taboption("general",
- (#tx_power_list > 0) and ListValue or Value,
- "txpower", translate("Transmit Power"), "dBm")
-
- tp.rmempty = true
- tp.default = tx_power_cur
-
- function tp.cfgvalue(...)
- return txpower_current(Value.cfgvalue(...), tx_power_list)
- end
-
- tp:value("", translate("auto"))
- for _, p in ipairs(tx_power_list) do
- tp:value(p.driver_dbm, "%i dBm (%i mW)"
- %{ p.display_dbm, p.display_mw })
- end
-
- mode = s:taboption("advanced", ListValue, "hwmode", translate("Band"))
- if hw_modes.b then
- mode:value("11b", "2.4GHz (802.11b)")
- if hw_modes.g then
- mode:value("11bg", "2.4GHz (802.11b+g)")
- end
- end
- if hw_modes.g then
- mode:value("11g", "2.4GHz (802.11g)")
- mode:value("11gst", "2.4GHz (802.11g + Turbo)")
- mode:value("11lrs", "2.4GHz (802.11g Limited Rate Support)")
- end
- if hw_modes.a then mode:value("11a", "5GHz (802.11a)") end
- if hw_modes.n then
- if hw_modes.g then
- mode:value("11ng", "2.4GHz (802.11g+n)")
- mode:value("11n", "2.4GHz (802.11n)")
- end
- if hw_modes.a then
- mode:value("11na", "5GHz (802.11a+n)")
- mode:value("11n", "5GHz (802.11n)")
- end
- htmode = s:taboption("advanced", ListValue, "htmode", translate("HT mode (802.11n)"))
- htmode:depends("hwmode", "11ng")
- htmode:depends("hwmode", "11na")
- htmode:depends("hwmode", "11n")
- htmode:value("HT20", "20MHz")
- htmode:value("HT40", "40MHz")
- end
-
- ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
- ant1.widget = "radio"
- ant1:depends("diversity", "")
- ant1:value("3", translate("auto"))
- ant1:value("0", translate("Antenna 1"))
- ant1:value("1", translate("Antenna 2"))
-
- ant2 = s:taboption("advanced", ListValue, "rxantenna", translate("Receiver Antenna"))
- ant2.widget = "radio"
- ant2:depends("diversity", "")
- ant2:value("3", translate("auto"))
- ant2:value("0", translate("Antenna 1"))
- ant2:value("1", translate("Antenna 2"))
-
- s:taboption("advanced", Flag, "frameburst", translate("Frame Bursting"))
-
- s:taboption("advanced", Value, "distance", translate("Distance Optimization"))
- --s:option(Value, "slottime", translate("Slot time"))
-
- s:taboption("advanced", Value, "country", translate("Country Code"))
- s:taboption("advanced", Value, "maxassoc", translate("Connection Limit"))
-end
-
-
---------------------- HostAP Device ---------------------
-
-if hwtype == "prism2" then
- s:taboption("advanced", Value, "txpower", translate("Transmit Power"), "att units").rmempty = true
-
- s:taboption("advanced", Flag, "diversity", translate("Diversity")).rmempty = false
-
- s:taboption("advanced", Value, "txantenna", translate("Transmitter Antenna"))
- s:taboption("advanced", Value, "rxantenna", translate("Receiver Antenna"))
-end
-
-
------------------------ Interface -----------------------
-
-s = m:section(NamedSection, wnet.sid, "wifi-iface", translate("Interface Configuration"))
-s.addremove = false
-s.anonymous = true
-s.defaults.device = wdev:name()
-
-s:tab("general", translate("General Setup"))
-s:tab("encryption", translate("Wireless Security"))
-s:tab("macfilter", translate("MAC-Filter"))
-s:tab("advanced", translate("Advanced Settings"))
-
-mode = s:taboption("general", ListValue, "mode", translate("Mode"))
-mode.override_values = true
-mode:value("ap", translate("Access Point"))
-mode:value("sta", translate("Client"))
-mode:value("adhoc", translate("Ad-Hoc"))
-
-meshid = s:taboption("general", Value, "mesh_id", translate("Mesh Id"))
-meshid:depends({mode="mesh"})
-
-meshfwd = s:taboption("advanced", Flag, "mesh_fwding", translate("Forward mesh peer traffic"))
-meshfwd.rmempty = false
-meshfwd.default = "1"
-meshfwd:depends({mode="mesh"})
-
-mesh_rssi_th = s:taboption("advanced", Value, "mesh_rssi_threshold",
- translate("RSSI threshold for joining"),
- translate("0 = not using RSSI threshold, 1 = do not change driver default"))
-mesh_rssi_th.rmempty = false
-mesh_rssi_th.default = "0"
-mesh_rssi_th.datatype = "range(-255,1)"
-mesh_rssi_th:depends({mode="mesh"})
-
-ssid = s:taboption("general", Value, "ssid", translate("ESSID"))
-ssid.datatype = "maxlength(32)"
-ssid:depends({mode="ap"})
-ssid:depends({mode="sta"})
-ssid:depends({mode="adhoc"})
-ssid:depends({mode="ahdemo"})
-ssid:depends({mode="monitor"})
-ssid:depends({mode="ap-wds"})
-ssid:depends({mode="sta-wds"})
-ssid:depends({mode="wds"})
-
-bssid = s:taboption("general", Value, "bssid", translate("BSSID"))
-bssid.datatype = "macaddr"
-
-network = s:taboption("general", Value, "network", translate("Network"),
- translate("Choose the network(s) you want to attach to this wireless interface or " ..
- "fill out the create field to define a new network."))
-
-network.rmempty = true
-network.template = "cbi/network_netlist"
-network.widget = "checkbox"
-network.novirtual = true
-
-function network.write(self, section, value)
- local i = nw:get_interface(section)
- if i then
- local _, net, old, new = nil, nil, {}, {}
-
- for _, net in ipairs(i:get_networks()) do
- old[net:name()] = true
- end
-
- for net in ut.imatch(value) do
- new[net] = true
- if not old[net] then
- local n = nw:get_network(net) or nw:add_network(net, { proto = "none" })
- if n then
- if not n:is_empty() then
- n:set("type", "bridge")
- end
- n:add_interface(i)
- end
- end
- end
-
- for net, _ in pairs(old) do
- if not new[net] then
- local n = nw:get_network(net)
- if n then
- n:del_interface(i)
- end
- end
- end
- end
-end
-
--------------------- MAC80211 Interface ----------------------
-
-if hwtype == "mac80211" then
- if fs.access("/usr/sbin/iw") then
- mode:value("mesh", "802.11s")
- end
-
- mode:value("ahdemo", translate("Pseudo Ad-Hoc (ahdemo)"))
- mode:value("monitor", translate("Monitor"))
- bssid:depends({mode="adhoc"})
- bssid:depends({mode="sta"})
- bssid:depends({mode="sta-wds"})
-
- mp = s:taboption("macfilter", ListValue, "macfilter", translate("MAC-Address Filter"))
- mp:depends({mode="ap"})
- mp:depends({mode="ap-wds"})
- mp:value("", translate("disable"))
- mp:value("allow", translate("Allow listed only"))
- mp:value("deny", translate("Allow all except listed"))
-
- ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
- ml.datatype = "macaddr"
- ml:depends({macfilter="allow"})
- ml:depends({macfilter="deny"})
- nt.mac_hints(function(mac, name) ml:value(mac, "%s (%s)" %{ mac, name }) end)
-
- mode:value("ap-wds", "%s (%s)" % {translate("Access Point"), translate("WDS")})
- mode:value("sta-wds", "%s (%s)" % {translate("Client"), translate("WDS")})
-
- function mode.write(self, section, value)
- if value == "ap-wds" then
- ListValue.write(self, section, "ap")
- m.uci:set("wireless", section, "wds", 1)
- elseif value == "sta-wds" then
- ListValue.write(self, section, "sta")
- m.uci:set("wireless", section, "wds", 1)
- else
- ListValue.write(self, section, value)
- m.uci:delete("wireless", section, "wds")
- end
- end
-
- function mode.cfgvalue(self, section)
- local mode = ListValue.cfgvalue(self, section)
- local wds = m.uci:get("wireless", section, "wds") == "1"
-
- if mode == "ap" and wds then
- return "ap-wds"
- elseif mode == "sta" and wds then
- return "sta-wds"
- else
- return mode
- end
- end
-
- hidden = s:taboption("general", Flag, "hidden", translate("Hide ESSID"))
- hidden:depends({mode="ap"})
- hidden:depends({mode="ap-wds"})
-
- wmm = s:taboption("general", Flag, "wmm", translate("WMM Mode"))
- wmm:depends({mode="ap"})
- wmm:depends({mode="ap-wds"})
- wmm.default = wmm.enabled
-
- isolate = s:taboption("advanced", Flag, "isolate", translate("Isolate Clients"),
- translate("Prevents client-to-client communication"))
- isolate:depends({mode="ap"})
- isolate:depends({mode="ap-wds"})
-
- ifname = s:taboption("advanced", Value, "ifname", translate("Interface name"), translate("Override default interface name"))
- ifname.optional = true
-
- short_preamble = s:taboption("advanced", Flag, "short_preamble", translate("Short Preamble"))
- short_preamble.default = short_preamble.enabled
-
- dtim_period = s:taboption("advanced", Value, "dtim_period", translate("DTIM Interval"), translate("Delivery Traffic Indication Message Interval"))
- dtim_period.optional = true
- dtim_period.placeholder = 2
- dtim_period.datatype = "range(1,255)"
-
-
- wparekey = s:taboption("advanced", Value, "wpa_group_rekey", translate("Time interval for rekeying GTK"), translate("sec"))
- wparekey.optional = true
- wparekey.placeholder = 600
- wparekey.datatype = "uinteger"
-
- inactivitypool = s:taboption("advanced", Flag , "skip_inactivity_poll", translate("Disable Inactivity Polling"))
- inactivitypool.optional = true
- inactivitypool.datatype = "uinteger"
-
- maxinactivity = s:taboption("advanced", Value, "max_inactivity", translate("Station inactivity limit"), translate("sec"))
- maxinactivity.optional = true
- maxinactivity.placeholder = 300
- maxinactivity.datatype = "uinteger"
-
- listeninterval = s:taboption("advanced", Value, "max_listen_interval", translate("Maximum allowed Listen Interval"))
- listeninterval.optional = true
- listeninterval.placeholder = 65535
- listeninterval.datatype = "uinteger"
-
- disassoc_low_ack = s:taboption("advanced", Flag, "disassoc_low_ack", translate("Disassociate On Low Acknowledgement"),
- translate("Allow AP mode to disconnect STAs based on low ACK condition"))
- disassoc_low_ack.default = disassoc_low_ack.enabled
-end
-
-
--------------------- Broadcom Interface ----------------------
-
-if hwtype == "broadcom" then
- mode:value("wds", translate("WDS"))
- mode:value("monitor", translate("Monitor"))
-
- hidden = s:taboption("general", Flag, "hidden", translate("Hide ESSID"))
- hidden:depends({mode="ap"})
- hidden:depends({mode="adhoc"})
- hidden:depends({mode="wds"})
-
- isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
- translate("Prevents client-to-client communication"))
- isolate:depends({mode="ap"})
-
- s:taboption("advanced", Flag, "doth", "802.11h")
- s:taboption("advanced", Flag, "wmm", translate("WMM Mode"))
-
- bssid:depends({mode="wds"})
- bssid:depends({mode="adhoc"})
-end
-
-
------------------------ HostAP Interface ---------------------
-
-if hwtype == "prism2" then
- mode:value("wds", translate("WDS"))
- mode:value("monitor", translate("Monitor"))
-
- hidden = s:taboption("general", Flag, "hidden", translate("Hide ESSID"))
- hidden:depends({mode="ap"})
- hidden:depends({mode="adhoc"})
- hidden:depends({mode="wds"})
-
- bssid:depends({mode="sta"})
-
- mp = s:taboption("macfilter", ListValue, "macpolicy", translate("MAC-Address Filter"))
- mp:value("", translate("disable"))
- mp:value("allow", translate("Allow listed only"))
- mp:value("deny", translate("Allow all except listed"))
- ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
- ml:depends({macpolicy="allow"})
- ml:depends({macpolicy="deny"})
- nt.mac_hints(function(mac, name) ml:value(mac, "%s (%s)" %{ mac, name }) end)
-
- s:taboption("advanced", Value, "rate", translate("Transmission Rate"))
- s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
- s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
-end
-
-
-------------------- WiFI-Encryption -------------------
-
-encr = s:taboption("encryption", ListValue, "encryption", translate("Encryption"))
-encr.override_values = true
-encr.override_depends = true
-encr:depends({mode="ap"})
-encr:depends({mode="sta"})
-encr:depends({mode="adhoc"})
-encr:depends({mode="ahdemo"})
-encr:depends({mode="ap-wds"})
-encr:depends({mode="sta-wds"})
-encr:depends({mode="mesh"})
-
-cipher = s:taboption("encryption", ListValue, "cipher", translate("Cipher"))
-cipher:depends({encryption="wpa"})
-cipher:depends({encryption="wpa2"})
-cipher:depends({encryption="psk"})
-cipher:depends({encryption="psk2"})
-cipher:depends({encryption="wpa-mixed"})
-cipher:depends({encryption="psk-mixed"})
-cipher:value("auto", translate("auto"))
-cipher:value("ccmp", translate("Force CCMP (AES)"))
-cipher:value("tkip", translate("Force TKIP"))
-cipher:value("tkip+ccmp", translate("Force TKIP and CCMP (AES)"))
-
-function encr.cfgvalue(self, section)
- local v = tostring(ListValue.cfgvalue(self, section))
- if v == "wep" then
- return "wep-open"
- elseif v and v:match("%+") then
- return (v:gsub("%+.+$", ""))
- end
- return v
-end
-
-function encr.write(self, section, value)
- local e = tostring(encr:formvalue(section))
- local c = tostring(cipher:formvalue(section))
- if value == "wpa" or value == "wpa2" then
- self.map.uci:delete("wireless", section, "key")
- end
- if e and (c == "tkip" or c == "ccmp" or c == "tkip+ccmp") then
- e = e .. "+" .. c
- end
- self.map:set(section, "encryption", e)
-end
-
-function cipher.cfgvalue(self, section)
- local v = tostring(ListValue.cfgvalue(encr, section))
- if v and v:match("%+") then
- v = v:gsub("^[^%+]+%+", "")
- if v == "aes" then v = "ccmp"
- elseif v == "tkip+aes" then v = "tkip+ccmp"
- elseif v == "aes+tkip" then v = "tkip+ccmp"
- elseif v == "ccmp+tkip" then v = "tkip+ccmp"
- end
- end
- return v
-end
-
-function cipher.write(self, section)
- return encr:write(section)
-end
-
-
-encr:value("none", "No Encryption")
-encr:value("wep-open", translate("WEP Open System"), {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"}, {mode="ahdemo"}, {mode="wds"})
-encr:value("wep-shared", translate("WEP Shared Key"), {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"}, {mode="ahdemo"}, {mode="wds"})
-
-if hwtype == "mac80211" or hwtype == "prism2" then
- local supplicant = fs.access("/usr/sbin/wpa_supplicant")
- local hostapd = fs.access("/usr/sbin/hostapd")
-
- -- Probe EAP support
- local has_ap_eap = (os.execute("hostapd -veap >/dev/null 2>/dev/null") == 0)
- local has_sta_eap = (os.execute("wpa_supplicant -veap >/dev/null 2>/dev/null") == 0)
-
- -- Probe SAE support
- local has_ap_sae = (os.execute("hostapd -vsae >/dev/null 2>/dev/null") == 0)
- local has_sta_sae = (os.execute("wpa_supplicant -vsae >/dev/null 2>/dev/null") == 0)
-
- -- Probe OWE support
- local has_ap_owe = (os.execute("hostapd -vowe >/dev/null 2>/dev/null") == 0)
- local has_sta_owe = (os.execute("wpa_supplicant -vowe >/dev/null 2>/dev/null") == 0)
-
- if hostapd and supplicant then
- encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
- encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
- encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
- if has_ap_sae and has_sta_sae then
- encr:value("sae", "WPA3-SAE", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"}, {mode="mesh"})
- encr:value("sae-mixed", "WPA2-PSK/WPA3-SAE Mixed Mode", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
- end
- if has_ap_eap and has_sta_eap then
- encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
- encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
- end
- if has_ap_owe and has_sta_owe then
- encr:value("owe", "OWE", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
- end
- elseif hostapd and not supplicant then
- encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="ap-wds"})
- encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="ap-wds"})
- encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="ap-wds"})
- if has_ap_sae then
- encr:value("sae", "WPA3-SAE", {mode="ap"}, {mode="ap-wds"})
- encr:value("sae-mixed", "WPA2-PSK/WPA3-SAE Mixed Mode", {mode="ap"}, {mode="ap-wds"})
- end
- if has_ap_eap then
- encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="ap-wds"})
- encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="ap-wds"})
- end
- if has_ap_owe then
- encr:value("owe", "OWE", {mode="ap"}, {mode="ap-wds"})
- end
- encr.description = translate(
- "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
- "and ad-hoc mode) to be installed."
- )
- elseif not hostapd and supplicant then
- encr:value("psk", "WPA-PSK", {mode="sta"}, {mode="sta-wds"}, {mode="adhoc"})
- encr:value("psk2", "WPA2-PSK", {mode="sta"}, {mode="sta-wds"}, {mode="adhoc"})
- encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"}, {mode="sta-wds"}, {mode="adhoc"})
- if has_sta_sae then
- encr:value("sae", "WPA3-SAE", {mode="sta"}, {mode="sta-wds"}, {mode="mesh"})
- encr:value("sae-mixed", "WPA2-PSK/WPA3-SAE Mixed Mode", {mode="sta"}, {mode="sta-wds"})
- end
- if has_sta_eap then
- encr:value("wpa", "WPA-EAP", {mode="sta"}, {mode="sta-wds"})
- encr:value("wpa2", "WPA2-EAP", {mode="sta"}, {mode="sta-wds"})
- end
- if has_sta_owe then
- encr:value("owe", "OWE", {mode="sta"}, {mode="sta-wds"})
- end
- encr.description = translate(
- "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
- "and ad-hoc mode) to be installed."
- )
- else
- encr.description = translate(
- "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
- "and ad-hoc mode) to be installed."
- )
- end
-elseif hwtype == "broadcom" then
- encr:value("psk", "WPA-PSK")
- encr:value("psk2", "WPA2-PSK")
- encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
-end
-
-auth_server = s:taboption("encryption", Value, "auth_server", translate("Radius-Authentication-Server"))
-auth_server:depends({mode="ap", encryption="wpa"})
-auth_server:depends({mode="ap", encryption="wpa2"})
-auth_server:depends({mode="ap-wds", encryption="wpa"})
-auth_server:depends({mode="ap-wds", encryption="wpa2"})
-auth_server.rmempty = true
-auth_server.datatype = "host(0)"
-
-auth_port = s:taboption("encryption", Value, "auth_port", translate("Radius-Authentication-Port"), translatef("Default %d", 1812))
-auth_port:depends({mode="ap", encryption="wpa"})
-auth_port:depends({mode="ap", encryption="wpa2"})
-auth_port:depends({mode="ap-wds", encryption="wpa"})
-auth_port:depends({mode="ap-wds", encryption="wpa2"})
-auth_port.rmempty = true
-auth_port.datatype = "port"
-
-auth_secret = s:taboption("encryption", Value, "auth_secret", translate("Radius-Authentication-Secret"))
-auth_secret:depends({mode="ap", encryption="wpa"})
-auth_secret:depends({mode="ap", encryption="wpa2"})
-auth_secret:depends({mode="ap-wds", encryption="wpa"})
-auth_secret:depends({mode="ap-wds", encryption="wpa2"})
-auth_secret.rmempty = true
-auth_secret.password = true
-
-acct_server = s:taboption("encryption", Value, "acct_server", translate("Radius-Accounting-Server"))
-acct_server:depends({mode="ap", encryption="wpa"})
-acct_server:depends({mode="ap", encryption="wpa2"})
-acct_server:depends({mode="ap-wds", encryption="wpa"})
-acct_server:depends({mode="ap-wds", encryption="wpa2"})
-acct_server.rmempty = true
-acct_server.datatype = "host(0)"
-
-acct_port = s:taboption("encryption", Value, "acct_port", translate("Radius-Accounting-Port"), translatef("Default %d", 1813))
-acct_port:depends({mode="ap", encryption="wpa"})
-acct_port:depends({mode="ap", encryption="wpa2"})
-acct_port:depends({mode="ap-wds", encryption="wpa"})
-acct_port:depends({mode="ap-wds", encryption="wpa2"})
-acct_port.rmempty = true
-acct_port.datatype = "port"
-
-acct_secret = s:taboption("encryption", Value, "acct_secret", translate("Radius-Accounting-Secret"))
-acct_secret:depends({mode="ap", encryption="wpa"})
-acct_secret:depends({mode="ap", encryption="wpa2"})
-acct_secret:depends({mode="ap-wds", encryption="wpa"})
-acct_secret:depends({mode="ap-wds", encryption="wpa2"})
-acct_secret.rmempty = true
-acct_secret.password = true
-
-dae_client = s:taboption("encryption", Value, "dae_client", translate("DAE-Client"))
-dae_client:depends({mode="ap", encryption="wpa"})
-dae_client:depends({mode="ap", encryption="wpa2"})
-dae_client:depends({mode="ap-wds", encryption="wpa"})
-dae_client:depends({mode="ap-wds", encryption="wpa2"})
-dae_client.rmempty = true
-dae_client.datatype = "host(0)"
-
-dae_port = s:taboption("encryption", Value, "dae_port", translate("DAE-Port"), translatef("Default %d", 3799))
-dae_port:depends({mode="ap", encryption="wpa"})
-dae_port:depends({mode="ap", encryption="wpa2"})
-dae_port:depends({mode="ap-wds", encryption="wpa"})
-dae_port:depends({mode="ap-wds", encryption="wpa2"})
-dae_port.rmempty = true
-dae_port.datatype = "port"
-
-dae_secret = s:taboption("encryption", Value, "dae_secret", translate("DAE-Secret"))
-dae_secret:depends({mode="ap", encryption="wpa"})
-dae_secret:depends({mode="ap", encryption="wpa2"})
-dae_secret:depends({mode="ap-wds", encryption="wpa"})
-dae_secret:depends({mode="ap-wds", encryption="wpa2"})
-dae_secret.rmempty = true
-dae_secret.password = true
-
-wpakey = s:taboption("encryption", Value, "_wpa_key", translate("Key"))
-wpakey:depends("encryption", "psk")
-wpakey:depends("encryption", "psk2")
-wpakey:depends("encryption", "psk+psk2")
-wpakey:depends("encryption", "psk-mixed")
-wpakey:depends("encryption", "sae")
-wpakey:depends("encryption", "sae-mixed")
-wpakey.datatype = "wpakey"
-wpakey.rmempty = true
-wpakey.password = true
-
-wpakey.cfgvalue = function(self, section, value)
- local key = m.uci:get("wireless", section, "key")
- if key == "1" or key == "2" or key == "3" or key == "4" then
- return nil
- end
- return key
-end
-
-wpakey.write = function(self, section, value)
- self.map.uci:set("wireless", section, "key", value)
- self.map.uci:delete("wireless", section, "key1")
-end
-
-
-wepslot = s:taboption("encryption", ListValue, "_wep_key", translate("Used Key Slot"))
-wepslot:depends("encryption", "wep-open")
-wepslot:depends("encryption", "wep-shared")
-wepslot:value("1", translatef("Key #%d", 1))
-wepslot:value("2", translatef("Key #%d", 2))
-wepslot:value("3", translatef("Key #%d", 3))
-wepslot:value("4", translatef("Key #%d", 4))
-
-wepslot.cfgvalue = function(self, section)
- local slot = tonumber(m.uci:get("wireless", section, "key"))
- if not slot or slot < 1 or slot > 4 then
- return 1
- end
- return slot
-end
-
-wepslot.write = function(self, section, value)
- self.map.uci:set("wireless", section, "key", value)
-end
-
-local slot
-for slot=1,4 do
- wepkey = s:taboption("encryption", Value, "key" .. slot, translatef("Key #%d", slot))
- wepkey:depends("encryption", "wep-open")
- wepkey:depends("encryption", "wep-shared")
- wepkey.datatype = "wepkey"
- wepkey.rmempty = true
- wepkey.password = true
-
- function wepkey.write(self, section, value)
- if value and (#value == 5 or #value == 13) then
- value = "s:" .. value
- end
- return Value.write(self, section, value)
- end
-end
-
-if hwtype == "mac80211" or hwtype == "prism2" then
-
- -- Probe 802.11r support (and EAP support as a proxy for Openwrt)
- local has_80211r = (os.execute("hostapd -v11r 2>/dev/null || hostapd -veap 2>/dev/null") == 0)
-
- ieee80211r = s:taboption("encryption", Flag, "ieee80211r",
- translate("802.11r Fast Transition"),
- translate("Enables fast roaming among access points that belong " ..
- "to the same Mobility Domain"))
- ieee80211r:depends({mode="ap", encryption="wpa"})
- ieee80211r:depends({mode="ap", encryption="wpa2"})
- ieee80211r:depends({mode="ap-wds", encryption="wpa"})
- ieee80211r:depends({mode="ap-wds", encryption="wpa2"})
- if has_80211r then
- ieee80211r:depends({mode="ap", encryption="psk"})
- ieee80211r:depends({mode="ap", encryption="psk2"})
- ieee80211r:depends({mode="ap", encryption="psk-mixed"})
- ieee80211r:depends({mode="ap", encryption="sae"})
- ieee80211r:depends({mode="ap", encryption="sae-mixed"})
- ieee80211r:depends({mode="ap-wds", encryption="psk"})
- ieee80211r:depends({mode="ap-wds", encryption="psk2"})
- ieee80211r:depends({mode="ap-wds", encryption="psk-mixed"})
- ieee80211r:depends({mode="ap-wds", encryption="sae"})
- ieee80211r:depends({mode="ap-wds", encryption="sae-mixed"})
- end
- ieee80211r.rmempty = true
-
- nasid = s:taboption("encryption", Value, "nasid", translate("NAS ID"),
- translate("Used for two different purposes: RADIUS NAS ID and " ..
- "802.11r R0KH-ID. Not needed with normal WPA(2)-PSK."))
- nasid:depends({mode="ap", encryption="wpa"})
- nasid:depends({mode="ap", encryption="wpa2"})
- nasid:depends({mode="ap-wds", encryption="wpa"})
- nasid:depends({mode="ap-wds", encryption="wpa2"})
- nasid:depends({ieee80211r="1"})
- nasid.rmempty = true
-
- mobility_domain = s:taboption("encryption", Value, "mobility_domain",
- translate("Mobility Domain"),
- translate("4-character hexadecimal ID"))
- mobility_domain:depends({ieee80211r="1"})
- mobility_domain.placeholder = "4f57"
- mobility_domain.datatype = "and(hexstring,rangelength(4,4))"
- mobility_domain.rmempty = true
-
- reassociation_deadline = s:taboption("encryption", Value, "reassociation_deadline",
- translate("Reassociation Deadline"),
- translate("time units (TUs / 1.024 ms) [1000-65535]"))
- reassociation_deadline:depends({ieee80211r="1"})
- reassociation_deadline.placeholder = "1000"
- reassociation_deadline.datatype = "range(1000,65535)"
- reassociation_deadline.rmempty = true
-
- ft_protocol = s:taboption("encryption", ListValue, "ft_over_ds", translate("FT protocol"))
- ft_protocol:depends({ieee80211r="1"})
- ft_protocol:value("1", translatef("FT over DS"))
- ft_protocol:value("0", translatef("FT over the Air"))
- ft_protocol.rmempty = true
-
- ft_psk_generate_local = s:taboption("encryption", Flag, "ft_psk_generate_local",
- translate("Generate PMK locally"),
- translate("When using a PSK, the PMK can be automatically generated. When enabled, the R0/R1 key options below are not applied. Disable this to use the R0 and R1 key options."))
- ft_psk_generate_local:depends({ieee80211r="1"})
- ft_psk_generate_local.default = ft_psk_generate_local.enabled
- ft_psk_generate_local.rmempty = false
-
- r0_key_lifetime = s:taboption("encryption", Value, "r0_key_lifetime",
- translate("R0 Key Lifetime"), translate("minutes"))
- r0_key_lifetime:depends({ieee80211r="1"})
- r0_key_lifetime.placeholder = "10000"
- r0_key_lifetime.datatype = "uinteger"
- r0_key_lifetime.rmempty = true
-
- r1_key_holder = s:taboption("encryption", Value, "r1_key_holder",
- translate("R1 Key Holder"),
- translate("6-octet identifier as a hex string - no colons"))
- r1_key_holder:depends({ieee80211r="1"})
- r1_key_holder.placeholder = "00004f577274"
- r1_key_holder.datatype = "and(hexstring,rangelength(12,12))"
- r1_key_holder.rmempty = true
-
- pmk_r1_push = s:taboption("encryption", Flag, "pmk_r1_push", translate("PMK R1 Push"))
- pmk_r1_push:depends({ieee80211r="1"})
- pmk_r1_push.placeholder = "0"
- pmk_r1_push.rmempty = true
-
- r0kh = s:taboption("encryption", DynamicList, "r0kh", translate("External R0 Key Holder List"),
- translate("List of R0KHs in the same Mobility Domain. " ..
- " Format: MAC-address,NAS-Identifier,128-bit key as hex string. " ..
- " This list is used to map R0KH-ID (NAS Identifier) to a destination " ..
- "MAC address when requesting PMK-R1 key from the R0KH that the STA " ..
- "used during the Initial Mobility Domain Association."))
- r0kh:depends({ieee80211r="1"})
- r0kh.rmempty = true
-
- r1kh = s:taboption("encryption", DynamicList, "r1kh", translate("External R1 Key Holder List"),
- translate ("List of R1KHs in the same Mobility Domain. "..
- " Format: MAC-address,R1KH-ID as 6 octets with colons,128-bit key as hex string. "..
- " This list is used to map R1KH-ID to a destination MAC address " ..
- "when sending PMK-R1 key from the R0KH. This is also the " ..
- "list of authorized R1KHs in the MD that can request PMK-R1 keys."))
- r1kh:depends({ieee80211r="1"})
- r1kh.rmempty = true
- -- End of 802.11r options
-
- eaptype = s:taboption("encryption", ListValue, "eap_type", translate("EAP-Method"))
- eaptype:value("tls", "TLS")
- eaptype:value("ttls", "TTLS")
- eaptype:value("peap", "PEAP")
- eaptype:value("fast", "FAST")
- eaptype:depends({mode="sta", encryption="wpa"})
- eaptype:depends({mode="sta", encryption="wpa2"})
- eaptype:depends({mode="sta-wds", encryption="wpa"})
- eaptype:depends({mode="sta-wds", encryption="wpa2"})
-
- cacert = s:taboption("encryption", FileUpload, "ca_cert", translate("Path to CA-Certificate"))
- cacert:depends({mode="sta", encryption="wpa"})
- cacert:depends({mode="sta", encryption="wpa2"})
- cacert:depends({mode="sta-wds", encryption="wpa"})
- cacert:depends({mode="sta-wds", encryption="wpa2"})
- cacert.rmempty = true
-
- clientcert = s:taboption("encryption", FileUpload, "client_cert", translate("Path to Client-Certificate"))
- clientcert:depends({mode="sta", eap_type="tls", encryption="wpa"})
- clientcert:depends({mode="sta", eap_type="tls", encryption="wpa2"})
- clientcert:depends({mode="sta-wds", eap_type="tls", encryption="wpa"})
- clientcert:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"})
-
- privkey = s:taboption("encryption", FileUpload, "priv_key", translate("Path to Private Key"))
- privkey:depends({mode="sta", eap_type="tls", encryption="wpa2"})
- privkey:depends({mode="sta", eap_type="tls", encryption="wpa"})
- privkey:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"})
- privkey:depends({mode="sta-wds", eap_type="tls", encryption="wpa"})
-
- privkeypwd = s:taboption("encryption", Value, "priv_key_pwd", translate("Password of Private Key"))
- privkeypwd:depends({mode="sta", eap_type="tls", encryption="wpa2"})
- privkeypwd:depends({mode="sta", eap_type="tls", encryption="wpa"})
- privkeypwd:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"})
- privkeypwd:depends({mode="sta-wds", eap_type="tls", encryption="wpa"})
- privkeypwd.rmempty = true
- privkeypwd.password = true
-
- auth = s:taboption("encryption", ListValue, "auth", translate("Authentication"))
- auth:value("PAP", "PAP", {eap_type="ttls"})
- auth:value("CHAP", "CHAP", {eap_type="ttls"})
- auth:value("MSCHAP", "MSCHAP", {eap_type="ttls"})
- auth:value("MSCHAPV2", "MSCHAPv2", {eap_type="ttls"})
- auth:value("EAP-GTC")
- auth:value("EAP-MD5")
- auth:value("EAP-MSCHAPV2")
- auth:value("EAP-TLS")
- auth:depends({mode="sta", eap_type="fast", encryption="wpa2"})
- auth:depends({mode="sta", eap_type="fast", encryption="wpa"})
- auth:depends({mode="sta", eap_type="peap", encryption="wpa2"})
- auth:depends({mode="sta", eap_type="peap", encryption="wpa"})
- auth:depends({mode="sta", eap_type="ttls", encryption="wpa2"})
- auth:depends({mode="sta", eap_type="ttls", encryption="wpa"})
- auth:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"})
- auth:depends({mode="sta-wds", eap_type="fast", encryption="wpa"})
- auth:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"})
- auth:depends({mode="sta-wds", eap_type="peap", encryption="wpa"})
- auth:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"})
- auth:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"})
-
- cacert2 = s:taboption("encryption", FileUpload, "ca_cert2", translate("Path to inner CA-Certificate"))
- cacert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"})
- cacert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"})
- cacert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"})
- cacert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"})
-
- clientcert2 = s:taboption("encryption", FileUpload, "client_cert2", translate("Path to inner Client-Certificate"))
- clientcert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"})
- clientcert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"})
- clientcert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"})
- clientcert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"})
-
- privkey2 = s:taboption("encryption", FileUpload, "priv_key2", translate("Path to inner Private Key"))
- privkey2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"})
- privkey2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"})
- privkey2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"})
- privkey2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"})
-
- privkeypwd2 = s:taboption("encryption", Value, "priv_key2_pwd", translate("Password of inner Private Key"))
- privkeypwd2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"})
- privkeypwd2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"})
- privkeypwd2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"})
- privkeypwd2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"})
- privkeypwd2.rmempty = true
- privkeypwd2.password = true
-
- identity = s:taboption("encryption", Value, "identity", translate("Identity"))
- identity:depends({mode="sta", eap_type="fast", encryption="wpa2"})
- identity:depends({mode="sta", eap_type="fast", encryption="wpa"})
- identity:depends({mode="sta", eap_type="peap", encryption="wpa2"})
- identity:depends({mode="sta", eap_type="peap", encryption="wpa"})
- identity:depends({mode="sta", eap_type="ttls", encryption="wpa2"})
- identity:depends({mode="sta", eap_type="ttls", encryption="wpa"})
- identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"})
- identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa"})
- identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"})
- identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa"})
- identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"})
- identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"})
- identity:depends({mode="sta", eap_type="tls", encryption="wpa2"})
- identity:depends({mode="sta", eap_type="tls", encryption="wpa"})
- identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"})
- identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa"})
-
- anonymous_identity = s:taboption("encryption", Value, "anonymous_identity", translate("Anonymous Identity"))
- anonymous_identity:depends({mode="sta", eap_type="fast", encryption="wpa2"})
- anonymous_identity:depends({mode="sta", eap_type="fast", encryption="wpa"})
- anonymous_identity:depends({mode="sta", eap_type="peap", encryption="wpa2"})
- anonymous_identity:depends({mode="sta", eap_type="peap", encryption="wpa"})
- anonymous_identity:depends({mode="sta", eap_type="ttls", encryption="wpa2"})
- anonymous_identity:depends({mode="sta", eap_type="ttls", encryption="wpa"})
- anonymous_identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"})
- anonymous_identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa"})
- anonymous_identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"})
- anonymous_identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa"})
- anonymous_identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"})
- anonymous_identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"})
- anonymous_identity:depends({mode="sta", eap_type="tls", encryption="wpa2"})
- anonymous_identity:depends({mode="sta", eap_type="tls", encryption="wpa"})
- anonymous_identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"})
- anonymous_identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa"})
-
- password = s:taboption("encryption", Value, "password", translate("Password"))
- password:depends({mode="sta", eap_type="fast", encryption="wpa2"})
- password:depends({mode="sta", eap_type="fast", encryption="wpa"})
- password:depends({mode="sta", eap_type="peap", encryption="wpa2"})
- password:depends({mode="sta", eap_type="peap", encryption="wpa"})
- password:depends({mode="sta", eap_type="ttls", encryption="wpa2"})
- password:depends({mode="sta", eap_type="ttls", encryption="wpa"})
- password:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"})
- password:depends({mode="sta-wds", eap_type="fast", encryption="wpa"})
- password:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"})
- password:depends({mode="sta-wds", eap_type="peap", encryption="wpa"})
- password:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"})
- password:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"})
- password.rmempty = true
- password.password = true
-end
-
--- ieee802.11w options
-if hwtype == "mac80211" then
- local has_80211w = (os.execute("hostapd -v11w 2>/dev/null || hostapd -veap 2>/dev/null") == 0)
- if has_80211w then
- ieee80211w = s:taboption("encryption", ListValue, "ieee80211w",
- translate("802.11w Management Frame Protection"),
- translate("Requires the 'full' version of wpad/hostapd " ..
- "and support from the wifi driver (as of Jan 2019: " ..
- "ath9k, ath10k, mwlwifi and mt76)"))
- ieee80211w.default = ""
- ieee80211w.rmempty = true
- ieee80211w:value("", translate("Disabled (default)"))
- ieee80211w:value("1", translate("Optional"))
- ieee80211w:value("2", translate("Required"))
- ieee80211w:depends({mode="ap", encryption="wpa2"})
- ieee80211w:depends({mode="ap-wds", encryption="wpa2"})
- ieee80211w:depends({mode="ap", encryption="psk2"})
- ieee80211w:depends({mode="ap", encryption="psk-mixed"})
- ieee80211w:depends({mode="ap", encryption="sae"})
- ieee80211w:depends({mode="ap", encryption="sae-mixed"})
- ieee80211w:depends({mode="ap", encryption="owe"})
- ieee80211w:depends({mode="ap-wds", encryption="psk2"})
- ieee80211w:depends({mode="ap-wds", encryption="psk-mixed"})
- ieee80211w:depends({mode="ap-wds", encryption="sae"})
- ieee80211w:depends({mode="ap-wds", encryption="sae-mixed"})
- ieee80211w:depends({mode="ap-wds", encryption="owe"})
-
- max_timeout = s:taboption("encryption", Value, "ieee80211w_max_timeout",
- translate("802.11w maximum timeout"),
- translate("802.11w Association SA Query maximum timeout"))
- max_timeout:depends({ieee80211w="1"})
- max_timeout:depends({ieee80211w="2"})
- max_timeout.datatype = "uinteger"
- max_timeout.placeholder = "1000"
- max_timeout.rmempty = true
-
- retry_timeout = s:taboption("encryption", Value, "ieee80211w_retry_timeout",
- translate("802.11w retry timeout"),
- translate("802.11w Association SA Query retry timeout"))
- retry_timeout:depends({ieee80211w="1"})
- retry_timeout:depends({ieee80211w="2"})
- retry_timeout.datatype = "uinteger"
- retry_timeout.placeholder = "201"
- retry_timeout.rmempty = true
- end
-
- key_retries = s:taboption("encryption", Flag, "wpa_disable_eapol_key_retries",
- translate("Enable key reinstallation (KRACK) countermeasures"),
- translate("Complicates key reinstallation attacks on the client side by disabling retransmission of EAPOL-Key frames that are used to install keys. This workaround might cause interoperability issues and reduced robustness of key negotiation especially in environments with heavy traffic load."))
-
- key_retries:depends({mode="ap", encryption="wpa2"})
- key_retries:depends({mode="ap", encryption="psk2"})
- key_retries:depends({mode="ap", encryption="psk-mixed"})
- key_retries:depends({mode="ap", encryption="sae"})
- key_retries:depends({mode="ap", encryption="sae-mixed"})
- key_retries:depends({mode="ap-wds", encryption="wpa2"})
- key_retries:depends({mode="ap-wds", encryption="psk2"})
- key_retries:depends({mode="ap-wds", encryption="psk-mixed"})
- key_retries:depends({mode="ap-wds", encryption="sae"})
- key_retries:depends({mode="ap-wds", encryption="sae-mixed"})
-end
-
-if hwtype == "mac80211" or hwtype == "prism2" then
- local wpasupplicant = fs.access("/usr/sbin/wpa_supplicant")
- local hostcli = fs.access("/usr/sbin/hostapd_cli")
- if hostcli and wpasupplicant then
- wps = s:taboption("encryption", Flag, "wps_pushbutton", translate("Enable WPS pushbutton, requires WPA(2)-PSK"))
- wps.enabled = "1"
- wps.disabled = "0"
- wps.rmempty = false
- wps:depends("encryption", "psk")
- wps:depends("encryption", "psk2")
- wps:depends("encryption", "psk-mixed")
- end
-end
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/wifi_add.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/wifi_add.lua
deleted file mode 100644
index e8a3058..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/wifi_add.lua
+++ /dev/null
@@ -1,168 +0,0 @@
--- Copyright 2009 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local nw = require "luci.model.network"
-local fw = require "luci.model.firewall"
-local uci = require "luci.model.uci".cursor()
-local http = require "luci.http"
-
-local iw = luci.sys.wifi.getiwinfo(http.formvalue("device"))
-
-local has_firewall = fs.access("/etc/config/firewall")
-
-if not iw then
- luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
- return
-end
-
-m = SimpleForm("network", translatef("Joining Network: %q", http.formvalue("join")))
-m.cancel = translate("Back to scan results")
-m.reset = false
-
-function m.on_cancel()
- local dev = http.formvalue("device")
- http.redirect(luci.dispatcher.build_url(
- dev and "admin/network/wireless_join?device=" .. dev
- or "admin/network/wireless"
- ))
-end
-
-nw.init(uci)
-fw.init(uci)
-
-m.hidden = {
- device = http.formvalue("device"),
- join = http.formvalue("join"),
- channel = http.formvalue("channel"),
- mode = http.formvalue("mode"),
- bssid = http.formvalue("bssid"),
- wep = http.formvalue("wep"),
- wpa_suites = http.formvalue("wpa_suites"),
- wpa_version = http.formvalue("wpa_version")
-}
-
-if iw and iw.mbssid_support then
- replace = m:field(Flag, "replace", translate("Replace wireless configuration"),
- translate("Check this option to delete the existing networks from this radio."))
-
- function replace.cfgvalue() return "0" end
-else
- replace = m:field(DummyValue, "replace", translate("Replace wireless configuration"))
- replace.default = translate("The hardware is not multi-SSID capable and the existing " ..
- "configuration will be replaced if you proceed.")
-
- function replace.formvalue() return "1" end
-end
-
-if http.formvalue("wep") == "1" then
- key = m:field(Value, "key", translate("WEP passphrase"),
- translate("Specify the secret encryption key here."))
-
- key.password = true
- key.datatype = "wepkey"
-
-elseif (tonumber(m.hidden.wpa_version) or 0) > 0 and
- (m.hidden.wpa_suites == "PSK" or m.hidden.wpa_suites == "PSK2")
-then
- key = m:field(Value, "key", translate("WPA passphrase"),
- translate("Specify the secret encryption key here."))
-
- key.password = true
- key.datatype = "wpakey"
- --m.hidden.wpa_suite = (tonumber(http.formvalue("wpa_version")) or 0) >= 2 and "psk2" or "psk"
-end
-
-newnet = m:field(Value, "_netname_new", translate("Name of the new network"),
- translate("The allowed characters are: A-Z, a-z, " ..
- "0-9 and _"
- ))
-
-newnet.default = m.hidden.mode == "Ad-Hoc" and "mesh" or "wwan"
-newnet.datatype = "uciname"
-
-if has_firewall then
- fwzone = m:field(Value, "_fwzone",
- translate("Create / Assign firewall-zone"),
- translate("Choose the firewall zone you want to assign to this interface. Select unspecified to remove the interface from the associated zone or fill out the create field to define a new zone and attach the interface to it."))
-
- fwzone.template = "cbi/firewall_zonelist"
- fwzone.default = m.hidden.mode == "Ad-Hoc" and "mesh" or "wan"
-end
-
-function newnet.parse(self, section)
- local net, zone
-
- if has_firewall then
- local value = fwzone:formvalue(section)
- if value and #value > 0 then
- zone = fw:get_zone(value) or fw:add_zone(value)
- end
- end
-
- local wdev = nw:get_wifidev(m.hidden.device)
-
- wdev:set("disabled", false)
- wdev:set("channel", m.hidden.channel)
-
- if replace:formvalue(section) then
- local n
- for _, n in ipairs(wdev:get_wifinets()) do
- wdev:del_wifinet(n)
- end
- end
-
- local wconf = {
- device = m.hidden.device,
- ssid = m.hidden.join,
- mode = (m.hidden.mode == "Ad-Hoc" and "adhoc" or "sta")
- }
-
- if m.hidden.wep == "1" then
- wconf.encryption = "wep-open"
- wconf.key = "1"
- wconf.key1 = key and key:formvalue(section) or ""
- elseif (tonumber(m.hidden.wpa_version) or 0) > 0 then
- wconf.encryption = (tonumber(m.hidden.wpa_version) or 0) >= 2 and "psk2" or "psk"
- wconf.key = key and key:formvalue(section) or ""
- else
- wconf.encryption = "none"
- end
-
- if wconf.mode == "adhoc" or wconf.mode == "sta" then
- wconf.bssid = m.hidden.bssid
- end
-
- local value = self:formvalue(section)
- net = nw:add_network(value, { proto = "dhcp" })
-
- if not net then
- self.error = { [section] = "missing" }
- else
- wconf.network = net:name()
-
- local wnet = wdev:add_wifinet(wconf)
- if wnet then
- if zone then
- fw:del_network(net:name())
- zone:add_network(net:name())
- end
-
- uci:save("wireless")
- uci:save("network")
- uci:save("firewall")
-
- luci.http.redirect(wnet:adminlink())
- end
- end
-end
-
-if has_firewall then
- function fwzone.cfgvalue(self, section)
- self.iface = section
- local z = fw:get_zone_by_network(section)
- return z and z:name()
- end
-end
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_network/wifi_overview.lua b/root/usr/lib/lua/luci/model/cbi/admin_network/wifi_overview.lua
deleted file mode 100644
index 54720d6..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_network/wifi_overview.lua
+++ /dev/null
@@ -1,153 +0,0 @@
--- Copyright 2018 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local utl = require "luci.util"
-local tpl = require "luci.template"
-local ntm = require "luci.model.network"
-
-local has_iwinfo = pcall(require, "iwinfo")
-
-function guess_wifi_hw(dev)
- local bands = ""
- local ifname = dev:name()
- local name, idx = ifname:match("^([a-z]+)(%d+)")
- idx = tonumber(idx)
-
- if has_iwinfo then
- local bl = dev.iwinfo.hwmodelist
- if bl and next(bl) then
- if bl.a then bands = bands .. "a" end
- if bl.b then bands = bands .. "b" end
- if bl.g then bands = bands .. "g" end
- if bl.n then bands = bands .. "n" end
- if bl.ac then bands = bands .. "ac" end
- end
-
- local hw = dev.iwinfo.hardware_name
- if hw then
- return "%s 802.11%s" %{ hw, bands }
- end
- end
-
- -- wl.o
- if name == "wl" then
- local name = translatef("Broadcom 802.11%s Wireless Controller", bands)
- local nm = 0
-
- local fd = nixio.open("/proc/bus/pci/devices", "r")
- if fd then
- local ln
- for ln in fd:linesource() do
- if ln:match("wl$") then
- if nm == idx then
- local version = ln:match("^%S+%s+%S%S%S%S([0-9a-f]+)")
- name = translatef(
- "Broadcom BCM%04x 802.11 Wireless Controller",
- tonumber(version, 16)
- )
-
- break
- else
- nm = nm + 1
- end
- end
- end
- fd:close()
- end
-
- return name
-
- -- dunno yet
- else
- return translatef("Generic 802.11%s Wireless Controller", bands)
- end
-end
-
-
-m = Map("wireless", translate("Wireless Overview"))
-m:chain("network")
-m.pageaction = false
-
-if not has_iwinfo then
- s = m:section(NamedSection, "__warning__")
-
- function s.render(self)
- tpl.render_string([[
-
-
<%:Package libiwinfo required!%>
-
<%_The libiwinfo-lua package is not installed. You must install this component for working wireless configuration!%>
-
- ]])
- end
-end
-
-local _, dev, net
-for _, dev in ipairs(ntm:get_wifidevs()) do
- s = m:section(TypedSection)
- s.template = "admin_network/wifi_overview"
- s.wnets = dev:get_wifinets()
- s.dev = dev
- s.hw = guess_wifi_hw(dev)
-
- function s.cfgsections(self)
- local _, net, sl = nil, nil, { }
- for _, net in ipairs(self.wnets) do
- sl[#sl+1] = net:name()
- self.wnets[net:name()] = net
- end
- return sl
- end
-
- o = s:option(Value, "__disable__")
-
- function o.cfgvalue(self, sid)
- local wnet = self.section.wnets[sid]
- local wdev = wnet:get_device()
-
- return ((wnet and wnet:get("disabled") == "1") or
- (wdev and wdev:get("disabled") == "1")) and "1" or "0"
- end
-
- function o.write(self, sid, value)
- local wnet = self.section.wnets[sid]
- local wdev = wnet:get_device()
-
- if value ~= "1" then
- wnet:set("disabled", nil)
- wdev:set("disabled", nil)
- else
- wnet:set("disabled", "1")
- end
- end
-
- o.remove = o.write
-
-
- o = s:option(Value, "__delete__")
-
- function o.write(self, sid, value)
- local wnet = self.section.wnets[sid]
- local nets = wnet:get_networks()
-
- ntm:del_wifinet(wnet:id())
-
- local _, net
- for _, net in ipairs(nets) do
- if net:is_empty() then
- ntm:del_network(net:name())
- end
- end
- end
-end
-
-s = m:section(NamedSection, "__assoclist__")
-
-function s.render(self, sid)
- tpl.render_string([[
-
<%:Associated Stations%>
- <%+wifi_assoclist%>
- ]])
-end
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_status/processes.lua b/root/usr/lib/lua/luci/model/cbi/admin_status/processes.lua
deleted file mode 100644
index 0a6e48f..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_status/processes.lua
+++ /dev/null
@@ -1,34 +0,0 @@
--- Copyright 2008 Steven Barth
--- Copyright 2008 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-f = SimpleForm("processes", translate("Processes"), translate("This list gives an overview over currently running system processes and their status."))
-f.reset = false
-f.submit = false
-
-t = f:section(Table, luci.sys.process.list())
-t:option(DummyValue, "PID", translate("PID"))
-t:option(DummyValue, "USER", translate("Owner"))
-t:option(DummyValue, "COMMAND", translate("Command"))
-t:option(DummyValue, "%CPU", translate("CPU usage (%)"))
-t:option(DummyValue, "%MEM", translate("Memory usage (%)"))
-
-hup = t:option(Button, "_hup", translate("Hang Up"))
-hup.inputstyle = "reload"
-function hup.write(self, section)
- null, self.tag_error[section] = luci.sys.process.signal(section, 1)
-end
-
-term = t:option(Button, "_term", translate("Terminate"))
-term.inputstyle = "remove"
-function term.write(self, section)
- null, self.tag_error[section] = luci.sys.process.signal(section, 15)
-end
-
-kill = t:option(Button, "_kill", translate("Kill"))
-kill.inputstyle = "reset"
-function kill.write(self, section)
- null, self.tag_error[section] = luci.sys.process.signal(section, 9)
-end
-
-return f
\ No newline at end of file
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_system/backupfiles.lua b/root/usr/lib/lua/luci/model/cbi/admin_system/backupfiles.lua
index ee2401e..c81466c 100644
--- a/root/usr/lib/lua/luci/model/cbi/admin_system/backupfiles.lua
+++ b/root/usr/lib/lua/luci/model/cbi/admin_system/backupfiles.lua
@@ -20,7 +20,8 @@ if luci.http.formvalue("display") ~= "list" then
l.inputstyle = "apply"
c = f:option(TextValue, "_custom")
- c.rmempty = false
+ c.forcewrite = true
+ c.rmempty = true
c.cols = 70
c.rows = 30
@@ -28,9 +29,15 @@ if luci.http.formvalue("display") ~= "list" then
return nixio.fs.readfile("/etc/sysupgrade.conf")
end
- c.write = function(self, section, value)
- value = value:gsub("\r\n?", "\n")
- return nixio.fs.writefile("/etc/sysupgrade.conf", value)
+ m.handle = function(self, state, data)
+ if state == FORM_VALID then
+ if data._custom then
+ nixio.fs.writefile("/etc/sysupgrade.conf", data._custom:gsub("\r\n", "\n"))
+ else
+ nixio.fs.writefile("/etc/sysupgrade.conf", "")
+ end
+ end
+ return true
end
else
m.submit = false
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_system/crontab.lua b/root/usr/lib/lua/luci/model/cbi/admin_system/crontab.lua
deleted file mode 100644
index 016a619..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_system/crontab.lua
+++ /dev/null
@@ -1,32 +0,0 @@
--- Copyright 2008 Steven Barth
--- Copyright 2008-2013 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local cronfile = "/etc/crontabs/root"
-
-f = SimpleForm("crontab", translate("Scheduled Tasks"),
- translate("This is the system crontab in which scheduled tasks can be defined.") ..
- translate(" Note: you need to manually restart the cron service if the " ..
- "crontab file was empty before editing."))
-
-t = f:field(TextValue, "crons")
-t.rmempty = true
-t.rows = 10
-function t.cfgvalue()
- return fs.readfile(cronfile) or ""
-end
-
-function f.handle(self, state, data)
- if state == FORM_VALID then
- if data.crons then
- fs.writefile(cronfile, data.crons:gsub("\r\n", "\n"))
- luci.sys.call("/usr/bin/crontab %q" % cronfile)
- else
- fs.writefile(cronfile, "")
- end
- end
- return true
-end
-
-return f
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_system/fstab.lua b/root/usr/lib/lua/luci/model/cbi/admin_system/fstab.lua
deleted file mode 100644
index d4bce5b..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_system/fstab.lua
+++ /dev/null
@@ -1,272 +0,0 @@
--- Copyright 2008 Steven Barth
--- Licensed to the public under the Apache License 2.0.
-
-require("luci.tools.webadmin")
-
-local fs = require "nixio.fs"
-local util = require "nixio.util"
-local tp = require "luci.template.parser"
-
-local block = io.popen("block info", "r")
-local ln, dev, devices = nil, nil, {}
-
-repeat
- ln = block:read("*l")
- dev = ln and ln:match("^/dev/(.-):")
-
- if dev then
- local e, s, key, val = { }
-
- for key, val in ln:gmatch([[(%w+)="(.-)"]]) do
- e[key:lower()] = val
- devices[val] = e
- end
-
- s = tonumber((fs.readfile("/sys/class/block/%s/size" % dev)))
-
- e.dev = "/dev/%s" % dev
- e.size = s and math.floor(s / 2048)
-
- devices[e.dev] = e
- end
-until not ln
-
-block:close()
-
-m = Map("fstab", translate("Mount Points"))
-s = m:section(TypedSection, "global", translate("Global Settings"))
-s.addremove = false
-s.anonymous = true
-
-detect = s:option(Button, "block_detect", translate("Generate Config"), translate("Find all currently attached filesystems and swap and replace configuration with defaults based on what was detected"))
-detect.inputstyle = "reload"
-
-detect.write = function(self, section)
- luci.sys.call("block detect >/etc/config/fstab")
- luci.http.redirect(luci.dispatcher.build_url("admin/system", "fstab"))
-end
-
-o = s:option(Flag, "anon_swap", translate("Anonymous Swap"), translate("Mount swap not specifically configured"))
-o.default = o.disabled
-o.rmempty = false
-
-o = s:option(Flag, "anon_mount", translate("Anonymous Mount"), translate("Mount filesystems not specifically configured"))
-o.default = o.disabled
-o.rmempty = false
-
-o = s:option(Flag, "auto_swap", translate("Automount Swap"), translate("Automatically mount swap on hotplug"))
-o.default = o.enabled
-o.rmempty = false
-
-o = s:option(Flag, "auto_mount", translate("Automount Filesystem"), translate("Automatically mount filesystems on hotplug"))
-o.default = o.enabled
-o.rmempty = false
-
-o = s:option(Flag, "check_fs", translate("Check filesystems before mount"), translate("Automatically check filesystem for errors before mounting"))
-o.default = o.disabled
-o.rmempty = false
-
-local mounts = luci.sys.mounts()
-local non_system_mounts = {}
-for rawmount, val in pairs(mounts) do
- if (string.find(val.mountpoint, "/tmp/.jail") == nil) then
- repeat
- val.umount = false
- if (val.mountpoint == "/") then
- break
- elseif (val.mountpoint == "/overlay") then
- break
- elseif (val.mountpoint == "/rom") then
- break
- elseif (val.mountpoint == "/tmp") then
- break
- elseif (val.mountpoint == "/tmp/shm") then
- break
- elseif (val.mountpoint == "/tmp/upgrade") then
- break
- elseif (val.mountpoint == "/dev") then
- break
- end
- val.umount = true
- until true
- non_system_mounts[rawmount] = val
- end
-end
-
-v = m:section(Table, non_system_mounts, translate("Mounted file systems"))
-
-fs = v:option(DummyValue, "fs", translate("Filesystem"))
-
-mp = v:option(DummyValue, "mountpoint", translate("Mount Point"))
-
-avail = v:option(DummyValue, "avail", translate("Available"))
-function avail.cfgvalue(self, section)
- return luci.tools.webadmin.byte_format(
- ( tonumber(mounts[section].available) or 0 ) * 1024
- ) .. " / " .. luci.tools.webadmin.byte_format(
- ( tonumber(mounts[section].blocks) or 0 ) * 1024
- )
-end
-
-used = v:option(DummyValue, "used", translate("Used"))
-function used.cfgvalue(self, section)
- return ( mounts[section].percent or "0%" ) .. " (" ..
- luci.tools.webadmin.byte_format(
- ( tonumber(mounts[section].used) or 0 ) * 1024
- ) .. ")"
-end
-
-unmount = v:option(Button, "unmount", translate("Unmount"))
-function unmount.cfgvalue(self, section)
- return non_system_mounts[section].umount
-end
-
-unmount.render = function(self, section, scope)
- self.title = translate("Unmount")
- self.inputstyle = "remove"
- Button.render(self, section, scope)
-end
-
-unmount.write = function(self, section)
- if non_system_mounts[section].umount then
- luci.sys.call("/bin/umount '%s'" % luci.util.shellstartsqescape(non_system_mounts[section].mountpoint))
- return luci.http.redirect(luci.dispatcher.build_url("admin/system", "fstab"))
- end
-end
-
-mount = m:section(TypedSection, "mount", translate("Mount Points"), translate("Mount Points define at which point a memory device will be attached to the filesystem"))
-mount.anonymous = true
-mount.addremove = true
-mount.template = "cbi/tblsection"
-mount.extedit = luci.dispatcher.build_url("admin/system/fstab/mount/%s")
-
-mount.create = function(...)
- local sid = TypedSection.create(...)
- if sid then
- luci.http.redirect(mount.extedit % sid)
- return
- end
-end
-
-
-mount:option(Flag, "enabled", translate("Enabled")).rmempty = false
-
-dev = mount:option(DummyValue, "device", translate("Device"))
-dev.rawhtml = true
-dev.cfgvalue = function(self, section)
- local v, e
-
- v = m.uci:get("fstab", section, "uuid")
- e = v and devices[v]
- if v and e and e.size then
- return "UUID: %s (%s, %d MB)" %{ tp.pcdata(v), e.dev, e.size }
- elseif v and e then
- return "UUID: %s (%s)" %{ tp.pcdata(v), e.dev }
- elseif v then
- return "UUID: %s (%s)" %{ tp.pcdata(v), translate("not present") }
- end
-
- v = m.uci:get("fstab", section, "label")
- e = v and devices[v]
- if v and e and e.size then
- return "Label: %s (%s, %d MB)" %{ tp.pcdata(v), e.dev, e.size }
- elseif v and e then
- return "Label: %s (%s)" %{ tp.pcdata(v), e.dev }
- elseif v then
- return "Label: %s (%s)" %{ tp.pcdata(v), translate("not present") }
- end
-
- v = Value.cfgvalue(self, section) or "?"
- e = v and devices[v]
- if v and e and e.size then
- return "%s (%d MB)" %{ tp.pcdata(v), e.size }
- elseif v and e then
- return tp.pcdata(v)
- elseif v then
- return "%s (%s)" %{ tp.pcdata(v), translate("not present") }
- end
-end
-
-mp = mount:option(DummyValue, "target", translate("Mount Point"))
-mp.cfgvalue = function(self, section)
- if m.uci:get("fstab", section, "is_rootfs") == "1" then
- return "/overlay"
- else
- return Value.cfgvalue(self, section) or "?"
- end
-end
-
-fs = mount:option(DummyValue, "fstype", translate("Filesystem"))
-fs.cfgvalue = function(self, section)
- local v, e
-
- v = m.uci:get("fstab", section, "uuid")
- v = v and v:lower() or m.uci:get("fstab", section, "label")
- v = v or m.uci:get("fstab", section, "device")
-
- e = v and devices[v]
-
- return e and e.type or m.uci:get("fstab", section, "fstype") or "?"
-end
-
-op = mount:option(DummyValue, "options", translate("Options"))
-op.cfgvalue = function(self, section)
- return Value.cfgvalue(self, section) or "defaults"
-end
-
-rf = mount:option(DummyValue, "is_rootfs", translate("Root"))
-rf.cfgvalue = function(self, section)
- local target = m.uci:get("fstab", section, "target")
- if target == "/" then
- return translate("yes")
- elseif target == "/overlay" then
- return translate("overlay")
- else
- return translate("no")
- end
-end
-
-ck = mount:option(DummyValue, "enabled_fsck", translate("Check"))
-ck.cfgvalue = function(self, section)
- return Value.cfgvalue(self, section) == "1"
- and translate("yes") or translate("no")
-end
-
-
-swap = m:section(TypedSection, "swap", translate("SWAP"), translate("If your physical memory is insufficient unused data can be temporarily swapped to a swap-device resulting in a higher amount of usable RAM. Be aware that swapping data is a very slow process as the swap-device cannot be accessed with the high datarates of the RAM."))
-swap.anonymous = true
-swap.addremove = true
-swap.template = "cbi/tblsection"
-swap.extedit = luci.dispatcher.build_url("admin/system/fstab/swap/%s")
-
-swap.create = function(...)
- local sid = TypedSection.create(...)
- if sid then
- luci.http.redirect(swap.extedit % sid)
- return
- end
-end
-
-
-swap:option(Flag, "enabled", translate("Enabled")).rmempty = false
-
-dev = swap:option(DummyValue, "device", translate("Device"))
-dev.cfgvalue = function(self, section)
- local v
-
- v = m.uci:get("fstab", section, "uuid")
- if v then return "UUID: %s" % v end
-
- v = m.uci:get("fstab", section, "label")
- if v then return "Label: %s" % v end
-
- v = Value.cfgvalue(self, section) or "?"
- e = v and devices[v]
- if v and e and e.size then
- return "%s (%s MB)" % {v, e.size}
- else
- return v
- end
-end
-
-return m
diff --git a/root/usr/lib/lua/luci/model/cbi/admin_system/fstab/mount.lua b/root/usr/lib/lua/luci/model/cbi/admin_system/fstab/mount.lua
deleted file mode 100644
index 454a253..0000000
--- a/root/usr/lib/lua/luci/model/cbi/admin_system/fstab/mount.lua
+++ /dev/null
@@ -1,159 +0,0 @@
--- Copyright 2010 Jo-Philipp Wich
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local util = require "nixio.util"
-
-local has_fscheck = fs.access("/usr/sbin/e2fsck")
-
-local block = io.popen("block info", "r")
-local ln, dev, devices = nil, nil, {}
-
-repeat
- ln = block:read("*l")
- dev = ln and ln:match("^/dev/(.-):")
-
- if dev then
- local e, s, key, val = { }
-
- for key, val in ln:gmatch([[(%w+)="(.-)"]]) do
- e[key:lower()] = val
- end
-
- s = tonumber((fs.readfile("/sys/class/block/%s/size" % dev)))
-
- e.dev = "/dev/%s" % dev
- e.size = s and math.floor(s / 2048)
-
- devices[#devices+1] = e
- end
-until not ln
-
-block:close()
-
-
-m = Map("fstab", translate("Mount Points - Mount Entry"))
-m.redirect = luci.dispatcher.build_url("admin/system/fstab")
-
-if not arg[1] or m.uci:get("fstab", arg[1]) ~= "mount" then
- luci.http.redirect(m.redirect)
- return
-end
-
-
-
-mount = m:section(NamedSection, arg[1], "mount", translate("Mount Entry"))
-mount.anonymous = true
-mount.addremove = false
-
-mount:tab("general", translate("General Settings"))
-mount:tab("advanced", translate("Advanced Settings"))
-
-
-mount:taboption("general", Flag, "enabled", translate("Enable this mount")).rmempty = false
-
-
-o = mount:taboption("general", Value, "uuid", translate("UUID"),
- translate("If specified, mount the device by its UUID instead of a fixed device node"))
-
-o:value("", translate("-- match by uuid --"))
-
-for i, d in ipairs(devices) do
- if d.uuid and d.size then
- o:value(d.uuid, "%s (%s, %d MB)" %{ d.uuid, d.dev, d.size })
- elseif d.uuid then
- o:value(d.uuid, "%s (%s)" %{ d.uuid, d.dev })
- end
-end
-
-
-o = mount:taboption("general", Value, "label", translate("Label"),
- translate("If specified, mount the device by the partition label instead of a fixed device node"))
-
-o:value("", translate("-- match by label --"))
-
-o:depends("uuid", "")
-
-for i, d in ipairs(devices) do
- if d.label and d.size then
- o:value(d.label, "%s (%s, %d MB)" %{ d.label, d.dev, d.size })
- elseif d.label then
- o:value(d.label, "%s (%s)" %{ d.label, d.dev })
- end
-end
-
-
-o = mount:taboption("general", Value, "device", translate("Device"),
- translate("The device file of the memory or partition (e.g. /dev/sda1)"))
-
-o:value("", translate("-- match by device --"))
-
-o:depends({ uuid = "", label = "" })
-
-for i, d in ipairs(devices) do
- if d.size then
- o:value(d.dev, "%s (%d MB)" %{ d.dev, d.size })
- else
- o:value(d.dev)
- end
-end
-
-
-o = mount:taboption("general", Value, "target", translate("Mount point"),
- translate("Specifies the directory the device is attached to"))
-
-o:value("/", translate("Use as root filesystem (/)"))
-o:value("/overlay", translate("Use as external overlay (/overlay)"))
-
-
-o = mount:taboption("general", DummyValue, "__notice", translate("Root preparation"))
-o:depends("target", "/")
-o.rawhtml = true
-o.default = [[
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_status/connections.htm b/root/usr/lib/lua/luci/view/admin_status/connections.htm
deleted file mode 100644
index d9099aa..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/connections.htm
+++ /dev/null
@@ -1,374 +0,0 @@
-<%#
- Copyright 2010-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-
-
-
<%:Realtime Connections%>
-
-
<%:This page gives an overview over currently active network connections.%>
-
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_status/index.htm b/root/usr/lib/lua/luci/view/admin_status/index.htm
index 5fa90a1..958212a 100644
--- a/root/usr/lib/lua/luci/view/admin_status/index.htm
+++ b/root/usr/lib/lua/luci/view/admin_status/index.htm
@@ -4,131 +4,55 @@
Licensed to the public under the Apache License 2.0.
-%>
-<%
- local fs = require "nixio.fs"
- local ipc = require "luci.ip"
- local util = require "luci.util"
- local stat = require "luci.tools.status"
- local ver = require "luci.version"
-
- if luci.http.formvalue("status") == "1" then
-
- local sysinfo = luci.util.ubus("system", "info") or { }
-
- local meminfo = sysinfo.memory or {
- total = 0,
- free = 0,
- buffered = 0,
- shared = 0
- }
-
- local swapinfo = sysinfo.swap or {
- total = 0,
- free = 0
- }
-
- local has_dsl = fs.access("/etc/init.d/dsl_control")
-
- local ntm = require "luci.model.network".init()
- local wan_nets = ntm:get_wan_networks()
- local wan6_nets = ntm:get_wan6_networks()
-
- local conn_count = tonumber(
- fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0
-
- local conn_max = tonumber(luci.sys.exec(
- "sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max"
- ):match("%d+")) or 4096
-
- local rv = {
- uptime = sysinfo.uptime or 0,
- localtime = os.date(),
- loadavg = sysinfo.load or { 0, 0, 0 },
- memory = meminfo,
- swap = swapinfo,
- connmax = conn_max,
- conncount = conn_count,
- wifinets = stat.wifi_networks()
- }
-
- if #wan_nets > 0 then
- local k, v
-
- rv.wan = { }
-
- for k, v in pairs(wan_nets) do
- local dev = v:get_interface()
- local link = dev and ipc.link(dev:name())
-
- local wan_info = {
- ipaddr = v:ipaddr(),
- gwaddr = v:gwaddr(),
- netmask = v:netmask(),
- dns = v:dnsaddrs(),
- expires = v:expires(),
- uptime = v:uptime(),
- proto = v:proto(),
- i18n = v:get_i18n(),
- ifname = v:ifname(),
- link = v:adminlink(),
- mac = dev and dev:mac(),
- type = dev and dev:type(),
- name = dev and dev:get_i18n(),
- ether = link and link.type == 1
- }
-
- rv.wan[#rv.wan+1] = wan_info
- end
- end
-
- if #wan6_nets > 0 then
- local k, v
-
- rv.wan6 = { }
-
- for k, v in pairs(wan6_nets) do
- local dev = v:get_interface()
- local link = dev and ipc.link(dev:name())
- local wan6_info = {
- ip6addr = v:ip6addr(),
- gw6addr = v:gw6addr(),
- dns = v:dns6addrs(),
- ip6prefix = v:ip6prefix(),
- uptime = v:uptime(),
- proto = v:proto(),
- i18n = v:get_i18n(),
- ifname = v:ifname(),
- link = v:adminlink(),
- mac = dev and dev:mac(),
- type = dev and dev:type(),
- name = dev and dev:get_i18n(),
- ether = link and link.type == 1
- }
-
- rv.wan6[#rv.wan6+1] = wan6_info
- end
- end
-
- if has_dsl then
- local dsl_stat = luci.sys.exec("/etc/init.d/dsl_control lucistat")
- local dsl_func = loadstring(dsl_stat)
- if dsl_func then
- rv.dsl = dsl_func()
- end
- end
-
- luci.http.prepare_content("application/json")
- luci.http.write_json(rv)
-
- return
- end
--%>
-
<%+header%>
<%:Status%>
+
+
<%:Loading view…%>
+
+
+
+
+
<%-
+ local util = require "luci.util"
+ local fs = require "nixio.fs"
+
local incdir = util.libpath() .. "/view/admin_status/index/"
if fs.access(incdir) then
local _, inc
@@ -143,7 +67,11 @@
<%:Status%>
end
end
-%>
+
-
+
<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_status/index/10-system.htm b/root/usr/lib/lua/luci/view/admin_status/index/10-system.htm
deleted file mode 100644
index 994550e..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/index/10-system.htm
+++ /dev/null
@@ -1,29 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%
- local boardinfo = luci.util.ubus("system", "board") or { }
- local unameinfo = nixio.uname() or { }
- local ver = require "luci.version"
-%>
-
-
diff --git a/root/usr/lib/lua/luci/view/admin_status/index/20-memory.htm b/root/usr/lib/lua/luci/view/admin_status/index/20-memory.htm
deleted file mode 100644
index 1377470..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/index/20-memory.htm
+++ /dev/null
@@ -1,31 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%
- local sysinfo = luci.util.ubus("system", "info") or { }
- local has_swap = sysinfo.swap and sysinfo.swap.total > 0 or false
-%>
-
-
-
<%:Memory%>
-
-
-
<%:Total Available%>
-
<%:Free%>
-
<%:Buffered%>
-
-
-
-<% if has_swap then %>
-
-
<%:Swap%>
-
-
-
<%:Total Available%>
-
<%:Free%>
-
-
-<% end %>
diff --git a/root/usr/lib/lua/luci/view/admin_status/index/30-network.htm b/root/usr/lib/lua/luci/view/admin_status/index/30-network.htm
deleted file mode 100644
index 945a31b..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/index/30-network.htm
+++ /dev/null
@@ -1,17 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-
-
<%:Network%>
-
-
-
<%:Collecting data...%>
-
-
-
-
<%:Active Connections%>
-
-
diff --git a/root/usr/lib/lua/luci/view/admin_status/index/40-dhcp-leases.htm b/root/usr/lib/lua/luci/view/admin_status/index/40-dhcp-leases.htm
deleted file mode 100644
index aaf3661..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/index/40-dhcp-leases.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%
- local fs = require "nixio.fs"
- local has_dhcp = fs.access("/etc/config/dhcp")
-
- if has_dhcp then
- include("lease_status")
- end
-%>
diff --git a/root/usr/lib/lua/luci/view/admin_status/index/50-dsl.htm b/root/usr/lib/lua/luci/view/admin_status/index/50-dsl.htm
deleted file mode 100644
index f37bf14..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/index/50-dsl.htm
+++ /dev/null
@@ -1,20 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%
- local fs = require "nixio.fs"
- local has_dsl = fs.access("/etc/init.d/dsl_control")
-%>
-
-<% if has_dsl then %>
-
-
<%:DSL%>
-
-
-
<%:Collecting data...%>
-
-
-<% end %>
diff --git a/root/usr/lib/lua/luci/view/admin_status/index/60-wifi.htm b/root/usr/lib/lua/luci/view/admin_status/index/60-wifi.htm
deleted file mode 100644
index 7338bc7..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/index/60-wifi.htm
+++ /dev/null
@@ -1,26 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%
- local fs = require "nixio.fs"
- local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0)
-%>
-
-<% if has_wifi then %>
-
-
<%:Wireless%>
-
-
-
<%:Collecting data...%>
-
-
-
-
-
<%:Associated Stations%>
-
- <%+wifi_assoclist%>
-
-<% end %>
diff --git a/root/usr/lib/lua/luci/view/admin_status/iptables.htm b/root/usr/lib/lua/luci/view/admin_status/iptables.htm
index 1bb1e01..5a319fc 100644
--- a/root/usr/lib/lua/luci/view/admin_status/iptables.htm
+++ b/root/usr/lib/lua/luci/view/admin_status/iptables.htm
@@ -68,6 +68,6 @@
<%:Firewall Status%>
<%:Collecting data...%>
-
+
<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_status/load.htm b/root/usr/lib/lua/luci/view/admin_status/load.htm
deleted file mode 100644
index d31d340..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/load.htm
+++ /dev/null
@@ -1,283 +0,0 @@
-<%#
- Copyright 2010-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-
-
-
<%:Realtime Load%>
-
-
-
-
-
-
-
-
-
<%:1 Minute Load:%>
-
0
-
-
<%:Average:%>
-
0
-
-
<%:Peak:%>
-
0
-
-
-
<%:5 Minute Load:%>
-
0
-
-
<%:Average:%>
-
0
-
-
<%:Peak:%>
-
0
-
-
-
<%:15 Minute Load:%>
-
0
-
-
<%:Average:%>
-
0
-
-
<%:Peak:%>
-
0
-
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_status/wireless.htm b/root/usr/lib/lua/luci/view/admin_status/wireless.htm
deleted file mode 100644
index 5ac2eb4..0000000
--- a/root/usr/lib/lua/luci/view/admin_status/wireless.htm
+++ /dev/null
@@ -1,370 +0,0 @@
-<%#
- Copyright 2011-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%-
- local ntm = require "luci.model.network".init()
-
- local dev
- local devices = { }
- for _, dev in luci.util.vspairs(luci.sys.net.devices()) do
- if dev:match("^wlan%d") or dev:match("^ath%d") or dev:match("^wl%d") then
- devices[#devices+1] = dev
- end
- end
-
- local curdev = luci.http.formvalue("dev") or devices[1]
--%>
-
-<%+header%>
-
-
-
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_system/applyreboot.htm b/root/usr/lib/lua/luci/view/admin_system/applyreboot.htm
deleted file mode 100644
index c8e5de9..0000000
--- a/root/usr/lib/lua/luci/view/admin_system/applyreboot.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-
-
- <%=luci.sys.hostname()%> - <%= title or translate("Rebooting...") %>
-
-
-
-
-
-
-
-
-
<%=luci.sys.hostname() or "?"%>
-
-
-
-
-
-
-
-
<%:System%> - <%= title or translate("Rebooting...") %>
-
-
- <%= msg or translate("Changes applied.") %>
-
-
-
- <%:Waiting for changes to be applied...%>
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/root/usr/lib/lua/luci/view/admin_system/backupfiles.htm b/root/usr/lib/lua/luci/view/admin_system/backupfiles.htm
deleted file mode 100644
index c1f3361..0000000
--- a/root/usr/lib/lua/luci/view/admin_system/backupfiles.htm
+++ /dev/null
@@ -1,10 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-
<%:Click "Generate archive" to download a tar archive of the current configuration files.%>
-
-
-
-
-
<%:Restore%>
-
<%:To restore configuration files, you can upload a previously generated backup archive here. To reset the firmware to its initial state, click "Perform reset" (only possible with squashfs images).%>
-
- <% if reset_avail then %>
-
- <% end %>
-
- <% if backup_invalid then %>
-
<%:The backup archive does not appear to be a valid gzip file.%>
- <% end %>
-
-
- <% local mtds = require("luci.sys").mtds(); if #mtds > 0 then -%>
-
<%:Save mtdblock contents%>
-
<%:Click "Save mtdblock" to download specified mtdblock file. (NOTE: THIS FEATURE IS FOR PROFESSIONALS! )%>
-
-
-
- <% end %>
-
-
-
-
-
<%:Flash new firmware image%>
- <% if upgrade_avail then %>
-
- <% else %>
-
<%:Sorry, there is no sysupgrade support present; a new firmware image must be flashed manually. Please refer to the wiki for device specific install instructions.%>
- <% end %>
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_system/reboot.htm b/root/usr/lib/lua/luci/view/admin_system/reboot.htm
deleted file mode 100644
index d23664a..0000000
--- a/root/usr/lib/lua/luci/view/admin_system/reboot.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2015 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-
<%:Reboot%>
-
-
<%:Reboots the operating system of your device%>
-
-<%- local c = require("luci.model.uci").cursor():changes(); if c and next(c) then -%>
-
<%:Warning: There are unsaved changes that will get lost on reboot!%>
-<%- end -%>
-
-
-
-
-
-
-
- <%:Device is rebooting...%>
-
-
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_system/upgrade.htm b/root/usr/lib/lua/luci/view/admin_system/upgrade.htm
deleted file mode 100644
index 597ddfd..0000000
--- a/root/usr/lib/lua/luci/view/admin_system/upgrade.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2009 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-
<%:Flash Firmware%> - <%:Verify%>
-
- <%_ The flash image was uploaded.
- Below is the checksum and file size listed,
- compare them with the original file to ensure data integrity.
- Click "Proceed" below to start the flash procedure. %>
-
- <% if storage > 0 and size > storage then %>
-
-
<%:It appears that you are trying to
- flash an image that does not fit into the flash memory, please verify
- the image file! %>
<%:Size%>: <%
- local w = require "luci.tools.webadmin"
- write(w.byte_format(size))
-
- if storage > 0 then
- write(luci.i18n.translatef(
- " (%s available)",
- w.byte_format(storage)
- ))
- end
- %>
-
<% if keep then %>
- <%:Configuration files will be kept%>
- <% else %>
- <%:Caution: Configuration files will be erased%>
- <% end %>
- <% if force then %>
-
- <%:Caution: System upgrade will be forced%>
-
- <% end %>
-
-
-
-
-
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_uci/changelog.htm b/root/usr/lib/lua/luci/view/admin_uci/changelog.htm
deleted file mode 100644
index 9d6267c..0000000
--- a/root/usr/lib/lua/luci/view/admin_uci/changelog.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<%#
- Copyright 2010 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<% export("uci_changelog", function(changes) -%>
-
- <%:Legend:%>
-
-
<%:Section added%>
-
<%:Section removed%>
-
<%:Option changed%>
-
<%:Option removed%>
-
-
-
-
-
<%
- local util = luci.util
- local tpl = {
- ["add-3"] = "uci add %0 %3 # =%2",
- ["set-3"] = "uci set %0.%2=%3",
- ["set-4"] = "uci set %0.%2.%3=%4",
- ["remove-2"] = "uci del %0.%2",
- ["remove-3"] = "uci del %0.%2.%3",
- ["order-3"] = "uci reorder %0.%2=%3",
- ["list-add-4"] = "uci add_list %0.%2.%3=%4",
- ["list-del-4"] = "uci del_list %0.%2.%3=%4",
- ["rename-3"] = "uci rename %0.%2=%3",
- ["rename-4"] = "uci rename %0.%2.%3=%4"
- }
-
- local conf, deltas
- for conf, deltas in util.kspairs(changes) do
- write("
# /etc/config/%s
" % conf)
-
- local _, delta, added
- for _, delta in pairs(deltas) do
- local t = tpl["%s-%d" %{ delta[1], #delta }]
-
- write(t:gsub("%%(%d)", function(n)
- if n == "0" then
- return conf
- elseif n == "2" then
- if added and delta[2] == added[1] then
- return "@%s[-1]" % added[2]
- else
- return delta[2]
- end
- elseif n == "4" then
- return util.shellquote(delta[4])
- else
- return delta[tonumber(n)]
- end
- end))
-
- if delta[1] == "add" then
- added = { delta[2], delta[3] }
- end
- end
-
- write(" ")
- end
- %>
-
-<%- end) %>
diff --git a/root/usr/lib/lua/luci/view/admin_uci/changes.htm b/root/usr/lib/lua/luci/view/admin_uci/changes.htm
deleted file mode 100644
index 43bd7c2..0000000
--- a/root/usr/lib/lua/luci/view/admin_uci/changes.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-<%-
- local node, redir_url = luci.dispatcher.lookup(luci.http.formvalue("redir"))
- export("redirect", redir_url or url("admin/uci/changes"))
-
- include("admin_uci/changelog")
--%>
-
-
<%:Configuration%> / <%:Changes%>
-
-<% if changes then %>
- <%- uci_changelog(changes) -%>
-<% else %>
-
<%:There are no pending changes!%>
-<% end %>
-
-
-
-
- <% if redir_url then %>
-
- <% end %>
-
-
-
-
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/admin_uci/revert.htm b/root/usr/lib/lua/luci/view/admin_uci/revert.htm
deleted file mode 100644
index d8fd3de..0000000
--- a/root/usr/lib/lua/luci/view/admin_uci/revert.htm
+++ /dev/null
@@ -1,33 +0,0 @@
-<%#
- Copyright 2008 Steven Barth
- Copyright 2008-2018 Jo-Philipp Wich
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-<%-
- local node, redir_url = luci.dispatcher.lookup(luci.http.formvalue("redir"))
- export("redirect", redir_url or url("admin/uci/changes"))
-
- include("admin_uci/changelog")
--%>
-
-
<%:Configuration%> / <%:Revert%>
-
-<% if changes then %>
-
<%:The following changes have been reverted%>:
- <%- uci_changelog(changes) -%>
-<% else %>
-
<%:There are no pending changes to revert!%>
-<% end %>
-
-<% if redir_url then %>
-
-
-
-<% end %>
-
-<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/aria2/log_template.htm b/root/usr/lib/lua/luci/view/aria2/log_template.htm
new file mode 100644
index 0000000..38a0f13
--- /dev/null
+++ b/root/usr/lib/lua/luci/view/aria2/log_template.htm
@@ -0,0 +1,55 @@
+<%#
+ Copyright 2017-2019 Xingwang Liao
+ Licensed to the public under the MIT License.
+-%>
+
+<% css = [[
+
+ #log_text {
+ padding: 10px;
+ text-align: left;
+ }
+ #log_text pre {
+ word-break: break-all;
+ margin: 0;
+ }
+ .description {
+ background-color: #33ccff;
+ }
+
+]]
+-%>
+
+<%+header%>
+
+
+
+
+
<%:Aria2%> - <%:Log Data%>
+
+
+
+<%+footer%>
diff --git a/root/usr/lib/lua/luci/view/aria2/overview_status.htm b/root/usr/lib/lua/luci/view/aria2/overview_status.htm
index 9d9ffee..b14cca2 100644
--- a/root/usr/lib/lua/luci/view/aria2/overview_status.htm
+++ b/root/usr/lib/lua/luci/view/aria2/overview_status.htm
@@ -1,5 +1,5 @@
diff --git a/root/usr/lib/lua/luci/view/aria2/settings_header.htm b/root/usr/lib/lua/luci/view/aria2/settings_header.htm
new file mode 100644
index 0000000..b71690f
--- /dev/null
+++ b/root/usr/lib/lua/luci/view/aria2/settings_header.htm
@@ -0,0 +1,116 @@
+<%#
+ Copyright 2017-2019 Xingwang Liao
+ Licensed to the public under the MIT License.
+-%>
+
+<%
+ local ipkg = require "luci.model.ipkg"
+ local has_ui = false
+
+ local uilist = {
+ supported = {
+ ["ariang"] = "AriaNg",
+ ["webui-aria2"] = "WebUI-Aria2",
+ ["yaaw"] = "YAAW"
+ },
+ installed = {}
+ }
+
+ for k in pairs(uilist.supported) do
+ if ipkg.installed(k) then
+ uilist.installed[#uilist.installed + 1] = k
+ has_ui = true
+ end
+ end
+%>
+
+
+
+
diff --git a/root/usr/lib/lua/luci/view/aria2/value_with_btn.htm b/root/usr/lib/lua/luci/view/aria2/value_with_btn.htm
new file mode 100644
index 0000000..487e107
--- /dev/null
+++ b/root/usr/lib/lua/luci/view/aria2/value_with_btn.htm
@@ -0,0 +1,22 @@
+<%#
+ Copyright 2017-2019 Xingwang Liao
+ Licensed to the public under the MIT License.
+-%>
+
+<%+cbi/valueheader%>
+ />
+ <%- if self.btntext then -%>
+
><%=self.btntext%>
+ <% end %>
+<%+cbi/valuefooter%>
diff --git a/root/usr/lib/lua/luci/view/cbi/apply_widget.htm b/root/usr/lib/lua/luci/view/cbi/apply_widget.htm
deleted file mode 100644
index 0f96673..0000000
--- a/root/usr/lib/lua/luci/view/cbi/apply_widget.htm
+++ /dev/null
@@ -1,172 +0,0 @@
-<% export("cbi_apply_widget", function(redirect_ok, rollback_token) -%>
-
-<%- end) %>
diff --git a/root/usr/lib/lua/luci/view/cbi/cell_valueheader.htm b/root/usr/lib/lua/luci/view/cbi/cell_valueheader.htm
index cb11d8f..db5c668 100644
--- a/root/usr/lib/lua/luci/view/cbi/cell_valueheader.htm
+++ b/root/usr/lib/lua/luci/view/cbi/cell_valueheader.htm
@@ -3,9 +3,9 @@
local descr = luci.util.trim(striptags(self.description))
local ftype = self.typename or (self.template and self.template:gsub("^.+/", ""))
-%>
-
0, "data-type", ftype) ..
+ ifattr(ftype and #ftype > 0, "data-widget", ftype) ..
ifattr(title and #title > 0, "data-title", title, true) ..
ifattr(descr and #descr > 0, "data-description", descr, true)
%>>
diff --git a/root/usr/lib/lua/luci/view/cbi/dropdown.htm b/root/usr/lib/lua/luci/view/cbi/dropdown.htm
index 6f4b899..927ecf2 100644
--- a/root/usr/lib/lua/luci/view/cbi/dropdown.htm
+++ b/root/usr/lib/lua/luci/view/cbi/dropdown.htm
@@ -1,54 +1,19 @@
<%+cbi/valueheader%>
-
-<%-
- local selected = { }
-
- if self.multiple then
- local val
- for val in luci.util.imatch(self:cfgvalue(section)) do
- selected[val] = true
- end
- else
- selected[self:cfgvalue(section)] = true
- end
-
- if not next(selected) and self.default then
- selected[self.default] = true
- end
--%>
-
-
>
-
- <% local i, key; for i, key in pairs(self.keylist) do %>
-
<%+cbi/valuefooter%>
diff --git a/root/usr/lib/lua/luci/view/cbi/filebrowser.htm b/root/usr/lib/lua/luci/view/cbi/filebrowser.htm
deleted file mode 100644
index 806b1b5..0000000
--- a/root/usr/lib/lua/luci/view/cbi/filebrowser.htm
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
- Filebrowser - LuCI
-
-
-
-
-
- <%
- require("nixio.fs")
- require("nixio.util")
- require("luci.http")
- require("luci.dispatcher")
-
- local field = luci.http.formvalue('field')
- local request = luci.dispatcher.context.args
- local path = { '' }
-
- for i = 1, #request do
- if request[i] ~= '..' and #request[i] > 0 then
- path[#path+1] = request[i]
- end
- end
-
- local filestat = nixio.fs.stat(table.concat(path, '/'))
- local baseurl = { 'admin', 'filebrowser' }
-
- if filestat and filestat.type == "reg" then
- path[#path] = ''
- elseif not (filestat and filestat.type == "dir") then
- path = { '', '' }
- else
- path[#path+1] = ''
- end
-
- filepath = table.concat(path, '/')
-
- local entries = {}
- local _, e
- for _, e in luci.util.vspairs(nixio.util.consume((nixio.fs.dir(filepath)))) do
- local p = filepath .. e
- local s = nixio.fs.stat(p)
- if s then
- entries[#entries+1] = {
- name = e,
- path = p,
- type = s.type
- }
- end
- end
- -%>
-
- Location:
- <% for i, dir in ipairs(path) do %>
- <% if i == 1 then %>
- (root)
- <% elseif next(path, i) then %>
- <% baseurl[#baseurl+1] = luci.http.urlencode(dir) %>
- / <%=pcdata(dir)%>
- <% else %>
- <% baseurl[#baseurl+1] = luci.http.urlencode(dir) %>
- / <%=pcdata(dir)%>
- <% end %>
- <% end %>
-
-
-
-
-
-
- <% for _, e in ipairs(entries) do if e.type == 'dir' then -%>
-
-
-
diff --git a/root/usr/lib/lua/luci/view/cbi/firewall_zoneforwards.htm b/root/usr/lib/lua/luci/view/cbi/firewall_zoneforwards.htm
deleted file mode 100644
index dc251db..0000000
--- a/root/usr/lib/lua/luci/view/cbi/firewall_zoneforwards.htm
+++ /dev/null
@@ -1,73 +0,0 @@
-<%+cbi/valueheader%>
-
-<%-
- local utl = require "luci.util"
- local fwm = require "luci.model.firewall".init()
- local nwm = require "luci.model.network".init()
-
- local zone, fwd, fz
- local value = self:formvalue(section)
- if not value or value == "-" then
- value = self:cfgvalue(section) or self.default
- end
-
- local def = fwm:get_defaults()
- local zone = fwm:get_zone(value)
- local empty = true
-
- local function render_zone(zone)
--%>
-
-<%-
- end
--%>
-
-<% if zone then %>
-
-
- <%=render_zone(zone)%>
-
- ⇒
-
- <%
- for _, fwd in ipairs(zone:get_forwardings_by("src")) do
- fz = fwd:dest_zone()
- if fz then
- empty = false
- render_zone(fz)
- end
- end
- if empty then
- %>
-
- <% end %>
-