You are not logged in.

#1 2010-01-03 10:35:33

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

[SOLVED] virtualbox module install dir var. Where is it set?

I've run into an issue with the virtualbox-sun build from AUR. I can't setup the module with the command

/etc/rc.d/vboxdrv setup

I keep getting the error

:: Building/installing vbox modules for Linux 2.6.32-ARCH x86_64   [BUSY] 
/etc/rc.d/vboxdrv: line 54: cd: /src: No such file or directory  [FAIL] 
 > See '/var/log/vboxdrv-setup.log' for further details

Looking at the vboxdrv file I can see there is a variable $INSTALL_DIR used on line 54, but I can find no line where it is set.

/var/log/vboxdrv-setup.log contains only this line

make: *** No targets specified and no makefile found.  Stop.

I read the news about the kernel package split, so I have installed the headers package

[rene@ArchLounge ~]$ pacman -Q kernel26 kernel26-headers
kernel26 2.6.32.2-2
kernel26-headers 2.6.32.2-2

A search on the forum gave me the thread http://bbs.archlinux.org/viewtopic.php?id=87788. According to this I may need to run mkinitcpio. I did that by reinstalling the kernel. Don't know if that is enough though?

Looking in my /etc/rc.d/ folder I can't find the file called dkms_autoinstaller. (also used in the vboxdrv file.) Is this file needed? If yes where do I find it?

Last edited by madeye (2010-01-07 10:39:08)


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#2 2010-01-05 18:29:50

einhard
Member
From: Poland
Registered: 2010-01-05
Posts: 89

Re: [SOLVED] virtualbox module install dir var. Where is it set?

Try this on line 54

cd "/usr/lib/virtualbox/src"

If it doesn't wok just find path to your vboxdrv directory. Changing name from vboxdrv-3.1.2 to vboxdrv in usr/src/ should also help.

Last edited by einhard (2010-01-05 18:31:06)

Offline

#3 2010-01-06 10:15:33

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED] virtualbox module install dir var. Where is it set?

Thanks for the help. That was exactly what I needed.

I found that after changing the path to /usr/src/vboxdrv-3.1.2 the vboxdrv would build, however the other two modules (vboxnetadp and vboxnetflt) didn't.

I have now modified the script to build those two modules also. Here is the new script: (Please note that only the INSTALL_DIR var at the beginning and the setup section of the original script has been modified.)

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/vboxdrv

INSTALL_DIR="/usr" # No trailing slash!

case "$1" in
    start)
    stat_busy "Loading modules for VirtualBox"
    for module in "${MODULES[@]}"; do
        if [ "$module" = "${module#!}" ]; then
        modprobe -q $module >/dev/null 2>&1
        grep -q ^$module /proc/modules
        if [ $? -ne 0 ]; then
            res=$?; break
        fi
        fi
    done
    if [ -n "$res" ]; then
        stat_fail
        printhl "Try running '$0 setup', of course without quotes"
    else
        add_daemon vboxdrv
        stat_done
    fi
    ;;
    stop)
    stat_busy "Unloading modules for VirtualBox"
    for module in "${MODULES[@]}"; do
        if [ "$module" = "${module#!}" ]; then
        REVERSE="$module $REVERSE"
        fi
    done
    if modprobe -q -r $REVERSE >/dev/null 2>&1; then
        rm_daemon vboxdrv
        stat_done
    else
        stat_fail
    fi
    ;;
    restart)
    $0 stop
    $0 start
    ;;
    setup)
    if [ -x /etc/rc.d/dkms_autoinstaller ]; then
        for module in "${MODULES[@]}"; do
        dkms add -m $module -v $VBOX_VERSION >/dev/null 2>&1
        done
        exec /etc/rc.d/dkms_autoinstaller start
    else
        stat_busy "Building/installing vbox modules for `uname -srm`"
        SETUP_LOG='/var/log/vboxdrv-setup.log'

        # Build vboxdrv module
        cd "$INSTALL_DIR/src/vboxdrv-$VBOX_VERSION"
        make >${SETUP_LOG} 2>&1 && make install >>${SETUP_LOG} 2>&1; RET=$?; make clean >/dev/null 2>&1

        # Build vboxnetadp module
        cd "$INSTALL_DIR/src/vboxnetadp-$VBOX_VERSION"
        make >${SETUP_LOG} 2>&1 && make install >>${SETUP_LOG} 2>&1; RET+=$?; make clean >/dev/null 2>&1

        # Build vboxnetflt module
        cd "$INSTALL_DIR/src/vboxnetflt-$VBOX_VERSION"
        make >${SETUP_LOG} 2>&1 && make install >>${SETUP_LOG} 2>&1; RET+=$?; make clean >/dev/null 2>&1

        if [ "$RET" -eq 0 ]; then
        stat_done
        else
        stat_fail
        printhl "See '${SETUP_LOG}' for further details"
        fi
    fi
    ;;
    *)
    echo "usage: $0 {start|stop|restart|setup}"
esac
# vim:set ts=4 sw=4 et:

There's just one thing that I'm not sure is OK yet. The RET var is set in the first build line, and I made it add the return value in the next two. Could this give problems?

The VBOX_VERSION var is pulled from /etc/conf.d/vboxdrv. Seemed to me to be the best way of doing this.

Please feel free to tell me if I've done something wrong or if you think I'm a complete hopeless case wink


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#4 2010-01-06 23:49:16

bdheeman
Member
From: Chandigarh, PB, India
Registered: 2008-09-15
Posts: 10
Website

Re: [SOLVED] virtualbox module install dir var. Where is it set?

@madeye: I'm sorry, it was me who indeed introduced a small bug in the script in question; here follows a patch:

--- a/etc_rc.d_vboxdrv    2009-12-27 13:24:06.000000000 +0000
+++ b/etc_rc.d_vboxdrv    2010-01-06 23:44:04.000000000 +0000
@@ -50,6 +50,7 @@
         exec /etc/rc.d/dkms_autoinstaller start
     else
         stat_busy "Building/installing vbox modules for `uname -srm`"
+        . /etc/vbox.cfg
         SETUP_LOG='/var/log/vboxdrv-setup.log'
         cd "$INSTALL_DIR/src"
         make >${SETUP_LOG} 2>&1 && make install >>${SETUP_LOG} 2>&1; RET=$?; make clean >/dev/null 2>&1

I also have updated the PKGBUILD accordingly.

Last edited by bdheeman (2010-01-06 23:51:14)


Balwinder S Dheeman
http://werc.homelinux.net/

Offline

#5 2010-01-07 10:38:42

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED] virtualbox module install dir var. Where is it set?

No problem.

It gave me a chance to look into how the rc scripts are put together smile

Marking the topic as solved.


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

Board footer

Powered by FluxBB