Toolchain for the dd-wrt builds? (for kmod compilation)

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Sat Jul 03, 2021 11:56    Post subject: Toolchain for the dd-wrt builds? (for kmod compilation) Reply with quote
I am currently using the r47000 build (on my Netgear R7000), and wanted to build some additional kernel modules for it...
...And I can't seem to find where to get the toolchain. Querying /proc/version yields
Code:
Linux version 4.4.273 (root@linux) (gcc version 11.1.0 (OpenWrt GCC 11.1.0 r16592-aabc632023) ) #3542 SMP Mon Jun 28 09:28:51 +07 2021

Now, I checked OpenWrt toolchains, and it seems you can only build it up to gcc 10, but gcc 11.1 is nowhere to be found. Where can I get it?
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14102
Location: Texas, USA

PostPosted: Sat Jul 03, 2021 12:22    Post subject: Reply with quote
BrainSlayer no longer publicly posts the current toolchains archive. It has not been updated since 2018.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12812
Location: Netherlands

PostPosted: Sat Jul 03, 2021 12:53    Post subject: Reply with quote
10.3 builds fine, but you have to tweak the Openwrt tool chain to build for DDWRT

Currently I am not at home but if you do not succeed I can build additional kernel modules for you.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Sat Jul 03, 2021 14:24    Post subject: Reply with quote
Thanks, I will try first to build the 10.3 toolchain first... All the other toolchains I used ended up crashing the kernel after insmoding the compiled module.

Can you please hint about what should be tweaked in the toolchain?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12812
Location: Netherlands

PostPosted: Sat Jul 03, 2021 15:07    Post subject: Reply with quote
I am sorry I am not at liberty to share that information Sad

It is complicated

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Sat Jul 03, 2021 22:39    Post subject: Reply with quote
It's... Weird... To say the least...
But okay.
Could you please compile compatible macvlan, ipvlan, vxlan, veth kmods for the R7000 on build 47000?
I compiled them but the result was the same - either "unrecognized symbol" or just plain crash/reboot.
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Thu Jul 08, 2021 11:12    Post subject: Reply with quote
Surprisingly enough, I managed to compile some modules on the device itself (with the help of Entware's Gcc 7.4.0). So the version of gcc is definitely of no concern for kmods, and something other was buggying.
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Thu Jul 08, 2021 21:07    Post subject: Reply with quote
Yep definitely building on the device itself works quite well (although kinda slow, but not horribly slow). It required tinkering around with bypassing ccache, but overall it wasn't hard.
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Thu Jul 08, 2021 21:33    Post subject: Reply with quote
Attaching additional modules (veth, ipvlan, macvlan, macvtap, vxlan) for whoever it may concern ©
I do not guarantee it would work with any other revision than 47000 and on any other device than R7000. FYI it is an ARM device, not MIPS.

(see following posts for an updated version)


Last edited by Evengard on Mon Jul 26, 2021 17:35; edited 1 time in total
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Thu Jul 08, 2021 22:18    Post subject: Reply with quote
Testing on the newest released build 47033 - still working fine.
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 931
Location: WV, USA

PostPosted: Fri Jul 09, 2021 18:53    Post subject: Reply with quote
Evengard wrote:
Yep definitely building on the device itself works quite well (although kinda slow, but not horribly slow). It required tinkering around with bypassing ccache, but overall it wasn't hard.


If you could describe in detail how you managed to accomplish this (apart from the obvious #opkg install gcc), it could be quite useful for many folks on this forum, including me.

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate, gcc

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r53562
Features in use: multiple VLANs over single trunk port, multiple VAPs

Linksys EA8500 WDS Station x2 - DD-WRT r53562

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Member #248
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Fri Jul 09, 2021 21:46    Post subject: Reply with quote
Actually, I just tested cross-compiling with the help of Entwares cross-compiler. It actually works as well!

If there is a need for a step-by-step guide using it I can write it down, but I mostly used the official Entware docs from https://github.com/Entware/Entware/wiki/Compile-packages-from-sources and tips from https://blukat29.github.io/2017/12/cross-compile-arm-kernel-module/ to achieve it.
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 931
Location: WV, USA

PostPosted: Sat Jul 10, 2021 0:38    Post subject: Reply with quote
Evengard wrote:
Actually, I just tested cross-compiling with the help of Entwares cross-compiler. It actually works as well!

If there is a need for a step-by-step guide using it I can write it down, but I mostly used the official Entware docs from https://github.com/Entware/Entware/wiki/Compile-packages-from-sources and tips from https://blukat29.github.io/2017/12/cross-compile-arm-kernel-module/ to achieve it.


Cool. I guess I was just more curious about which kernel headers you used to build against. Did you use the official kernel headers or the openwrt kernel headers?

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate, gcc

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r53562
Features in use: multiple VLANs over single trunk port, multiple VAPs

Linksys EA8500 WDS Station x2 - DD-WRT r53562

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Member #248
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Sat Jul 10, 2021 10:23    Post subject: Reply with quote
I cloned the whole dd-wrt repo up to the revision of my firmware and built the modules out of it using the cross-compiler path from Entware's staging dir toolchain location. Smth like that.
Evengard
DD-WRT Novice


Joined: 03 Jul 2021
Posts: 15

PostPosted: Sun Jul 11, 2021 14:20    Post subject: Reply with quote
More modules. Now I added the zram-related ones, for people who struggles with RAM.
Modules list:
ipvlan.ko
lz4.ko
lz4_compress.ko
lz4_decompress.ko
macvlan.ko
macvtap.ko
veth.ko
vxlan.ko
xz.ko
zram.ko
zsmalloc.ko

(see following posts for an updated version)


Last edited by Evengard on Mon Jul 26, 2021 17:36; edited 1 time in total
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum