[Pkg-virtualbox-devel] Bug#703239: [PATCH proposed] Bug#703239: virtualbox-guest-x11: Bad return status for module build on kernel

Francesco Presel f.presel at alice.it
Fri Mar 29 11:43:50 UTC 2013


I've also been affected by this bug, and have apparently managed to 
solve it:

$ sudo dpkg-reconfigure virtualbox-guest-dkms
[...]
Building initial module for 3.2.0-4-686-pae
Done.
[...]

$ lsmod|grep vbox
vboxvideo              12405  0
drm                   146387  1 vboxvideo
vboxsf                 32382  1
vboxguest             128365  6 vboxsf

Shared folders work, as well as shared clipboard.
I've not yet checked 3d acceleration (currently running VM with 3d 
acceleration disabled); I'll report ASAP.

So, I have a patch to propose. I'm sorry if this is not the correct way 
to report this; I'm not a developer, but I hope it can help anyway.

I've been able to compile the module by editing 
vboxvideo/vboxvideo_drm.c (inside /usr/src/virtualbox-guest-4.1.18 ).
The patch works like this: since kernel 3.2 from Debian contains 
backports from other kernels, it must be treated, inside this piece of 
code, as a higher version kernel. This patch will break non-Debian 3.2 
kernels (but should we care for that?), but allows this module to be 
compiled in Wheezy with the kernel Wheezy officially provides. It should 
be very simple and should not, therefore, break anything else (so, I 
hope it's suitable for an RC bug).
If there's a better way to distinguish the Debian kernel from other 
ones, you could preserve compatibility with non-debian 3.2 kernels: the 
bug is the same as reported here ( 
https://www.virtualbox.org/ticket/10756 )  for Fedora, but that fix was 
not working (I guess the variable it was checking was specific to 
Fedora); is there a similar variable for Debian?

This is the patch:

--- vboxvideo/vboxvideo_drm.c.orig    2012-06-20 15:09:07.000000000 +0200
+++ vboxvideo/vboxvideo_drm.c    2013-03-29 12:12:37.648816514 +0100

@@ -85,8 +85,10 @@
      return 0;
  #endif
  }
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  /* since linux-3.3.0-rc1 drm_driver::fops is pointer */
+/* For Debian, due to backports in the kernel code, Kernel 3.2 has to 
be treated as 3.3.*
+ * Attention: this will break non-Debian, 3.2 kernels. #703239 */
  static struct file_operations driver_fops =
  {
          .owner = THIS_MODULE,
@@ -109,14 +111,14 @@
      .get_map_ofs = drm_core_get_map_ofs,
      .get_reg_ofs = drm_core_get_reg_ofs,
  #endif
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+# if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
      .fops =
      {
          .owner = THIS_MODULE,



More information about the Pkg-virtualbox-devel mailing list