setarch on guest for LXC

Some packages use uname -m, which is not set to i386 on LXC on a 64 bit
host.

fixes #24
This commit is contained in:
devrandom 2012-09-12 10:08:58 -07:00
parent 93d443077e
commit 5746af15e0

View File

@ -12,6 +12,11 @@ require 'pathname'
'amd64' => 64,
}
@arches = {
'i386' => 'i386',
'amd64' => 'x86_64',
}
def system!(cmd)
system(cmd) or raise "failed to run #{cmd}"
end
@ -68,7 +73,7 @@ def build_one_configuration(suite, arch, build_desc, reference_datetime)
system! "on-target true"
info "Preparing build environment"
system! "on-target bash < target-bin/init-build.sh"
system! "on-target setarch #{@arches[arch]} bash < target-bin/init-build.sh"
build_desc["files"].each do |filename|
filename = sanitize(filename, "files section")
@ -107,7 +112,7 @@ def build_one_configuration(suite, arch, build_desc, reference_datetime)
end
info "Running build script (log in var/build.log)"
system! "on-target bash -x < var/build-script > var/build.log 2>&1"
system! "on-target setarch #{@arches[arch]} bash -x < var/build-script > var/build.log 2>&1"
end
################################