From d17b4978674028fb134c5e2c75a74ebbaf64d3ec Mon Sep 17 00:00:00 2001 From: Denis Pynkin Date: Thu, 20 Nov 2014 19:09:53 +0300 Subject: [PATCH] Added configuration options for kernel and initrd selection during KVM build Some distributions have no initrd images compatible with KVM builds and sometimes we need to use not system kernel version. New options in configuration file: - build-kernel -- kernel used for VM builds - build-initrd -- initrd image used for VM builds --- osc/build.py | 5 +++++ osc/conf.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/osc/build.py b/osc/build.py index fbb61763..11431a00 100644 --- a/osc/build.py +++ b/osc/build.py @@ -991,6 +991,11 @@ def main(apiurl, opts, argv): if os.access(build_root, os.W_OK) and os.access('/dev/kvm', os.W_OK): # so let's hope there's also an fstab entry need_root = False + if config['build-kernel']: + vm_options += [ '--vm-kernel=' + config['build-kernel'] ] + if config['build-initrd']: + vm_options += [ '--vm-initrd=' + config['build-initrd'] ] + build_root += '/.mount' if config['build-memory']: diff --git a/osc/conf.py b/osc/conf.py index 67f1c973..24480451 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -112,6 +112,8 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org', 'build-vmdisk-rootsize': '', # optional for VM builds 'build-vmdisk-swapsize': '', # optional for VM builds 'build-vmdisk-filesystem': '', # optional for VM builds + 'build-kernel': '', # optional for VM builds + 'build-initrd': '', # optional for VM builds 'build-jobs': _get_processors(), 'builtin_signature_check': '1', # by default use builtin check for verify pkgs @@ -227,6 +229,12 @@ apiurl = %(apiurl)s # e.g. /var/tmp/FILE.swap #build-swap = /var/tmp/FILE.swap +# build-kernel is the boot kernel used for VM builds +#build-kernel = /boot/vmlinuz + +# build-initrd is the boot initrd used for VM builds +#build-initrd = /boot/initrd + # build-memory is the amount of memory used in the VM # value in MB - e.g. 512 #build-memory = 512