From 6ddca92349d2b4e7d26983dfdacdcde79a20cfc6986f0156245af30654f0e530 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 19 Dec 2019 05:12:48 +0000 Subject: [PATCH] Accepting request 758048 from home:lwfinger:branches:Virtualization - Fix build for kernel 5.5. Added file "fixes_for_5.5.patch". OBS-URL: https://build.opensuse.org/request/show/758048 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=524 --- fixes_for_5.4.patch | 2 +- fixes_for_5.5.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++ virtualbox-kmp-files | 1 - virtualbox.changes | 5 ++++ virtualbox.spec | 25 ++++++++++++-------- 5 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 fixes_for_5.5.patch diff --git a/fixes_for_5.4.patch b/fixes_for_5.4.patch index 541226a..38ef190 100644 --- a/fixes_for_5.4.patch +++ b/fixes_for_5.4.patch @@ -6,7 +6,7 @@ Index: VirtualBox-6.0.14/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux. #define VBOXNETFLT_OS_SPECFIC 1 #include "../VBoxNetFltInternal.h" -+# if CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 2 ++# if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 2 +# define OPENSUSE_152 +# endif + diff --git a/fixes_for_5.5.patch b/fixes_for_5.5.patch new file mode 100644 index 0000000..14ddcad --- /dev/null +++ b/fixes_for_5.5.patch @@ -0,0 +1,56 @@ +Index: VirtualBox-6.0.14/src/VBox/HostDrivers/linux/Makefile +=================================================================== +--- VirtualBox-6.0.14.orig/src/VBox/HostDrivers/linux/Makefile ++++ VirtualBox-6.0.14/src/VBox/HostDrivers/linux/Makefile +@@ -45,6 +45,8 @@ else # ! KERNELRELEASE + + KBUILD_VERBOSE ?= + KERN_VER ?= $(shell uname -r) ++PWD ?= $(shell pwd) ++ + .PHONY: all install clean check unload load vboxdrv vboxnetflt vboxnetadp \ + vboxpci + +@@ -64,6 +66,7 @@ vboxnetflt: vboxdrv + if [ -f vboxdrv/Module.symvers ]; then \ + cp vboxdrv/Module.symvers vboxnetflt; \ + fi; \ ++ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxnetflt/Module.symvers; \ + echo "=== Building 'vboxnetflt' module ==="; \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt || exit 1; \ + cp vboxnetflt/vboxnetflt.ko .; \ +@@ -75,8 +78,9 @@ vboxnetadp: vboxdrv + if [ -f vboxdrv/Module.symvers ]; then \ + cp vboxdrv/Module.symvers vboxnetadp; \ + fi; \ ++ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxnetadp/Module.symvers; \ + echo "=== Building 'vboxnetadp' module ==="; \ +- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp || exit 1; \ ++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp || exit 1; \ + cp vboxnetadp/vboxnetadp.ko .; \ + echo; \ + fi +@@ -86,6 +90,7 @@ vboxpci: vboxdrv + if [ -f vboxdrv/Module.symvers ]; then \ + cp vboxdrv/Module.symvers vboxpci; \ + fi; \ ++ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxpci/Module.symvers; \ + echo "=== Building 'vboxpci' module ==="; \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci || exit 1; \ + cp vboxpci/vboxpci.ko .; \ +@@ -95,12 +100,15 @@ vboxpci: vboxdrv + install: + @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install + @if [ -d vboxnetflt ]; then \ ++ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxnetflt/Module.symvers; \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \ + fi + @if [ -d vboxnetadp ]; then \ ++ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxnetadp/Module.symvers; \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \ + fi + @if [ -d vboxpci ]; then \ ++ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxpci/Module.symvers; \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci install; \ + fi + diff --git a/virtualbox-kmp-files b/virtualbox-kmp-files index c327efd..3142533 100644 --- a/virtualbox-kmp-files +++ b/virtualbox-kmp-files @@ -6,5 +6,4 @@ /lib/modules/%2-%1/extra/vboxnetflt.ko /lib/modules/%2-%1/extra/vboxpci.ko /lib/modules/%2-%1/extra/vboxsf.ko -/lib/modules/%2-%1/extra/vboxvideo.ko /lib/modules/%2-%1/extra/vboxguest.ko diff --git a/virtualbox.changes b/virtualbox.changes index b327fed..8b2b2ac 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Dec 18 19:47:16 UTC 2019 - Larry Finger + +- Fix build for kernel 5.5. Added file "fixes_for_5.5.patch". + ------------------------------------------------------------------- Wed Dec 4 16:33:09 UTC 2019 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index dae235c..4048a87 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -152,6 +152,8 @@ Patch132: fixes_for_qt5.13.patch #endif # Fixes for API changes in kernel 5.4 Patch133: fixes_for_5.4.patch +# Fixes for API changes in kernel 5.5 +Patch134: fixes_for_5.5.patch Patch999: virtualbox-fix-ui-background-color.patch # BuildRequires: %{python_module devel} @@ -458,6 +460,7 @@ echo "sle_version " %{?sle_version}", is_opensuse " %{?is_opensuse}", suse_versi %patch132 -p1 %endif %patch133 -p1 +%patch134 -p1 # make VB UI background colors look sane again %patch999 -p1 @@ -546,11 +549,7 @@ install -D -m 644 "COPYING" "%{buildroot}%{_datadir}/licenses/LICENSE.vnc" echo "build kernel modules" #%if 0%{?suse_version} < 1550 for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp,pci} \ - out/linux.*/release/bin/additions/src/vbox{guest,sf,video}; do -#%else -#for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp,pci} \ -# out/linux.*/release/bin/additions/src/vbox{guest,sf}; do -#%endif + out/linux.*/release/bin/additions/src/vbox{guest,sf}; do #get the module name from path module_name=$(basename "$vbox_module") @@ -559,6 +558,10 @@ for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp,pci} \ # delete old build dir for sure rm -rf modules_build_dir/${module_name}_${flavor} + if [ "$module_name" = "vboxdrv" -o \ + "$module_name" = "vboxguest" ] ; then + SYMBOLS="" + fi # create build directory for specific flavor mkdir -p modules_build_dir/$flavor @@ -571,16 +574,18 @@ for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp,pci} \ "$module_name" = "vboxpci" ] ; then cp $PWD/modules_build_dir/$flavor/vboxdrv/Module.symvers \ $PWD/modules_build_dir/$flavor/$module_name + SYMBOLS="$PWD/modules_build_dir/$flavor/vboxdrv/Module.symvers" fi - # copy vboxguest (for guest) module symbols which are used by vboxsf and vboxvideo km's: - if [ "$module_name" = "vboxsf" -o \ - "$module_name" = "vboxvideo" ] ; then - cp $PWD/modules_build_dir/$flavor/vboxguest/Module.symvers \ + # copy vboxguest (for guest) module symbols which are used by vboxsf km: + if [ "$module_name" = "vboxsf" -o \ + "$module_name" = "vboxvideo" ] ; then + cp $PWD/modules_build_dir/$flavor/vboxguest/Module.symvers \ $PWD/modules_build_dir/$flavor/$module_name + SYMBOLS="$PWD/modules_build_dir/$flavor/vboxguest/Module.symvers" fi # build the module for the specific flavor make -j2 -C %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor %{?linux_make_arch} modules \ - M=$PWD/modules_build_dir/$flavor/$module_name V=1 + M=$PWD/modules_build_dir/$flavor/$module_name KBUILD_EXTRA_SYMBOLS="$SYMBOLS" V=1 done done