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