From aff9fdd50b977639290dd833aa00f209f1d7c451 Mon Sep 17 00:00:00 2001 From: Marcin Bojara Date: Thu, 9 Jan 2020 12:48:47 +0100 Subject: [PATCH] virtualbox: add dkms packages --- hardware/virtualization/virtualbox/actions.py | 18 +++++++ .../virtualbox/files/dkms-guest.conf | 31 ++++++++++++ .../virtualization/virtualbox/files/dkms.conf | 31 ++++++++++++ hardware/virtualization/virtualbox/pspec.xml | 49 ++++++++++++++++++- 4 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 hardware/virtualization/virtualbox/files/dkms-guest.conf create mode 100644 hardware/virtualization/virtualbox/files/dkms.conf diff --git a/hardware/virtualization/virtualbox/actions.py b/hardware/virtualization/virtualbox/actions.py index a57fad60b3..4d0631d2a6 100644 --- a/hardware/virtualization/virtualbox/actions.py +++ b/hardware/virtualization/virtualbox/actions.py @@ -36,6 +36,24 @@ def build(): shelltools.system("source %s/env.sh && kmk" % get.curDIR()) def install(): + # dkms packages + with open("env.sh") as f: + for l in f.readlines(): + if l.startswith("BUILD_PLATFORM_ARCH"): + a = l.split("=")[1].strip()[1:-1] + break + + pisitools.dosed("dkms.conf", "@VERSION@", get.srcVERSION()) + pisitools.dosed("dkms-guest.conf", "@VERSION@", get.srcVERSION()) + + pisitools.insinto("/usr/src/%s-%s" % (get.srcNAME(), get.srcVERSION()), "out/linux.%s/release/bin/src/*" % a) + pisitools.insinto("/usr/src/%s-%s" % (get.srcNAME(), get.srcVERSION()), "include") + pisitools.insinto("/usr/src/%s-%s" % (get.srcNAME(), get.srcVERSION()), "dkms.conf") + + pisitools.insinto("/usr/src/%s-guest-%s" % (get.srcNAME(), get.srcVERSION()), "out/linux.%s/release/bin/additions/src/*" % a) + pisitools.insinto("/usr/src/%s-guest-%s" % (get.srcNAME(), get.srcVERSION()), "dkms-guest.conf", "dkms.conf") + + shelltools.system("awk '$1 ~ /Version:/ { print gensub(/([0-9]+)\.([0-9]+).*/, \"\\\\1\\\\2\", \"g\", $2) }' /usr/lib/pkgconfig/xorg-server.pc > XorgVersion") with open("XorgVersion", "r") as f: XorgVersion = f.readline().strip() diff --git a/hardware/virtualization/virtualbox/files/dkms-guest.conf b/hardware/virtualization/virtualbox/files/dkms-guest.conf new file mode 100644 index 0000000000..760b69fc71 --- /dev/null +++ b/hardware/virtualization/virtualbox/files/dkms-guest.conf @@ -0,0 +1,31 @@ +## @file +# Linux DKMS config script for the VirtualBox guest kernel modules +# + +# +# Copyright (C) 2006-2015 Oracle Corporation +# +# This file is part of VirtualBox Open Source Edition (OSE), as +# available from http://www.virtualbox.org. This file is free software; +# you can redistribute it and/or modify it under the terms of the GNU +# General Public License (GPL) as published by the Free Software +# Foundation, in version 2 as it comes in the "COPYING" file of the +# VirtualBox OSE distribution. VirtualBox OSE is distributed in the +# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# + +PACKAGE_NAME="vboxguest" +PACKAGE_VERSION=@VERSION@ +AUTOINSTALL=yes + +BUILT_MODULE_NAME[0]="vboxguest" +BUILT_MODULE_LOCATION[0]="vboxguest" +DEST_MODULE_LOCATION[0]="/extra" + +BUILT_MODULE_NAME[1]="vboxsf" +BUILT_MODULE_LOCATION[1]="vboxsf" +DEST_MODULE_LOCATION[1]="/extra" + +BUILT_MODULE_NAME[2]="vboxvideo" +BUILT_MODULE_LOCATION[2]="vboxvideo" +DEST_MODULE_LOCATION[2]="/extra" diff --git a/hardware/virtualization/virtualbox/files/dkms.conf b/hardware/virtualization/virtualbox/files/dkms.conf new file mode 100644 index 0000000000..4e3512e6d9 --- /dev/null +++ b/hardware/virtualization/virtualbox/files/dkms.conf @@ -0,0 +1,31 @@ +## @file +# Linux DKMS config script for the VirtualBox host kernel modules +# + +# +# Copyright (C) 2006-2015 Oracle Corporation +# +# This file is part of VirtualBox Open Source Edition (OSE), as +# available from http://www.virtualbox.org. This file is free software; +# you can redistribute it and/or modify it under the terms of the GNU +# General Public License (GPL) as published by the Free Software +# Foundation, in version 2 as it comes in the "COPYING" file of the +# VirtualBox OSE distribution. VirtualBox OSE is distributed in the +# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# + +PACKAGE_NAME="vboxhost" +PACKAGE_VERSION=@VERSION@ +AUTOINSTALL=yes + +BUILT_MODULE_NAME[0]="vboxdrv" +BUILT_MODULE_LOCATION[0]="vboxdrv" +DEST_MODULE_LOCATION[0]="/extra" + +BUILT_MODULE_NAME[1]="vboxnetflt" +BUILT_MODULE_LOCATION[1]="vboxnetflt" +DEST_MODULE_LOCATION[1]="/extra" + +BUILT_MODULE_NAME[2]="vboxnetadp" +BUILT_MODULE_LOCATION[2]="vboxnetadp" +DEST_MODULE_LOCATION[2]="/extra" diff --git a/hardware/virtualization/virtualbox/pspec.xml b/hardware/virtualization/virtualbox/pspec.xml index 0c6987b402..69ce1dc69a 100644 --- a/hardware/virtualization/virtualbox/pspec.xml +++ b/hardware/virtualization/virtualbox/pspec.xml @@ -13,6 +13,10 @@ A powerful virtualization program VirtualBox is a family of powerful x86 virtualization products for enterprise as well as home use. This is the Open Source Edition which lacks USB support and some other things. http://download.virtualbox.org/virtualbox/6.1.0/VirtualBox-6.1.0.tar.bz2 + + dkms.conf + dkms-guest.conf + dev86 cdrkit @@ -98,7 +102,10 @@ openssl device-mapper qt5-x11extras - module-virtualbox + + module-virtualbox + virtualbox-dkms + /etc/vbox @@ -136,7 +143,10 @@ libXdamage xorg-server libXcomposite - module-virtualbox-guest + + module-virtualbox-guest + virtualbox-guest-dkms + /etc/X11/xinit/xinitrc.d @@ -157,7 +167,42 @@ + + virtualbox-dkms + VirtualBox Host kernel modules sources + + dkms + + + module-virtualbox + + + /usr/src + + + + + virtualbox-guest-dkms + VirtualBox Guest kernel modules sources + + dkms + + + module-virtualbox-guest + + + /usr/src/*-guest-* + + + + + 2020-01-08 + 6.1.0 + Add dkms packages + Marcin Bojara + marcin.bojara@gmail.com + 2019-12-24 6.1.0