difficulties compiling rtl8812 module (Solved)

Moderator: Forum moderators

Post Reply
Aristos
Posts: 17
Joined: Thu Jul 01, 2021 11:02 am
Has thanked: 7 times
Been thanked: 13 times

difficulties compiling rtl8812 module (Solved)

Post by Aristos »

Greetings to all,together with my best wishes for a happy 2024.

I am trying to compile the rtl8812 module (5 ghz wifi) for my Puppy Linux phone running Raspup 8.2.1 with no success.
After downloading the latest? source code (https://github.com/aircrack-ng/rtl8812au),install headers,make the appropriate changes to "Makefile" for 32bit-ARM (well I suppose we are running a 32bit system in a 64 bit architecture), I got the following message just after trying to build the first object file:

"/bin/sh: scripts/basic/fixdep: cannot execute binary file: Exec format error
make[2]: *** [scripts/Makefile.build:266: /root/rtl8812au/core/rtw_cmd.o] Error 126"

Needless saying that I tried any tweak found in net concerning Makefile and config files.
The above holds true for source code from found elsewhere.

By the way the module was build successfully as an external module.

Code:
/lib/modules/5.4.42-v7/build/make modules_prepare

/root/rtl8812au/make

Unfortunately when loaded taints kernel.As doc.kernel.org states:
"modules_prepare" will not build Module.symvers even if CONFIG_MODVERSIONS is set; therefore, a full kernel build needs to be executed to make module versioning work."

Moreover the module compiles fine and works :-) in an Intel 64 pc running latest Puppies and in Debian Rasbian Buster 10 kernel 5.4.51-v7+

Lastly I tried to recompile kernel with Woof-CE but was far beyond my capabilities.

Any advice welcomed
Thank you

Last edited by Aristos on Thu Dec 28, 2023 2:26 pm, edited 1 time in total.
User avatar
bigpup
Moderator
Posts: 6259
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 730 times
Been thanked: 1289 times

Re: difficulties compiling rtl8812 module

Post by bigpup »

I am not sure you did this correctly.

Usually to compile in Puppy Linux.

Download and load these two SFS packages into the running operating system.
devx sfs
kernel sources SFS

They are here for raspup 8.2.1
http://distro.ibiblio.org/puppylinux/ar ... pup-8.2.1/

These provide all needed software to do compiling.
Make and all other compiling software programs are in the devx sfs.
They should already be correctly made to use.

Then use with the software source, for what you are trying to compile, using whatever info for compiling, is provided with the source package.

Note:
There are slightly different builds of Raspup, mainly to support different Raspberry Pi computers.
Looking at the different kernel sources sfs's
I guess you need to make sure to get the correct one for the specific raspup 8.2.1 you are using.
I would just use the biggest in size kernel sources SFS.

Warning:
Any software you installed that is used to compile, like make, etc.............
Delete it before you load the devx sfs

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 6259
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 730 times
Been thanked: 1289 times

Re: difficulties compiling rtl8812 module

Post by bigpup »

Do you know how to load a SFS package into the operating system?

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Aristos
Posts: 17
Joined: Thu Jul 01, 2021 11:02 am
Has thanked: 7 times
Been thanked: 13 times

Re: difficulties compiling rtl8812 module

Post by Aristos »

bigpup

thank you for your answer

I think I did it the right way.
If there was no devx loaded the "make" would complaining that their is no compiler and
if there was no kernel sources the "make" would complain that /lib/modules/xxxx/build:no such file or directory

did you read the error message in my post?
I specifically state I got the following message just after gcc is trying to build the first object file.
and yes the attempt was done in a fresh pupsave.

Regards

Last edited by Aristos on Sun Dec 24, 2023 9:35 pm, edited 1 time in total.
User avatar
bigpup
Moderator
Posts: 6259
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 730 times
Been thanked: 1289 times

Re: difficulties compiling rtl8812 module

Post by bigpup »

when you do not give specific details on what you did, we have to start guessing.

So, now you tell us you did download and load the needed devx and kernel sources SFS packages?

install headers,make the appropriate changes to "Makefile" for 32bit-ARM

That is not what this statement by you says.

I am not sure what headers you are trying to use.

the specific raspup kernel sources sfs is what needs to be used.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 6259
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 730 times
Been thanked: 1289 times

Re: difficulties compiling rtl8812 module

Post by bigpup »

Is this what you are saying you did with the makefile in the source package?

Then change the platform in Makefile to 32-bit ARM architecture (RPi 1/2/3/ & 0/Zero):

$ sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
$ sed -i 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/g' Mak

That may be required before running the make command. Raspup is 32bit.
However the info on the driver web page is talking about Raspberry OS.
So not sure really if it is setting up the file for working on Raspup.

After downloading and loading the raspup devx and kernel sources SFS's (nothing else)

Having the sources package (I assume you downloaded this:rtl8812au-5.6.4.2.zip) from the link you have in the first post.

Decompress it into a directory.

Navigate to that directory and open it showing the contents.

Screenshot(13).jpg
Screenshot(13).jpg (23.81 KiB) Viewed 477 times

.

Open a terminal in this directory to run this command.

This is all you should need to do:

For building & installing the driver with 'make' use

Code: Select all

$ make && make install

I usually do them separately.

First run make

Then run make install.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 6259
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 730 times
Been thanked: 1289 times

Re: difficulties compiling rtl8812 module

Post by bigpup »

The problem with Raspup is, it got released and that was about all the work, that was done on it.

Use it and live with any bugs, it may have.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Aristos
Posts: 17
Joined: Thu Jul 01, 2021 11:02 am
Has thanked: 7 times
Been thanked: 13 times

Re: difficulties compiling rtl8812 module

Post by Aristos »

Use it and live with any bugs, it may have

Probably correct,
finally we agreed on something.

The rest are epea pteroenta .

User avatar
bigpup
Moderator
Posts: 6259
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 730 times
Been thanked: 1289 times

Re: difficulties compiling rtl8812 module

Post by bigpup »

I think it is going to be something in the settings in the Makefile.

But what exactly.

I have tried a few ideas and did get a little different errors, but still would not build the driver.

Too bad 01micko is not around anymore. He produced Raspup and should know what was needed to compile for it.

You probably know more about this then I do.

I always have issues compiling software from source, but usually figure it out.

Maybe the devx SFS does not provide everything needed. :idea:

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 6259
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 730 times
Been thanked: 1289 times

Re: difficulties compiling rtl8812 module

Post by bigpup »

There is EasyOS for the Raspberry Pi computer and it is 64bit OS.
viewtopic.php?t=3330

This is not Puppy Linux, but is Puppy like.

Barryk is still active with EasyOS and still around to help.
Note:
He is original developer of Puppy Linux.


I tried to compile the driver you posted in this Pi computer OS version.
After downloading this OS's devx and kernel sources SFS's and using the Boot config manager to load them.

It compiled with no problem and installed the driver.

It did install this for the driver: 88XXau.ko

If I had the WIFI hardware, I could test it. No way I can tell if this is what you need.

Maybe this will help you!

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Aristos
Posts: 17
Joined: Thu Jul 01, 2021 11:02 am
Has thanked: 7 times
Been thanked: 13 times

Re: difficulties compiling rtl8812 module

Post by Aristos »

bigpup

Thanks a lot for your interest.
I am aware of the above.
It seems i was wrong in the first place choosing Raspup for my puppy Linux phone.

Aristos
Posts: 17
Joined: Thu Jul 01, 2021 11:02 am
Has thanked: 7 times
Been thanked: 13 times

Re: difficulties compiling rtl8812 module

Post by Aristos »

Finally the problem was in the Linux headers.

I had this suspicion since the module built OK as an external module.(but taint kernel and subsequently gave a kernel panic)
Due to cross compilation the fixdep command is a x86 version which cannot run on arm
"/bin/sh: scripts/basic/fixdep: cannot execute binary file: Exec format error"

The solution came from here" "https://www.mail-archive.com/debian-bug ... 04643.html"
and here: "https://github.com/armbian/build/issues/74"
and here: "https://github.com/raspberrypi/linux/issues/4125"

I could not upload the module since gziped is app. 620kb
If there is a way please advise.

it is compiled for raspberry 3b
the specific device is: realtek id=8812:0bda

/var/log/messages output:
Dec 28 08:00:39 puppy_phone kern.warn kernel: [ 203.766090] 88XXau: loading out-of-tree module taints kernel.
Dec 28 08:00:39 puppy_phone kern.info kernel: [ 204.108745] usb 1-1.2: 88XXau 54:c9:ff:02:db:7a hw_info[d7]
Dec 28 08:00:39 puppy_phone kern.info kernel: [ 204.114792] usbcore: registered new interface driver rtl88XXau

The next step is to dismantle the device and make a direct connection inside the phone :-)

God builds the nest for the blind birds.

Happy new year!

Post Reply

Return to “Raspbian Buster”