Pi + Lapdock + Arch + WiFi


21 posts
by davidkennedy85 » Mon Oct 29, 2012 7:15 am
I've been trying for days to get my Belkin F5D8053 wireless adapter to work without any success. lsusb prints this when it's plugged into the Pi's USB port:
Code: Select all
Bus 001 Device 005: ID 050d:805e Belkin Components F5D8053 N Wireless USB Adapter v5000 [Realtek RTL8192U]

Here's the relevant bits of dmesg:
Code: Select all
usb 1-1.2.6: USB disconnect, device number 7
usb 1-1.2.6: new high-speed USB device number 8 using dwc_otg
usb 1-1.2.6: New USB device found, idVendor=050d, idProduct=805e
usb 1-1.2.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.2.6: Product: Belkin N Wireless USB Adapter
usb 1-1.2.6: Manufacturer: Realtek
usb 1-1.2.6: SerialNumber: ********************

The driver is included in the kernel, so I did modprobe rt2800usb per this. There is no wlan interface in ifconfig. iwconfig displays the following:
Code: Select all
ifb0    no wireless extensions.
lo      no wireless extensions.
eth0    no wireless extensions.
ifb1    no wireless extensions.

I tried plugging/un-plugging the dongle as well as rmmod/modprobe again and again without any change. Then the helpful people at #archlinux-arm on Freenode IRC pointed out that I should actually be using the 8192cu driver. Same results there.

Here's my physical setup:

Lapdock micro USB -> Pi USB 1
Lapdock micro HDMI -> Pi HDMI
WiFi dongle -> Pi USB 2

... and that's it. I don't have a powered hub. I also tried this config:

Lapdock micro USB -> Pi USB 1
Lapdock micro HDMI -> Pi HDMI
WiFi dongle -> Lapdock USB 1

with the same exact results. Finally I tried this:

Lapdock micro USB -> Pi USB 1
Lapdock micro HDMI -> Pi HDMI
WiFi dongle -> Lapdock USB 1
Power supply -> Lapdock USB 2

thinking that the Lapdock acted as a powered USB hub of sorts (I forget where I read that). No change there.

Do I really just need a hub? Or should I get a different adapter? I'm looking at a ASUS USB-N10 or a TP-LINK TL-WN821N. I just hate to buy anything else after I FINALLY got my adapters in the mail.
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by drirr » Mon Oct 29, 2012 5:20 pm
Does iwconfig list any interfaces not shown with ifconfig? Could be that it's just not up, run "ifconfig wlan0 up" if that's the case.

What's the output in dmesg after loading the module?
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by davidkennedy85 » Mon Oct 29, 2012 11:33 pm
drirr, thanks for your reply. I will try looking at that as soon as I get home. I think I figured out part of my problem: the rt2800usb driver is for v3 of this adapter, whereas v5 is on r8192u_usb per this. I might pick up a power hub on my way home too just in case (I could probably use one anyways).
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by davidkennedy85 » Tue Oct 30, 2012 4:35 am
After doing modprobe 8192cu, this is what dmesg says:
Code: Select all
usbcore: registered new interface driver rtl8192cu

Still no wlan in ifconfig. There are four files in /sys/class/net: eth0, ifb0, ifb1 and lo. Only two of these are listed in ifconfig:
Code: Select all
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.237  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 **************  prefixlen 64  scopeid 0x20<link>
        ether **************  txqueuelen 1000  (Ethernet)
        RX packets 1645  bytes 274076 (267.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2108  bytes 541751 (529.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 4  bytes 268 (268.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 268 (268.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

After doing ifconfig ifb0 up and ifconfig ifb1 up I have some new info in ifconfig:
Code: Select all
ifb0: flags=195<UP,BROADCAST,RUNNING,NOARP>  mtu 1500
        inet6 **************  prefixlen 64  scopeid 0x20<link>
        ether **************  txqueuelen 32  (Ethernet)
        RX packets 3  bytes 210 (210.0 B)
        RX errors 0  dropped 3  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ifb1: flags=195<UP,BROADCAST,RUNNING,NOARP>  mtu 1500
        inet6 **************  prefixlen 64  scopeid 0x20<link>
        ether **************  txqueuelen 32  (Ethernet)
        RX packets 3  bytes 210 (210.0 B)
        RX errors 0  dropped 3  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

RX packets stays at 3 and TX at 0. I honestly don't know what those are, and I just reflashed the Arch image today so I didn't add them.

Edit: dmesg shows the following after enabling the ifb0 and ifb1 interfaces:
Code: Select all
ifb0: no IPv6 routers present
ifb1: no IPv6 routers present

So those must be related to IPv6 somehow.
Last edited by davidkennedy85 on Tue Oct 30, 2012 4:55 am, edited 1 time in total.
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by SirLagz » Tue Oct 30, 2012 4:47 am
What happens when you do iwconfig now ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Posts: 1704
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
by davidkennedy85 » Tue Oct 30, 2012 4:56 am
SirLagz wrote:What happens when you do iwconfig now ?


Same: no wireless extensions on ifb0, lo, eth0 and ifb1.

According to this page I should install compat-wireless. Guess I'll give that a shot.
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by drirr » Tue Oct 30, 2012 8:10 pm
davidkennedy85 wrote:After doing modprobe 8192cu, this is what dmesg says:
Code: Select all
usbcore: registered new interface driver rtl8192cu

Still no wlan in ifconfig. There are four files in /sys/class/net: eth0, ifb0, ifb1 and lo. Only two of these are listed in ifconfig:

Googled a bit about the module and found the following on the official arch forums: https://bbs.archlinux.org/viewtopic.php?id=147222. It seems people seem to have better luck with the driver built from AUR: https://aur.archlinux.org/packages.php?ID=60609. Perhaps you should give that one a go?
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by davidkennedy85 » Wed Oct 31, 2012 4:37 pm
drirr, that was a good find. Unfortunately it looks like they are discussing the RTL8188CUS chipset rather than the RTL8192U. Looking closer at the Linux Wireless site, I wonder if I'm using the wrong driver now:

r8192u_usb is a USB driver for RTL8192U devices.


So 8192cu might not be right after all, but it's the only driver I could find on my system that contains '8192' in the name. Also, I just realized the r8192u_usb driver is in the staging drivers section on the Linux Wireless site:

They are included in the staging tree at linux-2.6/drivers/staging


Does that mean that I wouldn't have it on my system? Do I need to download and compile it or something? Sorry for the extreme noobishness.

On a side note, I've tried installing compat-wireless (as suggested on the Linux Wireless FAQ) several times now with no success as the hosting site is apparently dead.

Edit: Searching the Linux kernel repository on GitHub, I was only able to find one reference to r8192u_usb here. However, the driver is (no longer?) listed at this location in the tree. Maybe it was rolled into another module, such as 8192cu???

Another edit!: Apparently r8192u_usb is a "built-in firmware image." I think that means it's included with the kernel, so I've probably been using the correct driver by attempting to modprobe 8192cu. Sheesh this stuff is so confusing :?

If that's the case then I think I'm S.O.L. with this adapter as there are no search results for my chipset in the AUR repository.
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by drirr » Wed Oct 31, 2012 6:35 pm
davidkennedy85 wrote:drirr, that was a good find. Unfortunately it looks like they are discussing the RTL8188CUS chipset rather than the RTL8192U. Looking closer at the Linux Wireless site, I wonder if I'm using the wrong driver now:

r8192u_usb is a USB driver for RTL8192U devices.


So 8192cu might not be right after all, but it's the only driver I could find on my system that contains '8192' in the name. Also, I just realized the r8192u_usb driver is in the staging drivers section on the Linux Wireless site:

This debian wiki page confirms that the driver you want is r8192u_usb: http://wiki.debian.org/rtl819x#r8192u_usb. This page (http://cateee.net/lkddb/web-lkddb/RTL8192U.html) says it's available in the following kernels: 2.6.33–2.6.39, 3.0–3.4, 3.6, 3.7-rc+HEAD.

And a look at the git tree for linux-3.2.y sure lists it under the staging tree: http://git.kernel.org/?p=linux/kernel/g ... inux-3.2.y

And looking at my RPi I can see that the module isn't built in Arch (ls /lib/modules/3.2.27-13-ARCH+/kernel/drivers/staging). So let's remedy that!

Start by installing git and then clone the alarm PKGBUILD repo:
Code: Select all
git clone https://github.com/archlinuxarm/PKGBUILDs.git

You should now have a directory called PKGBUILDs, the things we are interested in are located at "PKGBUILDs/core/linux-raspberrypi/". Normally you could just have used "makepkg -o" to grab the sources. But since the RPi support isn't merged into the vanilla kernel it starts the build process with grabbing the raspberrypi kernel.

Compiling the kernel on the rpi is going to be a slow process. So you should probably start the whole thing in a screen session, install it via pacman unless you have it already (pacman -S screen). Now to start screen you simply just write "screen". You'll see what looks just like a normal shell, but the clever thing with screen is that you get a "persistant" shell. You can detach from it by pressing "CTRL+A D", to reattach later on just run "screen -r".

Since we want to change the kernel configuration we'll edit the PKGBUILD so it gives us the configuration menu. This is done by uncommenting the line "#make nconfig" (remove the hash). In the code below I'm using sed to do the search/replace so it can just be copy/pasted without worrying about changing the wrong line.
Code: Select all
cd PKGBUILDs/core/linux-raspberrypi/
sed -i PKGBUILD -e 's/#make nconfig/make nconfig/'
makepkg

You'll probably have to install some dependencies, I needed the following:
Code: Select all
pacman -S --asdeps xmlto docbook-xsl uboot-mkimage

After running makepkg and letting it clone the linux kernel a happy little menu system should "pop up". This nifty menu lets us configure what parts of the kernel we want to build. And if we want something to be built-in or built as a module. Since this driver is in staging and it's for a hotpluggable device building as a module makes the most sense. Even though it's just for your machine now.

So, let's dive right in and see if we can find that pesky little module! We know it's a device driver and that it lives in the staging tree. So let's traverse there (using arrow keys and enter). And here's a nice surprise, the item "RealTek RTL8712U (RTL8192SU) Wireless LAN NIC Driver" entry has an "M" next too it. This means that it's configured to be built as a module and since we're using the alarm tree this means it's already built. Let's view the help (press H) and see if they give us the module name: "If built as a module, it will be called r8712u". So let's just back out of everything (CTRL+C) and put the new information to use.

I'll leave all the above text since I've taken the time to write it and someone else might find it useful. But for your needs a simple "modprobe r8712u" should hopefully make the dongle spring to life. Check with ifconfig/iwconfig if you get a nice shiny wireless NIC.
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by davidkennedy85 » Thu Nov 01, 2012 6:19 am
Wow, drirr, this is amazing. Thank you so much for the detailed walkthrough. I'm sure other noobies will find it just as useful as me.

Just to clarify, a big source of confusion for me was over the driver name. I kept loading the rtl8192cu driver by issuing `modprobe 8192cu`. Not to blame shift but I got started down that path with some bad advice from IRC. I was further convinced that this was the right driver when I checked the Linux Wireless website, specifically this page, and found my chipset listed there. The way the information is organized there led me to believe that all the devices listed on that page use the same driver, or that they at least use the same module, and that I should look for a module named something like rtl819x as that is the title of the page as well as the url (Drivers/rtl819x)! Furthermore, I was under the impression that this driver was included in the kernel, so I assumed that the module 8192cu was what I was looking for!! :x I didn't even know what a staging driver or tree was :?

Here are some more things I learned that (at least to me) aren't totally obvious:

1. Arch uses different drivers/firmware than Debian, but only for those that aren't already in the kernel - go figure!
2. Arch ARM uses different drivers/firmware than Arch.
3. Just because the driver source code is included in the kernel does not mean it is compiled. In fact, if the source is in the "staging" tree, you must compile it yourself! (In this case, we had to compile the whole kernel to add one driver.)
4. If the name of your device is listed as needing a particular driver/firmware, but it has a different version number than the one listed, your device could need something completely different.

I'm still confused as to why the rtl8192u_usb driver is listed as a "built-in firmware image" in the repository if only the source is "built-in." I suppose this could be just an error by whoever committed it, but this type of reasoning (supposing, guessing) has gotten me in trouble so far.

Unfortunately, it's late here and I've been up past 1am for the past several days working on this. I'll post back with the results :)
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by pepedog » Thu Nov 01, 2012 10:06 am
"built-in firmware image" means if it's built, the firmware is included (firmware sent to devices to bring them up are usually separate files in /usr/lib/firmware)
It maybe with upcoming 3.6 (https://github.com/raspberrypi/linux when rpi-3.6.y becomes master) the driver is out of staging, I'm too lazy to look
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by drirr » Thu Nov 01, 2012 6:03 pm
davidkennedy85 wrote:Wow, drirr, this is amazing. Thank you so much for the detailed walkthrough. I'm sure other noobies will find it just as useful as me.

Just to clarify, a big source of confusion for me was over the driver name. I kept loading the rtl8192cu driver by issuing `modprobe 8192cu`. Not to blame shift but I got started down that path with some bad advice from IRC. I was further convinced that this was the right driver when I checked the Linux Wireless website, specifically this page, and found my chipset listed there. The way the information is organized there led me to believe that all the devices listed on that page use the same driver, or that they at least use the same module, and that I should look for a module named something like rtl819x as that is the title of the page as well as the url (Drivers/rtl819x)! Furthermore, I was under the impression that this driver was included in the kernel, so I assumed that the module 8192cu was what I was looking for!! :x I didn't even know what a staging driver or tree was :?

I don't know anyone else but I like to learn new things. So instead of just telling you to type commands A, B and C I figured I could explain it all instead. If nothing else someone else stumbling upon this thread could find it useful.
davidkennedy85 wrote:Unfortunately, it's late here and I've been up past 1am for the past several days working on this. I'll post back with the results :)

Thankfully the driver you want should already be compiled and a simple "modprobe r8712u" should hopefully be all you need. Compiling the kernel on the rpi would probably take a day all by itself.
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by davidkennedy85 » Fri Nov 02, 2012 5:25 am
I think we may have a bit of a mixup here - I believe you succeeded in locating the driver for the RTL8192SU chipset (r8712u) but I am looking for the driver for the RTL8192U chipset (r8192u_usb). I'm in the process of compiling the kernel (?) now by following your instructions. Here's hoping!

Edit: Unfortunately I can't seem to find anything in the interactive config program for my chipset. Dang :cry:
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by davidkennedy85 » Fri Nov 02, 2012 5:22 pm
I think I may have found something in PKGBUILDs/core/linux:
Code: Select all
Line 3250: CONFIG_RTL8192U=m

I'll try running makepkg from there next time and building that module. Then maybe I can use it :)

Let me know if I'm way off track or about to break something.
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by drirr » Fri Nov 02, 2012 7:22 pm
davidkennedy85 wrote:I think we may have a bit of a mixup here - I believe you succeeded in locating the driver for the RTL8192SU chipset (r8712u) but I am looking for the driver for the RTL8192U chipset (r8192u_usb). I'm in the process of compiling the kernel (?) now by following your instructions. Here's hoping!

Edit: Unfortunately I can't seem to find anything in the interactive config program for my chipset. Dang :cry:

Sorry about the mixup, the names are too similiar. Let's see here, in one of your initial posts you posted the device info after plugging the device in.
Code: Select all
usb 1-1.2.6: New USB device found, idVendor=050d, idProduct=805e

A google search for "linux 050d 805e" gave me a hit on the following page http://cateee.net/lkddb/web-lkddb/RTL8192SU.html which mentions the driver. But it appears that the last kernel it was found in is 2.6.36. Doing some digging in the linux gitweb I found the following TODO for 2.6.36: http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=drivers/staging/rtl8192su/TODO;h=b15204ea4ec4932307f21d9be160ba0b089f668e;hb=refs/heads/linux-2.6.36.y
The following sections are interesting:
- prepare private ieee80211 stack for merge with rtl8187se's version:
...
- integrate with drivers/net/wireless/rtl818x

We know it was removed after .36, so let's have a look in .37 for the rtl8187se driver: http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=drivers/staging/rtl8187se/TODO;h=704949a9da0d9d5bbdc8f0a08eb89af5492ac142;hb=refs/heads/linux-2.6.37.y
- prepare private ieee80211 stack for merge with rtl8192su's version:
...
- integrate with drivers/net/wireless/rtl818x

This looks like a fun game of cat-and-mouse so I'm going to let google do the work for me, and it led me back to Debians wiki: http://wiki.debian.org/rtl819x#Drivers.
r8192u_usb (supported devices)
- Supports USB devices based on the RTL8192U chipset.
- Introduced in Linux 2.6.33,5 added and enabled at linux-2.6

The driver still looks available in the 3.2.27 tree forked and rpi-infused: https://github.com/raspberrypi/linux/tree/rpi-3.2.27/drivers/staging/rtl8192u. If you check the Makefile it should create a object file called "r8192u_usb.o", looking at some of the lines above it I'm guessing it's merged together with other objects into a common module. The trick will be to find it in the kernel config.

davidkennedy85 wrote:I think I may have found something in PKGBUILDs/core/linux:
Code: Select all
Line 3250: CONFIG_RTL8192U=m

I'll try running makepkg from there next time and building that module. Then maybe I can use it :)

Let me know if I'm way off track or about to break something.

If you already see a "m" or "y" then you don't have to do anything. The "m" means it will be compiled as a module and the "y" means it will be built in.

Now, the file you're looking in is for the vanilla kernel shipped by Arch Linux for i686/x86_64 with some minor modifications needed by Arch Linux ARM. The kernel built there will sadly not boot on your rpi.
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by davidkennedy85 » Sun Nov 04, 2012 12:37 am
drirr wrote:This debian wiki page confirms that the driver you want is r8192u_usb: http://wiki.debian.org/rtl819x#r8192u_usb. This page (http://cateee.net/lkddb/web-lkddb/RTL8192U.html) says it's available in the following kernels: 2.6.33–2.6.39, 3.0–3.4, 3.6, 3.7-rc+HEAD.

It would seem that we're going in circles. The driver I need is supposedly available in the 3.2.27 kernel. Is there no way for me to use it until someone puts it into the config file located at PKGBUILDs/core/linux-raspberrypi? Can I just add it myself?
drirr wrote:Now, the file you're looking in is for the vanilla kernel shipped by Arch Linux for i686/x86_64 with some minor modifications needed by Arch Linux ARM. The kernel built there will sadly not boot on your rpi.

Is there any way I can build it by running makepkg from PKGBUILDs/core/linux and then "export" the module or some such to PKGBUILDs/core/linux-raspberrypi?
User avatar
Posts: 30
Joined: Fri Aug 31, 2012 11:12 pm
by drirr » Sun Nov 04, 2012 10:49 am
davidkennedy85 wrote:
drirr wrote:This debian wiki page confirms that the driver you want is r8192u_usb: http://wiki.debian.org/rtl819x#r8192u_usb. This page (http://cateee.net/lkddb/web-lkddb/RTL8192U.html) says it's available in the following kernels: 2.6.33–2.6.39, 3.0–3.4, 3.6, 3.7-rc+HEAD.

It would seem that we're going in circles. The driver I need is supposedly available in the 3.2.27 kernel. Is there no way for me to use it until someone puts it into the config file located at PKGBUILDs/core/linux-raspberrypi? Can I just add it myself?

Yeah, that should also work assuming the option is named the same in 3.2 as in 3.6, which I think we can assume it is. I doubt the order of items have any meaning, but I'd suggest to stick it right under the line for "RTL8192CU" just in case.

- EDIT (start) -
I just cloned the repo (github sure is slow) and if you look under "Device Drivers" -> "Staging drivers" there is an entry "RealTek RTL8192U Wireless LAN NIC driver"
- EDIT (end) -

You'll have to re-generate the md5sums for the package after doing this though. You can just run "makepkg -g >> PKGBUILD" to have them appended at the end of the file. Make sure you comment out the "make ncofing" again though. Then just run "makepkg" and let it chug the night away, this will take time. It should be possible to build a single module only, I've never done it myself, but that should be faster than building the complete kernel. I've found different instructions on how to do it, and I'm not sure which ones apply so I'll post both.

1st suggestion:
http://www.linuxquestions.org/questions/linux-kernel-70/make-only-specific-module-is-kernel-source-tree-472529/#post2382175 wrote:i got the answer.
go to the kernel source tree and have

make modules SUBDIRS=drivers/net/e100

it will make only e100 driver
replace e100 with the directry name U want to build.

2nd suggestion:
http://www.debian-administration.org/article/Rebuilding_a_single_kernel_module wrote:Figure out what directory your wanted module resides in. For me this is drivers/net/wireless/ath5k

cd linux-headers-`uname -r`
mkdir -p Path/To/Module
cp -rf ../linux-source-$Version/Path/To/Module/* Path/To/Module
make -M=Path/To/Module

Run "makepkg -o" to create the src directory with all the files in the PKGBUILD src-array. Then cd into it and clone the repository ("git clone --depth 1 https://github.com/raspberrypi/linux.git"). Make your way into the new directory and try running one of the commands above and see if it works. I would personally try the 2nd suggestion first as it's more recent. The 2nd suggestion also has instructions on how to try the module and to copy it into the right directory for future reboots.
davidkennedy85 wrote:
drirr wrote:Now, the file you're looking in is for the vanilla kernel shipped by Arch Linux for i686/x86_64 with some minor modifications needed by Arch Linux ARM. The kernel built there will sadly not boot on your rpi.

Is there any way I can build it by running makepkg from PKGBUILDs/core/linux and then "export" the module or some such to PKGBUILDs/core/linux-raspberrypi?

That would most likely not work since you'd compile a module for another kernel version (3.6 vs 3.2).
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by drirr » Sun Nov 04, 2012 11:08 am
All these quoted message make it a hell to keep track on what I'm writing, so here's a new post. If you clone the repository and then grab the arch config file you're on the right track (run "pacman -S wget" if you don't have it installed).
Code: Select all
git clone --depth 1 https://github.com/raspberrypi/linux.git
wget https://raw.github.com/archlinuxarm/PKGBUILDs/master/core/linux-raspberrypi/config
cp config .config
make nconfig
Now work your way to the driver ("Device Drivers" -> "Staging drivers" (at the bottom) -> "RealTek RTL8192U Wireless LAN NIC driver") and mark it as a module (press m). Hit F6 to save your change, then F9 to exit. Then try the following and it should hopefully end with you building the module, installing and loading it.
Code: Select all
make drivers/staging/rtl8192u/r8192u_usb.ko
mkdir -p /lib/modules/`uname -r`/drivers/staging/rtl8192u
cp drivers/staging/rtl8192u/r8192u_usb.ko /lib/modules/`uname -r`/drivers/staging/rtl8192u
depmod -a
modprobe r8192u_usb
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by pepedog » Sun Nov 04, 2012 11:19 am
I have just spent some time on this
Depends on: STAGING [=y] && PCI [=n] && WLAN [=y] && USB [=y] && m && <choice>
It depends on PCI?
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by drirr » Sun Nov 04, 2012 12:02 pm
pepedog wrote:I have just spent some time on this
Depends on: STAGING [=y] && PCI [=n] && WLAN [=y] && USB [=y] && m && <choice>
It depends on PCI?

Yeah, I just noticed the same. I ran the above on my workstation (Arch 64-bit) and it seems like that's the problem. I tried cheating by generating the .config-file on my workstation, scp it to the rpi and then building the module. It will build, but unfortunally it won't load.
$ file drivers/staging/rtl8192u/r8192u_usb.o
drivers/staging/rtl8192u/r8192u_usb.o: ELF 32-bit LSB relocatable, ARM, version 1, not stripped
# insmod drivers/staging/rtl8192u/r8192u_usb.o
Error: could not insert module drivers/staging/rtl8192u/r8192u_usb.o: Invalid module format

So I guess this just won't work on the RPI since there is no PCI. :-/
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am
by drirr » Sun Nov 04, 2012 5:44 pm
drirr wrote:
pepedog wrote:I have just spent some time on this
Depends on: STAGING [=y] && PCI [=n] && WLAN [=y] && USB [=y] && m && <choice>
It depends on PCI?

Yeah, I just noticed the same. I ran the above on my workstation (Arch 64-bit) and it seems like that's the problem. I tried cheating by generating the .config-file on my workstation, scp it to the rpi and then building the module. It will build, but unfortunally it won't load.
$ file drivers/staging/rtl8192u/r8192u_usb.o
drivers/staging/rtl8192u/r8192u_usb.o: ELF 32-bit LSB relocatable, ARM, version 1, not stripped
# insmod drivers/staging/rtl8192u/r8192u_usb.o
Error: could not insert module drivers/staging/rtl8192u/r8192u_usb.o: Invalid module format

So I guess this just won't work on the RPI since there is no PCI. :-/

I must have been tired when I wrote that. Of course you need to build the .ko:
Code: Select all
$ make drivers/staging/rtl8192u/r8192u_usb.ko
$ file drivers/staging/rtl8192u/r8192u_usb.ko
drivers/staging/rtl8192u/r8192u_usb.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), BuildID[sha1]=0xee663bfdfd44e0c5e71b83f857c289655848135a, not stripped
$ modinfo drivers/staging/rtl8192u/r8192u_usb.ko
filename:       linux/drivers/staging/rtl8192u/r8192u_usb.ko
description:    Linux driver for Realtek RTL8192 USB WiFi cards
version:        V 1.1
license:        GPL
firmware:       RTL8192U/data.img
firmware:       RTL8192U/main.img
firmware:       RTL8192U/boot.img
license:        GPL
description:    HostAP crypto
author:         Jouni Malinen
license:        GPL
description:    Host AP crypt: TKIP
author:         Jouni Malinen
license:        GPL
description:    Host AP crypt: CCMP
author:         Jouni Malinen
license:        GPL
description:    Host AP crypt: WEP
author:         Jouni Malinen
license:        GPL
author:         Copyright (C) 2004 Intel Corporation <jketreno@linux.intel.com>
description:    802.11 data/management/control stack
srcversion:     CBD0699D19E4573A143D13E
alias:          usb:v043Ep7A01d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v5A57p0290d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v2001p3301d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v1740p9201d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0DF6p0031d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v050Dp805Ed*dc*dsc*dp*ic*isc*ip*
alias:          usb:v07AAp0043d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0BDAp8709d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0BDAp8192d*dc*dsc*dp*ic*isc*ip*
depends:       
staging:        Y
intree:         Y
vermagic:       3.2.27-ARCH+ preempt mod_unload modversions ARMv6
parm:           debug:debug output mask (int)
parm:           ifname: Net interface name, wlan%d=default (charp)
parm:           hwwep: Try to use hardware security support.  (int)
parm:           channels: Channel bitmask for specific locales. NYI (int)

No idea if it will actually work though. Didn't bother on copying it to my modules directory and run depmod since I don't have the hardware.

To get it to show in nconfig under arm just edit the Kconfig and remove the "PCI &&" part. Then build that directory only and the ko-file. Might even work with just specifying the .ko-file from the start.
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am