Bug #2289

'kldload linux' fails

Added by thomas.nikolajsen almost 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:01/26/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

On master and DragonFly_RELEASE_3_0 from yesterday (25th January 2012)
loading linux.ko kernel module fails,
both using loader(8) and kldload(8):
link_elf: symbol sys_osethostname undefined.
(i.e. both binutils 2.22 and 2.21)

This may be binutils related;
I think it worked with binutils 2.17, will test.

This is using a custom kernel; will test GENERIC.

-
# kldload linux
link_elf: symbol sys_osethostname undefined
kldload: can't load linux: No such file or directory

History

#1 Updated by vsrinivas almost 3 years ago

1) Does the kernel have COMPAT_DF12 or COMPAT_43 defined?
2) Can you check if the kernel has the sys_osethostname symbol? (nm /boot/kernel/kernel | grep sys_osethostname)

Could someone also look at a GENERIC kernel and check if /usr/obj/<whatever>/opt_compat.h defines COMPAT_43 to '1' even if COMPAT_43 is not set in GENERIC? It looks like that is the case here, which is a problem, as it turns on awful gorp.

#2 Updated by thomas.nikolajsen almost 3 years ago

Adding 'options COMPAT_43' to kernel config solves problem.
(I also found that myself, but thanks a lot for looking into this)

COMPAT_43 was removed from GENERIC recently (2nd Novemer 2011);
but it seems like linux kernel module needs it for now,
I will readd COMPAT_43 to GENERIC.

After fixing this I got another linux emulation problem:
mount_linprocfs panic'ed, I have opened issue 2290 for this.

#3 Updated by thomas.nikolajsen almost 3 years ago

Venkatesh,

See below for answer for your questions.

-
$ head -99 `find /usr/obj/usr/src/sys/GENERIC -name opt_compat.h`
==> /usr/obj/usr/src/sys/GENERIC/usr/src/sys/dev/serial/digi/opt_compat.h <==
#define COMPAT_43 1

==> /usr/obj/usr/src/sys/GENERIC/usr/src/sys/dev/misc/nmdm/opt_compat.h <==
#define COMPAT_43 1

==> /usr/obj/usr/src/sys/GENERIC/usr/src/sys/emulation/linux/opt_compat.h <==
#define COMPAT_43 1

==> /usr/obj/usr/src/sys/GENERIC/opt_compat.h <==
-
$ grep COMPAT_43 /sys/config/GENERIC
#options COMPAT_43 #Compatible with BSD 4.3
$ nm /boot/kernel.GENERIC.3.0.20120126/kernel | grep sys_osethostname
$ nm /boot/kernel/kernel | grep sys_osethostname
c05fa689 T sys_osethostname
$ uname -a
DragonFly blum 3.0-RELEASE DragonFly 3.0-RELEASE #0: Thu Jan 26 20:52:38 CET 2012 root@gonzales:/usr/obj/usr/src/sys/GENERIC+BSD43 i386
$ grep COMPAT_43 /sys/config/GENERIC+BSD43
options COMPAT_43 #Compatible with BSD 4.3

#4 Updated by thomas.nikolajsen almost 3 years ago

  • Status changed from New to Closed

Fixed in commit 221955.

#5 Updated by sjg almost 3 years ago

This isn't a good fix. Can we do something like this:
http://evilprojects.net/dragonflybsd/0001-linux-Add-native-sethostname-implementation.patch
(untested)
instead?

Thanks.

On Thu, Jan 26, 2012 at 7:13 AM, Thomas Nikolajsen via Redmine <
> wrote:

>
> Issue #2289 has been reported by Thomas Nikolajsen.
>
> ----------------------------------------
> Bug #2289: 'kldload linux' fails
> http://bugs.dragonflybsd.org/issues/2289
>
> Author: Thomas Nikolajsen
> Status: New
> Priority: Normal
> Assignee:
> Category:
> Target version:
>
>
> On master and DragonFly_RELEASE_3_0 from yesterday (25th January 2012)
> loading linux.ko kernel module fails,
> both using loader(8) and kldload(8):
> link_elf: symbol sys_osethostname undefined.
> (i.e. both binutils 2.22 and 2.21)
>
> This may be binutils related;
> I think it worked with binutils 2.17, will test.
>
> This is using a custom kernel; will test GENERIC.
>
> -
> # kldload linux
> link_elf: symbol sys_osethostname undefined
> kldload: can't load linux: No such file or directory
>
>
> --
> You have received this notification because you have either subscribed to
> it, or are involved in it.
> To change your notification preferences, please click here:
> http://bugs.dragonflybsd.org/my/account
>

#6 Updated by dillon almost 3 years ago

:This isn't a good fix. Can we do something like this:
:http://evilprojects.net/dragonflybsd/0001-linux-Add-native-sethostname-implementation.patch
:(untested)
:instead?
:
:Thanks.

Here's a fixed version of that patch:

http://apollo.backplane.com/DFlyMisc/linux01.patch

It fixes several issues with Sam's sethostname transplant and also
fixes linux_ostat (which also needed a transplant).

-Matt
Matthew Dillon

#7 Updated by thomas.nikolajsen almost 3 years ago

Thanks for patches; I will test and commit later today.
Just adding COMPAT_43 was quick & dirty work around :)

#8 Updated by vsrinivas almost 3 years ago

We would like to have COMPAT_DF12 enabled, but not COMPAT_43; is it clear why COMPAT_43 is being pulled in when only _DF12 is set in GENERIC?

#9 Updated by thomas.nikolajsen almost 3 years ago

Patch committed to master & rel3_0 (b4d6d1 & 2aeaf5);
hack in linux/Makefile which did set COMPAT_43 is also removed.

Also available in: Atom PDF