summaryrefslogtreecommitdiffstats
path: root/system/virtualbox-ose-addons/rc.vboxadd.diff
blob: 189123c454fe6d811f971493a2d43582d3250751 (plain)
--- tmp/vboxadd.sh	2010-06-25 16:24:10.000000000 +0200
+++ mnt/progs/slack/test/VirtualBox-3.2.6_OSE/src/VBox/Additions/linux/installer/vboxadd.sh	2010-07-07 15:59:28.710046357 +0200
@@ -307,152 +307,13 @@
 # setup_script
 setup()
 {
-    # don't stop the old modules here -- they might be in use
-    if find /lib/modules/`uname -r` -name "vboxvideo\.*" 2>/dev/null|grep -q vboxvideo; then
-        begin "Removing old VirtualBox vboxvideo kernel module"
-        find /lib/modules/`uname -r` -name "vboxvideo\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-        succ_msg
-    fi
-    if find /lib/modules/`uname -r` -name "vboxsf\.*" 2>/dev/null|grep -q vboxsf; then
-        begin "Removing old VirtualBox vboxsf kernel module"
-        find /lib/modules/`uname -r` -name "vboxsf\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-        succ_msg
-    fi
-    if find /lib/modules/`uname -r` -name "vboxguest\.*" 2>/dev/null|grep -q vboxguest; then
-        begin "Removing old VirtualBox vboxguest kernel module"
-        find /lib/modules/`uname -r` -name "vboxguest\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-        succ_msg
-    fi
-    begin "Building the VirtualBox Guest Additions kernel modules"
-    if ! sh /usr/share/$PACKAGE/test/build_in_tmp \
-        --no-dkms --no-print-directory > $LOG 2>&1; then
-        fail_msg
-        printf "Your system does not seem to be set up to build kernel modules.\nLook at $LOG to find out what went wrong.  Once you have corrected it, you can\nrun\n\n  /etc/init.d/vboxadd setup\n\nto build them."
-        BUILDVBOXGUEST=""
-        BUILDVBOXSF=""
-        BUILDVBOXVIDEO=""
-    else
-        if ! sh /usr/share/$PACKAGE/test_drm/build_in_tmp \
-            --no-dkms --no-print-directory >> $LOG 2>&1; then
-            printf "\nYour guest system does not seem to have sufficient OpenGL support to enable\naccelerated 3D effects (this requires Linux 2.6.27 or later in the guest\nsystem).  This Guest Additions feature will be disabled.\n\n"
-            BUILDVBOXVIDEO=""
-        fi
-    fi
-    echo
-    if [ -n "$BUILDVBOXGUEST" ]; then
-        begin "Building the main Guest Additions module"
-        if ! $BUILDVBOXGUEST \
-            --save-module-symvers /tmp/vboxguest-Module.symvers \
-            --no-print-directory install >> $LOG 2>&1; then
-            fail "Look at $LOG to find out what went wrong"
-        fi
-        succ_msg
-    fi
-    if [ -n "$BUILDVBOXSF" ]; then
-        begin "Building the shared folder support module"
-        if ! $BUILDVBOXSF \
-            --use-module-symvers /tmp/vboxguest-Module.symvers \
-            --no-print-directory install >> $LOG 2>&1; then
-            fail "Look at $LOG to find out what went wrong"
-        fi
-        succ_msg
-    fi
-    if [ -n "$BUILDVBOXVIDEO" ]; then
-        begin "Building the OpenGL support module"
-        if ! $BUILDVBOXVIDEO \
-            --use-module-symvers /tmp/vboxguest-Module.symvers \
-            --no-print-directory install >> $LOG 2>&1; then
-            fail "Look at $LOG to find out what went wrong"
-        fi
-        succ_msg
-    fi
-    depmod
-
-    begin "Doing non-kernel setup of the Guest Additions"
-    echo "Creating user for the Guest Additions." >> $LOG
-    # This is the LSB version of useradd and should work on recent
-    # distributions
-    useradd -d /var/run/vboxadd -g 1 -r -s /bin/false vboxadd >/dev/null 2>&1
-    # And for the others, we choose a UID ourselves
-    useradd -d /var/run/vboxadd -g 1 -u 501 -o -s /bin/false vboxadd >/dev/null 2>&1
-
-    # Create udev description file
-    if [ -d /etc/udev/rules.d ]; then
-        echo "Creating udev rule for the Guest Additions kernel module." >> $LOG
-        udev_call=""
-        udev_app=`which udevadm 2> /dev/null`
-        if [ $? -eq 0 ]; then
-            udev_call="${udev_app} version 2> /dev/null"
-        else
-            udev_app=`which udevinfo 2> /dev/null`
-            if [ $? -eq 0 ]; then
-                udev_call="${udev_app} -V 2> /dev/null"
-            fi
-        fi
-        udev_fix="="
-        if [ "${udev_call}" != "" ]; then
-            udev_out=`${udev_call}`
-            udev_ver=`expr "$udev_out" : '[^0-9]*\([0-9]*\)'`
-            if [ "$udev_ver" = "" -o "$udev_ver" -lt 55 ]; then
-               udev_fix=""
-            fi
-        fi
-        ## @todo 60-vboxadd.rules -> 60-vboxguest.rules ?
-        echo "KERNEL=${udev_fix}\"vboxguest\", NAME=\"vboxguest\", OWNER=\"vboxadd\", MODE=\"0660\"" > /etc/udev/rules.d/60-vboxadd.rules
-        echo "KERNEL=${udev_fix}\"vboxuser\", NAME=\"vboxuser\", OWNER=\"vboxadd\", MODE=\"0666\"" >> /etc/udev/rules.d/60-vboxadd.rules
-    fi
-
-    # Put mount.vboxsf in the right place
-    ln -sf "$lib_path/$PACKAGE/mount.vboxsf" /sbin
-    # At least Fedora 11 and Fedora 12 demand on the correct security context when
-    # executing this command from service scripts. Shouldn't hurt for other distributions.
-    chcon -u system_u -t mount_exec_t "$lib_path/$PACKAGE/mount.vboxsf" > /dev/null 2>&1
-
-    succ_msg
-    if [ -n "$BUILDVBOXGUEST" ]; then
-        if running_vboxguest || running_vboxadd; then
-            printf "You should restart your guest to make sure the new modules are actually used\n\n"
-        else
-            start
-        fi
-    fi
+    echo "Not implemented! Please use the virtualbox-kernel-addons.SlackBuild available at SlackBuilds.org instead."
 }
 
 # cleanup_script
 cleanup()
 {
-    # Delete old versions of VBox modules.
-    DKMS=`which dkms 2>/dev/null`
-    if [ -n "$DKMS" ]; then
-      echo "Attempt to remove old DKMS modules..."
-      for mod in vboxadd vboxguest vboxvfs vboxsf vboxvideo; do
-        $DKMS status -m $mod | while read line; do
-          if echo "$line" | grep -q added > /dev/null ||
-             echo "$line" | grep -q built > /dev/null ||
-             echo "$line" | grep -q installed > /dev/null; then
-            version=`echo "$line" | sed "s/$mod,\([^,]*\)[,:].*/\1/;t;d"`
-            echo "  removing module $mod version $version"
-            $DKMS remove -m $mod -v $version --all 1>&2
-          fi
-        done
-      done
-      echo "Done."
-    fi
-
-    # Remove old installed modules
-    find /lib/modules -name vboxadd\* | xargs rm 2>/dev/null
-    find /lib/modules -name vboxguest\* | xargs rm 2>/dev/null
-    find /lib/modules -name vboxvfs\* | xargs rm 2>/dev/null
-    find /lib/modules -name vboxsf\* | xargs rm 2>/dev/null
-    find /lib/modules -name vboxvideo\* | xargs rm 2>/dev/null
-    depmod
-
-    # Remove old module sources
-    rm -rf /usr/src/vboxadd-* /usr/src/vboxguest-* /usr/src/vboxvfs-* /usr/src/vboxsf-* /usr/src/vboxvideo-*
-
-    # Remove other files
-    rm /sbin/mount.vboxsf 2>/dev/null
-    rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null
+    echo "Not implemented! Please use removepkg or pkgtool to remove virtualbox-{ose,kernel}-addons instead."
 }
 
 dmnstatus()