From 17bc6d4e0603e8a07edc8b2d75062f774626ae774697f321b1e502a338d68d1b Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 27 May 2017 16:49:37 +0000 Subject: [PATCH 01/12] OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=335 --- modify_for_4_8_bo_move.patch | 14 +++++++------- virtualbox.spec | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modify_for_4_8_bo_move.patch b/modify_for_4_8_bo_move.patch index 01ecce3..de93b48 100644 --- a/modify_for_4_8_bo_move.patch +++ b/modify_for_4_8_bo_move.patch @@ -1,8 +1,8 @@ -Index: VirtualBox-5.1.6/src/VBox/Additions/linux/drm/vbox_ttm.c +Index: VirtualBox-5.1.22/src/VBox/Additions/linux/drm/vbox_ttm.c =================================================================== ---- VirtualBox-5.1.6.orig/src/VBox/Additions/linux/drm/vbox_ttm.c -+++ VirtualBox-5.1.6/src/VBox/Additions/linux/drm/vbox_ttm.c -@@ -229,7 +229,6 @@ static int vbox_bo_move(struct ttm_buffe +--- VirtualBox-5.1.22.orig/src/VBox/Additions/linux/drm/vbox_ttm.c ++++ VirtualBox-5.1.22/src/VBox/Additions/linux/drm/vbox_ttm.c +@@ -231,7 +231,6 @@ static int vbox_bo_move(struct ttm_buffe return r; } @@ -10,10 +10,10 @@ Index: VirtualBox-5.1.6/src/VBox/Additions/linux/drm/vbox_ttm.c static void vbox_ttm_backend_destroy(struct ttm_tt *tt) { ttm_tt_fini(tt); -Index: VirtualBox-5.1.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +Index: VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c =================================================================== ---- VirtualBox-5.1.6.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c -+++ VirtualBox-5.1.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +--- VirtualBox-5.1.22.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c ++++ VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c @@ -35,7 +35,7 @@ #include #include diff --git a/virtualbox.spec b/virtualbox.spec index 27a44cd..4085cb9 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -128,6 +128,8 @@ BuildRequires: kernel-syms BuildRequires: libcap-devel BuildRequires: libcurl-devel BuildRequires: libelf-devel +BuildRequires: libicu58_2 +BuildRequires: libicu58_2-ledata BuildRequires: libidl-devel BuildRequires: libopenssl-devel BuildRequires: libqt5-linguist From af26c92399cbf574d4bd35460aa9f1dffcff1c5b7cf87ca1a65079dd0ad53f38 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 8 Jun 2017 22:26:55 +0000 Subject: [PATCH 02/12] - Revise warning screen concerning USB passthru - fixes bnc#1041137. USB passthru opens a security hole, yet it is so valuable that many users want the feature, thus it is our default. Previously, a user needed to edit a udev rule to disable passthru. The bad part was that an update of VB changed the rule back to allow passthru without any notification. These changes modify the popup to allow the user to accept or decline passthru. If the user declines, then the root password is requested and the udev rule is modified. As these modifications will be lost with the next VB update, the inode of the udev rule is kept. If the user has previously declined and the inode has changed, the popup will show the next time VB is started. File "fix_usb_rules.sh" is added. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=336 --- fix_usb_rules.sh | 7 ++++++ vbox-usb-warning.diff | 45 ++++++++++++++++++++++------------- virtualbox-wrapper.sh | 55 ++++++++++++++++++++++++++++++++++++++++--- virtualbox.changes | 11 +++++++++ virtualbox.spec | 7 +++--- 5 files changed, 102 insertions(+), 23 deletions(-) create mode 100644 fix_usb_rules.sh diff --git a/fix_usb_rules.sh b/fix_usb_rules.sh new file mode 100644 index 0000000..b33950c --- /dev/null +++ b/fix_usb_rules.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# script to disable USB passthru in /etc/udev/rules.d/60-vboxdrv.rules +# if already disabled, clear the comment character +sed -i 's/#SUBSYSTEM==\"usb/SUBSYSTEM==\"usb/' /etc/udev/rules.d/60-vboxdrv.rules +# now comment the usb lines +sed -i 's/SUBSYSTEM==\"usb/#SUBSYSTEM==\"usb/' /etc/udev/rules.d/60-vboxdrv.rules + diff --git a/vbox-usb-warning.diff b/vbox-usb-warning.diff index 571987b..6142f1c 100644 --- a/vbox-usb-warning.diff +++ b/vbox-usb-warning.diff @@ -1,10 +1,8 @@ -Index: a/src/apps/Makefile.kmk +Index: VirtualBox-5.1.22/src/apps/Makefile.kmk =================================================================== ---- a/src/apps/Makefile.kmk (revision 58576) -+++ b/src/apps/Makefile.kmk (working copy) -@@ -34,7 +34,9 @@ - endif - endif +--- VirtualBox-5.1.22.orig/src/apps/Makefile.kmk ++++ VirtualBox-5.1.22/src/apps/Makefile.kmk +@@ -31,5 +31,7 @@ endif include $(PATH_SUB_CURRENT)/VBoxPermissionMessage/Makefile.kmk @@ -12,10 +10,10 @@ Index: a/src/apps/Makefile.kmk + include $(FILE_KBUILD_SUB_FOOTER) -Index: a/src/apps/VBoxUSB_DevRules/Makefile.kmk +Index: VirtualBox-5.1.22/src/apps/VBoxUSB_DevRules/Makefile.kmk =================================================================== ---- a/src/apps/VBoxUSB_DevRules/Makefile.kmk (revision 0) -+++ b/src/apps/VBoxUSB_DevRules/Makefile.kmk (working copy) +--- /dev/null ++++ VirtualBox-5.1.22/src/apps/VBoxUSB_DevRules/Makefile.kmk @@ -0,0 +1,33 @@ +# $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z vboxsync $ +## @file @@ -50,21 +48,34 @@ Index: a/src/apps/VBoxUSB_DevRules/Makefile.kmk +include $(KBUILD_PATH)/subfooter.kmk + + -Index: a/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp +Index: VirtualBox-5.1.22/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp =================================================================== ---- a/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp (revision 0) -+++ b/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp (working copy) -@@ -0,0 +1,13 @@ +--- /dev/null ++++ VirtualBox-5.1.22/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp +@@ -0,0 +1,26 @@ +#include +#include ++#include ++ +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QMessageBox msgBox; -+ msgBox.setWindowTitle(QObject::tr("USB Rules and Permissions !")); -+ msgBox.setText(QObject::tr("USB passthru opens a security hole. Please read \n\nhttps://bugzilla.novell.com/show_bug.cgi?id=664520\n\nto understand the problem. If you really want/need to use USB passthru and are willing to accept the security risk, then do nothing. To plug the security hole, remove all 'usb' lines from /etc/udev/rules.d/60-vboxdrv.rules.\n\nThis message will not be seen again!")); -+ int ret = msgBox.exec(); ++ QPushButton *myYesButton = msgBox.addButton("Enable", QMessageBox::YesRole); ++ QPushButton *myNoButton = msgBox.addButton("Disable", QMessageBox::NoRole); ++ msgBox.setWindowTitle(QObject::tr("USB Rules and Permissions !")); ++ msgBox.setText(QObject::tr("USB passthru opens a security hole. " ++ "Please read \nhttps://bugzilla.novell.com/show_bug.cgi?id=664520\n" ++ "to understand the problem.\n\nWe regard USB passthru to be extremely useful and worth the security risk. " ++ "thus the code defaults to enabling this feature. If you agree that the risk is acceptible, then click 'Enable'.\n" ++ "You will not be asked this question again when VB is updated. If you later change your mind, run 'rm ~/.vbox/*'\n\n" ++ "If you wish to disable USB passthru to plug the security hole, then click 'Disable'. " ++ "You will be asked for the system password, and /etc/udev/rules.d/60-vboxdrv.rules will be changed.\n" ++ "These changes cannot be preserved through VB updates, thus this screen will be displayed again at that time.")); ++ msgBox.exec(); + app.quit(); -+ return 0; ++ if (msgBox.clickedButton() == myYesButton) ++ return 0; ++ return 1; +} + diff --git a/virtualbox-wrapper.sh b/virtualbox-wrapper.sh index 7c48013..d3e0b90 100644 --- a/virtualbox-wrapper.sh +++ b/virtualbox-wrapper.sh @@ -1,9 +1,58 @@ #!/bin/bash export QT_NO_KDE_INTEGRATION=1 +# make certain that the user/group combination is valid /usr/bin/id -nG | grep -v -e "root" -e "vboxusers" >/dev/null && /usr/lib/virtualbox/VBoxPermissionMessage && exit -if [ ! -f ~/.vbox/message_out ] ; then +# +# Handle the issue regarding USB passthru +# The following conditions apply: +# 1. If ~/.vbox/enable exists, the user accepts the security risk. +# 2. If ~/.vbox/disable exists, the user does not accept the risk. That file will contain the inode of /etc/udev/rules.d/60-vboxdrv.rules. +# When that changes, the VBoxUSB_DevRules will again be displayed as that means that VB has been reloaded. +# +devrules() +{ /usr/lib/virtualbox/VBoxUSB_DevRules - mkdir -p ~/.vbox/ - touch ~/.vbox/message_out + if [ $? -eq 0 ] ; then + # User accepts the risk + touch ~/.vbox/enable + rm -f ~/.vbox/disable + else + # User declines the risk - save the inode + echo "" > ~/.vbox/disable + rm -f ~/.vbox/enable + fi +} +# Start of main routine +# +# Ensure that ~/.vbox exists +mkdir -p ~/.vbox/ +# Get the inode for /etc/udev/rules.d/60-vboxdrv.rules +INODE=$(stat /etc/udev/rules.d/60-vboxdrv.rules | grep Inode | cut -d' ' -f3) +if [ ! -f ~/.vbox/enable ] && [ ! -f ~/.vbox/disable ] ; then + # Neither file exists - find what the user wants + devrules fi +# Get the original Inode if it exists +if [ -f ~/.vbox/disable ] ; then + read LINE < ~/.vbox/disable +else + LINE=" " +fi +# If user originally declined, make certain that /etc/udev/rules.d/60-vboxdrv.rules has not been changed +if [ -f ~/.vbox/disable ] && [ "$LINE" != "$INODE" ] && [ "$LINE" != "" ] ; then + # disable is selected and the Inode has changed - ask again + devrules +fi +if [ -f ~/.vbox/disable ] ; then + echo $INODE > ~/.vbox/disable + if [ "$LINE" != "$INODE" ] ; then + if [ -f /usr/bin/kdesu ] ; then + kdesu /sbin/vbox-fix-usb-rules.sh + fi + if [ -f /usr/bin/gnomesu ] ; then + gnomesu /sbin/vbox-fix-usb-rules.sh + fi + fi +fi +# Now run the VB GUI LD_LIBRARY_PATH="/usr/lib/virtualbox${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" /usr/lib/virtualbox/VirtualBox $@ diff --git a/virtualbox.changes b/virtualbox.changes index 0a16a39..b47fbab 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Jun 8 17:37:35 UTC 2017 - Larry.Finger@lwfinger.net + +- Revise warning screen concerning USB passthru - fixes bnc#1041137. + USB passthru opens a security hole, yet it is so valuable that many users want the feature, thus it is our default. + Previously, a user needed to edit a udev rule to disable passthru. The bad part was that an update of VB changed the + rule back to allow passthru without any notification. These changes modify the popup to allow the user to accept or decline + passthru. If the user declines, then the root password is requested and the udev rule is modified. As these modifications will be + lost with the next VB update, the inode of the udev rule is kept. If the user has previously declined and the inode has changed, + the popup will show the next time VB is started. File "fix_usb_rules.sh" is added. + ------------------------------------------------------------------- Sun May 21 13:28:15 UTC 2017 - hpj@urpla.net diff --git a/virtualbox.spec b/virtualbox.spec index 4085cb9..c57f10d 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -51,6 +51,7 @@ Source14: vboxdrv.service Source15: vboxadd-service.service Source16: vboxconfig.sh Source17: vboxguestconfig.sh +Source18: fix_usb_rules.sh Source98: %{name}-rpmlintrc Source99: %{name}-patch-source.sh #rework init scripts to fit suse needs @@ -128,8 +129,6 @@ BuildRequires: kernel-syms BuildRequires: libcap-devel BuildRequires: libcurl-devel BuildRequires: libelf-devel -BuildRequires: libicu58_2 -BuildRequires: libicu58_2-ledata BuildRequires: libidl-devel BuildRequires: libopenssl-devel BuildRequires: libqt5-linguist @@ -622,7 +621,6 @@ install -m 644 out/linux.*/release/bin/VBox.png %{buildroot}%{_datadir}/pixmaps/ install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/default/virtualbox #install wrapper script install -m 644 %{SOURCE9} %{buildroot}%{_bindir}/VirtualBox - # modify and install the vboxdrv init script sed -i "s|%{NOLSB}%|yes|g;s|%{DEBIAN}%||g;s|%{PACKAGE}%|virtualbox|g" \ src/VBox/Installer/linux/vboxdrv.sh @@ -635,6 +633,7 @@ install -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/vboxadd-service.service install -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/multi-user.target.wants/vboxadd-service.service install -m 0644 %{SOURCE16} %{buildroot}/sbin/vboxconfig install -m 0644 %{SOURCE17} %{buildroot}/sbin/vboxguestconfig +install -m 0755 %{SOURCE18} %{buildroot}/sbin/vbox-fix-usb-rules.sh # Init script to start virtual boxes during boot install -m 755 %{SOURCE12} %{buildroot}%{_sysconfdir}/init.d/vboxes ln -s %{_sysconfdir}/init.d/vboxes %{buildroot}%{_sbindir}/rcvboxes @@ -883,6 +882,8 @@ export DISABLE_RESTART_ON_UPDATE=yes %verify(not mode) %attr(4750,root,vboxusers) %{_vbox_instdir}/VirtualBox #wrapper script is in bindir %attr(0755,root,root) %{_bindir}/VirtualBox +#rules fixing script is in /sbin +%attr(0755,root,root) /sbin/vbox-fix-usb-rules.sh #ldd shows libQt* dependency %{_vbox_instdir}/VBoxTestOGL #qm's translations From 532c4484c9b963182a61496b0174d49894f23d01dcbeec7def638f235d859d7b Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 10 Jun 2017 13:21:20 +0000 Subject: [PATCH 03/12] - Add installation of package "net-tools-deprecated" as requested in boo#1027742. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=337 --- vbox-vboxadd-init-script.diff | 7 ++++++- virtualbox.changes | 5 +++++ virtualbox.spec | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/vbox-vboxadd-init-script.diff b/vbox-vboxadd-init-script.diff index e447b38..43a6ffa 100644 --- a/vbox-vboxadd-init-script.diff +++ b/vbox-vboxadd-init-script.diff @@ -16,7 +16,7 @@ Index: VirtualBox-5.1.22/src/VBox/Additions/linux/installer/vboxadd.sh ### END INIT INFO ## @todo This file duplicates a lot of script with vboxdrv.sh. When making -@@ -108,7 +111,6 @@ fail() +@@ -108,11 +111,10 @@ fail() dev=/dev/vboxguest userdev=/dev/vboxuser @@ -24,6 +24,11 @@ Index: VirtualBox-5.1.22/src/VBox/Additions/linux/installer/vboxadd.sh owner=vboxadd group=1 +-if test -r $config; then ++if [[ -r $config ]] ; then + . $config + else + fail "Configuration file $config not found" @@ -162,12 +164,6 @@ do_vboxguest_non_udev() fail "Cannot create device $dev with major $maj and minor $min" } diff --git a/virtualbox.changes b/virtualbox.changes index b47fbab..c51a138 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Jun 10 13:19:05 UTC 2017 - Larry.Finger@lwfinger.net + +- Add installation of package "net-tools-deprecated" as requested in boo#1027742. + ------------------------------------------------------------------- Thu Jun 8 17:37:35 UTC 2017 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index c57f10d..ac131a6 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -173,6 +173,7 @@ BuildRequires: pkgconfig(xrandr) Requires: %{name}-host-kmp = %{version} Requires(post): sysvinit(syslog) Requires(pre): permissions +Requires(pre): net-tools-deprecated Requires(pre): pwdutils Requires(pre): %insserv_prereq Requires(pre): %fillup_prereq @@ -269,6 +270,7 @@ Supplements: modalias(pci:v000080EEd0000BEEFsv*sd*bc*sc*i*) Provides: %{name}-ose-guest-tools = %{version} Obsoletes: %{name}-ose-guest-tools < %{version} Requires(pre): %insserv_prereq +Requires(pre): net-tools-deprecated %description guest-tools VirtualBox guest addition tools. From 87881b07fc6701cd938bd49b5f30616d8f886ec1b2b5c4585138e60a5d9c79d8 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 21 Jun 2017 16:57:21 +0000 Subject: [PATCH 04/12] - Now that kernel:HEAD:standard has changed to version 4.12.0-rcX, the VB drivers need some changes for new API's. File "vbox_fix_for_kernel_4.12.patch" is added. The added installation of "net-tools-deprecated" broke builds for Leap 42.3. That change is now conditional on building for Factory. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=338 --- vbox_fix_for_kernel_4.12.patch | 108 +++++++++++++++++++++++++++++++++ virtualbox.changes | 6 ++ virtualbox.spec | 5 ++ 3 files changed, 119 insertions(+) create mode 100644 vbox_fix_for_kernel_4.12.patch diff --git a/vbox_fix_for_kernel_4.12.patch b/vbox_fix_for_kernel_4.12.patch new file mode 100644 index 0000000..5ed9f28 --- /dev/null +++ b/vbox_fix_for_kernel_4.12.patch @@ -0,0 +1,108 @@ +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c +@@ -1397,7 +1397,7 @@ RTDECL(int) SUPR0Printf(const char *pszF + SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void) + { + uint32_t fFlags = 0; +-#ifdef CONFIG_PAX_KERNEXEC ++#if defined(CONFIG_PAX_KERNEXEC) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + fFlags |= SUPKERNELFEATURES_GDT_READ_ONLY; + #endif + #if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV) +Index: VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c ++++ VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +@@ -36,6 +36,9 @@ + #include + #include "r0drv/alloc-r0drv.h" + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#include ++#endif + + #if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP) + # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) +Index: VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c ++++ VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +@@ -899,6 +899,9 @@ static struct page *rtR0MemObjLinuxVirtT + unsigned long pfn; + struct page *pPage; + pte_t *pEntry; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ p4d_t p4d; ++#endif + union + { + pgd_t Global; +@@ -917,9 +920,18 @@ static struct page *rtR0MemObjLinuxVirtT + u.Global = *pgd_offset(current->active_mm, ulAddr); + if (RT_UNLIKELY(pgd_none(u.Global))) + return NULL; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ p4d = *p4d_offset(&u.Global, ulAddr); ++ if (RT_UNLIKELY(p4d_none(p4d) || p4d_large(p4d) || !p4d_present(p4d))) ++ return NULL; ++#endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ u.Upper = *pud_offset(&p4d, ulAddr); ++#else + u.Upper = *pud_offset(&u.Global, ulAddr); ++#endif + if (RT_UNLIKELY(pud_none(u.Upper))) + return NULL; + # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +@@ -1463,13 +1475,23 @@ static int rtR0MemObjLinuxFixPte(struct + { + int rc = -ENOMEM; + pgd_t *pgd; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ p4d_t *p4d; ++#endif + + spin_lock(&mm->page_table_lock); + + pgd = pgd_offset(mm, ulAddr); + if (!pgd_none(*pgd) && !pgd_bad(*pgd)) + { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ p4d = p4d_offset(*pgd, ulAddr); ++ if (p4d_none(*p4d)) ++ goto exit; ++ pmd_t *pmd = pmd_offset(p4d, ulAddr); ++#else + pmd_t *pmd = pmd_offset(pgd, ulAddr); ++#endif + if (!pmd_none(*pmd)) + { + pte_t *ptep = pte_offset_map(pmd, ulAddr); +@@ -1487,6 +1509,9 @@ static int rtR0MemObjLinuxFixPte(struct + } + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++exit: ++#endif + spin_unlock(&mm->page_table_lock); + return rc; + } +Index: VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h ++++ VirtualBox-5.1.22/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h +@@ -320,6 +320,9 @@ DECLINLINE(unsigned long) msecs_to_jiffi + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#include ++#endif + # define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages) + # define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages) + #else diff --git a/virtualbox.changes b/virtualbox.changes index c51a138..7c2528a 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Jun 21 16:46:48 UTC 2017 - Larry.Finger@lwfinger.net + +- Now that kernel:HEAD:standard has changed to version 4.12.0-rcX, the VB drivers need some changes for new API's. + File "vbox_fix_for_kernel_4.12.patch" is added. + The added installation of "net-tools-deprecated" broke builds for Leap 42.3. That change is now conditional on building for Factory. +------------------------------------------------------------------- Sat Jun 10 13:19:05 UTC 2017 - Larry.Finger@lwfinger.net - Add installation of package "net-tools-deprecated" as requested in boo#1027742. diff --git a/virtualbox.spec b/virtualbox.spec index ac131a6..3fe90ac 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -101,6 +101,8 @@ Patch114: vbox_fix_42.3_api.patch Patch115: vbox_fix_for_gcc7.patch # Fix for missing include needed for server 1.19 Patch116: Fix_for_server_1.19.patch +# Fix for kernel 4.12 API changes +Patch117: vbox_fix_for_kernel_4.12.patch # BuildRequires: LibVNCServer-devel BuildRequires: SDL-devel @@ -173,7 +175,9 @@ BuildRequires: pkgconfig(xrandr) Requires: %{name}-host-kmp = %{version} Requires(post): sysvinit(syslog) Requires(pre): permissions +%if 0%{?suse_version} > 1320 Requires(pre): net-tools-deprecated +%endif Requires(pre): pwdutils Requires(pre): %insserv_prereq Requires(pre): %fillup_prereq @@ -377,6 +381,7 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL. %endif %patch115 -p1 %patch116 -p1 +%patch117 -p1 #copy user manual cp %{SOURCE1} UserManual.pdf From 7748557e4a3a6144dda067dd57be5881d608cd7d58df4f209f176cf6ff3f5c64 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 21 Jun 2017 17:07:17 +0000 Subject: [PATCH 05/12] OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=339 --- virtualbox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualbox.spec b/virtualbox.spec index 3fe90ac..fbf5cf1 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -548,7 +548,7 @@ ln -s %{_sysconfdir}/init.d/vboxadd-service %{buildroot}%{_sbindir}/rcvboxadd-se # udev rule for guest (virtualbox-guest-tools) install -m 644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/60-vboxguest.rules # /media is used for auto-mounting of shared folders -%if 0%{?suse_version} > 1310 +%if 0%{?suse_version} > 1320 install -d -m 755 %{buildroot}/media %endif # From 79cdaa4a0418ee56460542b927a9db4d9e48a00cb4906142d3a4a772a87bd4cb Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 25 Jun 2017 00:21:46 +0000 Subject: [PATCH 06/12] - Fix some typos in the various service files as noted in boo#1044931. With these fixes, TW guests start correctly. In addition, the /sbin/vboxconfig (for hosts) and the /sbin/vboxguestconfig (for guests) work correctly. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=340 --- vboxconfig.sh | 2 +- vboxguestconfig.sh | 6 +++--- virtualbox.changes | 7 +++++++ virtualbox.spec | 10 +++++----- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/vboxconfig.sh b/vboxconfig.sh index 595af6f..1cd5d4c 100644 --- a/vboxconfig.sh +++ b/vboxconfig.sh @@ -5,7 +5,7 @@ # # This script is part of the openSUSE VirtualBox package # -SOURCE="/usr/src/kernel-modules/virtualbox" +SOURCE="/usr/src/kernel-modules/virtualbox/src" LOGFILE="/var/log/virtualbox.log" INCLUDE="/lib/modules/`uname -r`/build/include" diff --git a/vboxguestconfig.sh b/vboxguestconfig.sh index 9944d62..ba789c3 100644 --- a/vboxguestconfig.sh +++ b/vboxguestconfig.sh @@ -5,7 +5,7 @@ # # This script is part of the openSUSE VirtualBox package # -SOURCE="/usr/src/kernel-modules/virtualbox" +SOURCE="/usr/src/kernel-modules" LOGFILE="/var/log/virtualbox.log" INCLUDE="/lib/modules/`uname -r`/build/include" @@ -21,7 +21,7 @@ fi # Prerequisites are available, start build pushd $SOURCE > /dev/null 2>&1 echo "Building kernel modules..." -tar jxf guest_src.tar.bz2 > /dev/null 2>&1 +tar jxf additions/guest_src.tar.bz2 > /dev/null 2>&1 cd additions/src make > $LOGFILE 2>&1 if [ ! $? ] ; then @@ -44,7 +44,7 @@ fi depmod -a modprobe -av vboxguest vboxvideo vboxsf cd ../.. -rm -rf additions +rm -rf additions/src popd > /dev/null 2>&1 echo "Kernel modules are installed and loaded." exit 0 diff --git a/virtualbox.changes b/virtualbox.changes index 7c2528a..a74fa5d 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Jun 25 00:20:08 UTC 2017 - Larry.Finger@lwfinger.net + +- Fix some typos in the various service files as noted in boo#1044931. + With these fixes, TW guests start correctly. In addition, the /sbin/vboxconfig (for hosts) and the + /sbin/vboxguestconfig (for guests) work correctly. + ------------------------------------------------------------------- Wed Jun 21 16:46:48 UTC 2017 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index fbf5cf1..72ea665 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -175,7 +175,7 @@ BuildRequires: pkgconfig(xrandr) Requires: %{name}-host-kmp = %{version} Requires(post): sysvinit(syslog) Requires(pre): permissions -%if 0%{?suse_version} > 1320 +%if ! 0%{?suse_version} > 1325 Requires(pre): net-tools-deprecated %endif Requires(pre): pwdutils @@ -635,15 +635,15 @@ install -m 744 src/VBox/Installer/linux/vboxdrv.sh %{buildroot}%{_sysconfdir}/in ln -s %{_sysconfdir}/init.d/vboxdrv %{buildroot}%{_sbindir}/rcvboxdrv # Service files to load kernel modules on boot install -m 0644 %{SOURCE14} %{buildroot}%{_unitdir}/vboxdrv.service -install -m 0644 %{SOURCE14} %{buildroot}%{_unitdir}/multi-user.target.wants/vboxdrv.service install -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/vboxadd-service.service -install -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/multi-user.target.wants/vboxadd-service.service -install -m 0644 %{SOURCE16} %{buildroot}/sbin/vboxconfig -install -m 0644 %{SOURCE17} %{buildroot}/sbin/vboxguestconfig +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 # Init script to start virtual boxes during boot install -m 755 %{SOURCE12} %{buildroot}%{_sysconfdir}/init.d/vboxes ln -s %{_sysconfdir}/init.d/vboxes %{buildroot}%{_sbindir}/rcvboxes +ln -sf %{_unitdir}/vboxdrv.service %{buildroot}%{_unitdir}/multi-user.target.wants/vboxdrv.service +ln -sf %{_unitdir}/vboxadd-service.service %{buildroot}%{_unitdir}/multi-user.target.wants/vboxadd-service.service # sysconfig file intended for vboxes script install -d -m 755 %{buildroot}%{_var}/adm/fillup-templates install -m 640 %{SOURCE13} %{buildroot}%{_var}/adm/fillup-templates/sysconfig.vbox From f3820cb7d9018221d40764bdd4c75feaaeb043a4c9afa2d5be7c2e54a48e9fdc Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 25 Jun 2017 17:11:33 +0000 Subject: [PATCH 07/12] - Fix logic error in scripts to build kernel modules locally - see bnc#1042726. Temporarily remove "requires" for net-tools-deprecated so that Leap 42.3 will build. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=341 --- vboxconfig.sh | 17 ++++++++++++----- vboxguestconfig.sh | 18 ++++++++++++------ virtualbox.changes | 6 ++++++ virtualbox.spec | 6 +++--- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/vboxconfig.sh b/vboxconfig.sh index 1cd5d4c..5f3ebe5 100644 --- a/vboxconfig.sh +++ b/vboxconfig.sh @@ -1,4 +1,4 @@ -#!/bin/bash +!/bin/bash # # Script to build VirtualBox host kernel modules # Copyright C 2017 by Larry Finger @@ -8,12 +8,19 @@ SOURCE="/usr/src/kernel-modules/virtualbox/src" LOGFILE="/var/log/virtualbox.log" INCLUDE="/lib/modules/`uname -r`/build/include" - +# +# Test if vboxpci module loaded. If it is, skip everything else +loaded=$(lsmod | grep vboxpci) +if [ -n "$loaded" ] ; then + echo "Kernel modules available - exiting..." + exit 0 +fi +# # Force installation of VB host sources. Zypper will install all the prerequisies echo "Installing all required packages..." killproc PackageKit zypper install -y virtualbox-host-source > /dev/null 2>&1 -if [ ! $? ] ; then +if [ "$?" -ne 0 ] ; then echo "Installation of required packages failed." echo "Use 'sudo zypper install virtualbox-host-source' to see the reason." exit 1 @@ -22,7 +29,7 @@ fi pushd $SOURCE > /dev/null 2>&1 echo "Building kernel modules..." make > $LOGFILE 2>&1 -if [ ! $? ] ; then +if [ "$?" -ne 0 ] ; then echo "" echo "Build of VirtualBox host kernel modules failed." echo "Look at $LOGFILE to find reasons." @@ -32,7 +39,7 @@ else echo "Kernel modules built correctly. They will now be installed." fi make install >> $LOGFILE 2>&1 -if [ ! $? ] ; then +if [ "$?" -ne 0 ] ; then echo "" echo "Installation of VirtualBox host kernel modules failed." echo "Look at $LOGFILE to find reasons." diff --git a/vboxguestconfig.sh b/vboxguestconfig.sh index ba789c3..299a080 100644 --- a/vboxguestconfig.sh +++ b/vboxguestconfig.sh @@ -8,12 +8,18 @@ SOURCE="/usr/src/kernel-modules" LOGFILE="/var/log/virtualbox.log" INCLUDE="/lib/modules/`uname -r`/build/include" - +# +# Test if vboxsf module loaded. If it is, skip everything else +loaded=$(lsmod | grep vboxsf) +if [ -n "$loaded" ] ; then + echo "Kernel modules available - exiting..." + exit 0 +fi # Force installation of VB guest sources. Zypper will install all the prerequisies echo "Installing all required packages..." killproc PackageKit zypper install -y virtualbox-guest-source > /dev/null 2>&1 -if [ ! $? ] ; then +if [ "$?" -ne 0 ] ; then echo "Installation of required packages failed." echo "Use 'sudo zypper install virtualbox-guest-source' to see the reason." exit 1 @@ -21,10 +27,10 @@ fi # Prerequisites are available, start build pushd $SOURCE > /dev/null 2>&1 echo "Building kernel modules..." -tar jxf additions/guest_src.tar.bz2 > /dev/null 2>&1 +tar jxf addition/guest_src.tar.bz2 > /dev/null 2>&1 cd additions/src make > $LOGFILE 2>&1 -if [ ! $? ] ; then +if [ "$?" -ne 0 ] ; then echo "" echo "Build of VirtualBox guest kernel modules failed." echo "Look at $LOGFILE to find reasons." @@ -34,7 +40,7 @@ else echo "Kernel modules built correctly. They will now be installed." fi make install >> $LOGFILE 2>&1 -if [ ! $? ] ; then +if [ "$?" -ne 0 ] ; then echo "" echo "Installation of VirtualBox guest kernel modules failed." echo "Look at $LOGFILE to find reasons." @@ -44,7 +50,7 @@ fi depmod -a modprobe -av vboxguest vboxvideo vboxsf cd ../.. -rm -rf additions/src +rm -rf additions popd > /dev/null 2>&1 echo "Kernel modules are installed and loaded." exit 0 diff --git a/virtualbox.changes b/virtualbox.changes index a74fa5d..ec47f1d 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Jun 25 17:09:01 UTC 2017 - Larry.Finger@lwfinger.net + +- Fix logic error in scripts to build kernel modules locally - see bnc#1042726. + Temporarily remove "requires" for net-tools-deprecated so that Leap 42.3 will build. + ------------------------------------------------------------------- Sun Jun 25 00:20:08 UTC 2017 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index 72ea665..ec5e4f0 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -175,9 +175,9 @@ BuildRequires: pkgconfig(xrandr) Requires: %{name}-host-kmp = %{version} Requires(post): sysvinit(syslog) Requires(pre): permissions -%if ! 0%{?suse_version} > 1325 -Requires(pre): net-tools-deprecated -%endif +#%if ! 0%{?suse_version} > 1325 +#Requires(pre): net-tools-deprecated +#%endif Requires(pre): pwdutils Requires(pre): %insserv_prereq Requires(pre): %fillup_prereq From bd0491518c851b5b3815be0c8867398b703c2a148a79d02b657bdc293a8729f2 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 25 Jun 2017 17:14:46 +0000 Subject: [PATCH 08/12] Fix "requires" for net-tools-deprecated so that Leap 42.3 will build. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=342 --- virtualbox.changes | 2 +- virtualbox.spec | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/virtualbox.changes b/virtualbox.changes index ec47f1d..8779755 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -2,7 +2,7 @@ Sun Jun 25 17:09:01 UTC 2017 - Larry.Finger@lwfinger.net - Fix logic error in scripts to build kernel modules locally - see bnc#1042726. - Temporarily remove "requires" for net-tools-deprecated so that Leap 42.3 will build. + Fix "requires" for net-tools-deprecated so that Leap 42.3 will build. ------------------------------------------------------------------- Sun Jun 25 00:20:08 UTC 2017 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index ec5e4f0..f98c8b9 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -175,9 +175,9 @@ BuildRequires: pkgconfig(xrandr) Requires: %{name}-host-kmp = %{version} Requires(post): sysvinit(syslog) Requires(pre): permissions -#%if ! 0%{?suse_version} > 1325 -#Requires(pre): net-tools-deprecated -#%endif +%if ! 0%{?suse_version} > 1325 +Requires(pre): net-tools-deprecated +%endif Requires(pre): pwdutils Requires(pre): %insserv_prereq Requires(pre): %fillup_prereq @@ -274,7 +274,9 @@ Supplements: modalias(pci:v000080EEd0000BEEFsv*sd*bc*sc*i*) Provides: %{name}-ose-guest-tools = %{version} Obsoletes: %{name}-ose-guest-tools < %{version} Requires(pre): %insserv_prereq +%if ! 0%{?suse_version} > 1325 Requires(pre): net-tools-deprecated +#endif %description guest-tools VirtualBox guest addition tools. From 7c7890c0c5a821a3eca86d6021c45fc6bf0eca26effa28112b31c27d49a0daa7 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 25 Jun 2017 17:20:00 +0000 Subject: [PATCH 09/12] Fix typo in above changes. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=343 --- virtualbox.changes | 1 + virtualbox.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/virtualbox.changes b/virtualbox.changes index 8779755..084862b 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -3,6 +3,7 @@ Sun Jun 25 17:09:01 UTC 2017 - Larry.Finger@lwfinger.net - Fix logic error in scripts to build kernel modules locally - see bnc#1042726. Fix "requires" for net-tools-deprecated so that Leap 42.3 will build. + Fix typo in above changes. ------------------------------------------------------------------- Sun Jun 25 00:20:08 UTC 2017 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index f98c8b9..cf526af 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -276,7 +276,7 @@ Obsoletes: %{name}-ose-guest-tools < %{version} Requires(pre): %insserv_prereq %if ! 0%{?suse_version} > 1325 Requires(pre): net-tools-deprecated -#endif +endif %description guest-tools VirtualBox guest addition tools. From 5f4d3deb2dda20c736c803ce04bbae74024c849788bfb857ffd50aa0db8b03cd Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 25 Jun 2017 18:06:27 +0000 Subject: [PATCH 10/12] OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=344 --- virtualbox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualbox.spec b/virtualbox.spec index cf526af..072de9b 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -276,7 +276,7 @@ Obsoletes: %{name}-ose-guest-tools < %{version} Requires(pre): %insserv_prereq %if ! 0%{?suse_version} > 1325 Requires(pre): net-tools-deprecated -endif +%endif %description guest-tools VirtualBox guest addition tools. From e2652713d3036a8fed9b954fb1eaf8e65c7f7ddad99eddd6321b97b9b1bb5d4d Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 25 Jun 2017 23:44:07 +0000 Subject: [PATCH 11/12] Fix missing /media for Leap 42.3. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=345 --- virtualbox.changes | 1 + virtualbox.spec | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/virtualbox.changes b/virtualbox.changes index 084862b..5d24935 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -3,6 +3,7 @@ Sun Jun 25 17:09:01 UTC 2017 - Larry.Finger@lwfinger.net - Fix logic error in scripts to build kernel modules locally - see bnc#1042726. Fix "requires" for net-tools-deprecated so that Leap 42.3 will build. + Fix missing /media for Leap 42.3. Fix typo in above changes. ------------------------------------------------------------------- diff --git a/virtualbox.spec b/virtualbox.spec index 072de9b..c46d06f 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -550,7 +550,7 @@ ln -s %{_sysconfdir}/init.d/vboxadd-service %{buildroot}%{_sbindir}/rcvboxadd-se # udev rule for guest (virtualbox-guest-tools) install -m 644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/60-vboxguest.rules # /media is used for auto-mounting of shared folders -%if 0%{?suse_version} > 1320 +%if 0%{?suse_version} > 1320 || 0%{?sle_version} == 120300 install -d -m 755 %{buildroot}/media %endif # @@ -927,7 +927,7 @@ export DISABLE_RESTART_ON_UPDATE=yes %{_unitdir}/multi-user.target.wants/vboxadd-service.service %{_sbindir}/rcvboxadd %{_sbindir}/rcvboxadd-service -%if 0%{?suse_version} > 1310 +%if 0%{?suse_version} > 1320 || 0%{?sle_version} == 120300 %dir /media %endif From 5217fddc80c754cc447815aa568dc618988314a2c2ebb58ecf1fb8c8a5010da4 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 30 Jun 2017 00:57:32 +0000 Subject: [PATCH 12/12] - Fix missing global for 32-bit version with gcc7. (bsc#1046571). Fix missing frame buffer cleanup - private communication from Oracle - adds file "fix_KMS_support.patch". OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=346 --- fix_KMS_support.patch | 14 +++ vbox_fix_for_gcc7.patch | 248 ++++++++++++++++++++++++++++++++++++++++ vboxconfig.sh | 2 +- virtualbox.changes | 6 + virtualbox.spec | 3 + 5 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 fix_KMS_support.patch diff --git a/fix_KMS_support.patch b/fix_KMS_support.patch new file mode 100644 index 0000000..c5d39c9 --- /dev/null +++ b/fix_KMS_support.patch @@ -0,0 +1,14 @@ +Index: VirtualBox-5.1.22/src/VBox/Additions/linux/drm/vbox_fb.c +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Additions/linux/drm/vbox_fb.c ++++ VirtualBox-5.1.22/src/VBox/Additions/linux/drm/vbox_fb.c +@@ -409,6 +409,9 @@ static void vbox_fbdev_destroy(struct dr + LogFunc(("vboxvideo: %d\n", __LINE__)); + if (fbdev->helper.fbdev) { + info = fbdev->helper.fbdev; ++#ifdef CONFIG_FB_DEFERRED_IO ++ fb_deferred_io_cleanup(info); ++#endif + unregister_framebuffer(info); + if (info->cmap.len) + fb_dealloc_cmap(&info->cmap); diff --git a/vbox_fix_for_gcc7.patch b/vbox_fix_for_gcc7.patch index e4cd3ae..bfd7287 100644 --- a/vbox_fix_for_gcc7.patch +++ b/vbox_fix_for_gcc7.patch @@ -25,3 +25,251 @@ Index: VirtualBox-5.1.22/src/VBox/Devices/PC/ipxe/src/arch/i386/interface/pxe/px } /* PXENV_START_UNDI +Index: VirtualBox-5.1.22/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest ++++ VirtualBox-5.1.22/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest +@@ -54,6 +54,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uint64.h=>include/iprt/uint64.h \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \ +@@ -113,6 +114,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/qdivrem.c=>common/math/gcc/qdivrem.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/quad.h=>common/math/gcc/quad.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivdi3.c=>common/math/gcc/udivdi3.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivmoddi4.c=>common/math/gcc/udivmoddi4.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/umoddi3.c=>common/math/gcc/umoddi3.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \ +Index: VirtualBox-5.1.22/src/VBox/Additions/common/VBoxGuest/linux/Makefile +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Additions/common/VBoxGuest/linux/Makefile ++++ VirtualBox-5.1.22/src/VBox/Additions/common/VBoxGuest/linux/Makefile +@@ -100,6 +100,7 @@ MOD_OBJS += \ + common/math/gcc/divdi3.o \ + common/math/gcc/moddi3.o \ + common/math/gcc/udivdi3.o \ ++ common/math/gcc/udivmoddi4.o \ + common/math/gcc/umoddi3.o \ + common/math/gcc/qdivrem.o + endif +Index: VirtualBox-5.1.22/src/VBox/Additions/linux/sharedfolders/files_vboxsf +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Additions/linux/sharedfolders/files_vboxsf ++++ VirtualBox-5.1.22/src/VBox/Additions/linux/sharedfolders/files_vboxsf +@@ -38,6 +38,7 @@ FILES_VBOXSF_NOBIN=" \ + ${PATH_ROOT}/include/iprt/string.h=>include/iprt/string.h \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uint64.h=>include/iprt/uint64.h \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \ +@@ -73,6 +74,7 @@ FILES_VBOXSF_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/qdivrem.c=>qdivrem.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/quad.h=>quad.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivdi3.c=>udivdi3.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivmoddi4.c=>udivmoddi4.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/umoddi3.c=>umoddi3.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h=>r0drv/linux/the-linux-kernel.h \ + ${PATH_ROOT}/src/VBox/Additions/linux/sharedfolders/Makefile.module=>Makefile \ +Index: VirtualBox-5.1.22/src/VBox/Additions/linux/sharedfolders/Makefile.module +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/Additions/linux/sharedfolders/Makefile.module ++++ VirtualBox-5.1.22/src/VBox/Additions/linux/sharedfolders/Makefile.module +@@ -38,6 +38,7 @@ MOD_OBJS += \ + divdi3.o \ + moddi3.o \ + udivdi3.o \ ++ udivmoddi4.o \ + umoddi3.o \ + qdivrem.o + endif +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/Support/linux/files_vboxdrv +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/Support/linux/files_vboxdrv ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/Support/linux/files_vboxdrv +@@ -65,6 +65,7 @@ FILES_VBOXDRV_NOBIN=" \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ + ${PATH_ROOT}/include/iprt/uint128.h=>include/iprt/uint128.h \ ++ ${PATH_ROOT}/include/iprt/uint64.h=>include/iprt/uint64.h \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ +@@ -109,6 +110,7 @@ FILES_VBOXDRV_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/qdivrem.c=>math/gcc/qdivrem.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/quad.h=>math/gcc/quad.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivdi3.c=>math/gcc/udivdi3.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivmoddi4.c=>math/gcc/udivmoddi4.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/umoddi3.c=>math/gcc/umoddi3.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \ +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/Support/linux/Makefile +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/Support/linux/Makefile ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/Support/linux/Makefile +@@ -158,6 +158,7 @@ OBJS += math/gcc/divdi3.o \ + math/gcc/moddi3.o \ + math/gcc/qdivrem.o \ + math/gcc/udivdi3.o \ ++ math/gcc/udivmoddi4.o \ + math/gcc/divdi3.o \ + math/gcc/umoddi3.o + endif +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp +@@ -49,6 +49,7 @@ VBOX_VBOXNETADP_SOURCES=" \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uint64.h=>include/iprt/uint64.h \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ +@@ -70,6 +71,7 @@ VBOX_VBOXNETADP_SOURCES=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/qdivrem.c=>math/gcc/qdivrem.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/quad.h=>math/gcc/quad.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivdi3.c=>math/gcc/udivdi3.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivmoddi4.c=>math/gcc/udivmoddi4.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/umoddi3.c=>math/gcc/umoddi3.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \ +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile +@@ -68,6 +68,7 @@ OBJS += math/gcc/divdi3.o \ + math/gcc/moddi3.o \ + math/gcc/qdivrem.o \ + math/gcc/udivdi3.o \ ++ math/gcc/udivmoddi4.o \ + math/gcc/divdi3.o \ + math/gcc/umoddi3.o + endif +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt +@@ -49,6 +49,7 @@ VBOX_VBOXNETFLT_SOURCES=" \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uint64.h=>include/iprt/uint64.h \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ +@@ -77,6 +78,7 @@ VBOX_VBOXNETFLT_SOURCES=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/qdivrem.c=>math/gcc/qdivrem.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/quad.h=>math/gcc/quad.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivdi3.c=>math/gcc/udivdi3.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivmoddi4.c=>math/gcc/udivmoddi4.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/umoddi3.c=>math/gcc/umoddi3.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h=>r0drv/linux/the-linux-kernel.h \ + ${PATH_OUT}/version-generated.h=>version-generated.h \ +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile +@@ -72,6 +72,7 @@ OBJS += math/gcc/divdi3.o \ + math/gcc/moddi3.o \ + math/gcc/qdivrem.o \ + math/gcc/udivdi3.o \ ++ math/gcc/udivmoddi4.o \ + math/gcc/divdi3.o \ + math/gcc/umoddi3.o + endif +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci +@@ -48,6 +48,7 @@ VBOX_VBOXPCI_SOURCES=" \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uint64.h=>include/iprt/uint64.h \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ +@@ -75,6 +76,7 @@ VBOX_VBOXPCI_SOURCES=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/qdivrem.c=>math/gcc/qdivrem.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/quad.h=>math/gcc/quad.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivdi3.c=>math/gcc/udivdi3.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/udivmoddi4.c=>math/gcc/udivmoddi4.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/umoddi3.c=>math/gcc/umoddi3.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h=>r0drv/linux/the-linux-kernel.h \ + ${PATH_OUT}/version-generated.h=>version-generated.h \ +Index: VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxPci/linux/Makefile +=================================================================== +--- VirtualBox-5.1.22.orig/src/VBox/HostDrivers/VBoxPci/linux/Makefile ++++ VirtualBox-5.1.22/src/VBox/HostDrivers/VBoxPci/linux/Makefile +@@ -72,6 +72,7 @@ OBJS += math/gcc/divdi3.o \ + math/gcc/moddi3.o \ + math/gcc/qdivrem.o \ + math/gcc/udivdi3.o \ ++ math/gcc/udivmoddi4.o \ + math/gcc/divdi3.o \ + math/gcc/umoddi3.o + endif +Index: VirtualBox-5.1.22/src/VBox/Runtime/common/math/gcc/udivmoddi4.c +=================================================================== +--- /dev/null ++++ VirtualBox-5.1.22/src/VBox/Runtime/common/math/gcc/udivmoddi4.c +@@ -0,0 +1,51 @@ ++/* $Id$ */ ++/** @file ++ * IPRT - __udivmoddi4 implementation ++ */ ++ ++/* ++ * Copyright (C) 2006-2016 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. ++ * ++ * The contents of this file may alternatively be used under the terms ++ * of the Common Development and Distribution License Version 1.0 ++ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the ++ * VirtualBox OSE distribution, in which case the provisions of the ++ * CDDL are applicable instead of those of the GPL. ++ * ++ * You may elect to license modified versions of this file under the ++ * terms and conditions of either the GPL or the CDDL or both. ++ */ ++ ++#include ++#include ++ ++/** ++ * __udivmoddi4() implementation to satisfy external references from 32-bit ++ * code generated by gcc-7 or later. ++ * ++ * @param u64A The divident value. ++ * @param u64B The divisor value. ++ * @param pu64R A pointer to the reminder. May be NULL. ++ * @returns u64A / u64B ++ */ ++uint64_t __udivmoddi4(uint64_t u64A, uint64_t u64B, uint64_t *pu64R) ++{ ++ RTUINT64U Divident; ++ RTUINT64U Divisor; ++ RTUINT64U Quotient; ++ RTUINT64U Reminder; ++ Divident.u = u64A; ++ Divisor.u = u64B; ++ RTUInt64DivRem(&Quotient, &Reminder, &Divident, &Divisor); ++ if (pu64R) ++ *pu64R = Reminder.u; ++ return Quotient.u; ++} diff --git a/vboxconfig.sh b/vboxconfig.sh index 5f3ebe5..7ca30d4 100644 --- a/vboxconfig.sh +++ b/vboxconfig.sh @@ -1,4 +1,4 @@ -!/bin/bash +#!/bin/bash # # Script to build VirtualBox host kernel modules # Copyright C 2017 by Larry Finger diff --git a/virtualbox.changes b/virtualbox.changes index 5d24935..d44835d 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 30 00:50:42 UTC 2017 - Larry.Finger@lwfinger.net + +- Fix missing global for 32-bit version with gcc7. (bsc#1046571). + Fix missing frame buffer cleanup - private communication from Oracle - adds file "fix_KMS_support.patch". + ------------------------------------------------------------------- Sun Jun 25 17:09:01 UTC 2017 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index c46d06f..eeb5d12 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -103,6 +103,8 @@ Patch115: vbox_fix_for_gcc7.patch Patch116: Fix_for_server_1.19.patch # Fix for kernel 4.12 API changes Patch117: vbox_fix_for_kernel_4.12.patch +# Fix for missing cleanup in KMS support +Patch118: fix_KMS_support.patch # BuildRequires: LibVNCServer-devel BuildRequires: SDL-devel @@ -384,6 +386,7 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL. %patch115 -p1 %patch116 -p1 %patch117 -p1 +%patch118 -p1 #copy user manual cp %{SOURCE1} UserManual.pdf