1
0
forked from jengelh/virtualbox
virtualbox/vboxconfig.sh
Larry Finger 79cdaa4a04 - Fix some typos in the various service files as noted in boo#1044931.
With these fixes, TW guests start correctly. In addition, the /sbin/vboxconfig (for hosts) and the
  /sbin/vboxguestconfig (for guests) work correctly.

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=340
2017-06-25 00:21:46 +00:00

48 lines
1.3 KiB
Bash

#!/bin/bash
#
# Script to build VirtualBox host kernel modules
# Copyright C 2017 by Larry Finger
#
# This script is part of the openSUSE VirtualBox package
#
SOURCE="/usr/src/kernel-modules/virtualbox/src"
LOGFILE="/var/log/virtualbox.log"
INCLUDE="/lib/modules/`uname -r`/build/include"
# Force installation of VB host sources. Zypper will install all the prerequisies
echo "Installing all required packages..."
killproc PackageKit
zypper install -y virtualbox-host-source > /dev/null 2>&1
if [ ! $? ] ; then
echo "Installation of required packages failed."
echo "Use 'sudo zypper install virtualbox-host-source' to see the reason."
exit 1
fi
# Prerequisites are available, start build
pushd $SOURCE > /dev/null 2>&1
echo "Building kernel modules..."
make > $LOGFILE 2>&1
if [ ! $? ] ; then
echo ""
echo "Build of VirtualBox host kernel modules failed."
echo "Look at $LOGFILE to find reasons."
popd > /dev/null 2>&1
exit 1
else
echo "Kernel modules built correctly. They will now be installed."
fi
make install >> $LOGFILE 2>&1
if [ ! $? ] ; then
echo ""
echo "Installation of VirtualBox host kernel modules failed."
echo "Look at $LOGFILE to find reasons."
popd > /dev/null 2>&1
exit 1
fi
depmod -a
modprobe -av vboxnetflt vboxnetadp vboxpci
popd > /dev/null 2>&1
echo "Kernel modules are installed and loaded."
exit 0