#!/bin/bash # $Header: /root/magellan-cvs/src/virtualbox/virtualbox-config.sh,v 1.2 2007-04-13 22:51:43 niro Exp $ # Configures virtualbox for Magellan-Linux LIBDIR=/usr/lib INSTDIR=${LIBDIR}/virtualbox VBOXMODULE=vboxdrv.ko if [[ $(id -u) != 0 ]] then echo "You must be r00t!" exit 1 fi echo "Running $(basename $0) for kernelversion $(uname -r) ..." if [ ! -f /lib/modules/$(uname -r)/source/include/linux/version.h ] then echo "No includes for $(uname -r) found! Aborting." exit 1 fi if [[ -f /lib/modules/$(uname -r)/misc/${VBOXMODULE} ]] then echo "Removing old module ..." rm -f /lib/modules/$(uname -r)/misc/${VBOXMODULE} fi # compile the module cd ${INSTDIR}/src make -C /lib/modules/$(uname -r)/source SUBDIRS=$(pwd) SRCROOT=$(pwd) clean modules # install the module install -d /lib/modules/$(uname -r)/misc install -m0644 ${VBOXMODULE} /lib/modules/$(uname -r)/misc # calc module dependencies depmod -ae # load the module echo "Loading module ${VBOXMODULE} ..." modprobe $(basename ${VBOXMODULE} .ko) echo echo "Virtualbox is now configured for your system." echo "Do not forget to add you users to the 'virtualbox' group." echo exit 0