lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

commit 0084c9377e16fec94031f1c2ae6d05427c604e4a
parent da074c97666a24f213cf5987ecc400bc6a5e9dbf
Author: Michal Hrusecky <michal.hrusecky@nic.cz>
Date:   Thu, 16 Jun 2016 10:49:23 +0200

luci-app-lxc: Use uname -m as architecture

As containers are basically virtual machines, it should not depend on the
build target but on the real hardware architecture. For example there is plenty
of ARM families (mvebu, sunxi, ...) but all armv7l arms should be able to run
armv7l containers.

Signed-off-by: Michal Hrusecky <michal.hrusecky@nic.cz>

Diffstat:
Mutils/luci-app-lxc/files/controller/lxc.lua | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/utils/luci-app-lxc/files/controller/lxc.lua b/utils/luci-app-lxc/files/controller/lxc.lua @@ -78,7 +78,10 @@ function lxc_create(lxc_name, lxc_template) return luci.http.write("1") end - local target = _G.DISTRIB_TARGET:match('([^/]+)') + local f = io.popen('uname -m', 'r') + local target = f:read('*a') + f:close() + target = target:gsub("^%s*(.-)%s*$", "%1") local lxc_dist = lxc_template:gsub("(.*):(.*)", '%1') local lxc_release = lxc_template:gsub("(.*):(.*)", '%2')