Bug 223780 - emulators/linux_base-c7 does not work with latest 10.4 (FreeBSD 10.4-RELEASE-p3) - "FATAL: kernel too old"
Summary: emulators/linux_base-c7 does not work with latest 10.4 (FreeBSD 10.4-RELEASE-...
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-21 14:07 UTC by jnn
Modified: 2018-01-16 17:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jnn 2017-11-21 14:07:46 UTC
After installing linux_base-c7, mounting the /compat/linux/proc and /compat/linux/dev/shm mounts, and loading the linux & linux64 modules, all Linux binaries fail to run with the following error message:

root@wintermute .../linux/usr/bin# /compat/linux/usr/bin/uname
FATAL: kernel too old

This particular error is indicative in Linux that the glibc in use was compiled with/for a kernel greater than the one currently in use. 

Here is the status of installed modules, mounts, loaded modules, etc at the time of the error -

------------------------------------------------------------
------------------------------------------------------------
root@wintermute .../linux/usr/bin # kldstat  | grep linux
 9    3 0xffffffff82064000 7566     linux_common.ko
11    1 0xffffffff82073000 3d0b3    linux.ko
12    1 0xffffffff820b1000 37e1a    linux64.ko

root@wintermute .../linux/usr/bin # mount | grep compat
tmpfs on /usr/compat/linux/dev/shm (tmpfs, local)
linprocfs on /usr/compat/linux/proc (linprocfs, local)

root@wintermute .../linux/usr/bin # pkg query %v linux_base-c7
7.4.1708_2

root@wintermute .../linux/usr/bin # uname -a
FreeBSD wintermute.synfin.org 10.4-RELEASE-p3 FreeBSD 10.4-RELEASE-p3 #0: Tue Nov 14 09:43:55 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

------------------------------------------------------------
------------------------------------------------------------

The good news is that the latest linux_base-c6 works just fine with FreeBSD 10.4-RELEASE-p3. All the same setup info as documented above, except linux_base-c7 has been removed and linux_base-c6 has been installed (version 6.9_4). Sample output of a successful command -

root@wintermute .../linux/usr/bin # /compat/linux/bin/uname -a
Linux wintermute.synfin.org 2.6.18 FreeBSD 10.4-RELEASE-p3 #0: Tue Nov 14 09:43:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I suspect that the latest linux_base-c7 has glibc kernel requirement that, for whatever reason, the linux/linux64 modules do not meet.

thanks,

John Newman
jnn@synfin.org
Comment 1 jnn 2017-11-21 14:37:18 UTC
Ok this is all fixed!  I don't think its a real bug at all, apologies. The issue was I had the following entry in /etc/sysctl.conf -

compat.linux.osrelease=2.6.18

I changed it to 2.6.32 with sysctl compat.linux.osrelease=2.6.32, reinstalled latest linux_base-c7, and now everything works! 

I don't know where the old entry in /etc/sysctl.conf came from (I don't remember making it, but I suppose it's possible I did at some point a long time ago). This particular machine started out at FreeBSD 10.1 a good while back and I have done updates first to 10.3 (long time ago) and 10.4 (a few days ago).

In any case, it is all working.  Thanks!
Comment 2 jnn 2017-11-21 14:41:12 UTC
Just a final parting note - maybe a good idea to add something in the install notes about this requirement ?  I didn't come across it anywhere until it was suggested to me on #freebsd (freenode). 

thanks,
John
Comment 3 Tijl Coosemans freebsd_committer freebsd_triage 2018-01-16 17:19:12 UTC
2.6.32 is the default so if you haven't done so already it's best to remove that setting from sysctl.conf.  Otherwise you'll have the same problem later.