summaryrefslogtreecommitdiff
path: root/updater.lua
diff options
context:
space:
mode:
Diffstat (limited to 'updater.lua')
-rw-r--r--updater.lua66
1 files changed, 66 insertions, 0 deletions
diff --git a/updater.lua b/updater.lua
new file mode 100644
index 0000000..2f6cdfd
--- /dev/null
+++ b/updater.lua
@@ -0,0 +1,66 @@
+local uci_cursor = uci.cursor(root_dir .. "/etc/config")
+
+local board
+local model = model or os_release["LEDE_DEVICE_PRODUCT"]
+if model:match('[Mm]ox') then
+ board = "mox"
+elseif model:match('[Oo]mnia') then
+ board = "omnia"
+else
+ DIE("Unsupported board: " .. model)
+end
+
+local mode = uci_cursor:get("updater", "turris", "mode")
+local animal = uci_cursor:get("updater", "turris", "branch")
+if mode and mode ~= "branch" then
+ DIE("Only branch mode allowed for personal-pkgs, used: " .. tostring(mode))
+end
+if animal ~= "hbd" and animal ~= "hbk" then
+ DIE("Unsupported branch for personal-pkgs: " .. tostring(animal))
+end
+
+Repository("personal-pkgs", animal .. "/" .. board)
+
+----------------------------------------------------------------------------------
+Install("personal-pkgs-repo")
+Package("personal-pkgs-repo", { replan = "finished" })
+
+local tools = false
+local vpn = false
+local bigclown = false
+local sentinel = false
+
+uci_cursor:foreach("system", "system", function(s) hostname = s['hostname'] end)
+if hostname == "turris-prague" then
+ tools = true
+ vpn = true
+ bigclown = true
+ sentinel = true
+ Install("6to4")
+ Install("etherwake")
+elseif hostname == "turris-home" then
+ tools = true
+ vpn = true
+ sentinel = true
+ Install("transmission-daemon-openssl")
+end
+
+if tools then
+ Install("grep", "coreutils-sha256sum")
+ Install("iperf", "iperf3")
+ Install("sysstat", "strace", "gdbserver")
+ Install("shellrc-zsh")
+end
+if vpn then
+ Install("luci-app-openvpn", "openvpn-openssl")
+ Install("luci-app-wireguard", "wireguard")
+end
+if bigclown then
+ Install("bigclown-gateway", "bigclown-mqtt2influxdb", "bigclown-control-tool")
+ Install("mosquitto", "mosquitto-client")
+ Install("bigclown-leds")
+end
+if sentinel then
+ --Install("sentinel-minipot", "sentinel-nikola", "sentinel-dynfw-client")
+ Install("sentinel-dynfw-client")
+end