Developing lightweight computation at the DSG edge

Commit 102b990b authored by p4u's avatar p4u
Browse files

Merge branch 'testing' into gsoc

parents 3dbf09af d5cf2c4a
...@@ -42,8 +42,12 @@ qmp_disable_netserver() { ...@@ -42,8 +42,12 @@ qmp_disable_netserver() {
killall -9 netserver || true killall -9 netserver || true
} }
## DISABLED
# Publish or unpublish lan HNA depending on qmp configuration # Publish or unpublish lan HNA depending on qmp configuration
qmp_publish_lan() { qmp_publish_lan() {
echo "Publish LAN is a garbage, doing nothing..."
return
is_publish_on=$(qmp_uci_get networks.publish_lan) is_publish_on=$(qmp_uci_get networks.publish_lan)
[ -z "$is_publish_on" ] && is_publish_on=0 [ -z "$is_publish_on" ] && is_publish_on=0
......
...@@ -61,7 +61,7 @@ qmp_update_get_checksum_from_image() { ...@@ -61,7 +61,7 @@ qmp_update_get_checksum_from_image() {
qmp_update_extract_timestamp() { qmp_update_extract_timestamp() {
image_name="$1" image_name="$1"
echo "$image_name" | awk -F\- '{print $3}' | awk -F_ '{print $1}' | sed s/"\..*"// echo "$image_name" | awk -F\- '{print $4}' | awk -F_ '{print $1}' | sed s/"\..*"//
} }
qmp_update_get_config() { qmp_update_get_config() {
...@@ -152,6 +152,7 @@ qmp_update_upgrade_system() { ...@@ -152,6 +152,7 @@ qmp_update_upgrade_system() {
read -p "Do you want to upgrade system using image $image_url? [N,y] " a read -p "Do you want to upgrade system using image $image_url? [N,y] " a
if [ "$a" == "y" ]; then if [ "$a" == "y" ]; then
[ $(echo $image_url | grep Alix -c) -eq 1 ] && { echo "Detected Alix, applying sysupgrade patch..."; rm -rf /overlay/* 2>/dev/null; }
[ -n "$config" ] && sysupgrade -f $config $output_image [ -n "$config" ] && sysupgrade -f $config $output_image
[ -z "$config" ] && sysupgrade -n $output_image [ -z "$config" ] && sysupgrade -n $output_image
fi fi
......
#!/bin/sh
if ! cat /etc/crontabs/root | grep bmx6health; then
echo "* * * * * /etc/qmp/bmx6health.sh >> /tmp/log/bmx6health.log" >> /etc/crontabs/root
/etc/init.d/cron enable
/etc/init.d/cron start
fi
#!/bin/sh
if cat /etc/firewall.user | grep -e "^# Clamp MSS TCP rule to fix MTU problems"; then exit 0; fi
cat << EOF >> /etc/firewall.user
# Clamp MSS TCP rule to fix MTU problems
iptables -A FORWARD -p tcp -o bmx6_+ -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
EOF
#!/bin/sh
if cat /etc/firewall.user | grep -e "^# QMP Masquerade options"; then exit 0; fi
cat << QMP >> /etc/firewall.user
# QMP Masquerade options
iptables -t nat -A POSTROUTING -s 172.16.0.0/12 ! -d 172.16.0.0/12 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 ! -d 192.168.0.0/16 -j MASQUERADE
QMP
#!/bin/sh
cat << QMP >> /etc/firewall.user
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -d 10.0.0.0/8 -j RETURN
iptables -t nat -A POSTROUTING -j MASQUERADE
QMP
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
# Temporal script to re-enable wifi after the boot # Temporal script to re-enable wifi after the boot
# this is to fix a temporaly issue when you are using non-standard wifi chanels # this is to fix a temporaly issue when you are using non-standard wifi chanels
sed -i -e "/^exit 0/d" /etc/rc.local if [ $(cat /etc/rc.local | grep -c ^wifi) -lt 1 ]; then
echo "wifi" >> /etc/rc.local sed -i -e "/^exit 0/d" /etc/rc.local
echo "wifi" >> /etc/rc.local
fi
#!/bin/sh
uci delete qmp.networks.bmx6_mesh_prefix48
uci delete bmx6.general.globalPrefix
uci set qmp.networks.bmx6_tablePrefTuns=7000
uci set qmp.networks.bmx6_tableTuns=70
uci set qmp.networks.bmx6_throwRules=1
uci commit
...@@ -29,22 +29,26 @@ function index() ...@@ -29,22 +29,26 @@ function index()
root.index = true root.index = true
-- Main window with auth enabled -- Main window with auth enabled
overview = entry({"qmp"}, call("action_status"), "qMp", 1) overview = entry({"qmp"}, template("admin_status/index"), "qMp", 1)
overview.dependent = false overview.dependent = false
overview.sysauth = "root" overview.sysauth = "root"
overview.sysauth_authenticator = "htmlauth" overview.sysauth_authenticator = "htmlauth"
-- Rest of entries -- Rest of entries
entry({"qmp","info"}, call("action_status"), "Info", 1).dependent=false
entry({"qmp","status"}, template("admin_status/index"), "Status", 2).dependent=false entry({"qmp","status"}, template("admin_status/index"), "Status", 2).dependent=false
entry({"qmp","wizard"}, cbi("qmp/wizard"), "Wizard", 3).dependent=false
entry({"qmp","node"}, cbi("qmp/node"), "Node", 4).dependent=false entry({"qmp","configuration"}, cbi("qmp/wizard"), "Configuration", 4).dependent=false
entry({"qmp","network"}, cbi("qmp/network"), "Network", 5).dependent=false entry({"qmp","configuration","wizard"}, cbi("qmp/wizard"), "Wizard", 1).dependent=false
entry({"qmp","network","advanced"}, cbi("qmp/network_adv"), "Advanced networking", 1).dependent=false entry({"qmp","configuration","network"}, cbi("qmp/network"), "Network", 2).dependent=false
entry({"qmp","wireless"}, cbi("qmp/wireless"), "Wireless", 6).dependent=false entry({"qmp","configuration","network","advanced"}, cbi("qmp/network_adv"), "Advanced networking", 1).dependent=false
entry({"qmp","splash"}, call("action_splash"), "Splash", 7).dependent=false entry({"qmp","configuration","wifi"}, cbi("qmp/wireless"), "WiFi", 3).dependent=false
entry({"qmp","tools"}, call("action_tools"), "Tools", 8).dependent=false entry({"qmp","configuration","node"}, cbi("qmp/node"), "Node", 4).dependent=false
entry({"qmp","map"}, call("action_map"), "Map", 8).dependent=false
entry({"qmp","tools"}, call("action_tools"), "Tools", 5).dependent=false
entry({"qmp","tools","splash"}, call("action_splash"), "Splash", 1).dependent=false
entry({"qmp","tools","map"}, call("action_map"), "Map", 2).dependent=false
entry({"qmp","about"}, call("action_status"), "About", 9).dependent=false
end end
function action_status() function action_status()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment