Re: kldload: can't load /boot/modules/vboxdrv.ko: Exec format error

From: Brandon Gooch <jamesbrandongooch_at_gmail.com>
Date: Sat, 21 Jul 2012 10:59:19 -0500
On Sat, Jul 21, 2012 at 10:11 AM, O. Hartmann
<ohartman_at_zedat.fu-berlin.de> wrote:
> On 07/21/12 16:53, O. Hartmann wrote:
>> On FreeBSD 10.0-CURRENT #1 r238671: Sat Jul 21 16:21:32 CEST 2012
>> (/usr/src recently update, is at Revision: 238672), VirtualBox seems to
>> be broken:
>>
>> kldload: can't load /boot/modules/vboxdrv.ko: Exec format error
>>
>> When both buildworld and kernel as well as /usr/src itself were at
>> Revision: 238671, I did a build of the whole port
>> /emulators/virtual-box-ose[-kmod] to prevent the vboxdrv.ko kernel
>> module located in /boot/modules/ and its siblings being in sync with
>> /usr/src.
>>
>> But it doesn't work. I searched the net and I only found hints of the
>> form that both, /usr/src and the last time the module
>> /emulators/virtual-box-ose-kmod has been build are out of sync. This is
>> not the case in my case.
>>
>> VirtualBox is at version 4.1.18.
>>
>> What is wrong? Am I wrong and repeating an error over and over again?
>>
>> Regards,
>> Oliver
>>
>
> I found this in the message log:
>
> Jul 21 16:41:37 <0.2> thor kernel: link_elf_obj: symbol
> vm_contig_grow_cache undefined
> Jul 21 16:41:37 <0.2> thor kernel: KLD file vboxdrv.ko - could not
> finalize loading
>

The function vm_contig_grow_cache was renamed:

http://svnweb.freebsd.org/base?view=revision&revision=238561

Apply the following patch in
ports/emulators/virtualbox-ose-kmod/files, then rebuild the kmod:

Index: patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
===================================================================
--- patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
(revision 301265)
+++ patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c (working copy)
_at__at_ -149,7 +149,7 _at__at_
 +        VM_OBJECT_UNLOCK(pObject);
 +        if (pPages || tries >= 1)
 +            break;
-+        vm_contig_grow_cache(tries, 0, VmPhysAddrHigh);
++        vm_pageout_grow_cache(tries, 0, VmPhysAddrHigh);
 +        tries++;
 +    }
 +    return pPages;
_at__at_ -176,7 +176,7 _at__at_
 +        pPages = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh,
uAlignment, 0);
 +        if (pPages || tries >= 1)
 +            break;
-+        vm_contig_grow_cache(tries, 0, VmPhysAddrHigh);
++        vm_pageout_grow_cache(tries, 0, VmPhysAddrHigh);
 +        tries++;
 +    }
 +    if (!pPages)

Let us know if it works.

-Brandon
Received on Sat Jul 21 2012 - 13:59:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:29 UTC