Index: /trunk/debian/VBox.sh
===================================================================
--- /trunk/debian/VBox.sh	(revision 9189)
+++ /trunk/debian/VBox.sh	(revision 9190)
@@ -96,19 +96,19 @@
   VirtualBox)
     exec "/usr/lib/virtualbox-ose/VirtualBox" "$@"
-  ;;
+    ;;
   VBoxManage)
     exec "/usr/lib/virtualbox-ose/VBoxManage" "$@"
-  ;;
+    ;;
   VBoxSDL)
     exec "/usr/lib/virtualbox-ose/VBoxSDL" "$@"
-  ;;
+    ;;
   VBoxVRDP)
     exec "/usr/lib/virtualbox-ose/VBoxVRDP" "$@"
-  ;;
+    ;;
   VBoxHeadless)
     exec "/usr/lib/virtualbox-ose/VBoxHeadless" "$@"
-  ;;
+    ;;
   *)
     echo "Unknown application - $APP"
-  ;;
+    ;;
 esac
Index: /trunk/debian/dirs
===================================================================
--- /trunk/debian/dirs	(revision 9189)
+++ /trunk/debian/dirs	(revision 9190)
@@ -2,3 +2,4 @@
 /etc/vbox
 /etc/init.d
+/usr/src
 /usr/lib/virtualbox-ose
Index: /trunk/debian/postinst
===================================================================
--- /trunk/debian/postinst	(revision 9189)
+++ /trunk/debian/postinst	(revision 9190)
@@ -28,4 +28,8 @@
   rm /etc/init.d/virtualbox
   update-rc.d virtualbox remove >/dev/null
+fi
+if [ -f /etc/vbox/vbox.cfg ]; then
+  echo "Found old version of /etc/vbox/vbox.cfg, removing."
+  rm /etc/vbox/vbox.cfg
 fi
 
Index: /trunk/debian/preinst.in
===================================================================
--- /trunk/debian/preinst.in	(revision 9189)
+++ /trunk/debian/preinst.in	(revision 9190)
@@ -32,4 +32,16 @@
 fi
 
+# check for old installation
+if [ -r /etc/vbox/vbox.cfg ]; then
+  . /etc/vbox/vbox.cfg
+  if [ "x$INSTALL_DIR" != "x" -a -d "$INSTALL_DIR" ]; then
+    db_fset virtualbox/old-installation-found seen false || true
+    db_input high virtualbox/old-installation-found || true
+    db_go || true
+    exit 1
+  fi
+  # we will remove that file in postinst
+fi
+
 # check for old vboxdrv modules
 if find /lib/modules -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
Index: /trunk/debian/rules
===================================================================
--- /trunk/debian/rules	(revision 9189)
+++ /trunk/debian/rules	(revision 9190)
@@ -202,8 +202,8 @@
 	dh_installmenu
 	$(if $(NOMODS),,dh_installmodules)
-	sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g;' \
-	    debian/vboxdrv.init.in > debian/vboxdrv.init
+	sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g; s|%PACKAGE%|virtualbox-ose|g;' \
+	    src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
 	sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge,$(debrel)),yes,)|g;' \
-	    debian/vboxnet.init.in > debian/vboxnet.init
+	    src/VBox/Installer/linux/vboxnet.sh.in > debian/vboxnet.init
 	dh_installinit --name=vboxdrv
 	dh_installinit --name=vboxnet
Index: /trunk/debian/templates
===================================================================
--- /trunk/debian/templates	(revision 9189)
+++ /trunk/debian/templates	(revision 9190)
@@ -52,2 +52,10 @@
  merge all snapshots and saved states before you proceed because VM states are version
  specific.
+
+Template: virtualbox-ose/old-installation-found
+Type: note
+Description: Old installation found
+ An old installation of VirtualBox was found. To install this package the old package
+ has to be removed first. Have a look at /etc/vbox/vbox.cfg determine the installation
+ directory of the previous installation. After uninstalling the old package remove the file
+ /etc/vbox/vbox.cfg.
Index: unk/debian/vboxdrv.init.in
===================================================================
--- /trunk/debian/vboxdrv.init.in	(revision 9189)
+++ 	(revision )
@@ -1,315 +1,0 @@
-#! /bin/sh
-#
-# Sun xVM VirtualBox
-# Linux kernel module init script
-#
-
-#
-# Copyright (C) 2006-2007 Sun Microsystems, Inc.
-#
-# 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 (GPL) 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.
-#
-
-# chkconfig: 35 30 60
-# description: VirtualBox Linux kernel module
-#
-### BEGIN INIT INFO
-# Provides:       vboxdrv
-# Required-Start: $syslog
-# Required-Stop:
-# Default-Start:  3 5
-# Default-Stop:
-# Short-Description: VirtualBox Linux kernel module
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
-DEVICE=/dev/vboxdrv
-MODNAME=vboxdrv
-GROUPNAME=vboxusers
-LOG="/var/log/vbox-install.log"
-NOLSB=%NOLSB%
-
-[ -f /lib/lsb/init-functions ] || NOLSB=yes
-[ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg
-
-if [ -n "$INSTALL_DIR" ]; then
-    VBOXMANAGE="$INSTALL_DIR/VBoxManage"
-    BUILDINTMP="$INSTALL_DIR/src/build_in_tmp"
-else
-    VBOXMANAGE="/usr/lib/virtualbox-ose/VBoxManage"
-    BUILDINTMP="/usr/share/virtualbox-ose/src/build_in_tmp"
-fi
-
-if [ -n "$NOLSB" ]; then
-    if [ -f /etc/redhat-release ]; then
-        system=redhat
-    elif [ -f /etc/SuSE-release ]; then
-        system=suse
-    elif [ -f /etc/gentoo-release ]; then
-        system=gentoo
-    fi
-fi
-
-[ -r /etc/default/virtualbox-ose ] && . /etc/default/virtualbox-ose
-
-if [ -z "$NOLSB" ]; then
-    . /lib/lsb/init-functions
-    fail_msg() {
-        echo ""
-        log_failure_msg "$1"
-    }
-    succ_msg() {
-        log_success_msg " done."
-    }
-    begin_msg() {
-        log_daemon_msg "$@"
-    }
-else
-    if [ "$system" = "redhat" ]; then
-        . /etc/init.d/functions
-        fail_msg() {
-            echo -n " "
-            echo_failure
-            echo
-            echo "  ($1)"
-        }
-        succ_msg() {
-            echo -n " "
-            echo_success
-            echo
-        }
-    elif [ "$system" = "suse" ]; then
-        . /etc/rc.status
-        fail_msg() {
-            rc_failed 1
-            rc_status -v
-            echo "  ($1)"
-        }
-        succ_msg() {
-            rc_reset
-            rc_status -v
-        }
-    elif [ "$system" = "gentoo" ]; then
-        . /sbin/functions.sh
-        fail_msg() {
-            eerror "$1"
-        }
-        succ_msg() {
-            eend "$?"
-        }
-        begin_msg() {
-            ebegin "$1"
-        }
-        if [ "`which $0`" = "/sbin/rc" ]; then
-            shift
-        fi
-    else
-        fail_msg() {
-            echo " ...failed!"
-            echo "  ($1)"
-        }
-        succ_msg() {
-            echo " ...done."
-        }
-    fi
-    if [ "$system" != "gentoo" ]; then
-        begin_msg() {
-            [ -z "${1:-}" ] && return 1
-            if [ -z "${2:-}" ]; then
-                echo -n "$1"
-            else
-                echo -n "$1: $2"
-            fi
-        }
-    fi
-fi
-
-failure()
-{
-    fail_msg "$1"
-    exit 0
-}
-
-running()
-{
-    lsmod | grep -q "$MODNAME[^_-]"
-}
-
-start()
-{
-    begin_msg "Starting VirtualBox kernel module"
-    if ! running; then
-        if ! find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
-            failure "No suitable module for running kernel found"
-        fi
-        if ! rm -f $DEVICE; then
-            failure "Cannot remove $DEVICE"
-        fi
-        if ! modprobe $MODNAME > /dev/null 2>&1; then
-            failure "modprobe $MODNAME failed. Please use 'dmesg' to find out why"
-        fi
-        sleep .2
-    fi
-    # ensure the character special exists
-    if [ ! -c $DEVICE ]; then
-        MAJOR=`sed -n 's;\([0-9]\+\) vboxdrv;\1;p' /proc/devices`
-        if [ ! -z "$MAJOR" ]; then
-            MINOR=0
-        else
-            MINOR=`sed -n 's;\([0-9]\+\) vboxdrv;\1;p' /proc/misc`
-            if [ ! -z "$MINOR" ]; then
-                MAJOR=10
-            fi
-        fi
-        if [ -z "$MAJOR" ]; then
-            rmmod $MODNAME 2>/dev/null
-            failure "Cannot locate the VirtualBox device"
-        fi
-        if ! mknod -m 0660 $DEVICE c $MAJOR $MINOR 2>/dev/null; then
-            rmmod $MODNAME 2>/dev/null
-            failure "Cannot create device $DEVICE with major $MAJOR and minor $MINOR"
-        fi
-    fi
-    # ensure permissions
-    if ! chown :$GROUPNAME $DEVICE 2>/dev/null; then
-        rmmod $MODNAME 2>/dev/null
-        failure "Cannot change owner $GROUPNAME for device $DEVICE"
-    fi
-    succ_msg
-}
-
-stop()
-{
-    begin_msg "Stopping VirtualBox kernel module"
-    if running; then
-        if ! rmmod $MODNAME 2>/dev/null; then
-            failure "Cannot unload module $MODNAME"
-        fi
-        if ! rm -f $DEVICE; then
-            failure "Cannot unlink $DEVICE"
-        fi
-    fi
-    succ_msg
-}
-
-# enter the following variables in /etc/default/virtualbox-ose:
-#   SHUTDOWN_USERS="foo bar"  
-#     check for running VMs of user foo and user bar
-#   SHUTDOWN=poweroff
-#   SHUTDOWN=acpibutton
-#   SHUTDOWN=savestate
-#     select one of these shutdown methods for running VMs
-stop_vms()
-{
-    wait=0
-    for i in $SHUTDOWN_USERS; do
-        # don't create the ipcd directory with wrong permissions!
-        if [ -d /tmp/.vbox-$i-ipc ]; then
-            export VBOX_IPC_SOCKETID="$i"
-            VMS=`$VBOXMANAGE -nologo list runningvms 2>/dev/null`
-            if [ -n "$VMS" ]; then
-                if [ "$SHUTDOWN" = "poweroff" ]; then
-                    begin_msg "Powering off remaining VMs"
-                    for v in $VMS; do
-                        $VBOXMANAGE -nologo controlvm $v poweroff
-                    done
-                    succ_msg
-                elif [ "$SHUTDOWN" = "acpibutton" ]; then
-                    begin_msg "Sending ACPI power button event to remaining VMs"
-                    for v in $VMS; do
-                        $VBOXMANAGE -nologo controlvm $v acpipowerbutton
-                        wait=30
-                    done
-                    succ_msg
-                elif [ "$SHUTDOWN" = "savestate" ]; then
-                    begin_msg "Saving state of remaining VMs"
-                    for v in $VMS; do
-                        $VBOXMANAGE -nologo controlvm $v savestate
-                    done
-                    succ_msg
-                fi
-            fi
-        fi
-    done
-    # wait for some seconds when doing ACPI shutdown
-    if [ "$wait" -ne 0 ]; then
-        begin_msg "Waiting for $wait seconds for VM shutdown"
-        sleep $wait
-        succ_msg
-    fi
-}
-
-setup()
-{
-    stop
-    if find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
-      begin_msg "Removing old VirtualBox kernel module"
-      find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-      succ_msg
-    fi
-    begin_msg "Recompiling VirtualBox kernel module"
-    if ! $BUILDINTMP install > $LOG 2>&1; then
-        failure "Look at $LOG to find out what went wrong"
-    fi
-    succ_msg
-    start
-}
-
-dmnstatus()
-{
-    if running; then
-        echo "VirtualBox kernel module is loaded."
-        for i in $SHUTDOWN_USERS; do
-            # don't create the ipcd directory with wrong permissions!
-            if [ -d /tmp/.vbox-$i-ipc ]; then
-                export VBOX_IPC_SOCKETID="$i"
-                VMS=`$VBOXMANAGE -nologo list runningvms 2>/dev/null`
-                if [ -n "$VMS" ]; then
-                    echo "The following VMs are currently running:"
-                    for v in $VMS; do
-                       echo "  $v"
-                    done
-                fi
-            fi
-        done
-    else
-        echo "VirtualBox kernel module is not loaded."
-    fi
-}
-
-case "$1" in
-start)
-    start
-    ;;
-stop)
-    stop_vms
-    stop
-    ;;
-stop_vms)
-    stop_vms
-    ;;
-restart)
-    stop && start
-    ;;
-force-reload)
-    stop
-    start
-    ;;
-setup)
-    setup
-    ;;
-status)
-    dmnstatus
-    ;;
-*)
-    echo "Usage: $0 {start|stop|stop_vms|restart|force-reload|status|setup}"
-    exit 1
-esac
-
-exit 0
Index: unk/debian/vboxnet.init.in
===================================================================
--- /trunk/debian/vboxnet.init.in	(revision 9189)
+++ 	(revision )
@@ -1,357 +1,0 @@
-#! /bin/sh
-# Sun xVM VirtualBox
-# Linux static host networking interface initialization
-#
-
-#
-# Copyright (C) 2007 Sun Microsystems, Inc.
-#
-# 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 (GPL) 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.
-#
-
-# chkconfig: 35 30 60
-# description: VirtualBox permanent host networking setup
-#
-### BEGIN INIT INFO
-# Provides:       vboxnet
-# Required-Start: $network
-# Required-Stop:
-# Default-Start:  3 5
-# Default-Stop:
-# Description:    VirtualBox permanent host networking setup
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
-CONFIG="/etc/vbox/interfaces"
-VARDIR="/var/run/VirtualBox"
-VARFILE="/var/run/VirtualBox/vboxnet"
-TAPDEV="/dev/net/tun"
-NOLSB=%NOLSB%
-
-[ -f /lib/lsb/init-functions ] || NOLSB=yes
-
-if [ -n "$NOLSB" ]; then
-    if [ -f /etc/redhat-release ]; then
-        system=redhat
-    elif [ -f /etc/SuSE-release ]; then
-        system=suse
-    elif [ -f /etc/gentoo-release ]; then
-        system=gentoo
-    fi
-fi
-
-if [ -z "$NOLSB" ]; then
-    . /lib/lsb/init-functions
-    fail_msg() {
-        echo ""
-        log_failure_msg "$1"
-    }
-    succ_msg() {
-        log_success_msg " done."
-    }
-    begin_msg() {
-        log_daemon_msg "$@"
-    }
-else
-    if [ "$system" = "redhat" ]; then
-        . /etc/init.d/functions
-        fail_msg() {
-            echo_failure
-            echo
-            echo "  ($1)"
-        }
-        succ_msg() {
-            echo_success
-            echo
-        }
-    elif [ "$system" = "suse" ]; then
-        . /etc/rc.status
-        fail_msg() {
-            rc_failed 1
-            rc_status -v
-            echo "  ($1)"
-        }
-        succ_msg() {
-            rc_reset
-            rc_status -v
-        }
-    elif [ "$system" = "gentoo" ]; then
-        . /sbin/functions.sh
-        fail_msg() {
-            eerror "$1"
-        }
-        succ_msg() {
-            eend "$?"
-        }
-        begin_msg() {
-            ebegin "$1"
-        }
-        if [ "`which $0`" = "/sbin/rc" ]; then
-            shift
-        fi
-    else
-        fail_msg() {
-            echo " ...failed!"
-            echo "  ($1)"
-        }
-        succ_msg() {
-            echo " ...done."
-        }
-    fi
-    if [ "$system" != "gentoo" ]; then
-        begin_msg() {
-            [ -z "${1:-}" ] && return 1
-            if [ -z "${2:-}" ]; then
-                echo -n "$1"
-            else
-                echo -n "$1: $2"
-            fi
-        }
-    fi
-fi
-
-failure()
-{
-    fail_msg "$1"
-    # never return with exit code != 0
-    exit 0
-}
-
-running()
-{
-    test -f "$VARFILE"
-}
-
-# Create all permanent TAP devices registered on the system, add them to a
-# bridge if required and keep a record of proceedings in the file
-# /var/run/VirtualBox/vboxnet.  If this file already exists, assume that the
-# script has already been started and do nothing.
-start_network()
-{
-    begin_msg "Starting VirtualBox host networking"
-    # If the service is already running, return successfully.
-    if [ -f "$VARFILE" ]; then
-      succ_msg
-      return 0
-    fi
-    # Fail if we can't create our runtime record file
-    if [ ! -d "$VARDIR" ]; then
-      if ! mkdir "$VARDIR" 2> /dev/null; then
-        failure "Cannot create $VARDIR"
-      fi
-    fi
-    if ! touch "$VARFILE" 2> /dev/null; then
-      failure "Cannot create $VARFILE"
-    fi
-    # If there is no configuration file, report success
-    if [ ! -f "$CONFIG" ]; then
-      succ_msg
-      return 0
-    fi
-    # Fail if we can't read our configuration
-    if [ ! -r "$CONFIG" ]; then
-      failure "Cannot read $CONFIG"
-    fi
-    # Fail if we don't have tunctl
-    if ! VBoxTunctl -h 2>&1 | grep VBoxTunctl > /dev/null; then
-      failure "VBoxTunctl not found"
-    fi
-    # Fail if we don't have the kernel tun device
-    # Make sure that the tun module is loaded (Ubuntu 7.10 needs this)
-    modprobe tun > /dev/null 2>&1
-    if ! cat /proc/misc 2>/dev/null | grep tun > /dev/null; then
-      failure "Linux tun/tap subsystem not available"
-    fi
-    succ_msg
-    # Read the configuration file entries line by line and create the
-    # interfaces
-    while read line; do
-      set ""$line
-      # If the line is a comment then ignore it
-      if ((! expr match "$1" "#" > /dev/null) && (! test -z "$1")); then
-        # Check that the line is correctly formed (an interface name plus one
-        # or two non-comment entries, possibly followed by a comment).
-        if ((! expr match "$2" "#" > /dev/null) &&
-            (test -z "$4" || expr match "$4" "#" > /dev/null)); then
-          # As the very first thing, try delete the interface. Might already
-          # exist with different configuration. Ignore errors.
-          VBoxTunctl -d $1 > /dev/null 2>&1
-          case $user in
-            +*)
-                group=`echo $2 | cut -c2-`
-                cmd="VBoxTunctl -t $1 -g $group"
-                ;;
-            *)
-                cmd="VBoxTunctl -t $1 -u $2"
-                ;;
-          esac
-          # Try to create the interface
-          if $cmd > /dev/null 2>&1; then
-            # On SUSE Linux Enterprise Server, the interface does not
-            # appear immediately, so we loop trying to bring it up.
-            i=1
-            while [ $i -le 10 ]; do
-              ifconfig "$1" up 2> /dev/null
-              if ifconfig | grep "$1" > /dev/null; then
-                # Add the interface to a bridge if one was specified
-                if [ -n "$3" ]; then
-                  if brctl addif "$3" "$1" 2> /dev/null; then
-                    echo "$1 $2 $3" >> "$VARFILE"
-                  else
-                    echo "$1 $2" >> "$VARFILE"
-                    echo "Warning - failed to add interface $1 to the bridge $3"
-                  fi
-                else
-                  echo "$1 $2" >> "$VARFILE"
-                fi
-                i=20
-              else
-                i=`expr $i + 1`
-                sleep .1
-              fi
-            done
-            if [ $i -ne 20 ]; then
-              echo "Warning - failed to bring up the interface $1"
-            fi
-          else
-            echo "Warning - failed to create the interface $1 for the user $2"
-          fi
-        else
-          echo "Warning - invalid line in $CONFIG:"
-          echo "  $line"
-        fi
-      fi
-    done < "$CONFIG"
-    # Set /dev/net/tun to belong to the group vboxusers if it exists and does
-    # yet belong to a group.
-    if ls -g "$TAPDEV" 2>/dev/null | grep root > /dev/null; then
-      chgrp vboxusers "$TAPDEV"
-      chmod 0660 "$TAPDEV"
-    fi
-    return 0
-}
-
-# Shut down VirtualBox host networking and remove all permanent TAP
-# interfaces.  This action will fail if some interfaces could not be removed.
-stop_network()
-{
-    begin_msg "Shutting down VirtualBox host networking"
-    # If there is no runtime record file, assume that the service is not
-    # running.
-    if [ ! -f "$VARFILE" ]; then
-      succ_msg
-      return 0
-    fi
-    # Fail if we can't read our runtime record file or write to the
-    # folder it is located in
-    if [ ! -r "$VARFILE" -o ! -w "$VARDIR" ]; then
-      failure "Failed to read $VARFILE or to write $VARDIR"
-    fi
-    # Fail if we don't have tunctl
-    if ! VBoxTunctl -h 2>&1 | grep VBoxTunctl > /dev/null; then
-      failure "VBoxTunctl not found"
-    fi
-    # Read the runtime record file entries line by line and delete the
-    # interfaces.  The format of the runtime record file is not checked for
-    # errors.
-    while read line; do
-      set ""$line
-      # Remove the interface from a bridge if it is part of one
-      if [ -n "$3" ]; then
-        brctl delif "$3" "$1" 2> /dev/null
-      fi
-      # Remove the interface.  Roll back everything and fail if this is not
-      # possible
-      if (! ifconfig "$1" down 2> /dev/null ||
-          ! VBoxTunctl -d "$1" > /dev/null 2>&1); then
-        while read line; do
-          set ""$line
-          VBoxTunctl -t "$1" -u "$2" > /dev/null 2>&1
-          ifconfig "$1" up 2> /dev/null
-          if [ -n "$3" ]; then
-            brctl addif "$3" "$1"
-          fi
-        done < "$VARFILE"
-      fi
-    done < "$VARFILE"
-    rm -f "$VARFILE" 2> /dev/null
-    succ_msg
-    return 0
-}
-
-# Shut down VirtualBox host networking and remove all permanent TAP
-# interfaces.  This action will succeed even if not all interfaces could be
-# removed.  It is only intended for exceptional circumstances such as
-# uninstalling VirtualBox.
-force_stop_network()
-{
-    begin_msg "Shutting down VirtualBox host networking"
-    # If there is no runtime record file, assume that the service is not
-    # running.
-    if [ ! -f "$VARFILE" ]; then
-      succ_msg
-      return 0
-    fi
-    # Fail if we can't read our runtime record file or write to the
-    # folder it is located in
-    if [ ! -r "$VARFILE" -o ! -w "$VARDIR" ]; then
-      failure "Failed to read $VARFILE or to write $VARDIR"
-    fi
-    # Fail if we don't have tunctl
-    if ! VBoxTunctl -h 2>&1 | grep VBoxTunctl > /dev/null; then
-      failure "VBoxTunctl not found"
-    fi
-    # Read the runtime record file entries line by line and delete the
-    # interfaces.  The format of the runtime record file is not checked for
-    # errors.
-    while read line; do
-      set ""$line
-      # Remove the interface from a bridge if it is part of one
-      if [ -n "$3" ]; then
-        brctl delif "$3" "$1" 2> /dev/null
-      fi
-      # Remove the interface.
-      ifconfig "$1" down 2> /dev/null
-      VBoxTunctl -d "$1" > /dev/null 2>&1
-    done < "$VARFILE"
-    rm -f "$VARFILE" 2> /dev/null
-    succ_msg
-    return 0
-}
-
-case "$1" in
-start)
-    start_network
-    ;;
-stop)
-    stop_network
-    ;;
-restart|reload)
-    stop_network && start_network
-    ;;
-force-reload)
-    stop_network
-    start_network
-    ;;
-force-stop)
-    force_stop_network
-    ;;
-status)
-    if running; then
-        echo "VirtualBox host networking is loaded."
-    else
-        echo "VirtualBox host networking is not loaded."
-    fi
-    ;;
-*)
-    echo "Usage: `basename $0` {start|stop|force-stop|restart|force-reload|status}"
-    exit 1
-esac
-
-exit 0
Index: /trunk/src/VBox/Installer/linux/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/linux/Makefile.kmk	(revision 9189)
+++ /trunk/src/VBox/Installer/linux/Makefile.kmk	(revision 9190)
@@ -207,5 +207,5 @@
 
 $(PATH_TARGET)/vboxdrv.sh: vboxdrv.sh.in
-	$(QUIET)$(SED_EXT) -e "s|%NOLSB%|yes|g" $< > $@
+	$(QUIET)$(SED_EXT) -e "s|%NOLSB%|yes|g; s|%PACKAGE%|virtualbox|g" $< > $@
 
 $(PATH_TARGET)/vboxnet.sh: vboxnet.sh.in
Index: /trunk/src/VBox/Installer/linux/vboxdrv.sh.in
===================================================================
--- /trunk/src/VBox/Installer/linux/vboxdrv.sh.in	(revision 9189)
+++ /trunk/src/VBox/Installer/linux/vboxdrv.sh.in	(revision 9190)
@@ -41,6 +41,6 @@
     BUILDINTMP="$INSTALL_DIR/src/build_in_tmp"
 else
-    VBOXMANAGE="/usr/lib/virtualbox/VBoxManage"
-    BUILDINTMP="/usr/share/virtualbox/src/build_in_tmp"
+    VBOXMANAGE="/usr/lib/%PACKAGE%/VBoxManage"
+    BUILDINTMP="/usr/share/%PACKAGE%/src/build_in_tmp"
 fi
 
@@ -55,5 +55,5 @@
 fi
 
-[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
+[ -r /etc/default/%PACKAGE% ] && . /etc/default/%PACKAGE%
 
 if [ -z "$NOLSB" ]; then
@@ -197,5 +197,5 @@
 }
 
-# enter the following variables in /etc/default/virtualbox:
+# enter the following variables in /etc/default/%PACKAGE%:
 #   SHUTDOWN_USERS="foo bar"  
 #     check for running VMs of user foo and user bar
