Annotation of /trunk/virtualbox/virtualbox-config.sh
Parent Directory | Revision Log
Revision 126 -
(hide annotations)
(download)
(as text)
Fri Apr 13 21:55:56 2007 UTC (17 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 1097 byte(s)
Fri Apr 13 21:55:56 2007 UTC (17 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 1097 byte(s)
- wrapper and config tool for virtualbox
1 | niro | 126 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/virtualbox/virtualbox-config.sh,v 1.1 2007-04-13 21:55:56 niro Exp $ | ||
3 | # Configures virtualbox for Magellan-Linux | ||
4 | |||
5 | LIBDIR=/usr/lib | ||
6 | INSTDIR=${LIBDIR}/virtualbox | ||
7 | VBOXMODULE=vboxdrv.ko | ||
8 | |||
9 | echo "Running $(basename $0) for kernelversion $(uname -r) ..." | ||
10 | |||
11 | if [ ! -f /lib/modules/$(uname -r)/source/include/linux/version.h ] | ||
12 | then | ||
13 | echo "No includes for $(uname -r) found! Aborting." | ||
14 | exit 1 | ||
15 | fi | ||
16 | |||
17 | if [[ -f /lib/modules/$(uname -r)/misc/${VBOXMODULE} ]] | ||
18 | then | ||
19 | echo "Removing old module ..." | ||
20 | rm -f /lib/modules/$(uname -r)/misc/${VBOXMODULE} | ||
21 | fi | ||
22 | |||
23 | # compile the module | ||
24 | cd ${INSTDIR}/src | ||
25 | make -C /lib/modules/$(uname -r)/source SUBDIRS=$(pwd) SRCROOT=$(pwd) clean modules | ||
26 | |||
27 | # install the module | ||
28 | install -d /lib/modules/$(uname -r)/misc | ||
29 | install -m0644 ${VBOXMODULE} /lib/modules/$(uname -r)/misc | ||
30 | |||
31 | # calc module dependencies | ||
32 | depmod -ae | ||
33 | |||
34 | # load the module | ||
35 | echo "Loading module ${VBOXMODULE} ..." | ||
36 | modprobe $(basename ${VBOXMODULE} .ko) | ||
37 | |||
38 | echo | ||
39 | echo "Virtualbox is now configured for your system." | ||
40 | echo "Do not forget to add you users to the 'virtualbox' group." | ||
41 | echo | ||
42 | |||
43 | exit 0 |