Index: /trunk/src/VBox/Additions/linux/module/Makefile.module
===================================================================
--- /trunk/src/VBox/Additions/linux/module/Makefile.module	(revision 6856)
+++ /trunk/src/VBox/Additions/linux/module/Makefile.module	(revision 6857)
@@ -93,18 +93,22 @@
 
  # 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
+ 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
+  KERN_VERSION := 26
  endif
- # KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)
 
 else # neq($(KERNELRELEASE),)
 
  #
- # building from Linux-2.6-kbuild (make -C <kernel_directory> M=`pwd`)
+ # building from kbuild (make -C <kernel_directory> M=`pwd`)
  #
 
- KERN_VERSION := 26
+ # guess kernel version (24 or 26)
+ ifeq ($(shell if grep '"2\.4\.' $(PWD)/include/linux/version.h > /dev/null; then echo yes; fi),yes)
+  KERN_VERSION := 24
+ else
+  KERN_VERSION := 26
+ endif
 
 endif # neq($(KERNELRELEASE),)
Index: /trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module
===================================================================
--- /trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module	(revision 6856)
+++ /trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module	(revision 6857)
@@ -91,18 +91,22 @@
 
  # 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
+ 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 := 26
+ endif
 
 else # neq($(KERNELRELEASE),)
 
  #
- # building from Linux-2.6-kbuild (make -C <kernel_directory> M=`pwd`)
- #
-
- KERN_VERSION := 26
+ # building from kbuild (make -C <kernel_directory> M=`pwd`)
+ #
+
+ # guess kernel version (24 or 26)
+ ifeq ($(shell if grep '"2\.4\.' $(PWD)/include/linux/version.h > /dev/null; then echo yes; fi),yes)
+  KERN_VERSION := 24
+ else
+  KERN_VERSION := 26
+ endif
 
 endif # neq($(KERNELRELEASE),)
Index: /trunk/src/VBox/HostDrivers/Support/linux/Makefile
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/linux/Makefile	(revision 6856)
+++ /trunk/src/VBox/HostDrivers/Support/linux/Makefile	(revision 6857)
@@ -168,8 +168,9 @@
 
  #
- # building from Linux-2.6-kbuild (make -C <kernel_directory> M=`pwd`)
- #
-
- KERN_VERSION := 26
+ # building from kbuild (make -C <kernel_directory> M=`pwd`)
+ #
+
+ # guess kernel version (24 or 26)
+ KERN_VERSION := $(if $(wildcard $(PWD)/Rules.make),24,26)
 
 endif # neq($(KERNELRELEASE),)
