From aa9cd92c07fd5e50e5a077acc40b196f39e51e90d954dd182e2b34129fbb2866 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 30 Mar 2022 01:06:55 +0000 Subject: [PATCH 1/2] Accepting request 965783 from home:lwfinger:branches:Virtualization - Update fixes for kernel 5.17. Add fixes for kernel 5.18 - file "fixes_for_kernel_5.18.patch" added - Fix build error for guest modules in Leap 15.3 OBS-URL: https://build.opensuse.org/request/show/965783 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=628 --- fixes_for_kernel_5.17.patch | 68 ++++++++++++++++++++++ fixes_for_kernel_5.18.patch | 18 ++++++ fixes_for_leap15.2.patch | 2 +- virtualbox.changes | 11 ++++ virtualbox.spec | 112 ++++++++++++++++++++++++++++++++++++ 5 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 fixes_for_kernel_5.17.patch create mode 100644 fixes_for_kernel_5.18.patch diff --git a/fixes_for_kernel_5.17.patch b/fixes_for_kernel_5.17.patch new file mode 100644 index 0000000..701b743 --- /dev/null +++ b/fixes_for_kernel_5.17.patch @@ -0,0 +1,68 @@ +Index: VirtualBox-6.1.32/src/VBox/Additions/linux/drm/vbox_drv.c +=================================================================== +--- VirtualBox-6.1.32.orig/src/VBox/Additions/linux/drm/vbox_drv.c ++++ VirtualBox-6.1.32/src/VBox/Additions/linux/drm/vbox_drv.c +@@ -50,6 +50,19 @@ + #include "version-generated.h" + #include "revision-generated.h" + ++/** Detect whether kernel mode setting is OFF. */ ++#if defined(CONFIG_VGA_CONSOLE) ++# if RTLNX_VER_MIN(5,17,0) ++# define VBOX_VIDEO_NOMODESET() drm_firmware_drivers_only() && vbox_modeset == -1 ++# elif RTLNX_VER_MIN(4,7,0) ++# define VBOX_VIDEO_NOMODESET() vgacon_text_force() && vbox_modeset == -1 ++# else /* < 4.7.0 */ ++# define VBOX_VIDEO_NOMODESET() 0 ++# endif /* < 4.7.0 */ ++#else /* !CONFIG_VGA_CONSOLE */ ++# define VBOX_VIDEO_NOMODESET() 0 ++#endif /* !CONFIG_VGA_CONSOLE */ ++ + static int vbox_modeset = -1; + + MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); +@@ -401,15 +414,13 @@ static struct drm_driver driver = { + static int __init vbox_init(void) + { + printk("vboxvideo: loading version " VBOX_VERSION_STRING " r" __stringify(VBOX_SVN_REV) "\n"); +-#if defined(CONFIG_VGA_CONSOLE) || RTLNX_VER_MIN(4,7,0) +- if (vgacon_text_force() && vbox_modeset == -1) ++ if (VBOX_VIDEO_NOMODESET()) + { + printk("vboxvideo: kernel is running with *nomodeset* parameter,\n"); + printk("vboxvideo: please consider either to remove it or load driver\n"); + printk("vboxvideo: with parameter modeset=1, unloading\n"); + return -EINVAL; + } +-#endif + + if (vbox_modeset == 0) + { +Index: VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c +=================================================================== +--- VirtualBox-6.1.32.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c ++++ VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c +@@ -66,6 +66,12 @@ + + #define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface)) + ++/** Set netdev MAC address. */ ++#if RTLNX_VER_MIN(5,17,0) ++# define VBOX_DEV_ADDR_SET(dev, addr, len) dev_addr_mod(dev, 0, addr, len) ++#else /* < 5.17.0 */ ++# define VBOX_DEV_ADDR_SET(dev, addr, len) memcpy(dev->dev_addr, addr, len) ++#endif + + /********************************************************************************************************************************* + * Internal Functions * +@@ -303,7 +309,7 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis + + if (pNetDev->dev_addr) + { +- memcpy(pNetDev->dev_addr, pMACAddress, ETH_ALEN); ++ VBOX_DEV_ADDR_SET(pNetDev, pMACAddress, ETH_ALEN); + Log2(("vboxNetAdpOsCreate: pNetDev->dev_addr = %.6Rhxd\n", pNetDev->dev_addr)); + + /* + diff --git a/fixes_for_kernel_5.18.patch b/fixes_for_kernel_5.18.patch new file mode 100644 index 0000000..716cc18 --- /dev/null +++ b/fixes_for_kernel_5.18.patch @@ -0,0 +1,18 @@ +Index: VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +=================================================================== +--- VirtualBox-6.1.32.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c ++++ VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +@@ -2314,8 +2314,13 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS + { + vboxNetFltDumpPacket(pSG, true, "host", (fDst & INTNETTRUNKDIR_WIRE) ? 0 : 1); + Log6(("vboxNetFltPortOsXmit: pBuf->cb dump:\n%.*Rhxd\n", sizeof(pBuf->cb), pBuf->cb)); ++# if RTLNX_VER_MAX(5, 18, 0) + Log6(("vboxNetFltPortOsXmit: netif_rx_ni(%p)\n", pBuf)); + err = netif_rx_ni(pBuf); ++#else ++ Log6(("vboxNetFltPortOsXmit: netif_rx(%p)\n", pBuf)); ++ err = netif_rx(pBuf); ++#endif + if (err) + rc = RTErrConvertFromErrno(err); + } diff --git a/fixes_for_leap15.2.patch b/fixes_for_leap15.2.patch index 1916626..6cf1ddc 100644 --- a/fixes_for_leap15.2.patch +++ b/fixes_for_leap15.2.patch @@ -25,7 +25,7 @@ Index: VirtualBox-6.1.26/src/VBox/Additions/linux/drm/vbox_drv.c - .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | +#if RTLNX_VER_MAX(5,4,0) + .driver_features = -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) ++#if defined(OPENSUSE_152) + DRIVER_PRIME | +#endif # if RTLNX_VER_MAX(5,1,0) && !RTLNX_RHEL_MAJ_PREREQ(8,1) diff --git a/virtualbox.changes b/virtualbox.changes index 64068a3..309ceaf 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Mar 29 19:01:11 UTC 2022 - Larry Finger + +- Update fixes for kernel 5.17. + Add fixes for kernel 5.18 - file "fixes_for_kernel_5.18.patch" added + +------------------------------------------------------------------- +Fri Mar 11 18:45:02 UTC 2022 - Larry Finger + +- Fix build error for guest modules in Leap 15.3 + ------------------------------------------------------------------- Thu Jan 20 17:19:56 UTC 2022 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index b85b760..52aabbd 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -179,6 +179,8 @@ Patch137: handle_gsoap_208103.patch Patch142: fixes_for_leap15.3.patch Patch143: vb-6.1.16-modal-dialog-parent.patch Patch144: fixes_for_leap15.4.patch +Patch145: fixes_for_kernel_5.17.patch +Patch146: fixes_for_kernel_5.18.patch Patch999: virtualbox-fix-ui-background-color.patch # # Common BuildRequires for both virtualbox and virtualbox-kmp @@ -310,12 +312,24 @@ the terms of the GNU Public License (GPL). + + + + + + + + + + + ########################################## + %package qt Summary: Qt GUI part for %{name} Group: System/Emulators/PC @@ -340,12 +354,24 @@ This package contains the code for the GUI used to control VMs. + + + + + + + + + + + ######################################### + %package websrv Summary: WebService GUI part for %{name} Group: System/Emulators/PC @@ -364,12 +390,24 @@ The VirtualBox web server is used to control headless VMs using a browser. + + + + + + + + + + + ######################################### + %package guest-x11 Summary: VirtualBox X11 drivers for mouse and video Group: System/X11/Servers/XF86_4 @@ -391,12 +429,24 @@ This package contains X11 guest utilities and X11 guest mouse and video drivers + + + + + + + + + + + ########################################### + %package guest-tools Summary: VirtualBox guest tools Group: System/Emulators/PC @@ -422,12 +472,24 @@ VirtualBox guest addition tools. + + + + + + + + + + + ########################################### + %package -n python3-%{name} Summary: Python bindings for %{name} Group: Development/Libraries/Python @@ -453,12 +515,24 @@ Python XPCOM bindings to %{name}. Used e.g. by vboxgtk package. + + + + + + + + + + + ########################################### + %package devel Summary: Devel files for %{name} Group: Development/Libraries/Other @@ -479,12 +553,24 @@ Development file for %{name} + + + + + + + + + + + ########################################### + %package host-source Summary: Source files for %{name} host kernel modules Group: Development/Sources @@ -522,12 +608,24 @@ sudo %{_sbindir}/vboxguestconfig + + + + + + + + + + + ########################################### + %package guest-desktop-icons Summary: Icons for guest desktop files Group: System/Emulators/PC @@ -546,12 +644,24 @@ This package contains icons for guest desktop files that were created on the des + + + + + + + + + + + ########################################### + %package vnc Summary: VNC desktop sharing Group: System/Emulators/PC @@ -627,6 +737,8 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %patch144 -p1 %endif %patch143 -p1 +%patch145 -p1 +%patch146 -p1 # make VB UI background colors look sane again %patch999 -p1 From 1a269902d129be64485751fd4c42fa644c93aa5848491a511f4e2b35de33d29c Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 30 Mar 2022 02:28:52 +0000 Subject: [PATCH 2/2] Accepting request 965792 from home:lwfinger:branches:Virtualization - Add fixes for kernel 5.17 - file "fixes_for_kernel_5.17.patch" added Add fixes for kernel 5.18 - file "fixes_for_kernel_5.18.patch" added OBS-URL: https://build.opensuse.org/request/show/965792 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=629 --- virtualbox.changes | 2 +- virtualbox.spec | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/virtualbox.changes b/virtualbox.changes index 309ceaf..c4721ee 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Tue Mar 29 19:01:11 UTC 2022 - Larry Finger -- Update fixes for kernel 5.17. +- Add fixes for kernel 5.17 - file "fixes_for_kernel_5.17.patch" added Add fixes for kernel 5.18 - file "fixes_for_kernel_5.18.patch" added ------------------------------------------------------------------- diff --git a/virtualbox.spec b/virtualbox.spec index 52aabbd..3fbac3c 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -328,8 +328,8 @@ the terms of the GNU Public License (GPL). -########################################## +########################################## %package qt Summary: Qt GUI part for %{name} Group: System/Emulators/PC @@ -370,8 +370,8 @@ This package contains the code for the GUI used to control VMs. -######################################### +######################################### %package websrv Summary: WebService GUI part for %{name} Group: System/Emulators/PC @@ -406,8 +406,8 @@ The VirtualBox web server is used to control headless VMs using a browser. -######################################### +######################################### %package guest-x11 Summary: VirtualBox X11 drivers for mouse and video Group: System/X11/Servers/XF86_4 @@ -445,8 +445,8 @@ This package contains X11 guest utilities and X11 guest mouse and video drivers -########################################### +########################################### %package guest-tools Summary: VirtualBox guest tools Group: System/Emulators/PC @@ -488,8 +488,8 @@ VirtualBox guest addition tools. -########################################### +########################################### %package -n python3-%{name} Summary: Python bindings for %{name} Group: Development/Libraries/Python @@ -531,8 +531,8 @@ Python XPCOM bindings to %{name}. Used e.g. by vboxgtk package. -########################################### +########################################### %package devel Summary: Devel files for %{name} Group: Development/Libraries/Other @@ -569,8 +569,8 @@ Development file for %{name} -########################################### +########################################### %package host-source Summary: Source files for %{name} host kernel modules Group: Development/Sources @@ -624,8 +624,8 @@ sudo %{_sbindir}/vboxguestconfig -########################################### +########################################### %package guest-desktop-icons Summary: Icons for guest desktop files Group: System/Emulators/PC @@ -660,8 +660,8 @@ This package contains icons for guest desktop files that were created on the des -########################################### +########################################### %package vnc Summary: VNC desktop sharing Group: System/Emulators/PC