diff --git a/fixes-for-5.11.patch b/fixes-for-5.11.patch new file mode 100644 index 0000000..f1c7a29 --- /dev/null +++ b/fixes-for-5.11.patch @@ -0,0 +1,14 @@ +Index: VirtualBox-6.1.16/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +=================================================================== +--- VirtualBox-6.1.16.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c ++++ VirtualBox-6.1.16/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +@@ -342,6 +342,9 @@ typedef struct ethtool_ops OVR_OPSTYPE; + + # else /* RTLNX_VER_MIN(2,6,29) */ + ++#if RTLNX_VER_MIN(5,11,0) ++# include ++#endif + typedef struct net_device_ops OVR_OPSTYPE; + # define OVR_OPS netdev_ops + # define OVR_XMIT pOrgOps->ndo_start_xmit diff --git a/vboxguestconfig.sh b/vboxguestconfig.sh deleted file mode 100644 index db91e41..0000000 --- a/vboxguestconfig.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# Script to build VirtualBox guest kernel modules -# Copyright C 2017 by Larry Finger -# -# This script is part of the openSUSE VirtualBox package -# -SOURCE="/usr/src/kernel-modules/" -LOGFILE="/var/log/virtualbox.log" -INCLUDE="/lib/modules/`uname -r`/build/include" -# -# Test if vboxguest module loaded. If it is, skip everything else -loaded=$(lsmod | grep vboxguest) -if [ -n "$loaded" ] ; then - echo "Kernel modules available. but we will continue..." -fi -# -# Check if virtualbox-guest-source is installed, quit if not -if ! rpm -qf "$SOURCE/additions/guest_src.tar.bz2" &>/dev/null ; then - echo "Sources for building guest modules are not present," - echo "Use 'sudo zypper install virtualbox-guest-source' to install them. Quitting .." - exit 1 -fi -# unpack source -pushd $SOURCE > /dev/null 2>&1 -tar jxf additions/guest_src.tar.bz2 > /dev/null 2>&1 -popd > /dev/null 2>&1 -# -# Check if virtualbox-guest-source version matches virtualbox version -if [ "$(rpm -q virtualbox virtualbox-guest-source --queryformat='%{version}-%{release}\n' 2>/dev/null | sort -u | wc -l)" -ne "1" ] ; then - echo "virtualbox-guest-source package version doesn't match the version of virtualbox package." - echo "This situation is probably not fatal, thus we will try to continue .." -fi -# Prerequisites are available, start build -pushd $SOURCE/additions/src > /dev/null 2>&1 -echo "Building kernel modules..." -make > $LOGFILE 2>&1 -if [ "$?" -ne 0 ] ; then - echo "" - echo "Build of VirtualBox guest kernel modules failed." - echo "Look at $LOGFILE to find reasons." - popd > /dev/null 2>&1 - exit 1 -else -echo "Kernel modules built correctly. They will now be installed." -fi -make install >> $LOGFILE 2>&1 -if [ "$?" -ne 0 ] ; then - echo "" - echo "Installation of VirtualBox guest kernel modules failed." - echo "Look at $LOGFILE to find reasons." - popd > /dev/null 2>&1 - exit 1 -fi -depmod -a -modprobe -av vboxsf vboxguest vboxvideo -cd ../.. -rm -rf additions -popd > /dev/null 2>&1 -echo "Kernel modules are installed and loaded." -exit 0 - diff --git a/virtualbox-kmp-files b/virtualbox-kmp-files index fc0a759..7e9bb85 100644 --- a/virtualbox-kmp-files +++ b/virtualbox-kmp-files @@ -4,6 +4,3 @@ /lib/modules/%2-%1/extra/vboxdrv.ko /lib/modules/%2-%1/extra/vboxnetadp.ko /lib/modules/%2-%1/extra/vboxnetflt.ko -/lib/modules/%2-%1/extra/vboxsf.ko -/lib/modules/%2-%1/extra/vboxguest.ko -/lib/modules/%2-%1/extra/vboxvideo.ko diff --git a/virtualbox.changes b/virtualbox.changes index 399bfc6..9a2579b 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Dec 29 19:39:35 UTC 2020 - Larry Finger + +- Fix build for kernel 5.11 - File "fixes-for-5.11.patch" is added. + +------------------------------------------------------------------- +Sun Dec 20 19:31:27 UTC 2020 - Larry Finger + +- Disable build of guest modules. These are included in recent kernels + and are not needed for Tumbleweed, Leap 15.1 and Leap 15.3. + + File "vboxguestconfig.sh" is deleted. + ------------------------------------------------------------------- Sat Dec 12 19:10:34 UTC 2020 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index 3293144..3d6e0f5 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -93,7 +93,6 @@ Source11: virtualbox-60-vboxdrv.rules Source14: vboxdrv.service Source15: vboxadd-service.service Source16: vboxconfig.sh -Source17: vboxguestconfig.sh Source18: fix_usb_rules.sh Source19: vboxdrv.sh Source20: README.autostart @@ -184,6 +183,7 @@ Patch138: linux-5.10-r0drv-memobj-fix-r0.patch Patch139: linux-5.10-address-space-fixes.patch Patch140: linux-5.10-framebuffer-fixes.patch Patch141: vb-6.1.16-modal-dialog-parent.patch +Patch142: fixes-for-5.11.patch Patch999: virtualbox-fix-ui-background-color.patch # @@ -414,21 +414,6 @@ Source files for %{name} host kernel modules These can be built for custom kernels using sudo /sbin/vboxconfig -%package guest-source -Summary: Source files for %{name} guest kernel modules -Group: Development/Sources -Requires: gcc -Requires: kernel-devel -Requires: libelf-devel -Requires: make -BuildArch: noarch - -%description guest-source -Source files for %{name} guest kernel modules -These can be built for custom kernels using -sudo /sbin/vboxguestconfig -########################################### - %package guest-desktop-icons Summary: Icons for guest desktop files Group: System/Emulators/PC @@ -510,6 +495,7 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %patch139 -p1 %patch140 -p1 %patch141 -p1 +%patch142 -p1 # make VB UI background colors look sane again %patch999 -p1 @@ -697,7 +683,6 @@ install -m 644 nls/* %{buildroot}%{_datadir}/virtualbox/nls/ # install kmp src mkdir -p %{buildroot}%{_usrsrc}/kernel-modules/virtualbox mkdir -p %{buildroot}%{_usrsrc}/kernel-modules/additions -tar jcf %{buildroot}%{_usrsrc}/kernel-modules/additions/guest_src.tar.bz2 additions/src cp -a src %{buildroot}%{_usrsrc}/kernel-modules/virtualbox install -m 644 %{SOURCE11} %{buildroot}%{_udevrulesdir}/60-vboxdrv.rules popd @@ -724,7 +709,6 @@ install -m 0644 %{SOURCE14} %{buildroot}%{_unitdir}/vboxdrv. ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcvboxdrv install -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/vboxadd-service.service install -m 0755 %{SOURCE16} %{buildroot}/sbin/vboxconfig -install -m 0755 %{SOURCE17} %{buildroot}/sbin/vboxguestconfig install -m 0755 %{SOURCE18} %{buildroot}/sbin/vbox-fix-usb-rules.sh install -m 0755 %{SOURCE19} %{buildroot}%{_vbox_instdir}/vboxdrv.sh install -m 0644 %{SOURCE21} %{buildroot}%{_unitdir}/vboxweb-service.service @@ -1043,7 +1027,6 @@ export DISABLE_RESTART_ON_UPDATE=yes %defattr(-, root, root) %{_bindir}/VBoxControl %{_sbindir}/VBoxService -/sbin/vboxguestconfig /sbin/mount.vboxsf %{_udevrulesdir}/60-vboxguest.rules %{_vbox_instdir}/vboxadd-service @@ -1079,12 +1062,6 @@ export DISABLE_RESTART_ON_UPDATE=yes %dir %{_usrsrc}/kernel-modules %{_usrsrc}/kernel-modules/virtualbox -%files guest-source -%defattr(-,root, root) -%dir %{_usrsrc}/kernel-modules -%dir %{_usrsrc}/kernel-modules/additions -%{_usrsrc}/kernel-modules/additions/guest_src.tar.bz2 - %files websrv %defattr(-,root, root) %{_unitdir}/vboxweb-service.service @@ -1181,12 +1158,10 @@ COMMON_KMK_FLAGS+=" %{_bindir}/kmk %_smp_mflags -C src/VBox/HostDrivers/ \ ${COMMON_KMK_FLAGS} # -# build kernel modules for guest and host (check novel-kmp package as example) +# build kernel modules for host (check novel-kmp package as example) # host modules : vboxdrv,vboxnetflt,vboxnetadp -# guest modules : vboxguest,vboxsf vboxvideo (for Leap 15.1 and older) echo "build kernel modules" -for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp} \ - out/linux.*/release/bin/additions/src/vbox{guest,sf,video}; do +for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp} ; do #get the module name from path module_name=$(basename "$vbox_module") @@ -1195,8 +1170,7 @@ for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp} \ # delete old build dir for sure rm -rf modules_build_dir/${module_name}_${flavor} - if [ "$module_name" = "vboxdrv" -o \ - "$module_name" = "vboxguest" ] ; then + if [ "$module_name" = "vboxdrv" ] ; then SYMBOLS="" fi # create build directory for specific flavor @@ -1212,13 +1186,6 @@ for vbox_module in out/linux.*/release/bin/src/vbox{drv,netflt,netadp} \ $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 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 KBUILD_EXTRA_SYMBOLS="$SYMBOLS" V=1 @@ -1229,7 +1196,7 @@ done export INSTALL_MOD_PATH=%{buildroot} export INSTALL_MOD_DIR=extra #to install modules we use here similar steps like in build phase, go through all the modules : -for module_name in vbox{drv,netflt,netadp,guest,sf,video} +for module_name in vbox{drv,netflt,netadp} do #and through the all flavors for flavor in %{flavors_to_build}; do