COMPAT_LINUX32 option on kernel

Status
Not open for further replies.

ajohnson

Dabbler
Joined
Feb 25, 2013
Messages
18
Hello,

This was actually mentioned before in the forums, and came up for me as well:
http://forums.freenas.org/archive/index.php/t-9115.html

Basically, attempting to load the linux.ko kernel module using kldload from the FreeBSD CD (8.3) corresponding to my FreeNAS installation (8.3) results in the following errors:
Code:
# kldload linux.ko
kldload: can't load linux.ko: Exec format error


Then, in dmesg:
Code:
link_elf_obj: symbol ifnet undefined
linker_load_file: Unsupported file type


Furthermore, grabbing the 8.3 FreeNAS branch and compiling linux.ko results in the same errors upon load, so I've verified that there's nothing fishy going on with the linux.ko that comes with the FreeBSD release vs. what the FreeNAS distro is looking for.

So it appears loading linux.ko dynamically is a no-go for FreeNAS, unless I'm missing something.

So I had to compile my own kernel and include linux support statically with the following kernel option:
Code:
options         COMPAT_LINUX32


This works fine, but I'd prefer not to do this in the future every time FreeNAS gets updated. What are the chances of the devs including this option in nanobsd/FREENAS.amd64 in future FreeNAS releases?

The filesize difference on the kernel does not seem too great:
Code:
-r-xr-xr-x  1 root  wheel  5922007 Oct 24 00:57 kernel-orig.gz*
-r-xr-xr-x  1 root  wheel  5991044 Feb 24 23:36 kernel.gz*


Mind you, I compiled the latest 8.3 branch revision which is slightly newer than what was included with the last 8.3 stable release, so some of that filesize difference may be due to other changes that took place between those revisions rather than the addition of the option.

As for the reasoning behind this -- this comes in handy for using CrashPlan backup on FreeNAS (or perhaps even other linux based programs).
 

ajohnson

Dabbler
Joined
Feb 25, 2013
Messages
18
This isn't a bug, this is a feature request...:rolleyes:
I'd certainly considered that, though if the standard FreeBSD kernel is able to load linux.ko and FreeNAS kernel can't, I think that's more of a bug (I can't confirm that myself at the moment -- I'd have to fire up 8.3 Release on a VM).
Static compilation of COMPAT_LINUX32 and LINPROCFS is more of a workaround for that problem.

Point being, bug vs. feature, I think it's more of a grey area, but I respect your call on it.
 
Status
Not open for further replies.
Top