[Pkg-virtualbox-commits] r202 - in trunk/debian: . patches

daniel at alioth.debian.org daniel at alioth.debian.org
Sat Feb 9 06:50:40 UTC 2008


Author: daniel
Date: 2008-02-09 06:50:40 +0000 (Sat, 09 Feb 2008)
New Revision: 202

Modified:
   trunk/debian/changelog
   trunk/debian/patches/02-diff-vmreq.dpatch
   trunk/debian/patches/07-xsession.dpatch
   trunk/debian/patches/08-module-build.dpatch
Log:
Rediffed patches and again fixed their headers.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-02-09 06:44:45 UTC (rev 201)
+++ trunk/debian/changelog	2008-02-09 06:50:40 UTC (rev 202)
@@ -3,6 +3,7 @@
   [ Daniel Baumann ]
   * Again removing reimported useless whitespaces at EOL and EOF in debian/*.
   * Unified header of Euskarian debconf translation.
+  * Rediffed patches and again fixed their headers.
 
   [ Michael Meskes ]
   * Added Basque debconf translation, closes: #460348

Modified: trunk/debian/patches/02-diff-vmreq.dpatch
===================================================================
--- trunk/debian/patches/02-diff-vmreq.dpatch	2008-02-09 06:44:45 UTC (rev 201)
+++ trunk/debian/patches/02-diff-vmreq.dpatch	2008-02-09 06:50:40 UTC (rev 202)
@@ -1,16 +1,14 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 10-diff-vmreq.dpatch by Michael Meskes <meskes at debian.org>
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 02-diff-vmreq.dpatch by Michael Meskes <meskes at debian.org>
 ##
-## All lines beginning with `## DP:' are a description of the patch.
 ## DP: Fix runtime assertions
 
 @DPATCH@
 
-Index: virtualbox-1.5.4/src/VBox/VMM/VMReq.cpp
-===================================================================
---- virtualbox-1.5.4/src/VBox/VMM/VMReq.cpp	(revision 27120)
-+++ virtualbox-1.5.4/src/VBox/VMM/VMReq.cpp	(revision 27121)
-@@ -525,9 +525,16 @@
+diff -Naurp virtualbox-ose-1.5.4-dfsg.orig/src/VBox/VMM/VMReq.cpp virtualbox-ose-1.5.4-dfsg/src/VBox/VMM/VMReq.cpp
+--- virtualbox-ose-1.5.4-dfsg.orig/src/VBox/VMM/VMReq.cpp	2007-12-19 13:25:48.000000000 +0000
++++ virtualbox-ose-1.5.4-dfsg/src/VBox/VMM/VMReq.cpp	2008-02-09 06:45:12.000000000 +0000
+@@ -525,9 +525,16 @@ VMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, 
          return VERR_VM_REQUEST_INVALID_TYPE;
      }
  
@@ -28,7 +26,7 @@
          /*
           * Insert it.
           */
-@@ -535,20 +542,20 @@
+@@ -535,20 +542,20 @@ VMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, 
          PVMREQ pNext;
          do
          {
@@ -54,7 +52,7 @@
              rc = VMR3ReqWait(pReq, cMillies);
          LogFlow(("VMR3ReqQueue: returns %Vrc\n", rc));
      }
-@@ -558,7 +565,7 @@
+@@ -558,7 +565,7 @@ VMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, 
           * The requester was EMT, just execute it.
           */
          pReq->enmState = VMREQSTATE_QUEUED;

Modified: trunk/debian/patches/07-xsession.dpatch
===================================================================
--- trunk/debian/patches/07-xsession.dpatch	2008-02-09 06:44:45 UTC (rev 201)
+++ trunk/debian/patches/07-xsession.dpatch	2008-02-09 06:50:40 UTC (rev 202)
@@ -1,5 +1,5 @@
 #!/bin/sh /usr/share/dpatch/dpatch-run
-## 07-Xsession.dpatch by Michael Meskes <meskes at debian.org>
+## 07-xsession.dpatch by Michael Meskes <meskes at debian.org>
 ##
 ## DP: Create a start script in Xsession.d.
 

Modified: trunk/debian/patches/08-module-build.dpatch
===================================================================
--- trunk/debian/patches/08-module-build.dpatch	2008-02-09 06:44:45 UTC (rev 201)
+++ trunk/debian/patches/08-module-build.dpatch	2008-02-09 06:50:40 UTC (rev 202)
@@ -1,17 +1,27 @@
 #!/bin/sh /usr/share/dpatch/dpatch-run
-## 02-module-in-kernel.dpatch by Michael Meskes <meskes at debian.org>
+## 08-module-build.dpatch by Michael Meskes <meskes at debian.org>
 ##
 ## DP: Make sure modules build in a kernel build environment.
 
 @DPATCH@
 
---- virtualbox-ose-1.5.4-dfsg/src/VBox/HostDrivers/Support/linux/Makefile	2007-10-12 23:19:22.000000000 +0200
-+++ Makefile.vboxdrv	2008-02-02 19:26:20.000000000 +0100
-@@ -5,19 +5,30 @@
- 
+diff -Naurp virtualbox-ose-1.5.4-dfsg.orig/src/VBox/Additions/linux/module/Makefile.module virtualbox-ose-1.5.4-dfsg/src/VBox/Additions/linux/module/Makefile.module
+--- virtualbox-ose-1.5.4-dfsg.orig/src/VBox/Additions/linux/module/Makefile.module	2007-09-24 20:13:56.000000000 +0000
++++ virtualbox-ose-1.5.4-dfsg/src/VBox/Additions/linux/module/Makefile.module	2008-02-09 06:47:10.000000000 +0000
+@@ -3,18 +3,19 @@
  #
+ # (For 2.6.x this file must be 'Makefile'!)
  #
--#  Copyright (C) 2006 innotek GmbH
+-#  Copyright (C) 2006-2007 innotek GmbH
+-# 
+-#  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 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.
+-
 +# Copyright (C) 2006-2007 innotek GmbH
 +#
 +# This file is part of VirtualBox Open Source Edition (OSE), as
@@ -21,64 +31,20 @@
 +# 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.
  #
--#  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 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.
- 
- #
--# First, figure out which architecture we're targeting.
-+# First, figure out which architecture we're targeting and the build type.
- # (We have to support basic cross building (ARCH=i386|x86_64).)
-+# While at it, warn about BUILD_* vars found to help with user problems.
- #
- ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
-  $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
-@@ -37,10 +48,23 @@
-    endif
-   endif
-  endif
-+else
-+ $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
- endif
- 
-+ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
-+ $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
-+ BUILD_TYPE :=
-+endif
-+ifeq ($(BUILD_TYPE),)
-+ BUILD_TYPE := release
-+else
-+ $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
-+endif
- 
--MODULE = vboxdrv
+-MODULE = vboxadd
 +
 +# override is required by the Debian guys
-+override MODULE = vboxdrv
++override MODULE = vboxadd
  OBJS   = \
- 	linux/SUPDrv-linux.o \
- 	SUPDRVShared.o \
-@@ -58,53 +82,74 @@
+ 	cmc.o \
+ 	hgcmcall.o \
+@@ -31,49 +32,69 @@ OBJS   = \
  
  ifneq ($(MAKECMDGOALS),clean)
  
 -# kernel base directory
 -ifndef KERN_DIR
-- # build for the current kernel, version check
 - KERN_DIR := /lib/modules/$(shell uname -r)/build
 - ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 -  KERN_DIR := /usr/src/linux
@@ -90,10 +56,8 @@
 +
 + # kernel base directory
 + ifndef KERN_DIR
-+  # build for the current kernel, version check
 +  KERN_DIR := /lib/modules/$(shell uname -r)/build
-   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
--   $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.)
++  ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 +   KERN_DIR := /usr/src/linux
 +   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 +    $(error Error: unable to find the sources of your current Linux kernel. \
@@ -102,30 +66,15 @@
 +   $(warning Warning: using /usr/src/linux as the source directory of your \
 +                      Linux kernel. If this is not correct, specify \
 +		      KERN_DIR=<directory> and run Make again.)
-   endif
--  $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.)
-- endif
-- # check if versions match -- works only for later 2.6 kernels
-- VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) kernelrelease 2> /dev/null || true)
-- ifneq ($(VBOX_KERN_VER),)
--  ifneq ($(VBOX_KERN_VER),$(shell uname -r))
--   $(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match the current kernel (version $(shell uname -r)))
-+  # check if versions match -- works only for later 2.6 kernels
-+  VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) kernelrelease 2> /dev/null || true)
-+  ifneq ($(VBOX_KERN_VER),)
-+   ifneq ($(VBOX_KERN_VER),$(shell uname -r))
-+    $(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match \
-+                   the current kernel (version $(shell uname -r)))
-+   endif
 +  endif
 + else
-+  # build for a dedicated kernel, no version check
-+  ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+-   $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.)
 +   $(error Error: KERN_DIR does not point to a directory)
    endif
+-  $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.)
   endif
 -else
-- # build for a dedicated kernel, no version check
 - ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 -  $(error Error: KERN_DIR does not point to a directory.)
 +
@@ -146,32 +95,44 @@
 -ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
 - $(error Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=<directory> and run Make again.)
 -endif
-+ # module install dir, only for current kernel
++ # module install dir.
 + ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
 +  ifndef MODULE_DIR
 +   MODULE_DIR_TST := /lib/modules/$(shell uname -r)
 +   ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
 +    MODULE_DIR := $(MODULE_DIR_TST)/misc
 +   else
-+    $(error Unable to find the folder to install the support driver to)
++    $(error Unable to find the folder to install the additions driver to)
 +   endif
 +  endif # MODULE_DIR unspecified
 + endif
  
--# module install dir, only for current kernel
+-# module install dir.
 -ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
 - ifndef MODULE_DIR
 -  MODULE_DIR_TST := /lib/modules/$(shell uname -r)
 -  ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
 -   MODULE_DIR := $(MODULE_DIR_TST)/misc
 -  else
--   $(error Unable to find the folder to install the support driver to)
+-   $(error Unable to find the folder to install the additions driver to)
 -  endif
 - endif # MODULE_DIR unspecified
 -endif
 + # guess kernel version (24 or 26)
-+ KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
-+
++ ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
++ KERN_VERSION := 24
++ else
++ KERN_VERSION := 26
++ endif
++ # KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
+ 
+-# guess kernel version (24 or 26)
+-ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
+-KERN_VERSION := 24
+-else
+-KERN_VERSION := 26
+-endif
+-# KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
 +else # neq($(KERNELRELEASE),)
 +
 + #
@@ -179,14 +140,12 @@
 + #
 +
 + KERN_VERSION := 26
- 
--# guess kernel version (24 or 26)
--KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
++
 +endif # neq($(KERNELRELEASE),)
  
  # debug - show guesses.
  ifdef DEBUG
-@@ -118,14 +163,14 @@
+@@ -88,18 +109,19 @@ endif
  # Compiler options
  #
  ifndef INCL
@@ -198,13 +157,23 @@
   INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
   export INCL
  endif
--KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0
-+KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX
- ifndef CONFIG_VBOXDRV_FIXEDMAJOR
-  KFLAGS  += -DCONFIG_VBOXDRV_AS_MISC
- endif
---- virtualbox-ose-1.5.4-dfsg/src/VBox/Additions/linux/module/Makefile.module	2007-09-24 22:13:56.000000000 +0200
-+++ Makefile.vboxadd	2008-02-02 19:27:31.000000000 +0100
+-KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 \
+-	    -DVBGL_VBOXGUEST -DVBOX_HGCM -DLOG_TO_BACKDOOR
+-#ifeq ($(BUILD_TYPE),debug) - you'll have to enable this manually to get debug stuff.
+-#KFLAGS   += -DDEBUG
+-#endif
++KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ \
++	    -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DVBGL_VBOXGUEST -DVBOX_HGCM \
++	    -DLOG_TO_BACKDOOR -DRT_WITH_VBOX -DIN_MODULE -DIN_GUEST_R0
++ifeq ($(BUILD_TYPE),debug)
++KFLAGS   += -DDEBUG
++endif
+ 
+ ifeq ($(KERN_VERSION), 24)
+ #
+diff -Naurp virtualbox-ose-1.5.4-dfsg.orig/src/VBox/Additions/linux/sharedfolders/Makefile.module virtualbox-ose-1.5.4-dfsg/src/VBox/Additions/linux/sharedfolders/Makefile.module
+--- virtualbox-ose-1.5.4-dfsg.orig/src/VBox/Additions/linux/sharedfolders/Makefile.module	2007-09-24 20:13:56.000000000 +0000
++++ virtualbox-ose-1.5.4-dfsg/src/VBox/Additions/linux/sharedfolders/Makefile.module	2008-02-09 06:47:10.000000000 +0000
 @@ -3,18 +3,19 @@
  #
  # (For 2.6.x this file must be 'Makefile'!)
@@ -229,14 +198,14 @@
 +# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
 +# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  #
--MODULE = vboxadd
+-MODULE = vboxvfs
 +
 +# override is required by the Debian guys
-+override MODULE = vboxadd
++override MODULE = vboxvfs
  OBJS   = \
- 	cmc.o \
- 	hgcmcall.o \
-@@ -31,49 +32,69 @@
+ 	vfsmod.o \
+ 	vfs-utils.o \
+@@ -38,49 +39,69 @@ EXTRA_CFLAGS = -fshort-wchar
  
  ifneq ($(MAKECMDGOALS),clean)
  
@@ -299,7 +268,7 @@
 +   ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
 +    MODULE_DIR := $(MODULE_DIR_TST)/misc
 +   else
-+    $(error Unable to find the folder to install the additions driver to)
++    $(error Unable to find the folder to install the shared folders driver to)
 +   endif
 +  endif # MODULE_DIR unspecified
 + endif
@@ -311,7 +280,7 @@
 -  ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
 -   MODULE_DIR := $(MODULE_DIR_TST)/misc
 -  else
--   $(error Unable to find the folder to install the additions driver to)
+-   $(error Unable to find the folder to install the shared folders driver to)
 -  endif
 - endif # MODULE_DIR unspecified
 -endif
@@ -342,7 +311,7 @@
  
  # debug - show guesses.
  ifdef DEBUG
-@@ -88,18 +109,19 @@
+@@ -95,18 +116,19 @@ endif
  # Compiler options
  #
  ifndef INCL
@@ -355,35 +324,57 @@
   export INCL
  endif
 -KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 \
--	    -DVBGL_VBOXGUEST -DVBOX_HGCM -DLOG_TO_BACKDOOR
+-	    -DVBOX_HGCM -DLOG_TO_BACKDOOR
 -#ifeq ($(BUILD_TYPE),debug) - you'll have to enable this manually to get debug stuff.
 -#KFLAGS   += -DDEBUG
 -#endif
-+KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ \
-+	    -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DVBGL_VBOXGUEST -DVBOX_HGCM \
-+	    -DLOG_TO_BACKDOOR -DRT_WITH_VBOX -DIN_MODULE -DIN_GUEST_R0
++KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 \
++	    -DIN_SUP_R0 -DVBOX -DVBOX_HGCM -DLOG_TO_BACKDOOR -DIN_MODULE \
++	    -DIN_GUEST_R0
 +ifeq ($(BUILD_TYPE),debug)
 +KFLAGS   += -DDEBUG
 +endif
  
  ifeq ($(KERN_VERSION), 24)
  #
---- virtualbox-ose-1.5.4-dfsg/src/VBox/Additions/linux/sharedfolders/Makefile.module	2007-09-24 22:13:56.000000000 +0200
-+++ Makefile.vboxvfs	2008-02-02 19:28:32.000000000 +0100
-@@ -3,18 +3,19 @@
+@@ -133,16 +155,19 @@ MODULE_EXT := ko
+ 
+ $(MODULE)-y  := $(OBJS)
+ 
+-# detect FC6 2.6.18
+-KFLAGS += $(foreach inc,$(KERN_INCL),\
+-            $(if $(wildcard $(inc)/linux/utsrelease.h),\
+-              $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
+-                then echo yes; fi),-DKERNEL_FC6,),))
+-# detect rhel5 2.6.18
+-KFLAGS += $(foreach inc,$(KERN_INCL),\
+-            $(if $(wildcard $(inc)/linux/utsrelease.h),\
+-              $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
+-                then echo yes; fi),-DKERNEL_FC6,),))
++# special hack for FC6 2.6.18 and rhel5 2.6.18
++ifeq ($(KERNELRELEASE),)
++ KFLAGS += $(foreach inc,$(KERN_INCL),\
++             $(if $(wildcard $(inc)/linux/utsrelease.h),\
++               $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
++                 then echo yes; fi),-DKERNEL_FC6,),) \
++             $(if $(wildcard $(inc)/linux/utsrelease.h),\
++               $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
++                 then echo yes; fi),-DKERNEL_FC6,),))
++else
++ KFLAGS += $(filter -DKERNEL_FC6,$(patsubst 2.6.18%fc6,-DKERNEL_FC6,$(KERNELRELEASE)) \
++                                 $(patsubst 2.6.18%el5,-DKERNEL_FC6,$(KERNELRELEASE)))
++endif
+ 
+ # build defs
+ EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG)
+diff -Naurp virtualbox-ose-1.5.4-dfsg.orig/src/VBox/HostDrivers/Support/linux/Makefile virtualbox-ose-1.5.4-dfsg/src/VBox/HostDrivers/Support/linux/Makefile
+--- virtualbox-ose-1.5.4-dfsg.orig/src/VBox/HostDrivers/Support/linux/Makefile	2007-10-12 21:19:22.000000000 +0000
++++ virtualbox-ose-1.5.4-dfsg/src/VBox/HostDrivers/Support/linux/Makefile	2008-02-09 06:47:10.000000000 +0000
+@@ -5,19 +5,30 @@
+ 
  #
- # (For 2.6.x this file must be 'Makefile'!)
  #
--#  Copyright (C) 2006-2007 innotek GmbH
--# 
--#  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 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.
--
+-#  Copyright (C) 2006 innotek GmbH
 +# Copyright (C) 2006-2007 innotek GmbH
 +#
 +# This file is part of VirtualBox Open Source Edition (OSE), as
@@ -393,20 +384,64 @@
 +# 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.
  #
--MODULE = vboxvfs
+-#  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 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.
+ 
+ #
+-# First, figure out which architecture we're targeting.
++# First, figure out which architecture we're targeting and the build type.
+ # (We have to support basic cross building (ARCH=i386|x86_64).)
++# While at it, warn about BUILD_* vars found to help with user problems.
+ #
+ ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
+  $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
+@@ -37,10 +48,23 @@ ifeq ($(BUILD_TARGET_ARCH),)
+    endif
+   endif
+  endif
++else
++ $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
++endif
 +
++ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
++ $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
++ BUILD_TYPE :=
++endif
++ifeq ($(BUILD_TYPE),)
++ BUILD_TYPE := release
++else
++ $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
+ endif
+ 
+ 
+-MODULE = vboxdrv
 +# override is required by the Debian guys
-+override MODULE = vboxvfs
++override MODULE = vboxdrv
  OBJS   = \
- 	vfsmod.o \
- 	vfs-utils.o \
-@@ -38,49 +39,69 @@
+ 	linux/SUPDrv-linux.o \
+ 	SUPDRVShared.o \
+@@ -58,53 +82,74 @@ endif
  
  ifneq ($(MAKECMDGOALS),clean)
  
 -# kernel base directory
 -ifndef KERN_DIR
+- # build for the current kernel, version check
 - KERN_DIR := /lib/modules/$(shell uname -r)/build
 - ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 -  KERN_DIR := /usr/src/linux
@@ -418,8 +453,10 @@
 +
 + # kernel base directory
 + ifndef KERN_DIR
++  # build for the current kernel, version check
 +  KERN_DIR := /lib/modules/$(shell uname -r)/build
-+  ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+-   $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.)
 +   KERN_DIR := /usr/src/linux
 +   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 +    $(error Error: unable to find the sources of your current Linux kernel. \
@@ -428,15 +465,30 @@
 +   $(warning Warning: using /usr/src/linux as the source directory of your \
 +                      Linux kernel. If this is not correct, specify \
 +		      KERN_DIR=<directory> and run Make again.)
+   endif
+-  $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.)
+- endif
+- # check if versions match -- works only for later 2.6 kernels
+- VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) kernelrelease 2> /dev/null || true)
+- ifneq ($(VBOX_KERN_VER),)
+-  ifneq ($(VBOX_KERN_VER),$(shell uname -r))
+-   $(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match the current kernel (version $(shell uname -r)))
++  # check if versions match -- works only for later 2.6 kernels
++  VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) kernelrelease 2> /dev/null || true)
++  ifneq ($(VBOX_KERN_VER),)
++   ifneq ($(VBOX_KERN_VER),$(shell uname -r))
++    $(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match \
++                   the current kernel (version $(shell uname -r)))
++   endif
 +  endif
 + else
-   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
--   $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.)
++  # build for a dedicated kernel, no version check
++  ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 +   $(error Error: KERN_DIR does not point to a directory)
    endif
--  $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.)
   endif
 -else
+- # build for a dedicated kernel, no version check
 - ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
 -  $(error Error: KERN_DIR does not point to a directory.)
 +
@@ -457,44 +509,32 @@
 -ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
 - $(error Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=<directory> and run Make again.)
 -endif
-+ # module install dir.
++ # module install dir, only for current kernel
 + ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
 +  ifndef MODULE_DIR
 +   MODULE_DIR_TST := /lib/modules/$(shell uname -r)
 +   ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
 +    MODULE_DIR := $(MODULE_DIR_TST)/misc
 +   else
-+    $(error Unable to find the folder to install the shared folders driver to)
++    $(error Unable to find the folder to install the support driver to)
 +   endif
 +  endif # MODULE_DIR unspecified
 + endif
  
--# module install dir.
+-# module install dir, only for current kernel
 -ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
 - ifndef MODULE_DIR
 -  MODULE_DIR_TST := /lib/modules/$(shell uname -r)
 -  ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
 -   MODULE_DIR := $(MODULE_DIR_TST)/misc
 -  else
--   $(error Unable to find the folder to install the shared folders driver to)
+-   $(error Unable to find the folder to install the support driver to)
 -  endif
 - endif # MODULE_DIR unspecified
 -endif
 + # guess kernel version (24 or 26)
-+ ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
-+ KERN_VERSION := 24
-+ else
-+ KERN_VERSION := 26
-+ endif
-+ # KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
- 
--# guess kernel version (24 or 26)
--ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
--KERN_VERSION := 24
--else
--KERN_VERSION := 26
--endif
--# KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
++ KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
++
 +else # neq($(KERNELRELEASE),)
 +
 + #
@@ -502,12 +542,14 @@
 + #
 +
 + KERN_VERSION := 26
-+
+ 
+-# guess kernel version (24 or 26)
+-KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
 +endif # neq($(KERNELRELEASE),)
  
  # debug - show guesses.
  ifdef DEBUG
-@@ -95,18 +116,19 @@
+@@ -118,14 +163,14 @@ endif
  # Compiler options
  #
  ifndef INCL
@@ -519,47 +561,8 @@
   INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
   export INCL
  endif
--KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 \
--	    -DVBOX_HGCM -DLOG_TO_BACKDOOR
--#ifeq ($(BUILD_TYPE),debug) - you'll have to enable this manually to get debug stuff.
--#KFLAGS   += -DDEBUG
--#endif
-+KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 \
-+	    -DIN_SUP_R0 -DVBOX -DVBOX_HGCM -DLOG_TO_BACKDOOR -DIN_MODULE \
-+	    -DIN_GUEST_R0
-+ifeq ($(BUILD_TYPE),debug)
-+KFLAGS   += -DDEBUG
-+endif
- 
- ifeq ($(KERN_VERSION), 24)
- #
-@@ -133,16 +155,19 @@
- 
- $(MODULE)-y  := $(OBJS)
- 
--# detect FC6 2.6.18
--KFLAGS += $(foreach inc,$(KERN_INCL),\
--            $(if $(wildcard $(inc)/linux/utsrelease.h),\
--              $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
--                then echo yes; fi),-DKERNEL_FC6,),))
--# detect rhel5 2.6.18
--KFLAGS += $(foreach inc,$(KERN_INCL),\
--            $(if $(wildcard $(inc)/linux/utsrelease.h),\
--              $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
--                then echo yes; fi),-DKERNEL_FC6,),))
-+# special hack for FC6 2.6.18 and rhel5 2.6.18
-+ifeq ($(KERNELRELEASE),)
-+ KFLAGS += $(foreach inc,$(KERN_INCL),\
-+             $(if $(wildcard $(inc)/linux/utsrelease.h),\
-+               $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
-+                 then echo yes; fi),-DKERNEL_FC6,),) \
-+             $(if $(wildcard $(inc)/linux/utsrelease.h),\
-+               $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
-+                 then echo yes; fi),-DKERNEL_FC6,),))
-+else
-+ KFLAGS += $(filter -DKERNEL_FC6,$(patsubst 2.6.18%fc6,-DKERNEL_FC6,$(KERNELRELEASE)) \
-+                                 $(patsubst 2.6.18%el5,-DKERNEL_FC6,$(KERNELRELEASE)))
-+endif
- 
- # build defs
- EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG)
+-KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0
++KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX
+ ifndef CONFIG_VBOXDRV_FIXEDMAJOR
+  KFLAGS  += -DCONFIG_VBOXDRV_AS_MISC
+ endif




More information about the Pkg-virtualbox-commits mailing list