summaryrefslogtreecommitdiff
path: root/libre/virtualbox-libre/vboxbuild
diff options
context:
space:
mode:
Diffstat (limited to 'libre/virtualbox-libre/vboxbuild')
-rw-r--r--libre/virtualbox-libre/vboxbuild30
1 files changed, 20 insertions, 10 deletions
diff --git a/libre/virtualbox-libre/vboxbuild b/libre/virtualbox-libre/vboxbuild
index 4bc8e0c9d..27519950f 100644
--- a/libre/virtualbox-libre/vboxbuild
+++ b/libre/virtualbox-libre/vboxbuild
@@ -1,13 +1,23 @@
#!/bin/bash
-. /etc/rc.conf
-. /etc/rc.d/functions
. /etc/vbox/vbox.cfg
MODLIST=()
LOG="/var/log/vbox-install.log"
>| "$LOG"
+stat_busy() {
+ printf '==> %s ... ' "$1"
+}
+
+stat_done() {
+ echo 'done'
+}
+
+stat_fail() {
+ echo 'failed'
+}
+
if [[ $INSTALL_DIR ]]; then
VBOXMANAGE=$INSTALL_DIR/VBoxManage
BUILDVBOXDRV=$INSTALL_DIR/src/vboxdrv/build_in_tmp
@@ -25,16 +35,16 @@ if [[ -f /proc/modules ]]; then
fi
if (( ${#MODLIST[*]} )); then
- stat_busy "Unloading VirtualBox kernel modules"
+ stat_busy "Unloading VirtualBox kernel libre modules"
modprobe -ar "${MODLIST[@]}" && stat_done || stat_fail
fi
-for kdir in /lib/modules/[2-3]*; do
+for kdir in /usr/lib/modules/[2-3]*; do
if [[ ! -d $kdir/kernel ]]; then
# found a stale kernel
mods=("$kdir/extramodules"{drv,netadp,netflt,pci}.ko*)
if (( ${#mods[@]} )); then
- stat_busy "Removing all old VirtualBox kernel modules"
+ stat_busy "Removing all old VirtualBox kernel libre modules"
if rm -f "${mods[@]}" &&
rmdir -p --ignore-fail-on-non-empty "$kdir/extramodules" 2>/dev/null; then
stat_done
@@ -51,15 +61,15 @@ if (( ! $# )); then
fi
for kernver; do
- export KERN_DIR=/lib/modules/$kernver/build
- export MODULE_DIR=/lib/modules/$kernver/extramodules
+ export KERN_DIR=/usr/lib/modules/$kernver/build
+ export MODULE_DIR=/usr/lib/modules/$kernver/extramodules
if [[ ! -d $KERN_DIR ]]; then
- printf "error: \`%s' does not appear to be a valid kernel build directory.\n" \
+ printf "error: \`%s' does not appear to be a valid kernel libre build directory.\n" \
"$KERN_DIR"
continue
fi
- stat_busy "Recompiling VirtualBox kernel modules ($kernver)"
+ stat_busy "Recompiling VirtualBox kernel libre modules ($kernver)"
if ! $BUILDVBOXDRV \
--save-module-symvers /tmp/vboxdrv-Module.symvers \
--no-print-directory install >> $LOG 2>&1; then
@@ -80,6 +90,6 @@ for kernver; do
done
if (( ${#MODLIST[*]} )); then
- stat_busy "Reloading VirtualBox kernel modules"
+ stat_busy "Reloading VirtualBox kernel libre modules"
modprobe -a "${MODLIST[@]}" && stat_done || stat_fail
fi