Переглянути джерело

gluon-core: commit all UCI configs at the end

Avoid commiting configs inbetween to decrease number of flash writes.

Fixes #714.
Matthias Schiffer 8 роки тому
батько
коміт
63fb516bd3
35 змінених файлів з 3 додано та 43 видалено
  1. 0 1
      package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred
  2. 0 1
      package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater
  3. 0 1
      package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network
  4. 0 1
      package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless
  5. 0 1
      package/gluon-core/files/lib/gluon/upgrade/020-interfaces
  6. 0 1
      package/gluon-core/files/lib/gluon/upgrade/030-system
  7. 0 1
      package/gluon-core/files/lib/gluon/upgrade/110-network
  8. 0 1
      package/gluon-core/files/lib/gluon/upgrade/120-ntp-servers
  9. 0 1
      package/gluon-core/files/lib/gluon/upgrade/140-firewall-rules
  10. 0 1
      package/gluon-core/files/lib/gluon/upgrade/200-wireless
  11. 3 0
      package/gluon-core/files/lib/gluon/upgrade/998-commit
  12. 0 1
      package/gluon-legacy/files/lib/gluon/upgrade/019-legacy-interfaces
  13. 0 1
      package/gluon-legacy/files/lib/gluon/upgrade/210-legacy-wireless
  14. 0 2
      package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-setup-mode
  15. 0 1
      package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc
  16. 0 1
      package/gluon-legacy/files/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd
  17. 0 1
      package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14
  18. 0 1
      package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15
  19. 0 1
      package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan
  20. 0 4
      package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh
  21. 0 2
      package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless
  22. 0 1
      package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan
  23. 0 1
      package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan
  24. 0 1
      package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid
  25. 0 3
      package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd
  26. 0 1
      package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret
  27. 0 1
      package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc
  28. 0 1
      package/gluon-neighbour-info/files/lib/gluon/upgrade/400-neighbour-info-firewall
  29. 0 2
      package/gluon-next-node/files/lib/gluon/upgrade/400-next-node
  30. 0 1
      package/gluon-node-info/files/lib/gluon/upgrade/500-node-info-system
  31. 0 1
      package/gluon-node-info/files/lib/gluon/upgrade/510-node-info-role
  32. 0 1
      package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall
  33. 0 1
      package/gluon-setup-mode/files/lib/gluon/upgrade/300-setup-mode
  34. 0 1
      package/gluon-setup-mode/files/lib/gluon/upgrade/310-setup-mode-migrate
  35. 0 2
      package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api

+ 0 - 1
package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred

@@ -16,4 +16,3 @@ c:section('alfred', 'alfred', 'alfred',
 )
 
 c:save('alfred')
-c:commit('alfred')

+ 0 - 1
package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater

@@ -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'

+ 0 - 1
package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network

@@ -24,4 +24,3 @@ end
 uci:set('network', 'client', 'macaddr', sysconfig.primary_mac)
 
 uci:save('network')
-uci:commit('network')

+ 0 - 1
package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless

@@ -45,4 +45,3 @@ end
 util.iterate_radios(configure_radio)
 
 uci:save('wireless')
-uci:commit('wireless')

+ 0 - 1
package/gluon-core/files/lib/gluon/upgrade/020-interfaces

@@ -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

+ 0 - 1
package/gluon-core/files/lib/gluon/upgrade/030-system

@@ -14,5 +14,4 @@ if not sysconfig.gluon_version then
   uci:set('system', system, 'timezone', site.timezone)
 
   uci:save('system')
-  uci:commit('system')
 end

+ 0 - 1
package/gluon-core/files/lib/gluon/upgrade/110-network

@@ -53,7 +53,6 @@ uci:section('network', 'route6', 'wan6_unreachable',
 )
 
 uci:save('network')
-uci:commit('network')
 
 
 sysctl.set('net.ipv6.conf.all.accept_ra', 0)

+ 0 - 1
package/gluon-core/files/lib/gluon/upgrade/120-ntp-servers

@@ -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')

+ 0 - 1
package/gluon-core/files/lib/gluon/upgrade/140-firewall-rules

@@ -27,4 +27,3 @@ c:section('firewall', 'rule', 'wan_ssh',
 )
 
 c:save('firewall')
-c:commit('firewall')

+ 0 - 1
package/gluon-core/files/lib/gluon/upgrade/200-wireless

@@ -23,4 +23,3 @@ end
 util.iterate_radios(configure_radio)
 
 uci:save('wireless')
-uci:commit('wireless')

+ 3 - 0
package/gluon-core/files/lib/gluon/upgrade/998-commit

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+uci commit

+ 0 - 1
package/gluon-legacy/files/lib/gluon/upgrade/019-legacy-interfaces

@@ -34,7 +34,6 @@ if sysconfig.gluon_version == 'legacy' then
   uci:delete('network', 'wan')
 
   uci:save('network')
-  uci:commit('network')
 end
 
 

+ 0 - 1
package/gluon-legacy/files/lib/gluon/upgrade/210-legacy-wireless

@@ -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

+ 0 - 2
package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-setup-mode

@@ -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

+ 0 - 1
package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc

@@ -21,7 +21,6 @@ if sysconfig.gluon_version == 'legacy' then
       )
 
       uci:save('simple-tc')
-      uci:commit('simple-tc')
 
       break
     end

+ 0 - 1
package/gluon-legacy/files/lib/gluon/upgrade/390-legacy-mesh-vpn-fastd

@@ -33,5 +33,4 @@ if sysconfig.gluon_version == 'legacy' then
   end
 
   uci:save('fastd')
-  uci:commit('fastd')
 end

+ 0 - 1
package/gluon-mesh-batman-adv-14/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-14

@@ -45,4 +45,3 @@ end
 
 
 uci:save('network')
-uci:commit('network')

+ 0 - 1
package/gluon-mesh-batman-adv-15/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-15

@@ -45,4 +45,3 @@ end
 
 
 uci:save('network')
-uci:commit('network')

+ 0 - 1
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/300-gluon-mesh-batman-adv-core-wan

@@ -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')
 

+ 0 - 4
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh

@@ -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')
@@ -52,7 +51,6 @@ uci:section('network', 'interface', 'bat0',
 )
 
 uci:save('network')
-uci:commit('network')
 
 
 uci:delete('firewall', 'client')
@@ -76,7 +74,6 @@ uci:section('firewall', 'rule', 'client_dns',
 )
 
 uci:save('firewall')
-uci:commit('firewall')
 
 
 local dnsmasq = uci:get_first('dhcp', 'dnsmasq')
@@ -93,7 +90,6 @@ uci:section('dhcp', 'dhcp', 'client',
 )
 
 uci:save('dhcp')
-uci:commit('dhcp')
 
 
 sysctl.set('net.ipv6.conf.br-client.forwarding', 0)

+ 0 - 2
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless

@@ -131,5 +131,3 @@ util.iterate_radios(configure_radio)
 
 uci:save('wireless')
 uci:save('network')
-uci:commit('wireless')
-uci:commit('network')

+ 0 - 1
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/330-gluon-mesh-batman-adv-core-mesh-on-wan

@@ -15,4 +15,3 @@ if not c:get('network', 'mesh_wan') then
 end
 
 c:save('network')
-c:commit('network')

+ 0 - 1
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan

@@ -32,6 +32,5 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then
   })
 
   uci:save('network')
-  uci:commit('network')
 end
 

+ 0 - 1
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/350-gluon-mesh-batman-adv-core-rssid

@@ -6,5 +6,4 @@ if uci:get('system', 'rssid_wlan0') then
   uci:set('system', 'rssid_wlan0', 'dev', 'mesh0')
 
   uci:save('system')
-  uci:commit('system')
 end

+ 0 - 3
package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd

@@ -119,7 +119,6 @@ add_groups('mesh_vpn', site.fastd_mesh_vpn.groups)
 
 
 uci:save('fastd')
-uci:commit('fastd')
 
 
 uci:section('network', 'interface', 'mesh_vpn',
@@ -133,7 +132,6 @@ uci:section('network', 'interface', 'mesh_vpn',
 )
 
 uci:save('network')
-uci:commit('network')
 
 
 uci:section('firewall', 'include', 'mesh_vpn_dns',
@@ -145,4 +143,3 @@ uci:section('firewall', 'include', 'mesh_vpn_dns',
 )
 
 uci:save('firewall')
-uci:commit('firewall')

+ 0 - 1
package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret

@@ -9,5 +9,4 @@ local secret = c:get("fastd", "mesh_vpn", "secret")
 if not secret or not secret:match(("%x"):rep(64)) then
   c:set("fastd", "mesh_vpn", "secret", "generate")
   c:save("fastd")
-  c:commit("fastd")
 end

+ 0 - 1
package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/420-mesh-vpn-fastd-simple-tc

@@ -28,5 +28,4 @@ if not uci:get('simple-tc', 'mesh_vpn') then
 
   uci:section('simple-tc', 'interface', 'mesh_vpn', config)
   uci:save('simple-tc')
-  uci:commit('simple-tc')
 end

+ 0 - 1
package/gluon-neighbour-info/files/lib/gluon/upgrade/400-neighbour-info-firewall

@@ -17,4 +17,3 @@ uci:section('firewall', 'rule', 'wan_respondd_reply',
 )
 
 uci:save('firewall')
-uci:commit('firewall')

+ 0 - 2
package/gluon-next-node/files/lib/gluon/upgrade/400-next-node

@@ -39,7 +39,6 @@ c:section('network', 'route6', 'local_node_route6',
 )
 
 c:save('network')
-c:commit('network')
 
 c:delete('firewall', 'local_node')
 c:section('firewall', 'zone', 'local_node',
@@ -52,4 +51,3 @@ c:section('firewall', 'zone', 'local_node',
 	  }
 )
 c:save('firewall')
-c:commit('firewall')

+ 0 - 1
package/gluon-node-info/files/lib/gluon/upgrade/500-node-info-system

@@ -7,5 +7,4 @@ local config = 'gluon-node-info'
 if not uci:get_first(config, 'system') then
   uci:section(config, 'system')
   uci:save(config)
-  uci:commit(config)
 end

+ 0 - 1
package/gluon-node-info/files/lib/gluon/upgrade/510-node-info-role

@@ -15,5 +15,4 @@ end
 if not role then
   uci:set(config, uci:get_first(config, 'system'), 'role', default_role)
   uci:save(config)
-  uci:commit(config)
 end

+ 0 - 1
package/gluon-respondd/files/lib/gluon/upgrade/400-respondd-firewall

@@ -29,4 +29,3 @@ uci:section('firewall', 'rule', 'client_respondd',
 )
 
 uci:save('firewall')
-uci:commit('firewall')

+ 0 - 1
package/gluon-setup-mode/files/lib/gluon/upgrade/300-setup-mode

@@ -11,6 +11,5 @@ if site.setup_mode
      local name = c:get_first("gluon-setup-mode", "setup_mode")
      c:set("gluon-setup-mode", name, "configured", 1)
      c:save('gluon-setup-mode')
-     c:commit('gluon-setup-mode')
 end
 

+ 0 - 1
package/gluon-setup-mode/files/lib/gluon/upgrade/310-setup-mode-migrate

@@ -12,7 +12,6 @@ if old == '1' then
 	c:set('gluon-setup-mode', setup_mode, 'configured', '1')
 
 	c:save('gluon-setup-mode')
-	c:commit('gluon-setup-mode')
 end
 
 os.remove('/etc/config/gluon-config-mode')

+ 0 - 2
package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api

@@ -10,6 +10,4 @@ uci batch <<-EOF
 	set uhttpd.main.home=/lib/gluon/status-page/www
 
 	set uhttpd.main.max_requests=32
-
-	commit uhttpd
 EOF