Browse Source

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
pull/36/head
devrandom 10 years ago
parent
commit
5746af15e0
  1. 9
      bin/gbuild

9
bin/gbuild

@ -12,6 +12,11 @@ require 'pathname' @@ -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) @@ -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) @@ -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
################################

Loading…
Cancel
Save