From 8097a9550dbcc933ccbcca774cb69e01d409d3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Sun, 3 Feb 2013 19:07:17 +0100 Subject: [PATCH] - fix local build with emulator support. - fix package signing check (skip always for use inside of secure VMs) --- NEWS | 2 +- osc/build.py | 14 ++++++-------- osc/commandline.py | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index c19532f2..d54d7bf2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ 0.139 - - + - support generic emulator virtualization 0.138 - add support to remove repositories recursively (mostly only usefull for admins) diff --git a/osc/build.py b/osc/build.py index 5d1fb6bf..ec816557 100644 --- a/osc/build.py +++ b/osc/build.py @@ -42,7 +42,6 @@ qemu_can_build = [ 'armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l', 'armv6el', 's390', 's390x', 'sparc64v', 'sparcv9v', 'sparcv9', 'sparcv8', 'sparc', 'hppa', - 'aarch64' # qemu has not support yet, but generic emulator in build script has support ] can_also_build = { @@ -653,7 +652,7 @@ def main(apiurl, opts, argv): elif hostarch != bi.buildarch: if not bi.buildarch in can_also_build.get(hostarch, []): # OBSOLETE: qemu_can_build should not be needed anymore since OBS 2.3 - if not bi.buildarch in qemu_can_build: + if vm_type != "emulator" and not bi.buildarch in qemu_can_build + system_emulator_can_build: print >>sys.stderr, 'Error: hostarch \'%s\' cannot build \'%s\'.' % (hostarch, bi.buildarch) return 1 print >>sys.stderr, 'WARNING: It is guessed to build on hostarch \'%s\' for \'%s\' via QEMU.' % (hostarch, bi.buildarch) @@ -814,17 +813,16 @@ def main(apiurl, opts, argv): else: os.symlink(path + "/" + filename, tffn) - if bi.pacsuffix == 'rpm': + if vm_type == "xen" or vm_type == "kvm" or vm_type == "lxc": + print 'Skipping verification of package signatures due to secure VM build' + elif bi.pacsuffix == 'rpm': if opts.no_verify: print 'Skipping verification of package signatures' else: print 'Verifying integrity of cached packages' verify_pacs(bi) - elif bi.pacsuffix == 'deb': - if vm_type == "xen" or vm_type == "kvm" or vm_type == "lxc": - print 'Skipping verification of package signatures due to secure VM build' - elif opts.no_verify or opts.noinit: + if opts.no_verify or opts.noinit: print 'Skipping verification of package signatures' else: print 'WARNING: deb packages get not verified, they can compromise your system !' @@ -867,7 +865,7 @@ def main(apiurl, opts, argv): my_build_swap = build_root + '/swap' vm_options = [ '--vm-type=%s'%vm_type ] - if vm_type != 'lxc': + if vm_type != 'lxc' and vm_type != 'emulator': vm_options += [ '--vm-disk=' + my_build_device ] vm_options += [ '--vm-swap=' + my_build_swap ] vm_options += [ '--logfile=%s/.build.log' % build_root ] diff --git a/osc/commandline.py b/osc/commandline.py index 1e993b3d..a5591696 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -5090,7 +5090,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. print row - def parse_repoarchdescr(self, args, noinit = False, alternative_project = None, ignore_descr = False): + def parse_repoarchdescr(self, args, noinit = False, alternative_project = None, ignore_descr = False, vm_type = None): """helper to parse the repo, arch and build description from args""" import osc.build import glob @@ -5321,7 +5321,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. if len(args) > 3: raise oscerr.WrongArgs('Too many arguments') - args = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project) + args = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project, False, opts.vm_type) # check for source services r = None