[Pkg-virtualbox-devel] Bug#703358: virtualbox-guest-dkms: virtualbox guest modules fail to build with the modified 3.2 kernel of Debian 7.0
J.D.
debian2013 at mailmetrash.com
Fri Mar 29 13:01:27 UTC 2013
Package: virtualbox-guest-dkms
Version: 4.1.18-dfsg-2
Followup-For: Bug #703358
Dear Maintainer,
Without a Linux 3.4 kernel and with the 3.2 kernel currently included with
Debian 7.0 (patched to include portions of the 3.4 kernel), build fails
when attempting to build the kernel modules required to support Debian 7.0
inside a virtualbox virtual machine.
Here's an excerpt reporting the error:
Loading new virtualbox-guest-4.1.18 DKMS files...
Building only for 3.2.0-4-amd64
Building initial module for 3.2.0-4-amd64
Error! Bad return status for module build on kernel: 3.2.0-4-amd64 (x86_64)
To overcome the difficulty, I modified the r42164 fix available from the
following source: https://www.virtualbox.org/ticket/10756
After patching the code, "dpkg-reconfigure virtualbox-guest-dkms"
successfully produces functional modules:
DKMS: install completed.
The patch here assumes that any kernel at or above 3.2.39 is either
3.3.0+ or is modified with drm code from the later kernel versions for
a Debian 7.0 system.
Obviously, this patch breaks 3.2 compatibility above 3.2.39 for a
non-"Debian 7.0" system or a Debian 7.0 system modified to run a clean
3.2 kernel, but Debian 7.0 already breaks version number compatibility
anyway by patching the 3.2 kernel with portions of 3.4 code and calling
it 3.2 instead of using the entire stable 3.4 kernel and calling it 3.4.
In other words, this patch counters one somewhat broken version number
with a version check that is itself somewhat broken.
"A broken patch for a broken system."
*** Patch begin (edited by jodarom, licensed for GNU GPLv2) ***
--- vboxvideo_drm.c.orig 2012-06-20 08:09:07.000000000 -0500
+++ vboxvideo_drm.c 2013-03-29 06:19:28.689023873 -0500
@@ -67,6 +67,14 @@
# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,1)
# define DRM_RHEL61
# endif
+# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,3)
+# define DRM_RHEL63
+# endif
+# endif
+/* Debian 7.0 patches kernel 3.2.39 with code from the 3.4 kernel */
+/* Assume a Debian 7.0 system and force it for versions >= 3.2.39 */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 39)
+# define DRM_DEBIAN70
# endif
# endif
@@ -85,7 +93,7 @@
return 0;
#endif
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) || defined(DRM_RHEL63) || defined(DRM_DEBIAN70)
/* since linux-3.3.0-rc1 drm_driver::fops is pointer */
static struct file_operations driver_fops =
{
@@ -109,7 +117,7 @@
.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,3,0) && !defined(DRM_RHEL63) && !defined(DRM_DEBIAN70)
.fops =
{
.owner = THIS_MODULE,
@@ -126,7 +134,7 @@
.poll = drm_poll,
.fasync = drm_fasync,
},
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) */
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) || defined(DRM_RHEL63) || defined(DRM_DEBIAN70) */
.fops = &driver_fops,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39) && !defined(DRM_RHEL61)
*** Patch end ***
-- System Information:
Debian Release: 7.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages virtualbox-guest-dkms depends on:
ii dkms 2.2.0.3-1.2
ii dpkg 1.16.9
ii virtualbox-guest-utils 4.1.18-dfsg-2
virtualbox-guest-dkms recommends no packages.
virtualbox-guest-dkms suggests no packages.
-- no debconf information
More information about the Pkg-virtualbox-devel
mailing list