Installing run(4) drivers

Status
Not open for further replies.

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
Hi Everybody,

I recently built a FreeNAS system running FreeNAS 8.2. I'm trying to use an ASUS USB-N13 wireless adapter. From what I've read this adapter uses the chipset that requires the if_run.ko and runfw.ko modules. I noticed that these aren't installed in FreeNAS, but are installed in FreeBSD 8.2.

I assumed I could compile a new kernel to include if_run and runfw, so I followed several HOWTO's and installed a VM version of FreeBSD will all the needed sources to build FreeNAS. I successfully created a FreeNAS iso (with no changes) which installed just fine.

However, when I try and create a custom kernel and add the lines required by the run(4) man page, the kernel won't build using the make buildkernel KERNCONF=CUSTOMKERNEL(what I named it) command. I get an error stating the runfw module is unknown. The one thing I haven't been able to find through numerous searches, is where to put the if_run and runfw files so they are included in the kernel. I assume that is my problem, but I could be wrong.

Thanks for any help in advance.

Brendan
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Brendan,

Take a look at the link below, I think it includes all of the wireless drivers for x64. It was compiled for FreeNAS 8.0.4, but they should work on 8.2. Other than that, you shouldn't need to build the whole kernel, just cd to the directory in the source for the device you want to build and run make and copy the .ko file(s) to /boot/kernel in FreeNAS.

http://protosd.blogspot.com/2012/03/freenas-8-wifi-driver-modules-for.html
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
Brendan,

Take a look at the link below, I think it includes all of the wireless drivers for x64. It was compiled for FreeNAS 8.0.4, but they should work on 8.2. Other than that, you shouldn't need to build the whole kernel, just cd to the directory in the source for the device you want to build and run make and copy the .ko file(s) to /boot/kernel in FreeNAS.

http://protosd.blogspot.com/2012/03/freenas-8-wifi-driver-modules-for.html

I've tried similar methods to that already, but I gave it a shot anyways. Still doesn't work. The driver I need isn't included in the .zip file from the source you provided. I pulled the if_run and runfw drivers off of an image from a FreeBSD ISO to my /boot/kernel directory, and modified the /boot/loader.conf file to state 'if_run_load="YES"' and 'runfw_load="YES"', plus all the other modules with a prefix of "wlan."

Any ideas? I know the run drivers are included in the 8.2 version of FreeBSD which is what I thought FreeNAS 8.x is derived from.

I've actually run across a post of yours from before which made me believe I couldn't just copy the if_run.ko file over...I thought my situation was similar to http://forums.freenas.org/showthread.php?6402-Help-Request-WiFi-adapter-drivers. I figured I had to build a custom kernel to include if_run.ko.

Brendan
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I'm sorry I got RUM and Run mixed up ;) You should be able to pull the drivers from the 8.2 distro, I would try to make sure they were from the same patch level (FreeNAS is 8.2 p6), but they might still work, it's worth a try.

I'm not sure which part of my other post mislead you, but I'll see if I can help you out. I need to build the drivers for the i386 users at some point anyway.

Are you sure you pulled the drivers from the correct architecture/distro? amd64=x64

You can also test the driver will load without editing the loader.conf by just doing a "kldload if_run.ko", but you need to make sure the other "wlan" drivers are there also and load whichever ones if_run complains about needing.

See how that goes and I'll build you the driver(s) if it doesn't work.
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
I'm sorry I got RUM and Run mixed up ;) You should be able to pull the drivers from the 8.2 distro, I would try to make sure they were from the same patch level (FreeNAS is 8.2 p6), but they might still work, it's worth a try.

I'm not sure which part of my other post mislead you, but I'll see if I can help you out. I need to build the drivers for the i386 users at some point anyway.

Are you sure you pulled the drivers from the correct architecture/distro? amd64=x64

You can also test the driver will load without editing the loader.conf by just doing a "kldload if_run.ko", but you need to make sure the other "wlan" drivers are there also and load whichever ones if_run complains about needing.

See how that goes and I'll build you the driver(s) if it doesn't work.

I thought you might have gotten them mixed up. From a lot of the reading I've been doing, you aren't the first to mistake rum and run. I pulled the drivers right from the iso download from the main FreeBSD ftp site (under 8.2 amd64), so I'm guessing they aren't up to date. The VM that I have FreeBSD installed on, is updated to 8.2 p3, but can't get it to go to p6 using "FreeBSD-update fetch install." I get the message:

The following files will be updated as part of updating to 8.2-RELEASE-p6:
/boot/kernel/kernel
/boot/kernel/kernel.symbols
/boot/kernel/linux.ko
/boot/kernel/linux.ko.symbols
Installing updates... done.

I pulled the drivers from my FreeBSD VM, and copied them over to my FreeNAS system. Unfortunately, my FreeNAS system still doesn't recognize my wireless adapter. If you want to build the drivers, that would be much appreciated. However, I don't mind learning how to do it myself too, so let me know if you know of any good how to's on building modules. I may just break down and buy a wireless adapter that works out of the box, but I was hoping I could get this one to work.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
The VM that I have FreeBSD installed on, is updated to 8.2 p3, but can't get it to go to p6 using "FreeBSD-update fetch install." I get the message:

The following files will be updated as part of updating to 8.2-RELEASE-p6:
/boot/kernel/kernel
/boot/kernel/kernel.symbols
/boot/kernel/linux.ko
/boot/kernel/linux.ko.symbols
Installing updates... done.

I just went through this myself and it was a huge PITA. I did it before and it went more smoothly, but I don't remember what I did. It would sure be nice if things worked as smoothly as "apt-get update" / "apt-get upgrade" in Linux.... You have to get it to install the new kernel to get it to go from p3 to p6. I just downloaded the sources and went with the "make buildworld", "make build kernel", "make install world" method, the FreeBSD docs have a bit to be desired in spelling out certain details.


I pulled the drivers from my FreeBSD VM, and copied them over to my FreeNAS system. Unfortunately, my FreeNAS system still doesn't recognize my wireless adapter. If you want to build the drivers, that would be much appreciated. However, I don't mind learning how to do it myself too, so let me know if you know of any good how to's on building modules. I may just break down and buy a wireless adapter that works out of the box, but I was hoping I could get this one to work.

I really can't understand why this isn't working for you. If you want to learn how to do it, it's really helpful to know. I haven't done a FreeNAS build lately because so much stuff is changing and I'm out of space to create more virtual disks to do anything right now, as well as a little short on spare time. A complete FreeNAS compile takes close to 6 hours on my Core-i5. The drivers are a different story, if you do like I mentioned earlier, you can build them in 10 minutes if you have the source.

Which version of FreeNAS do you need the drivers for? (Please don't say 8.2 beta-2, I won't touch that)
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
I just went through this myself and it was a huge PITA. I did it before and it went more smoothly, but I don't remember what I did. It would sure be nice if things worked as smoothly as "apt-get update" / "apt-get upgrade" in Linux.... You have to get it to install the new kernel to get it to go from p3 to p6. I just downloaded the sources and went with the "make buildworld", "make build kernel", "make install world" method, the FreeBSD docs have a bit to be desired in spelling out certain details.




I really can't understand why this isn't working for you. If you want to learn how to do it, it's really helpful to know. I haven't done a FreeNAS build lately because so much stuff is changing and I'm out of space to create more virtual disks to do anything right now, as well as a little short on spare time. A complete FreeNAS compile takes close to 6 hours on my Core-i5. The drivers are a different story, if you do like I mentioned earlier, you can build them in 10 minutes if you have the source.

Which version of FreeNAS do you need the drivers for? (Please don't say 8.2 beta-2, I won't touch that)

When you updated, where did you get your source from? svn, cvsup, ftp, etc...I'm going to try the option you used to update after reading the FreeBSD page on doing updates.

Unfortunately, I do have FreeNAS 8.2 BETA-2 installed. Probably shouldn't have went with the BETA, since I'm new to all of this. But, it hasn't been a problem for me so far, other than this driver issue with the wireless adapter. I don't mind dropping to an earlier version, if it means I can get a driver for my adapter.

When you say it takes 10 minutes to build, if I have the source, what source do you mean? Like source code from the manufacturer of the adapter or the source in FreeBSD? I'm sorry if I'm a little confused, but I just want to clarify this.

Brendan
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
When you updated, where did you get your source from? svn, cvsup, ftp, etc...I'm going to try the option you used to update after reading the FreeBSD page on doing updates.

I used cvsup. I could probably find the "sup" file I used if you need an accurate example.


When you say it takes 10 minutes to build, if I have the source, what source do you mean? Like source code from the manufacturer of the adapter or the source in FreeBSD? I'm sorry if I'm a little confused, but I just want to clarify this.
Brendan

I meant the FreeBSD source. I'll see if I can build it for you a little later tonight. I'll build for 8.04, but you could still try it on 8.2.
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
I used cvsup. I could probably find the "sup" file I used if you need an accurate example.

Don't worry, I think I'll be able to do it.




I meant the FreeBSD source. I'll see if I can build it for you a little later tonight. I'll build for 8.04, but you could still try it on 8.2.

I would be willing to give it a try. Since they're both based off of FreeBSD 8.2, I'm hoping it will work. If it doesn't work, do you have any suggestions for a good pcie wireless card or usb wireless adapter that will work out of the box, or with those other drivers that you created.

Brendan
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
If it doesn't work, do you have any suggestions for a good pcie wireless card or usb wireless adapter that will work out of the box, or with those other drivers that you created.

Brendan

I don't have any suggestions for cards, but I wouldn't waste a pcie slot on a wifi card since the bandwidth you'll get from wifi won't be much more than you'll get through USB. Really you can take your pick since none of the wireless drivers are included in FreeNAS 8.

-- Proto
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
I don't have any suggestions for cards, but I wouldn't waste a pcie slot on a wifi card since the bandwidth you'll get from wifi won't be much more than you'll get through USB. Really you can take your pick since none of the wireless drivers are included in FreeNAS 8.

-- Proto

Haha. I guess wireless just isn't an option for most people because of speed. I just wanted some variability to where I could put my FreeNAS system without worrying about cords. I may have to try using a router with DD-WRT in client mode. I've played around with DD-WRT in the past, but it has been a while. I just wanted something a little more seemless.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I use DD-WRT on my old Linksys WRT54G which is still my primary router. I'm waiting for COX to officially support ipv6 before I get another router which I plan to put DD-WRT on also! :)

Here's a link for the if_RUN.ko module. You'll need to grab/use the other modules for authentication etc. from that link I posted above.

https://www.rapidshare.com/files/3444434057/if_run.zip

If you have an extra flash drive around you could just flash 8.04 onto it and give this a try if it doesn't work with 8.2, but I don't really see why it shouldn't.
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
Still doesn't work. I don't know if you needed to build the runfw.ko file too. That's the one that I think is giving me all this trouble.

From the BSD man page for run:

Firmware is also needed, and provided by:

device runfw

When I tried to compile my custom kernel earlier, the make buildkernel command spit out an error about runfw. Also, when I use kldstat on my FreeNAS system it doesn't show up with the rest of the .ko files in /boot/kernel/. IIRC, modules that are loaded from loader.conf, and not the kernel, should show up after using kldstat. Since runfw.ko is about firmware and not a driver, should it be treated differently than if_run.ko?

EDIT: If I try to kldload runfw, it gives me an exec file format error. I don't know if that gives any hints as to why I can't get this to work.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Since runfw.ko is about firmware and not a driver, should it be treated differently than if_run.ko?

EDIT: If I try to kldload runfw, it gives me an exec file format error. I don't know if that gives any hints as to why I can't get this to work.

If it's a .ko file it should be loaded the same AFIK. The exec error might just be permissions on the file. Try "chmod 555 runfw.ko" and see if that helps.
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
Still no luck. When I try kldload it says
"file has no contents
linker load file: Unsupported file type
kldload: can't load runfw.ko: exec format error"

This is after using chmod 555...which doesn't report any problems. When I use ee on runfw, I can see all the code, so it definitely isn't empty.
 

bpm5001

Cadet
Joined
Apr 15, 2012
Messages
9
I wanted to let you know that I went with the DD-WRT option. I did client bridge instead of client mode so everything would stay in the same subnet. I'm hoping my speeds are faster than what most people are getting with wireless adapters too. Thanks for your help...looks like I have a new wireless adapter for my main computer.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Glad to hear you found a solution that worked, don't count on faster wifi. It's better than nothing, but I despise it.
 
Status
Not open for further replies.
Top