From 5ebf5a7f37805ace3de7972d437523f016a6342834397b5c03cdbbec613ad1fe Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 8 Mar 2017 21:20:56 +0000 Subject: [PATCH] - Fix API changes for kernel 4.11. This change adds file "vbox_fix_4.11_api_changes.patch". Make some changes to various script files to remove reference to run level 4, which is not used. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=316 --- vbox-vboxadd-init-script.diff | 78 ++++++++++++++++++ vbox_fix_4.11_api_changes.patch | 139 ++++++++++++++++++++++++++++++++ virtualbox.changes | 6 ++ virtualbox.spec | 3 + 4 files changed, 226 insertions(+) create mode 100644 vbox_fix_4.11_api_changes.patch diff --git a/vbox-vboxadd-init-script.diff b/vbox-vboxadd-init-script.diff index c2600aa..023805d 100644 --- a/vbox-vboxadd-init-script.diff +++ b/vbox-vboxadd-init-script.diff @@ -183,3 +183,81 @@ Index: VirtualBox-5.1.14/src/VBox/Additions/linux/installer/vboxadd.sh rm -f /etc/kernel/postinst.d/vboxadd /etc/kernel/prerm.d/vboxadd rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null +Index: VirtualBox-5.1.14/src/VBox/Additions/linux/installer/vboxadd-service.sh +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Additions/linux/installer/vboxadd-service.sh ++++ VirtualBox-5.1.14/src/VBox/Additions/linux/installer/vboxadd-service.sh +@@ -20,7 +20,7 @@ + # Provides: vboxadd-service + # Required-Start: vboxadd + # Required-Stop: vboxadd +-# Default-Start: 2 3 4 5 ++# Default-Start: 2 3 5 + # Default-Stop: 0 1 6 + # Description: VirtualBox Additions Service + ### END INIT INFO +Index: VirtualBox-5.1.14/src/VBox/Installer/linux/vboxautostart-service.sh +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Installer/linux/vboxautostart-service.sh ++++ VirtualBox-5.1.14/src/VBox/Installer/linux/vboxautostart-service.sh +@@ -20,7 +20,7 @@ + # Provides: vboxautostart-service + # Required-Start: vboxdrv + # Required-Stop: vboxdrv +-# Default-Start: 2 3 4 5 ++# Default-Start: 2 3 5 + # Default-Stop: 0 1 6 + # Description: VirtualBox autostart service + ### END INIT INFO +Index: VirtualBox-5.1.14/src/VBox/Installer/linux/vboxballoonctrl-service.sh +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Installer/linux/vboxballoonctrl-service.sh ++++ VirtualBox-5.1.14/src/VBox/Installer/linux/vboxballoonctrl-service.sh +@@ -20,7 +20,7 @@ + # Provides: vboxballoonctrl-service + # Required-Start: vboxdrv + # Required-Stop: vboxdrv +-# Default-Start: 2 3 4 5 ++# Default-Start: 2 3 5 + # Default-Stop: 0 1 6 + # Description: VirtualBox watchdog daemon + ### END INIT INFO +Index: VirtualBox-5.1.14/src/VBox/ValidationKit/testboxscript/linux/testboxscript-service.sh +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/ValidationKit/testboxscript/linux/testboxscript-service.sh ++++ VirtualBox-5.1.14/src/VBox/ValidationKit/testboxscript/linux/testboxscript-service.sh +@@ -31,7 +31,7 @@ + # Provides: testboxscript-service + # Required-Start: $network + # Required-Stop: +-# Default-Start: 2 3 4 5 ++# Default-Start: 2 3 5 + # Default-Stop: 0 1 6 + # Description: TestBoxScript service + ### END INIT INFO +Index: VirtualBox-5.1.14/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs-nat.sh +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs-nat.sh ++++ VirtualBox-5.1.14/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs-nat.sh +@@ -31,7 +31,7 @@ + # Provides: vboxtxs + # Required-Start: $network + # Required-Stop: +-# Default-Start: 2 3 4 5 ++# Default-Start: 2 3 5 + # Default-Stop: 0 1 6 + # Description: VirtualBox Test Execution Service + ### END INIT INFO +Index: VirtualBox-5.1.14/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh ++++ VirtualBox-5.1.14/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh +@@ -31,7 +31,7 @@ + # Provides: vboxtxs + # Required-Start: $network + # Required-Stop: +-# Default-Start: 2 3 4 5 ++# Default-Start: 2 3 5 + # Default-Stop: 0 1 6 + # Description: VirtualBox Test Execution Service + ### END INIT INFO diff --git a/vbox_fix_4.11_api_changes.patch b/vbox_fix_4.11_api_changes.patch new file mode 100644 index 0000000..543cced --- /dev/null +++ b/vbox_fix_4.11_api_changes.patch @@ -0,0 +1,139 @@ +Index: VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c ++++ VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c +@@ -40,8 +40,9 @@ + #include + + #include "internal/magics.h" +- +- ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include ++#endif + /********************************************************************************************************************************* + * Structures and Typedefs * + *********************************************************************************************************************************/ +@@ -206,7 +207,7 @@ static int rtSemMutexLinuxRequestSleep(P + break; + + /* Go to sleep. */ +- set_task_state(pSelf, fInterruptible ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); ++ set_current_state(fInterruptible ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); + spin_unlock_irq(&pThis->Spinlock); + + lTimeout = schedule_timeout(lTimeout); +Index: VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c ++++ VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c +@@ -32,6 +32,9 @@ + #include "the-linux-kernel.h" + #include "internal/iprt.h" + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include ++#endif + + #include + #include +Index: VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c ++++ VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c +@@ -35,6 +35,10 @@ + #include + #include + #include "internal/thread.h" ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include ++#include ++#endif + + + RTDECL(RTTHREAD) RTThreadSelf(void) +Index: VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c ++++ VirtualBox-5.1.14/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c +@@ -38,11 +38,13 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include ++#endif + + #include "waitqueue-r0drv-linux.h" + #include "internal/magics.h" + +- + /********************************************************************************************************************************* + * Structures and Typedefs * + *********************************************************************************************************************************/ +Index: VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/utils.c +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Additions/linux/sharedfolders/utils.c ++++ VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/utils.c +@@ -290,8 +290,15 @@ sf_dentry_revalidate(struct dentry *dent + has inode at all) from these new attributes we derive [kstat] via + [generic_fillattr] */ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++int sf_getattr(const struct path *path, struct kstat *kstat, ++ u32 request_mask, unsigned int flags) ++{ ++ struct dentry *dentry = path->dentry; ++#else + int sf_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *kstat) + { ++#endif + int err; + + TRACE(); +Index: VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/vfsmod.h +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Additions/linux/sharedfolders/vfsmod.h ++++ VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/vfsmod.h +@@ -100,8 +100,13 @@ extern int sf_stat(const char *caller, + SHFLSTRING *path, PSHFLFSOBJINFO result, int ok_to_fail); + extern int sf_inode_revalidate(struct dentry *dentry); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) +-extern int sf_getattr(struct vfsmount *mnt, struct dentry *dentry, +- struct kstat *kstat); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++extern int sf_getattr(const struct path *path, struct kstat *kstat, ++ u32 request_mask, unsigned int flags); ++#else ++extern int sf_getattr(struct vfsmount *mnt, struct dentry *dentry, ++ struct kstat *kstat); ++#endif + extern int sf_setattr(struct dentry *dentry, struct iattr *iattr); + #endif + extern int sf_path_from_dentry(const char *caller, struct sf_glob_info *sf_g, +Index: VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/regops.c +=================================================================== +--- VirtualBox-5.1.14.orig/src/VBox/Additions/linux/sharedfolders/regops.c ++++ VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/regops.c +@@ -445,7 +445,11 @@ static int sf_reg_release(struct inode * + } + + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++static int sf_reg_fault(struct vm_fault *vmf) ++#else + static int sf_reg_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ++#endif + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) + static struct page *sf_reg_nopage(struct vm_area_struct *vma, unsigned long vaddr, int *type) + # define SET_TYPE(t) *type = (t) +@@ -459,6 +463,9 @@ static struct page *sf_reg_nopage(struct + loff_t off; + uint32_t nread = PAGE_SIZE; + int err; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ struct vm_area_struct *vma = vmf->vma; ++#endif + struct file *file = vma->vm_file; + struct inode *inode = GET_F_DENTRY(file)->d_inode; + struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb); diff --git a/virtualbox.changes b/virtualbox.changes index 61f4f0b..07ddb06 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 8 21:18:08 UTC 2017 - Larry.Finger@lwfinger.net + +- Fix API changes for kernel 4.11. This change adds file "vbox_fix_4.11_api_changes.patch". + Make some changes to various script files to remove reference to run level 4, which is not used. + ------------------------------------------------------------------- Sat Mar 4 05:00:03 UTC 2017 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index 976f763..69c9871 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -94,6 +94,8 @@ Patch113: vbox_remove_smp_mflags.patch Patch116: Fix_for_server_1.19.patch # Patch117: vbox_fix_4.10_api_changes.patch +# Fix kernel 4.11 API changes +Patch118: vbox_fix_4.11_api_changes.patch # BuildRequires: LibVNCServer-devel BuildRequires: SDL-devel @@ -338,6 +340,7 @@ This package contains icons for guest desktop files that were created on the des %patch113 -p1 %patch116 -p1 %patch117 -p1 +%patch118 -p1 #copy user manual cp %{SOURCE1} UserManual.pdf