Index: trunk/src/VBox/Additions/linux/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/linux/Makefile.kmk	(revision 31636)
+++ trunk/src/VBox/Additions/linux/Makefile.kmk	(revision 31637)
@@ -65,40 +65,37 @@
 # Targets
 #
-ifndef VBOX_OSE
- # OSE only contains the source code for this
- VBOX_SELINUX_CMPLD := $(PATH_SUB_CURRENT)/selinux-fedora/vbox_x11.pp
- VBOX_LNX_ADD_ARCHIVE.x86   := $(PATH_OUT_BASE)/linux.x86/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-x86-r$(VBOX_SVN_REV).tar.bz2
- VBOX_LNX_ADD_ARCHIVE.amd64 := $(PATH_OUT_BASE)/linux.amd64/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-amd64-r$(VBOX_SVN_REV).tar.bz2
- ifndef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
-  VBOX_LNX_ADD_ARCHIVES := $(PATH_BIN)/additions/VBoxGuestAdditions-$(KBUILD_TARGET_ARCH)-r$(VBOX_SVN_REV).tar.bz2
- else
-  VBOX_LNX_ADD_ARCHIVES := \
-  	$(VBOX_LNX_ADD_ARCHIVE.x86) \
-  	$(VBOX_LNX_ADD_ARCHIVE.amd64)
- endif
- BLDDIRS     += \
- 	$(VBOX_LNX_ADD_INST_OUT_DIR) \
- 	$(VBOX_LNX_ADD_INST_BIN_DIR) \
- 	$(VBOX_LNX_ADD_INST_SBIN_DIR) \
- 	$(VBOX_LNX_ADD_INST_LIB_DIR) \
- 	$(VBOX_LNX_ADD_INST_MOD_DIR) \
- 	$(VBOX_LNX_ADD_INST_KMOD_DIR) \
- 	$(VBOX_LNX_ADD_INST_INIT_DIR) \
- 	$(VBOX_LNX_ADD_INST_DBG_DIR) \
- 	$(VBOX_LNX_ADD_DBG_BIN_DIR) \
- 	$(VBOX_LNX_ADD_DBG_SBIN_DIR) \
- 	$(VBOX_LNX_ADD_DBG_LIB_DIR) \
- 	$(VBOX_LNX_ADD_DBG_MOD_DIR) \
- 	$(VBOX_LNX_ADD_INST_STAGE_DIR)
- # Use VBOX_WITHOUT_LINUX_GUEST_PACKAGE to skip building the .run installer.
- # This will only take effect if you also use VBOX_WITHOUT_ADDITIONS_ISO.
- PACKING     += \
- 	$(if-expr !defined(VBOX_WITHOUT_LINUX_GUEST_PACKAGE), $(PATH_BIN)/additions/VBoxLinuxAdditions.run,) \
- 	$(VBOX_LNX_ADD_ARCHIVES) \
- 	$(PATH_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2
- OTHER_CLEAN += \
- 	$(PACKING) \
- 	$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file))))
-endif # !VBOX_OSE
+VBOX_SELINUX_CMPLD := $(PATH_SUB_CURRENT)/selinux-fedora/vbox_x11.pp
+VBOX_LNX_ADD_ARCHIVE.x86   := $(PATH_OUT_BASE)/linux.x86/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-x86-r$(VBOX_SVN_REV).tar.bz2
+VBOX_LNX_ADD_ARCHIVE.amd64 := $(PATH_OUT_BASE)/linux.amd64/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-amd64-r$(VBOX_SVN_REV).tar.bz2
+ifndef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
+ VBOX_LNX_ADD_ARCHIVES := $(PATH_BIN)/additions/VBoxGuestAdditions-$(KBUILD_TARGET_ARCH)-r$(VBOX_SVN_REV).tar.bz2
+else
+ VBOX_LNX_ADD_ARCHIVES := \
+	$(VBOX_LNX_ADD_ARCHIVE.x86) \
+	$(VBOX_LNX_ADD_ARCHIVE.amd64)
+endif
+BLDDIRS     += \
+	$(VBOX_LNX_ADD_INST_OUT_DIR) \
+	$(VBOX_LNX_ADD_INST_BIN_DIR) \
+	$(VBOX_LNX_ADD_INST_SBIN_DIR) \
+	$(VBOX_LNX_ADD_INST_LIB_DIR) \
+	$(VBOX_LNX_ADD_INST_MOD_DIR) \
+	$(VBOX_LNX_ADD_INST_KMOD_DIR) \
+	$(VBOX_LNX_ADD_INST_INIT_DIR) \
+	$(VBOX_LNX_ADD_INST_DBG_DIR) \
+	$(VBOX_LNX_ADD_DBG_BIN_DIR) \
+	$(VBOX_LNX_ADD_DBG_SBIN_DIR) \
+	$(VBOX_LNX_ADD_DBG_LIB_DIR) \
+	$(VBOX_LNX_ADD_DBG_MOD_DIR) \
+	$(VBOX_LNX_ADD_INST_STAGE_DIR)
+# Use VBOX_WITHOUT_LINUX_GUEST_PACKAGE to skip building the .run installer.
+# This will only take effect if you also use VBOX_WITHOUT_ADDITIONS_ISO.
+PACKING     += \
+	$(if-expr !defined(VBOX_WITHOUT_LINUX_GUEST_PACKAGE), $(PATH_BIN)/additions/VBoxLinuxAdditions.run,) \
+	$(VBOX_LNX_ADD_ARCHIVES) \
+	$(PATH_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2
+OTHER_CLEAN += \
+	$(PACKING) \
+	$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file))))
 
 
@@ -306,17 +303,16 @@
 
 
-ifndef VBOX_OSE
- INSTALLS += lnx_add_inst-exec
- lnx_add_inst-exec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_MOD_DIR))
- lnx_add_inst-exec_MODE = a+rx,u+w
- lnx_add_inst-exec_SOURCES = \
+INSTALLS += lnx_add_inst-exec
+lnx_add_inst-exec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_MOD_DIR))
+lnx_add_inst-exec_MODE = a+rx,u+w
+lnx_add_inst-exec_SOURCES = \
 	$(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
 	$(VBOX_REL_X11_ADD_INST)x11config-new.pl
 
 
- INSTALLS += lnx_add_inst-noexec
- lnx_add_inst-noexec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/
- lnx_add_inst-noexec_MODE = a+r,u+w
- lnx_add_inst-noexec_SOURCES = \
+INSTALLS += lnx_add_inst-noexec
+lnx_add_inst-noexec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/
+lnx_add_inst-noexec_MODE = a+r,u+w
+lnx_add_inst-noexec_SOURCES = \
 	$(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
 	$(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
@@ -327,17 +323,17 @@
 
 
- INSTALLS += AutoRun-sh
- AutoRun-sh_INST = bin/additions/
- AutoRun-sh_MODE = a+rx,u+w
- AutoRun-sh_SOURCES = $(VBOX_REL_LNX_ADD_INST)autorun.sh
-
-
- #
- # Install the sources of our (sanity) test kernel module
- #
- INSTALLS += LnxAddTest-src
- LnxAddTest-src_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test/
- LnxAddTest-src_MODE    = a+r,u+w
- LnxAddTest-src_SOURCES = \
+INSTALLS += AutoRun-sh
+AutoRun-sh_INST = bin/additions/
+AutoRun-sh_MODE = a+rx,u+w
+AutoRun-sh_SOURCES = $(VBOX_REL_LNX_ADD_INST)autorun.sh
+
+
+#
+# Install the sources of our (sanity) test kernel module
+#
+INSTALLS += LnxAddTest-src
+LnxAddTest-src_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test/
+LnxAddTest-src_MODE    = a+r,u+w
+LnxAddTest-src_SOURCES = \
 	$(VBOX_REL_LNX_ADD_INST)Makefile.test=>Makefile \
 	../../HostDrivers/linux/build_in_tmp \
@@ -345,11 +341,11 @@
 
 
- #
- # Install the sources of our (sanity) test kernel rendering (DRM) module
- #
- INSTALLS += LnxAddDRM-src
- LnxAddDRM-src_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test_drm/
- LnxAddDRM-src_MODE    = a+r,u+w
- LnxAddDRM-src_SOURCES = \
+#
+# Install the sources of our (sanity) test kernel rendering (DRM) module
+#
+INSTALLS += LnxAddDRM-src
+LnxAddDRM-src_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test_drm/
+LnxAddDRM-src_MODE    = a+r,u+w
+LnxAddDRM-src_SOURCES = \
 	$(VBOX_REL_LNX_ADD_INST)Makefile.include.header \
 	$(VBOX_REL_LNX_ADD_INST)Makefile.include.footer \
@@ -359,12 +355,12 @@
 
 
- #
- # We need our routines.sh and the uninstallation scripts in the staging
- # directory too
- #
- INSTALLS += LnxAdd-scripts
- LnxAdd-scripts_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_STAGE_DIR))
- LnxAdd-scripts_MODE    = a+rx,u+w
- LnxAdd-scripts_SOURCES = \
+#
+# We need our routines.sh and the uninstallation scripts in the staging
+# directory too
+#
+INSTALLS += LnxAdd-scripts
+LnxAdd-scripts_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_STAGE_DIR))
+LnxAdd-scripts_MODE    = a+rx,u+w
+LnxAdd-scripts_SOURCES = \
 	$(VBOX_REL_LNX_INST_SRC)routines.sh \
 	$(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
@@ -374,23 +370,22 @@
 
 
- #
- # VBoxClient-all
- #
- INSTALLS += LnxAdd-Nostrip-Bin
- LnxAdd-Nostrip-Bin_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_BIN_DIR))
- LnxAdd-Nostrip-Bin_MODE    = a+rx,u+w
- LnxAdd-Nostrip-Bin_SOURCES = \
+#
+# VBoxClient-all
+#
+INSTALLS += LnxAdd-Nostrip-Bin
+LnxAdd-Nostrip-Bin_INST    = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_BIN_DIR))
+LnxAdd-Nostrip-Bin_MODE    = a+rx,u+w
+LnxAdd-Nostrip-Bin_SOURCES = \
 	$(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all
 
 
- #
- # And the init scripts
- #
- INSTALLS += LnxAdd-init-scripts
- LnxAdd-init-scripts_INST    = bin/additions
- LnxAdd-init-scripts_MODE    = a+rx,u+w
- LnxAdd-init-scripts_SOURCES = \
+#
+# And the init scripts
+#
+INSTALLS += LnxAdd-init-scripts
+LnxAdd-init-scripts_INST    = bin/additions
+LnxAdd-init-scripts_MODE    = a+rx,u+w
+LnxAdd-init-scripts_SOURCES = \
 	$(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
-endif  # ! VBOX_OSE
 
 
Index: trunk/src/VBox/Additions/linux/installer/Makefile.test
===================================================================
--- trunk/src/VBox/Additions/linux/installer/Makefile.test	(revision 31637)
+++ trunk/src/VBox/Additions/linux/installer/Makefile.test	(revision 31637)
@@ -0,0 +1,116 @@
+#
+# VirtualBox Guest Additions Module Makefile.
+#
+# (For 2.6.x this file must be 'Makefile'!)
+#
+# Copyright (C) 2006-2007 Sun Microsystems, Inc.
+#
+# Use only with permission
+#
+
+#
+MODULE = vboxadd_test
+OBJS   = test.o
+
+ifneq ($(MAKECMDGOALS),clean)
+
+# kernel base directory
+ifndef KERN_DIR
+ 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
+  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.)
+  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
+ ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+  $(error Error: KERN_DIR does not point to a directory.)
+ endif
+endif
+
+# includes
+ifndef KERN_INCL
+ KERN_INCL = $(KERN_DIR)/include
+endif
+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
+
+# 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)
+
+# debug - show guesses.
+ifdef DEBUG
+$(warning dbg: KERN_DIR     = $(KERN_DIR))
+$(warning dbg: KERN_INCL    = $(KERN_INCL))
+$(warning dbg: MODULE_DIR   = $(MODULE_DIR))
+$(warning dbg: KERN_VERSION = $(KERN_VERSION))
+endif
+
+
+#
+# Compiler options
+#
+ifndef INCL
+ INCL    := -I$(KERN_INCL) $(addprefix -I, $(EXTRA_INCL))
+ ifndef KBUILD_EXTMOD
+  KBUILD_EXTMOD := $(shell pwd)
+ endif
+ 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 \
+	    -DVBGL_VBOXGUEST -DVBGL_HGCM -DVBOX_WITH_HGCM
+ifeq ($(BUILD_TYPE),debug)
+KFLAGS   += -DDEBUG
+endif
+
+ifeq ($(KERN_VERSION), 24)
+#
+# 2.4
+#
+
+CFLAGS := -DVBOX_LINUX_2_4 $(INCL) $(KFLAGS) $(KDEBUG)
+MODULE_EXT := o
+
+# 2.4 Module linking
+$(MODULE).o: $(OBJS)
+	$(LD) -o $@ -r $(OBJS)
+
+.PHONY: $(MODULE)
+all: $(MODULE)
+$(MODULE): $(MODULE).o
+
+else
+#
+# 2.6 and later
+#
+
+MODULE_EXT := ko
+
+$(MODULE)-y  := $(OBJS)
+
+# build defs
+EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG)
+
+all: $(MODULE)
+
+obj-m += $(MODULE).o
+
+$(MODULE):
+	$(MAKE) KBUILD_VERBOSE=1 -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) modules
+
+endif
+
+endif # eq($(MAKECMDGOALS),clean)
+
+clean:
+	for f in . linux r0drv r0drv/linux; do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
+	rm -rf .vboxdrv* .tmp_ver* vboxdrv.* Module.symvers Modules.symvers
Index: trunk/src/VBox/Additions/linux/installer/deffiles
===================================================================
--- trunk/src/VBox/Additions/linux/installer/deffiles	(revision 31637)
+++ trunk/src/VBox/Additions/linux/installer/deffiles	(revision 31637)
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Sun VirtualBox
+# VirtualBox linux Guest Additions default files list
+
+#
+# Copyright (C) 2009 Sun Microsystems, Inc.
+#
+# Sun Microsystems, Inc. confidential
+# All rights reserved
+#
+
+# This file contains the names of all files that the Guest Additions for
+# Linux guests have ever installed into the main filesystem tree (/usr and
+# /sbin).  No entries should ever be removed from this file, as it is used
+# for uninstalling old installations of VirtualBox which did not keep track
+# of the names of their files, or damaged installations which lost track of
+# them.
+
+DEFAULT_FILE_NAMES=" \
+    /usr/bin/vboxadd-xclient \
+    /usr/bin/VBoxClient \
+    /usr/bin/VBoxControl \
+    /usr/sbin/vboxadd-timesync \
+    /usr/sbin/vboxadd-service \
+    /usr/sbin/VBoxService \
+    /sbin/mount.vboxsf \
+    /usr/lib/VBoxOGLarrayspu.so \
+    /usr/lib64/VBoxOGLarrayspu.so \
+    /usr/lib/VBoxOGLcrutil.so \
+    /usr/lib64/VBoxOGLcrutil.so \
+    /usr/lib/VBoxOGLerrorspu.so \
+    /usr/lib64/VBoxOGLerrorspu.so \
+    /usr/lib/VBoxOGLfeedbackspu.so \
+    /usr/lib64/VBoxOGLfeedbackspu.so \
+    /usr/lib/VBoxOGLpackspu.so \
+    /usr/lib64/VBoxOGLpackspu.so \
+    /usr/lib/VBoxOGLpassthroughspu.so \
+    /usr/lib64/VBoxOGLpassthroughspu.so \
+    /usr/lib/VBoxOGL.so \
+    /usr/lib64/VBoxOGL.so \
+    /etc/X11/Xsession.d/98vboxadd-xclient \
+    /etc/X11/xinit.d/98vboxadd-xclient \
+    /etc/X11/xinit/xinitrc.d/98vboxadd-xclient.sh \
+    /usr/bin/VBoxRandR \
+    /usr/bin/VBoxClient-all \
+    /etc/xdg/autostart/vboxclient.desktop \
+    /usr/share/autostart/vboxclient.desktop \
+    /etc/udev/rules.d/60-vboxadd.rules \
+    /usr/share/xserver-xorg/pci/vboxvideo.ids \
+    /etc/hal/fdi/policy/90-vboxguest.fdi \
+    /etc/udev/rules.d/70-xorg-vboxmouse.rules \
+    /usr/share/hal/fdi/policy/20thirdparty/90-vboxguest.fdi \
+    /usr/lib/X11/xorg.conf.d/50-vboxmouse.conf \
+    /usr/share/X11/xorg.conf.d/50-vboxmouse.conf \
+    /usr/lib/dri/vboxvideo_dri.so \
+    /usr/lib64/dri/vboxvideo_dri.so \
+    /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so \
+    /usr/lib/xorg/modules/drivers/vboxvideo_drv.so \
+    /usr/X11R6/lib64/modules/drivers/vboxvideo_drv.so \
+    /usr/X11R6/lib/modules/drivers/vboxvideo_drv.so \
+    /usr/X11R6/lib/X11/modules/drivers/vboxvideo_drv.so \
+    /usr/lib64/xorg/modules/input/vboxmouse_drv.so \
+    /usr/lib/xorg/modules/input/vboxmouse_drv.so \
+    /usr/X11R6/lib64/modules/input/vboxmouse_drv.so \
+    /usr/X11R6/lib/modules/input/vboxmouse_drv.so \
+    /usr/X11R6/lib/X11/modules/input/vboxmouse_drv.so
+"
+
+DEFAULT_VERSIONED_FILE_NAMES=" \
+    /usr/src/vboxadd \
+    /usr/src/vboxguest \
+    /usr/src/vboxvfs \
+    /usr/src/vboxsf \
+    /usr/src/vboxvideo \
+"
Index: trunk/src/VBox/Additions/linux/installer/test.c
===================================================================
--- trunk/src/VBox/Additions/linux/installer/test.c	(revision 31637)
+++ trunk/src/VBox/Additions/linux/installer/test.c	(revision 31637)
@@ -0,0 +1,25 @@
+/*
+ * VirtualBox Guest Additions installer test module for Linux
+ *
+ * Copyright (C) 2006-2007 Oracle Corporation
+ *
+ * Oracle Corporation confidential
+ * All rights reserved
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+
+MODULE_DESCRIPTION("VirtualBox Guest Additions configuration test module");
+MODULE_AUTHOR("Oracle Corporation");
+MODULE_LICENSE("GPL");
+
+static int init(void)
+{
+    return 0;
+}
+
+static void fini(void) {}
+
+module_init(init);
+module_exit(fini);
Index: trunk/src/VBox/Additions/linux/installer/test_drm.c
===================================================================
--- trunk/src/VBox/Additions/linux/installer/test_drm.c	(revision 31637)
+++ trunk/src/VBox/Additions/linux/installer/test_drm.c	(revision 31637)
@@ -0,0 +1,27 @@
+/*
+ * VirtualBox Guest Additions installer test module for Linux
+ *
+ * Copyright (C) 2006-2007 Oracle Corporation
+ *
+ * Oracle Corporation confidential
+ * All rights reserved
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include "drm/drmP.h"
+
+
+MODULE_DESCRIPTION("VirtualBox Guest Additions drm test module");
+MODULE_AUTHOR("Oracle Corporation");
+MODULE_LICENSE("GPL");
+
+static int init(void)
+{
+    return 0;
+}
+
+static void fini(void) {}
+
+module_init(init);
+module_exit(fini);
