LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   8812au driver on raspi 2 (https://www.linuxquestions.org/questions/slackware-arm-108/8812au-driver-on-raspi-2-a-4175615176/)

aihaike 10-06-2017 01:26 PM

8812au driver on raspi 2
 
Dear all,

I got a Realtek RTL8812AU 802.11a/b/g/n/ac WLAN Adapter but I'm not able to compile the module provided in the cdrom.

The platform type is not in the Makefile list.
When I try to build it from sources I get from github the compilation crash because the 'build' folder doesn't exist.

I'm wondering if anyone has successfully built and used this module.

Thank you.

petelq 10-06-2017 04:25 PM

I'm sure you'll find a workable driver to compile on github. Search "github rtl8812au raspberry pi" or something similar.

aihaike 10-06-2017 04:50 PM

I git cloned https://github.com/zebulon2/rtl8812au-driver-5.2.9

then did a make,make install

But modprobe returns:
Quote:

modprobe -v 8812au
insmod /lib/modules/4.9.50-v7+/kernel/drivers/net/wireless/8812au.ko
modprobe: ERROR: could not insert '8812au': Exec format error
I checked dmesg
Quote:

8812au: disagrees about version of symbol module_layout
Any idea about what's going wrong here ?

abga 10-06-2017 08:57 PM

@aihaike

I suppose you're running the kernel from Raspbian on your Pi2. The issue you came across trying to load the module you've just compiled:
Quote:

8812au: disagrees about version of symbol module_layout
is caused by the fact that the kernel is compiled with CONFIG_MODVERSIONS set and the module symbols from your driver are different from the ones in the other (depending) kernel modules/kernel. This CONFIG_MODVERSIONS option was introduced in the kernel some time ago for consistency checking of the loadable modules and it was meant to be used optionally and only on productions systems (where you wouldn't let anyone play around / tamper / taint with the kernel ). Nowadays it is enabled by default in all kernel compilations, I'm still asking myself why, and it is a BIG (to be read catastrophic) pain in the A$$!
https://www.kernel.org/doc/Documenta...ld/modules.txt

Your only option is to get at least the kernel headers corresponding to your kernel from Raspbian, which includes the Module.symvers file and try to compile your module in the kernel headers tree. Theoretically. In practice, although a lot of people are showing off that they have their own "magic" scripts for doing that, I've never seen one actually posting some of those scripts, nor explaining how they achieve it through compiler/environmental variables.
Recently I was in the same situation like yours and found out that not even the "gurus" could have helped me and I had to recompile the whole kernel for a simple driver (I was registered as geronimo):
https://discourse.osmc.tv/t/kernel-d...-2-hd-ci/38459

Under Slack ARM there is no way you can get the kernel headers / kernel source from Raspbian and your only alternative is to get them directly under a running Raspbian - check the following post for the how-to (I was justme123 - before they banned me :) ):
https://www.raspberrypi.org/forums/v...me123#p1156462

Since the kernel version is not something the folks at Raspberry really care about, you need to check your actual running kernel version with uname -a under Slackware and then guess which Raspbian Image came with it... or maybe you remember what release you have used in the first place:
https://downloads.raspberrypi.org/ra...ease_notes.txt

Raspbian Images Repository:
https://downloads.raspberrypi.org/raspbian/images/
or Raspbian Lite Images Repository:
https://downloads.raspberrypi.org/raspbian_lite/images/

My advice will be to compile your driver directly under Raspbian and then move the compiled ko to your Slackware like I was documenting in this post:
https://www.linuxquestions.org/quest...8/#post5750237
You haven't specified what Slack ARM version you run on (14.2 / current), nor the kernel version. You should pay attention at the ending of your running kernel - if it's armv6 or armv7 - for example 4.4.50+ for armv6 and 4.4.50-v7+ for armv7 and not mix them, that's stay on the same kernel version on both Raspbian / Slack.
Personally, I'm also compiling a patched DVB-S2 driver file directly under Slackware with only having the kernel headers available, but I'm using (hacking) the media_build script and just substituting the original source file with my patched one. If you're into such an approach, then you'll need the kernel .config file and to not forget to prepare the kernel headers first.
- to get the .config file from your running kernel run the following:
Code:

modprobe configs
cp /proc/config.gz /usr/src/linux-headers-VERSION
rmmod configs
cd /usr/src/linux-headers-VERSION
gunzip config.gz

- VERSION should be completed with your actual version
- then prepare the kernel headers
Code:

cd /usr/src/linux-headers-VERSION
make -j 4 oldconfig && make -j 4 prepare
make -j 4 modules_prepare

... finally build your driver in a way that it reads/respects the Module.symvers

aihaike 10-07-2017 07:13 AM

Thank you abga for your reply,

That's not a good news though.
I'll try to compile on a friend's raspian.

Why is this module so complicated to build?

Thanks again.

syg00 10-07-2017 05:49 PM

Excellent reply.
I recently built 8814au on x86_64 (I have no need for it on ARM), but this might become a PITA. It looks like it will need a rebuild again for 4.11.

SCerovec 10-16-2017 10:59 AM

Other than that, the sources seem to requiure a tweak in the Makefile and a few others (did a superficial read across the net).

Final outcome?

Ordered an Atheros b/g/n Dongle instead :/

aihaike 11-24-2017 01:41 PM

Hey SCerovec,

I finally gave up.

SCerovec 11-25-2017 01:37 AM

By buying an Atheros dongle like me?
:(

aihaike 11-26-2017 07:18 AM

No, using Power-line communication (PLC)

abga 11-27-2017 12:59 PM

@aihaike
I thought it's easier to compile a driver module (8812au in your case) under Debian (Raspbian), that's why I've advised you to do so.
With all their convenient/aiding automation and scripting it doesn't look to work after all:
https://www.raspberrypi.org/forums/v...?f=29&t=101920

SCerovec 11-28-2017 03:08 PM

The current state of wireless brings me back into the era of ACX100 and reign supreme of Prism and Intersil.

Some chipsets received more love than the others and just are worth a purchase.

There was a time when "just anyone" was safe to buy, but I'm afraid that time is over (for a while at least)?

stormtracknole 12-01-2017 07:26 PM

These are the steps that I took on my Raspberry Pi 3. It *should* work on 2. First, ensure that you have the latest kernel loaded (run rpi-update). Reboot if necessary to boot the latest kernel.

Code:


cd /usr/src
git clone --depth 1 https://github.com/raspberrypi/linux.git
ln -s linux $(uname -r)
ln -s /usr/src/linux /lib/modules/$(uname -r)/build
cd linux
wget -O Module.symvers https://raw.githubusercontent.com/raspberrypi/firmware/master/extra/Module7.symvers
KERNEL=kernel7
make bcm2709_defconfig
make prepare
make modules_prepare
cd $HOME
git clone https://github.com/diederikdehaas/rtl8812AU.git
cd rtl8812AU
make
make install <-- as root

I'm not sure if setting the value "KERNEL=kernel7" is needed. Also, not sure if downloaded Module.symvers is needed either. Those were the suggested steps on another website. Try it without it first and see. I bought this usb dongle from amazon and I can confirm that it works with hostapd with 5GHz.


All times are GMT -5. The time now is 10:42 AM.