Bug 141013 - [patch] emulators/virtualbox: Fix kernel module loading for vboxnetadp.ko
Summary: [patch] emulators/virtualbox: Fix kernel module loading for vboxnetadp.ko
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Beat Gaetzi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-30 06:10 UTC by Scot Hetzel
Modified: 2009-12-09 12:40 UTC (History)
0 users

See Also:


Attachments
file.diff (1.46 KB, patch)
2009-11-30 06:10 UTC, Scot Hetzel
no flags Details | Diff
vbox.diff (2.06 KB, patch)
2009-11-30 07:12 UTC, Scot Hetzel
no flags Details | Diff
vbox-dep.patch (1.13 KB, patch)
2009-12-06 17:40 UTC, Fredrik Lindberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scot Hetzel 2009-11-30 06:10:00 UTC
Currently, when loading the vboxnetadp kernel module, you first need to load the vboxnetflt kernel module.

When vboxnetadp is loaded first, it produces this error message:

dv8t01# kldload vboxnetadp
kldload: can't load vboxnetadp: Exec format error

The problem is that vboxnetadp.ko expects to find a kernel module named ng_vboxnetflt.ko in the modules path, but no such module exists.

There are 2 ways to fix this problem:

1. rename vboxnetflt.ko to ng_vboxnetflt.ko in the KMODDIR

2. Patch src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c to change the MODULE_DEPEND to use vboxnetflt instead of ng_vboxnetflt

Fix: The attached patch changes the vboxnetadp.ko to depend on vboxnetflt.ko instead of ng_vboxnetflt.ko.

Patch attached with submission follows:
How-To-Repeat: install virtualbox, and then kldload vboxnetadp
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-11-30 06:10:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vbox

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Scot Hetzel 2009-11-30 07:12:34 UTC
Sorry about this, but that previous patch doesn't work.

Attached is the patch that does work.

This patch changes renames vboxnetflt.ko to ng_vboxnetflt.ko

I only added load_vboxnetadp="YES" to /boot/loader.conf, rebooted, and
was able to verify that this caused vboxnetadp.ko to load along with
it's dependancies vboxdrv.ko and ng_vboxnetflt.ko modules.

Scot
Comment 3 Fredrik Lindberg 2009-12-06 17:40:14 UTC
I would really like to avoid prefixing the module with ng_. It's only a
netgraph node because it's currently the only viable way to hook into
the interface path, this might change in the future.

I think the following patch might be better, even though the module
name to MODULE_VERSION won't match MODULE_DECLARE.

Fredrik
Comment 4 Scot Hetzel 2009-12-07 03:54:20 UTC
On 12/6/09, Fredrik Lindberg <fli@shapeshifter.se> wrote:
> I would really like to avoid prefixing the module with ng_. It's only a
>  netgraph node because it's currently the only viable way to hook into
>  the interface path, this might change in the future.
>
>  I think the following patch might be better, even though the module
>  name to MODULE_VERSION won't match MODULE_DECLARE.
>
Thanks for looking into this.  I verified that your patch also solves
the problem.

Scot
Comment 5 Beat Gaetzi freebsd_committer freebsd_triage 2009-12-09 12:20:31 UTC
Responsible Changed
From-To: vbox->beat

I'll take it.
Comment 6 dfilter service freebsd_committer freebsd_triage 2009-12-09 12:31:59 UTC
beat        2009-12-09 12:31:45 UTC

  FreeBSD ports repository

  Modified files:
    emulators/virtualbox Makefile 
    emulators/virtualbox/files 
                               patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c 
  Added files:
    emulators/virtualbox/files 
                               patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c 
  Log:
  - Fix loading of vboxnetadp.ko kernel module without loading vboxnetflt.ko
    kernel module first.
  - Bump PORTREVISION.
  
  PR:                     ports/141013
  Reported / tested by:   Scot Hetzel <swhetzel AT gmail.com>
  Submitted by:           Fredrik Lindberg <fli AT shapeshifter.se>
  
  Revision  Changes    Path
  1.13      +1 -1      ports/emulators/virtualbox/Makefile
  1.1       +11 -0     ports/emulators/virtualbox/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c (new)
  1.2       +9 -0      ports/emulators/virtualbox/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 Beat Gaetzi freebsd_committer freebsd_triage 2009-12-09 12:34:25 UTC
State Changed
From-To: open->closed

Committed. Thanks!