From: Tobias Ulmer Date: Wed, 15 Jun 2016 14:18:43 +0000 (+0200) Subject: project: move host system architecture check here X-Git-Tag: e2factory-2.3.15rc1~153 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=5e6005709d80136f764844f8eb12fbfb2d2ae545;p=e2factory.git project: move host system architecture check here Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 0f92826..1be1fa3 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -428,7 +428,7 @@ end -- @return True on success, false on error. -- @return Error object on failure. function e2lib.init2() - local rc, re, e, config, ssh, host_system_arch + local rc, re, e, config, ssh e = err.new("initializing globals (step2)") @@ -464,12 +464,6 @@ function e2lib.init2() return false, e:cat(re) end - -- get host system architecture - host_system_arch, re = e2lib.uname_machine() - if not host_system_arch then - return false, e:cat(re) - end - return true end diff --git a/local/project.lua b/local/project.lua index e703b73..29f39a1 100644 --- a/local/project.lua +++ b/local/project.lua @@ -55,7 +55,7 @@ end -- @return True on success, false on error. -- @return Error object on failure. local function load_prj_cfg(prj) - local rc, re, e, info + local rc, re, e, info, system_arch info = e2tool.info() assert(info) @@ -103,7 +103,13 @@ local function load_prj_cfg(prj) if not info.chroot_call_prefix[prj.chroot_arch] then return false, err.new("chroot_arch is set to an invalid value") end - if prj.chroot_arch == "x86_64" and e2lib.host_system_arch ~= "x86_64" then + + -- get host system architecture + system_arch, re = e2lib.uname_machine() + if not system_arch then + return false, re + end + if prj.chroot_arch == "x86_64" and system_arch ~= "x86_64" then return false, err.new("running on x86_32: switching to x86_64 mode is impossible.") end