Skip to content
Snippets Groups Projects
Commit 4658afb2 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: commit all UCI configs at the end

Avoid commiting configs inbetween to decrease number of flash writes.

Fixes #714.
parent 827d81aa
No related branches found
No related tags found
No related merge requests found
Showing
with 3 additions and 24 deletions
......@@ -16,4 +16,3 @@ c:section('alfred', 'alfred', 'alfred',
)
c:save('alfred')
c:commit('alfred')
......@@ -40,7 +40,6 @@ end
c:set('autoupdater', 'settings', 'version_file', '/lib/gluon/release')
c:save('autoupdater')
c:commit('autoupdater')
local autoupdater_util = require 'autoupdater.util'
......
......@@ -24,4 +24,3 @@ end
uci:set('network', 'client', 'macaddr', sysconfig.primary_mac)
uci:save('network')
uci:commit('network')
......@@ -45,4 +45,3 @@ end
util.iterate_radios(configure_radio)
uci:save('wireless')
uci:commit('wireless')
......@@ -32,5 +32,4 @@ if not (sysconfig.lan_ifname or sysconfig.wan_ifname) then
uci:delete('network', 'wan')
uci:save('network')
uci:commit('network')
end
......@@ -14,5 +14,4 @@ if not sysconfig.gluon_version then
uci:set('system', system, 'timezone', site.timezone)
uci:save('system')
uci:commit('system')
end
......@@ -53,7 +53,6 @@ uci:section('network', 'route6', 'wan6_unreachable',
)
uci:save('network')
uci:commit('network')
uci:section('firewall', 'rule', 'wan_igmp',
......@@ -79,7 +78,6 @@ uci:section('firewall', 'rule', 'wan_mld',
)
uci:save('firewall')
uci:commit('firewall')
sysctl.set('net.ipv6.conf.all.accept_ra', 0)
......
......@@ -11,4 +11,3 @@ local c = uci.cursor()
c:delete('system', 'ntp', 'server')
c:set_list('system', 'ntp', 'server', site.ntp_servers)
c:save('system')
c:commit('system')
......@@ -27,4 +27,3 @@ c:section('firewall', 'rule', 'wan_ssh',
)
c:save('firewall')
c:commit('firewall')
......@@ -33,4 +33,3 @@ end
util.iterate_radios(configure_radio)
uci:save('wireless')
uci:commit('wireless')
#!/bin/sh
uci commit
......@@ -34,7 +34,6 @@ if sysconfig.gluon_version == 'legacy' then
uci:delete('network', 'wan')
uci:save('network')
uci:commit('network')
end
......@@ -20,5 +20,4 @@ if sysconfig.gluon_version == 'legacy' then
uci:delete_all('wireless', 'wifi-iface', delete_legacy_iface)
uci:save('wireless')
uci:commit('wireless')
end
......@@ -12,9 +12,7 @@ if sysconfig.gluon_version == 'legacy' then
if old == '1' then
local setup_mode = uci:get_first('gluon-setup-mode', 'setup_mode')
uci:set('gluon-setup-mode', setup_mode, 'configured', '1')
uci:save('gluon-setup-mode')
uci:commit('gluon-setup-mode')
break
end
......
......@@ -21,7 +21,6 @@ if sysconfig.gluon_version == 'legacy' then
)
uci:save('simple-tc')
uci:commit('simple-tc')
break
end
......
......@@ -33,5 +33,4 @@ if sysconfig.gluon_version == 'legacy' then
end
uci:save('fastd')
uci:commit('fastd')
end
......@@ -45,4 +45,3 @@ end
uci:save('network')
uci:commit('network')
......@@ -45,4 +45,3 @@ end
uci:save('network')
uci:commit('network')
......@@ -7,5 +7,4 @@ local uci = require('luci.model.uci').cursor()
-- fix up duplicate mac addresses (for mesh-on-WAN)
uci:set('network', 'wan', 'macaddr', util.generate_mac(1, 0))
uci:save('network')
uci:commit('network')
......@@ -24,7 +24,6 @@ uci:section('batman-adv', 'mesh', 'bat0',
}
)
uci:save('batman-adv')
uci:commit('batman-adv')
if not uci:get('network', 'client', 'ifname') then
uci:add_to_set('network', 'client', 'ifname', 'bat0')
......@@ -53,7 +52,6 @@ uci:section('network', 'interface', 'bat0',
)
uci:save('network')
uci:commit('network')
uci:delete('firewall', 'client')
......@@ -77,7 +75,6 @@ uci:section('firewall', 'rule', 'client_dns',
)
uci:save('firewall')
uci:commit('firewall')
local dnsmasq = uci:get_first('dhcp', 'dnsmasq')
......@@ -94,7 +91,6 @@ uci:section('dhcp', 'dhcp', 'client',
)
uci:save('dhcp')
uci:commit('dhcp')
sysctl.set('net.ipv6.conf.br-client.forwarding', 0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment