Zdravím,
Baličky sw, pokud mají zůstat aktuální, by se měli stahovat skrze updater a ne přes stránku Software v luci.
Bohužel ale chybí jednoduchý způsob jak toho docílit bez příkazové řádky.
Takže mě napadlo rozšířit luci stránku software o další okno v nastavení kde mohu nastavovat jaké balíčky má updater zkontrolovat a nainstalovat.
Upravil jsem soubor /usr/lib/lua/luci/model/cbi/admin_system/ipkg.lua
následovně:
-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local ipkgfile = "/etc/opkg.conf"
local distfeeds = "/etc/opkg/distfeeds.conf"
local customfeeds = "/etc/opkg/customfeeds.conf"
+local mypackages = "/etc/updater/conf.d/mypackages.lua"
f = SimpleForm("ipkgconf", translate("OPKG-Configuration"), translate("General options for opkg"))
f:append(Template("admin_system/ipkg"))
t = f:field(TextValue, "lines")
t.wrap = "off"
t.rows = 10
function t.cfgvalue()
return nixio.fs.readfile(ipkgfile) or ""
end
function t.write(self, section, data)
return nixio.fs.writefile(ipkgfile, data:gsub("\r\n", "\n"))
end
function f.handle(self, state, data)
return true
end
g = SimpleForm("distfeedconf", translate("Distribution feeds"),
translate("Build/distribution specific feed definitions. This file will NOT be preserved in any sysupgrade."))
d = g:field(TextValue, "lines2")
d.wrap = "off"
d.rows = 10
function d.cfgvalue()
return nixio.fs.readfile(distfeeds) or ""
end
function d.write(self, section, data)
return nixio.fs.writefile(distfeeds, data:gsub("\r\n", "\n"))
end
function g.handle(self, state, data)
return true
end
h = SimpleForm("customfeedconf", translate("Custom feeds"),
translate("Custom feed definitions, e.g. private feeds. This file can be preserved in a sysupgrade."))
c = h:field(TextValue, "lines3")
c.wrap = "off"
c.rows = 10
function c.cfgvalue()
return nixio.fs.readfile(customfeeds) or ""
end
function c.write(self, section, data)
return nixio.fs.writefile(customfeeds, data:gsub("\r\n", "\n"))
end
function h.handle(self, state, data)
return true
end
+i = SimpleForm("myopkg", translate("MyPackages.lua"),
+ translate("This is the content of /etc/updater/conf.d/mypackages.lua."))
+
+e = i:field(TextValue, "lines4")
+e.wrap = "off"
+e.rows = 20
+function e.cfgvalue()
+ return nixio.fs.readfile(mypackages) or ""
+end
+
+function e.write(self, section, data)
+ return nixio.fs.writefile(mypackages, data:gsub("\r\n", "\n"))
+end
+
+function i.handle(self, state, data)
+ return true
+end
-return f, g, h
+return f, g, h, i
Je mi jasné, že při první aktualizaci mé změny vezmou za své, ale bohužel není v mých schopnostech, vytvořit a pushnout patch, a tímto žádám vývojáře z CZ.NIC aby zvážili tuto úpravu a přidání této funkcionality.
Ještě by bylo hezké, aby tlačítko odeslat spustilo i updater. Momentálně ho spouštím kliknutím na uložit v rozhraní Foris na stránce updater.