commit da074c97666a24f213cf5987ecc400bc6a5e9dbf
parent 4b0e0a378a44acb98b73b97ab12b051fe16ca4f1
Author: Michal Hrusecky <michal.hrusecky@nic.cz>
Date: Thu, 16 Jun 2016 10:44:23 +0200
luci-app-lxc: Allow versioned images
I makes quite some sense to provide user the choice between various versions of
the distribution to install into LXC.
Signed-off-by: Michal Hrusecky <michal.hrusecky@nic.cz>
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/utils/luci-app-lxc/files/controller/lxc.lua b/utils/luci-app-lxc/files/controller/lxc.lua
@@ -80,7 +80,10 @@ function lxc_create(lxc_name, lxc_template)
local target = _G.DISTRIB_TARGET:match('([^/]+)')
- local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url, "--no-validate", "--dist", lxc_template, "--release", "bb", "--arch", target } } )
+ local lxc_dist = lxc_template:gsub("(.*):(.*)", '%1')
+ local lxc_release = lxc_template:gsub("(.*):(.*)", '%2')
+
+ local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url, "--no-validate", "--dist", lxc_dist, "--release", lxc_release, "--arch", target } } )
luci.http.write(data)
end
diff --git a/utils/luci-app-lxc/files/view/lxc.htm b/utils/luci-app-lxc/files/view/lxc.htm
@@ -47,7 +47,7 @@ Author: Petar Koretic <petar.koretic@sartura.hr>
</td>
<td>
<select id="s_template" class="cbi-input-select cbi-button">
- <option value="openwrt">OpenWrt</option>
+ <option value="openwrt:bb">OpenWrt BB</option>
</select>
</td>
<td>