summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2019-02-09 17:21:48 +0100
committerKarel Kočí <cynerd@email.cz>2019-02-09 17:21:48 +0100
commit0103e62bed6a118f9b8935c126790160fe55b02c (patch)
tree06f2b27ab1baa09088c8dc6dfb8a59fcd20f7af5
parentee1de2a3d1376e1aa19cc4deaaece86b32ab14aa (diff)
downloadopenwrt-personal-pkgs-0103e62bed6a118f9b8935c126790160fe55b02c.tar.gz
openwrt-personal-pkgs-0103e62bed6a118f9b8935c126790160fe55b02c.tar.bz2
openwrt-personal-pkgs-0103e62bed6a118f9b8935c126790160fe55b02c.zip
personal-pkgs-repo: add support for mox and home routers
-rw-r--r--personal-pkgs-repo/Makefile2
-rw-r--r--personal-pkgs-repo/files/updater.lua45
2 files changed, 42 insertions, 5 deletions
diff --git a/personal-pkgs-repo/Makefile b/personal-pkgs-repo/Makefile
index 32bc990..4e1038b 100644
--- a/personal-pkgs-repo/Makefile
+++ b/personal-pkgs-repo/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=personal-pkgs-repo
-PKG_VERSION:=1.2
+PKG_VERSION:=1.3
PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
diff --git a/personal-pkgs-repo/files/updater.lua b/personal-pkgs-repo/files/updater.lua
index a102956..3b16e6a 100644
--- a/personal-pkgs-repo/files/updater.lua
+++ b/personal-pkgs-repo/files/updater.lua
@@ -1,18 +1,55 @@
+local uci_cursor = uci.cursor(root_dir .. "/etc/config")
+
local board
-if model:match('[Oo]mnia') then
+if model:match('Mox') then
+ board = "mox"
+elseif model:match('Omnia') then
board = "omnia"
-elseif model:match('^[Tt]urris$') then
+elseif model:match('^Turris$') then
board = "turris"
else
DIE("Unsupported board!")
end
-Repository("personal-pkgs", "https://cynerd.cz/repo/turris4x/" .. board, {
+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 pernal-pkgs: " .. tostring(animal))
+end
+
+Repository("personal-pkgs", "https://cynerd.cz/repo/turris4x/" .. animal .. "/" .. board, {
pubkey = "file:///etc/updater/keys/personal-pkgs.pub",
ocsp = false
})
+----------------------------------------------------------------------------------
Install("personal-pkgs-repo")
Package("personal-pkgs-repo", { replan = "finished" })
-Install("shellrc-zsh", "shellrc-ash")
+local tools = false
+local vpn = false
+
+uci_cursor:foreach("system", "system", function(s) hostname = s['hostname'] end)
+if hostname == "turris-prague" then
+ tools = true
+ vpn = true
+ Install("6to4")
+elseif hostname == "turris-home" then
+ tools = true
+ vpn = true
+ Install("transmission-daemon-openssl")
+end
+
+if tools then
+ Install("grep", "coreutils-sha256sum")
+ Install("iperf", "iperf3")
+ Install("sysstat", "strace", "gdbserver")
+ Install("shellrc-zsh", "shellrc-ash")
+end
+if vpn then
+ Install("luci-app-openvpn", "openvpn-openssl")
+ Install("luci-app-wireguard", "wireguard")
+end