Control: tags -1 + patch

Hi

The attached debdiff adds support to build and use virtualbox modules 
with linux kernel v3.6 and v3.7.

$ LANG= m-a --kvers-list $(uname -r) --kernel-dir 
/usr/src/linux-headers-$(uname -r)/ --userdir /tmp/pkg/ --text-mode build 
virtualbox-source
[…]
dpkg-deb: building package `virtualbox-modules-3.7-0.slh.3-aptosid-amd64' in 
`/tmp/pkg/virtualbox-modules-3.7-0.slh.3-aptosid-amd64_4.1.18-dfsg-1.1+c0.aptosid.2+3.7-3_amd64.deb'.
[…]
[ 5735.277075] vboxdrv: Found 2 processor cores.
[ 5735.278196] VBoxDrv: dbg - g_abExecMemory=ffffffffa08bef40
[ 5735.278225] vboxdrv: fAsync=1 offMin=0x2ae506 offMax=0x2ae506
[ 5735.279371] vboxdrv: TSC mode is 'asynchronous', kernel timer mode is 
'normal'.
[ 5735.279377] vboxdrv: Successfully loaded version 4.1.18_Debian (interface 
0x00190000).
[ 5735.337469] vboxpci: IOMMU not found (not registered)

$ LANG= m-a --kvers-list $(uname -r) --kernel-dir 
/usr/src/linux-headers-$(uname -r)/ --userdir /tmp/pkg/ --text-mode build 
virtualbox-guest-source
[…]
dpkg-deb: building package `virtualbox-guest-modules-3.7-0.slh.3-aptosid-amd64' 
in 
`/tmp/pkg/virtualbox-guest-modules-3.7-0.slh.3-aptosid-amd64_4.1.18-dfsg-1.1+c0.aptosid.2+3.7-3_amd64.deb'.
[…]

Regards
        Stefan Lippers-Hollmann
diff -Nru virtualbox-4.1.18-dfsg/debian/changelog virtualbox-4.1.18-dfsg/debian/changelog
--- virtualbox-4.1.18-dfsg/debian/changelog	2012-10-18 22:41:45.000000000 +0200
+++ virtualbox-4.1.18-dfsg/debian/changelog	2012-12-15 17:21:29.000000000 +0100
@@ -1,3 +1,11 @@
+virtualbox (4.1.18-dfsg-1.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * fix kernel module compilation against v3.6 and v3.7
+    (closes: #696011).
+
+ -- aptosid <aptosid@aptosid>  Sat, 15 Dec 2012 17:20:57 +0100
+
 virtualbox (4.1.18-dfsg-1.1) unstable; urgency=high
 
   * Non-maintainer upload.
diff -Nru virtualbox-4.1.18-dfsg/debian/patches/37-kcompat-3.6.patch virtualbox-4.1.18-dfsg/debian/patches/37-kcompat-3.6.patch
--- virtualbox-4.1.18-dfsg/debian/patches/37-kcompat-3.6.patch	1970-01-01 01:00:00.000000000 +0100
+++ virtualbox-4.1.18-dfsg/debian/patches/37-kcompat-3.6.patch	2012-12-15 17:15:33.000000000 +0100
@@ -0,0 +1,21 @@
+Description: Fix module FTBFS with kernel 3.6.
+Author: Stefan Lippers-Hollmann <s....@gmx.de>
+Bug-Debian: #696011
+
+partially backport upstream patches for kernel 3.6:
+
+r42784 | vboxsync | 2012-08-12 22:31:36 +0200 (So, 12. Aug 2012) | 2 Zeilen
+Linux 3.6-rc1 compile fix, spaces
+
+--- a/src/VBox/Additions/linux/drm/vboxvideo_drm.c
++++ b/src/VBox/Additions/linux/drm/vboxvideo_drm.c
+@@ -103,7 +103,9 @@ static struct drm_driver driver =
+ {
+     /* .driver_features = DRIVER_USE_MTRR, */
+     .load = vboxvideo_driver_load,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
+     .reclaim_buffers = drm_core_reclaim_buffers,
++#endif
+     /* As of Linux 2.6.37, always the internal functions are used. */
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 37) && !defined(DRM_RHEL61)
+     .get_map_ofs = drm_core_get_map_ofs,
diff -Nru virtualbox-4.1.18-dfsg/debian/patches/38-kcompat-3.7.patch virtualbox-4.1.18-dfsg/debian/patches/38-kcompat-3.7.patch
--- virtualbox-4.1.18-dfsg/debian/patches/38-kcompat-3.7.patch	1970-01-01 01:00:00.000000000 +0100
+++ virtualbox-4.1.18-dfsg/debian/patches/38-kcompat-3.7.patch	2012-12-15 15:57:37.000000000 +0100
@@ -0,0 +1,55 @@
+Description: Fix module FTBFS with kernel 3.7.
+Author: Stefan Lippers-Hollmann <s....@gmx.de>
+Bug-Debian: #696011
+
+backport upstream patches for kernel 3.7:
+
+r43637 | vboxsync | 2012-10-15 13:14:33 +0200 (Mo, 15. Okt 2012) | 2 Zeilen
+Linux 3.7 fixes
+
+r43674 | vboxsync | 2012-10-18 10:54:34 +0200 (Do, 18. Okt 2012) | 2 Zeilen
+configure: fix compilation test for Linux 3.7 headers
+
+--- a/Config.kmk
++++ b/Config.kmk
+@@ -2550,7 +2550,11 @@ if1of ($(KBUILD_TARGET), linux)
+                        $(kernelpath)/include/asm-x86/mach-default \
+                        $(kernelpath)/arch/x86/include \
+                        $(kernelpath)/arch/x86/include/asm/mach-default \
++                       $(kernelpath)/arch/x86/include/uapi \
+                        $(kernelpath)/arch/x86/include/generated \
++                       $(kernelpath)/arch/x86/include/generated/uapi \
++                       $(kernelpath)/include/uapi \
++                       $(kernelpath)/include/generated/uapi \
+                        $(kernelpath)/include
+   endif
+  endif
+--- a/configure
++++ b/configure
+@@ -1614,7 +1614,8 @@ EOF
+   cat $ODIR.tmp_src.c >> $LOG
+   echo "using the following command line:" >> $LOG
+   echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
+-  $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
++  $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include \
++      -I$LINUX/include/generated/uapi >> $LOG 2>&1
+   if [ $? -ne 0 ]; then
+     echo
+     echo "  Linux kernel headers not found at $LINUX"
+--- a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
++++ b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+@@ -1448,7 +1448,13 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(
+ 
+ #if   defined(VBOX_USE_INSERT_PAGE) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+                     rc = vm_insert_page(vma, ulAddrCur, pMemLnxToMap->apPages[iPage]);
+-                    vma->vm_flags |= VM_RESERVED; /* This flag helps making 100% sure some bad stuff wont happen (swap, core, ++). */
++                    /* Thes flags help making 100% sure some bad stuff wont happen (swap, core, ++).
++                     * See remap_pfn_range() in mm/memory.c */
++#if   LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
++                    vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
++#else
++                    vma->vm_flags |= VM_RESERVED;
++#endif
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+                     rc = remap_pfn_range(vma, ulAddrCur, page_to_pfn(pMemLnxToMap->apPages[iPage]), PAGE_SIZE, fPg);
+ #elif defined(VBOX_USE_PAE_HACK)
diff -Nru virtualbox-4.1.18-dfsg/debian/patches/series virtualbox-4.1.18-dfsg/debian/patches/series
--- virtualbox-4.1.18-dfsg/debian/patches/series	2012-10-18 22:39:18.000000000 +0200
+++ virtualbox-4.1.18-dfsg/debian/patches/series	2012-12-15 17:12:00.000000000 +0100
@@ -15,3 +15,5 @@
 35-libvdeplug-soname.patch
 36-fix-ftbfs-xserver-112.patch
 cve-2012-3221.patch
+37-kcompat-3.6.patch
+38-kcompat-3.7.patch

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to