forked from pool/virtualbox
17a3ba2102
* Add VBoxVNC as a proper external pack rather than just make the so available (bnc #1037033). Thanks to Michal Nowak for most of this effort. One hack was required to work around a bug in "VBoxManage extpack install" whereby the --accept-license option failed to work. * Improve startup of VirtualBox through use of systemd service files: a. Beginning with Oracle version 5.0.8, the command used to build the kernel modules outside of the RPM packaging code changed; however, the openSUSE version did not implement the new method. That new code is now implemented. b. In Tumbleweed, the SysV init scripts to systemd service files stopped working. Part of the new code also checks to see if the kernel modules are loaded. If not, new script files are called to include the necessary packages and build the necessary modules. c. The hooks are in place to remove the sysv init files and do the complete conversion to systemd. This step will be done at a later time. * New files are "vboxconfig.sh", "vboxguestconfig.sh", "vboxdrv.service", and "vboxadd-service.service". * New sub-packages virtualbox-guest-source and virtualbox-vnc are produced. * Some typos in virtualbox.spec are fixed. - Add libelf-devel to build. Fixes bnc #1037511. Modified the startup files to build the kernel modules if they are missing. Files "vboxconfig.sh" and "vboxguestconfig" added. OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=331
48 lines
1.3 KiB
Bash
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"
|
|
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
|
|
|