Index: /trunk/src/VBox/Installer/linux/install.sh
===================================================================
--- /trunk/src/VBox/Installer/linux/install.sh	(revision 57939)
+++ /trunk/src/VBox/Installer/linux/install.sh	(revision 57940)
@@ -130,16 +130,4 @@
 create_log $LOG
 
-# Now stop the autostart service otherwise it will keep VBoxSVC running
-stop_init_script vboxautostart-service
-
-# Now stop the ballon control service otherwise it will keep VBoxSVC running
-stop_init_script vboxballoonctrl-service
-
-# Now stop the web service otherwise it will keep VBoxSVC running
-stop_init_script vboxweb-service
-
-# Now check if no VBoxSVC daemon is running
-check_running
-
 log "VirtualBox $VERSION r$SVNREV installer, built $BUILD."
 log ""
@@ -162,21 +150,4 @@
 fi
 
-# Check that the system is setup correctly for the installation
-have_bzip2="`check_bzip2; echo $?`"     # Do we have bzip2?
-have_gmake="`check_gmake; echo $?`"     # Do we have GNU make?
-have_ksource="`check_ksource; echo $?`" # Can we find the kernel source?
-have_gcc="`check_gcc; echo $?`"         # Is GCC installed?
-
-if [ $have_bzip2 -eq 1 -o $have_gmake -eq 1 -o $have_ksource -eq 1 \
-     -o $have_gcc -eq 1 ]; then
-    info "Problems were found which would prevent VirtualBox from installing."
-    info "Please correct these problems and try again."
-    log "Giving up due to the problems mentioned above."
-    exit 1
-else
-    log "System setup appears correct."
-    log ""
-fi
-
 # Sensible default actions
 ACTION="install"
@@ -221,8 +192,5 @@
 
     # Find previous installation
-    if [ ! -r $CONFIG_DIR/$CONFIG ]; then
-        mkdir -p -m 755 $CONFIG_DIR
-        touch $CONFIG_DIR/$CONFIG
-    else
+    if test -r "$CONFIG_DIR/$CONFIG"; then
         . $CONFIG_DIR/$CONFIG
         PREV_INSTALLATION=$INSTALL_DIR
@@ -247,30 +215,5 @@
     fi
 
-    # Terminate Server and VBoxNetDHCP if running
-    terminate_proc VBoxSVC
-    terminate_proc VBoxNetDHCP
-    terminate_proc VBoxNetNAT
-
     # Remove previous installation
-    if [ -n "$PREV_INSTALLATION" -a -z "$FORCE_UPGRADE" -a ! "$VERSION" = "$INSTALL_VER" ] &&
-      expr "$INSTALL_VER" "<" "1.6.0" > /dev/null 2>&1
-    then
-        info
-        info "If you are upgrading from VirtualBox 1.5 or older and if some of your virtual"
-        info "machines have saved states, then the saved state information will be lost"
-        info "after the upgrade and will have to be discarded.  If you do not want this then"
-        info "you can cancel the upgrade now."
-        info
-        info "Do you wish to continue? [yes or no]"
-        read reply dummy
-        if ! expr "$reply" : [yY] && ! expr "$reply" : [yY][eE][sS]
-        then
-            info
-            info "Cancelling upgrade."
-            log "User requested cancellation of the installation"
-            exit 1
-        fi
-    fi
-
     if [ ! "$VERSION" = "$INSTALL_VER" -a ! "$BUILD_MODULE" = "true" -a -n "$DKMS" ]
     then
@@ -279,4 +222,5 @@
         BUILD_MODULE=true
     fi
+    test "${BUILD_MODULE}" = true || VBOX_DONT_REMOVE_OLD_MODULES=1
 
     if [ -n "$PREV_INSTALLATION" ]; then
@@ -286,35 +230,11 @@
         log ""
 
-        stop_init_script vboxnet >/dev/null 2>&1  # Do we need this?
-        delrunlevel vboxnet > /dev/null 2>&1
-        if [ "$BUILD_MODULE" = "true" ]; then
-            stop_init_script vboxdrv
-            if [ -n "$DKMS" ]
-            then
-                $DKMS remove -m vboxhost -v $INSTALL_VER --all > /dev/null 2>&1
-                $DKMS remove -m vboxdrv -v $INSTALL_VER --all > /dev/null 2>&1
-                $DKMS remove -m vboxnetflt -v $INSTALL_VER --all > /dev/null 2>&1
-                $DKMS remove -m vboxnetadp -v $INSTALL_VER --all > /dev/null 2>&1
-            fi
-            # OSE doesn't always have the initscript
-            rmmod vboxpci > /dev/null 2>&1
-            rmmod vboxnetadp > /dev/null 2>&1
-            rmmod vboxnetflt > /dev/null 2>&1
-            rmmod vboxdrv > /dev/null 2>&1
-
-            module_loaded && {
-                info "Warning: could not stop VirtualBox kernel module."
-                info "Please restart your system to apply changes."
-                log "Unable to remove the old VirtualBox kernel module."
-                log "  An old version of VirtualBox may be running."
-            }
-        else
-            VBOX_DONT_REMOVE_OLD_MODULES=1
-        fi
-
         VBOX_NO_UNINSTALL_MESSAGE=1
+        # This also checks $BUILD_MODULE and $VBOX_DONT_REMOVE_OLD_MODULES
         . ./uninstall.sh
-
-    fi
+    fi
+
+    mkdir -p -m 755 $CONFIG_DIR
+    touch $CONFIG_DIR/$CONFIG
 
     info "Installing VirtualBox to $INSTALLATION_DIR"
@@ -324,18 +244,15 @@
     # Verify the archive
     mkdir -p -m 755 $INSTALLATION_DIR
-    bzip2 -d -c VirtualBox.tar.bz2 | tar -tf - > $CONFIG_DIR/$CONFIG_FILES
-    RETVAL=$?
-    if [ $RETVAL != 0 ]; then
+    bzip2 -d -c VirtualBox.tar.bz2 > VirtualBox.tar
+    if ! tar -tf VirtualBox.tar > $CONFIG_DIR/$CONFIG_FILES; then
         rmdir $INSTALLATION_DIR 2> /dev/null
         rm -f $CONFIG_DIR/$CONFIG 2> /dev/null
         rm -f $CONFIG_DIR/$CONFIG_FILES 2> /dev/null
-        log 'Error running "bzip2 -d -c VirtualBox.tar.bz2 | tar -tf - > '"$CONFIG_DIR/$CONFIG_FILES"'".'
+        log 'Error running "bzip2 -d -c VirtualBox.tar.bz2" or "tar -tf VirtualBox.tar".'
         abort "Error installing VirtualBox.  Installation aborted"
     fi
 
     # Create installation directory and install
-    bzip2 -d -c VirtualBox.tar.bz2 | tar -xf - -C $INSTALLATION_DIR
-    RETVAL=$?
-    if [ $RETVAL != 0 ]; then
+    if ! tar -xf VirtualBox.tar -C $INSTALLATION_DIR; then
         cwd=`pwd`
         cd $INSTALLATION_DIR
@@ -344,5 +261,5 @@
         rmdir $INSTALLATION_DIR 2> /dev/null
         rm -f $CONFIG_DIR/$CONFIG 2> /dev/null
-        log 'Error running "bzip2 -d -c VirtualBox.tar.bz2 | tar -xf - -C '"$INSTALLATION_DIR"'".'
+        log 'Error running "tar -xf VirtualBox.tar -C '"$INSTALLATION_DIR"'".'
         abort "Error installing VirtualBox.  Installation aborted"
     fi
@@ -461,7 +378,6 @@
         cur=`pwd`
         log ""
-        ./vboxdrv.sh setup
         # Start VirtualBox kernel module
-        if [ $RETVAL -eq 0 ] && ! ./vboxdrv.sh start; then
+        if ! ./vboxdrv.sh setup || ! ./vboxdrv.sh start; then
             info "Failed to load the kernel module."
             MODULE_FAILED="true"
Index: /trunk/src/VBox/Installer/linux/routines.sh
===================================================================
--- /trunk/src/VBox/Installer/linux/routines.sh	(revision 57939)
+++ /trunk/src/VBox/Installer/linux/routines.sh	(revision 57940)
@@ -107,80 +107,4 @@
         fi
     fi
-}
-
-## Do we have bzip2?
-check_bzip2()
-{
-    if ! ls /bin/bzip2 /usr/bin/bzip2 /usr/local/bin/bzip2 2> /dev/null | grep bzip2 > /dev/null; then
-        echo 1>&2 "Please install the bzip2 utility."
-        log "Please install bzip2."
-        return 1
-    fi
-    return 0
-}
-
-## Do we have GNU make?
-check_gmake()
-{
-make --version 2>&1 | grep GNU > /dev/null
-    if [ ! $? = 0 ]; then
-        echo 1>&2 "Please install GNU make."
-        log "Please install GNU make."
-        return 1
-    fi
-    return 0
-}
-
-## Can we find the kernel source?
-check_ksource()
-{
-    ro_KBUILD_DIR=/lib/modules/`uname -r`/build
-    if [ ! -d $ro_KBUILD_DIR/include ]; then
-        ro_KBUILD_DIR=/usr/src/linux
-        if [ ! -d $ro_KBUILD_DIR/include ]; then
-            echo 1>&2 "Please install the build and header files for your current Linux kernel."
-            echo 1>&2 "The current kernel version is `uname -r`"
-            ro_KBUILD_DIR=""
-            log "Could not find the Linux kernel header files - the directories"
-            log "  /lib/modules/`uname -r`/build/include and /usr/src/linux/include"
-            log "  do not exist."
-            return 1
-        fi
-    fi
-    return 0
-}
-
-## Is GCC installed?
-check_gcc()
-{
-    ro_gcc_version=`gcc --version 2> /dev/null | head -n 1`
-    if [ "$ro_gcc_version" = "" ]; then
-        echo 1>&2 "Please install the GNU compiler."
-        log "Please install the GNU compiler."
-        return 1
-    fi # GCC installed
-    return 0
-}
-
-## Is bash installed?  You never know...
-check_bash()
-{
-    if [ ! -x /bin/bash ]; then
-        echo 1>&2 "Please install GNU bash."
-        log "Please install GNU bash."
-        return 1
-    fi
-    return 0
-}
-
-## Is perl installed?
-check_perl()
-{
-    if [ ! `perl -e 'print "test"' 2> /dev/null` = "test" ]; then
-        echo 1>&2 "Please install perl."
-        echo "Please install perl."
-        return 1
-    fi
-    return 0
 }
 
Index: /trunk/src/VBox/Installer/linux/run-inst.sh
===================================================================
--- /trunk/src/VBox/Installer/linux/run-inst.sh	(revision 57939)
+++ /trunk/src/VBox/Installer/linux/run-inst.sh	(revision 57940)
@@ -177,6 +177,4 @@
 
 info "$PACKAGE_NAME installer"
-
-check_bzip2
 
 # Check architecture
Index: /trunk/src/VBox/Installer/linux/uninstall.sh
===================================================================
--- /trunk/src/VBox/Installer/linux/uninstall.sh	(revision 57939)
+++ /trunk/src/VBox/Installer/linux/uninstall.sh	(revision 57940)
@@ -50,5 +50,6 @@
 # Do pre-removal common to all installer types, currently service script
 # clean-up.
-./prerm-common.sh
+test "${BUILD_MODULE}" = true && DO_DKMS="--dkms ${INSTALL_VER}"
+`dirname $0`/prerm-common.sh ${DO_DKMS} || exit 1  # Arguments intentionally not quoted.
 
 # Remove kernel module installed
