summaryrefslogtreecommitdiff
path: root/system/virtualbox-ose-addons/rc.vboxadd.diff
blob: 4f5c8fe72eb42103ff9fa64de7f452f6ccb41ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
--- vboxadd.sh.orig	2010-03-25 20:54:37.000000000 +0100
+++ vboxadd.sh	2010-03-27 18:17:26.464988367 +0100
@@ -310,142 +310,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 "vboxvfs\.*" 2>/dev/null|grep -q vboxvfs; then
-        begin "Removing old VirtualBox vboxvfs kernel module"
-        find /lib/modules/`uname -r` -name "vboxvfs\.*" 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 "`printf "Your system does not seem to be set up to build kernel modules.\nLook at $LOG to find out what went wrong"`"
-    fi
-    echo
-    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
-    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
-    if [ -n "$BUILDVBOXVFS" ]; then
-        begin "Building the shared folder support module"
-        if ! $BUILDVBOXVFS \
-            --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 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
+    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 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 vboxvideo\* | xargs rm 2>/dev/null
-    depmod
-
-    # Remove old module sources
-    rm -rf /usr/src/vboxadd-* /usr/src/vboxguest-* /usr/src/vboxvfs-* /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()