wok-current view get-virtualbox/stuff/installer.u @ rev 7543

mplayer-svn:add depends
author fireflyoo <lufeng369@gmail.com>
date Tue Dec 07 23:24:12 2010 +0800 (2010-12-07)
parents 734283599021
children
line source
1 --- stuff/get-virtualbox Thu Jan 7 14:12:34 2010
2 +++ get-virtualbox Fri Jan 15 11:39:10 2010
3 @@ -57,6 +57,159 @@
4 cd install
5 [ -d /usr/share/VirtualBox ] && ./uninstall.sh
6 find /usr /etc /lib > ../before
7 +
8 +
9 +# Add Slitaz support to VirtualBox installer.
10 patch -p1 <<'EOT'
11 +--- install-ori/routines.sh Thu Dec 17 14:37:35 2009
12 ++++ install/routines.sh Thu Dec 24 13:33:02 2009
13 +@@ -207,6 +207,10 @@
14 + ro_SYS_TYPE=unknown
15 + ro_INIT_TYPE=bsd
16 + ro_RC_LOCAL=/etc/rc.local
17 ++ elif [ -f /etc/slitaz-release ]; then
18 ++ ro_SYS_TYPE=slitaz
19 ++ ro_INIT_TYPE=slitaz
20 ++ ro_RC_LOCAL=/etc/rcS.conf
21 + elif [ -d /etc/init.d ]; then
22 + ro_SYS_TYPE=unknown
23 + ro_INIT_TYPE=sysv
24 +@@ -252,6 +256,9 @@
25 + cp "$script" "/usr/sbin/$name" 2> /dev/null
26 + chmod 755 "/usr/sbin/$name" 2> /dev/null
27 + hav register $name System.Service $pardus_script
28 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
29 ++ cp "$script" "/etc/init.d/$name" 2> /dev/null
30 ++ chmod 755 "/etc/init.d/$name" 2> /dev/null
31 + else
32 + log "install_init_script: error: unknown init type"
33 + return 1
34 +@@ -279,6 +286,8 @@
35 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
36 + hav remove $name
37 + rm -f "/usr/sbin/$name" > /dev/null 2>&1
38 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
39 ++ rm -f "/etc/init.d/$name" > /dev/null 2>&1
40 + else
41 + log "remove_init_script: error: unknown init type"
42 + return 1
43 +@@ -303,6 +312,8 @@
44 + "/etc/rc.d/rc.$name" start >> $ro_LOG_FILE 2>&1
45 + elif [ "$ro_INIT_TYPE" = "lfs" ]; then
46 + "/etc/rc.d/init.d/$name" start >> $ro_LOG_FILE 2>&1
47 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
48 ++ "/etc/init.d/$name" start >> $ro_LOG_FILE 2>&1
49 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
50 + service $name on
51 + else
52 +@@ -328,6 +339,8 @@
53 + "/etc/rc.d/rc.$name" stop >> $ro_LOG_FILE 2>&1
54 + elif [ "$ro_INIT_TYPE" = "lfs" ]; then
55 + "/etc/rc.d/init.d/$name" stop >> $ro_LOG_FILE 2>&1
56 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
57 ++ "/etc/init.d/$name" stop >> $ro_LOG_FILE 2>&1
58 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
59 + service $name off
60 + else
61 +@@ -425,6 +438,12 @@
62 + echo "fi" >> $ro_RC_LOCAL
63 + echo "" >> $ro_RC_LOCAL
64 + fi
65 ++ # Slitaz GNU/Linux use /etc/rcS.conf to start services.
66 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
67 ++ if ! grep $1 $ro_RC_LOCAL
68 ++ then
69 ++ sed -i -e "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"\1 $1\"/" $ro_RC_LOCAL
70 ++ fi
71 + # Probably most unknown Linux systems will be sysv type ones. These can theoretically
72 + # be handled automatically if people give us information about them.
73 + elif [ "$ro_INIT_TYPE" = "sysv" ]; then
74 +@@ -484,6 +503,12 @@
75 + rm "/etc/rc4.d/S??$1" > /dev/null 2>&1
76 + rm "/etc/rc5.d/S??$1" > /dev/null 2>&1
77 + rm "/etc/rc6.d/K??$1" > /dev/null 2>&1
78 ++ # Slitaz GNU/Linux
79 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
80 ++ if grep $1 $ro_RC_LOCAL
81 ++ then
82 ++ sed -i -e "s/$1//" $ro_RC_LOCAL
83 ++ fi
84 + # Unknown sysv-type system
85 + elif [ "$ro_INIT_TYPE" = "sysv" ]; then
86 + echo 1>&2 "Please remove remove references to the initialization script"
87 +@@ -515,6 +540,8 @@
88 + scriptname="/etc/rc.d/init.d/$name"
89 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
90 + scriptname="/usr/sbin/$name"
91 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
92 ++ scriptname="/etc/init.d/$name"
93 + else
94 + log "$self: error: unknown init type"
95 + return 1
96 +@@ -563,6 +590,8 @@
97 + scriptname="/etc/rc.d/init.d/$name"
98 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
99 + scriptname="/usr/sbin/$name"
100 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
101 ++ scriptname="/etc/rc.d/init.d/$name"
102 + else
103 + log "$self: error: unknown init type"
104 + return 1
105 +--- install-ori/vboxdrv.sh Thu Dec 17 14:37:35 2009
106 ++++ install/vboxdrv.sh Thu Dec 24 11:49:30 2009
107 +@@ -63,6 +63,8 @@
108 + system=suse
109 + elif [ -f /etc/gentoo-release ]; then
110 + system=gentoo
111 ++ elif [ -f /etc/slitaz-release ]; then
112 ++ system=slitaz
113 + fi
114 + fi
115 +
116 +@@ -123,6 +125,19 @@
117 + if [ "`which $0`" = "/sbin/rc" ]; then
118 + shift
119 + fi
120 ++ elif [ "$system" = "slitaz" ]; then
121 ++ if [ -f /etc/init.d/rc.functions ]; then
122 ++ . /etc/init.d/rc.functions
123 ++ fi
124 ++ fail_msg() {
125 ++ status
126 ++ }
127 ++ succ_msg() {
128 ++ status "$?"
129 ++ }
130 ++ begin_msg() {
131 ++ echo "$1"
132 ++ }
133 + else
134 + fail_msg() {
135 + echo " ...failed!"
136 +@@ -132,6 +147,7 @@
137 + echo " ...done."
138 + }
139 + fi
140 ++
141 + if [ "$system" != "gentoo" ]; then
142 + begin_msg() {
143 + [ -z "${1:-}" ] && return 1
144 +@@ -169,7 +185,11 @@
145 + if ! modprobe vboxdrv > /dev/null 2>&1; then
146 + failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why"
147 + fi
148 +- sleep .2
149 ++ if [ "$system" = "slitaz" ]; then
150 ++ sleep 1
151 ++ else
152 ++ sleep .2
153 ++ fi
154 + fi
155 + # ensure the character special exists
156 + if [ ! -c $DEVICE ]; then
157 +
158 +EOT
159 +
160 ./install.sh install /usr/share/VirtualBox
161 cd ..
162 find /usr /etc /lib > after
163 @@ -82,6 +235,11 @@
164 {
165 $(grep ' udev[atp]' install/install.sh)
166 chroot "\$1/" depmod -a $(uname -r)
167 +
168 + # Add vboxusers group
169 + if (! grep -q ^vboxusers /etc/group); then
170 + addgroup vboxusers
171 + fi
172 }
173 EOT