Compiling DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Generic Questions
Goto page Previous  1, 2, 3 ... , 16, 17, 18  Next
Author Message
dominic0315
DD-WRT Novice


Joined: 21 Apr 2020
Posts: 10

PostPosted: Fri Apr 24, 2020 1:30    Post subject: Reply with quote
And by the way, I started researching into how to compile DD-WRT myself due to macOS dropping support of L2TP over IPSec. And DD-WRT built-in SoftEther runs L2TP over IPSec which means I can no longer connect to the DD-WRT flashed device I have.

I successfully built a cross-compiler, gcc 9.3.0 (musl Libc) for ARMv7 and compiled strongSWAN 5.8.4 for the DD-WRT. But then I realised the lacking of kernel modules that rendered the strongSWAN connectable but without real communications going through. Therefore, I am digging out how to compile things from source to build things like xt_policy.ko, etc. And eventually even modifying some bits and bytes to built my own firmware binaries.
Sponsor
dmitrmax
DD-WRT Novice


Joined: 23 Nov 2014
Posts: 6

PostPosted: Sat Apr 25, 2020 17:56    Post subject: Reply with quote
Hi folks!

Given that:
# cat /proc/version
Linux version 3.10.108-d10 (root@linux) (gcc version 9.2.0 (OpenWrt GCC 9.2.0 r10890-7d542dc804) ) #3540 Fri Apr 10 13:25:57 +04 2020

I assume that is possible to build DD-WRT with OpenWRT toolchain. I've cloned OpenWRT, built its toolchain - it has prefix mipsel-openwrt-linux-musl-

How should I configure DD-WRT to use such a toolchain? First error I get is:

Code:
ccache: error: Could not find compiler "mipsel-linux-uclibc-gcc" in PATH
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 6226
Location: Netherlands

PostPosted: Sat Apr 25, 2020 18:16    Post subject: Reply with quote
dmitrmax wrote:
Hi folks!

Given that:
# cat /proc/version
Linux version 3.10.108-d10 (root@linux) (gcc version 9.2.0 (OpenWrt GCC 9.2.0 r10890-7d542dc804) ) #3540 Fri Apr 10 13:25:57 +04 2020

I assume that is possible to build DD-WRT with OpenWRT toolchain. I've cloned OpenWRT, built its toolchain - it has prefix mipsel-openwrt-linux-musl-

How should I configure DD-WRT to use such a toolchain? First error I get is:

Code:
ccache: error: Could not find compiler "mipsel-linux-uclibc-gcc" in PATH


Well you have to set the toolchain/bin in your current path.

To be honest not many people were successful in building DDWRT.
You have to be a wizard in cross compiling C.

The toolchain from OpenWRT is a start but it needs a lot of tweaking and dark magic.

BS must have some special build system and toolchain if he is compiling the source without modification Sad

I have asked him once if we could get his new toolchain but he said that was not necessary, he said you can build with his older toolchains too Smile

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
dmitrmax
DD-WRT Novice


Joined: 23 Nov 2014
Posts: 6

PostPosted: Sat Apr 25, 2020 22:16    Post subject: Reply with quote
egc wrote:

Well you have to set the toolchain/bin in your current path.


I do. But there is no such binaries in the path since the prefix differs.

egc wrote:

To be honest not many people were successful in building DDWRT.
You have to be a wizard in cross compiling C.


Well, some time ago I have such an experience. Have you managed to do it?

egc wrote:

The toolchain from OpenWRT is a start but it needs a lot of tweaking and dark magic.

BS must have some special build system and toolchain if he is compiling the source without modification Sad

I have asked him once if we could get his new toolchain but he said that was not necessary, he said you can build with his older toolchains too Smile


Ok. I'll take to take those built by BS.

I've just found some issues in IPv6 and wanted to test fixes and submit a patch. How one usually did this? Or BS makes everything alone without others help?
kernel-panic69
DD-WRT Guru


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

PostPosted: Sat Apr 25, 2020 22:52    Post subject: Reply with quote
dmitrmax wrote:
I've just found some issues in IPv6 and wanted to test fixes and submit a patch. How one usually did this? Or BS makes everything alone without others help?


If you look in the bugtracker, you will see that @egc and others have submitted patches through that system, which is usually the easiest way to publicly submit them.

_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

Linux User #377467 counter.li.org / linuxcounter.net
rkboni
DD-WRT Novice


Joined: 04 Mar 2016
Posts: 49

PostPosted: Sun Apr 26, 2020 0:47    Post subject: Reply with quote
dmitrmax wrote:
Hi folks!

Given that:
# cat /proc/version
Linux version 3.10.108-d10 (root@linux) (gcc version 9.2.0 (OpenWrt GCC 9.2.0 r10890-7d542dc804) ) #3540 Fri Apr 10 13:25:57 +04 2020

I assume that is possible to build DD-WRT with OpenWRT toolchain. I've cloned OpenWRT, built its toolchain - it has prefix mipsel-openwrt-linux-musl-

How should I configure DD-WRT to use such a toolchain? First error I get is:

Code:
ccache: error: Could not find compiler "mipsel-linux-uclibc-gcc" in PATH


musl and uclibc are two different libc implementations. I don't know much about what the DDWRT MIPS builds expect but if that's the mismatch, you can configure the OpenWrt toolchain to use one vs the other.
kernel-panic69
DD-WRT Guru


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

PostPosted: Sun Apr 26, 2020 1:10    Post subject: Reply with quote
I thought the last toolchains uploaded by BS were MUSL for the Broadcom-MIPS platforms (MIPS in general, actually)? I think DD-WRT uses both libraries, perhaps? Probably just as easy to use the last published DD-WRT toolchains.
_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

Linux User #377467 counter.li.org / linuxcounter.net
dominic0315
DD-WRT Novice


Joined: 21 Apr 2020
Posts: 10

PostPosted: Mon Apr 27, 2020 2:51    Post subject: Reply with quote
Hello all,

I have yet another problem here, I tried to compile DD-WRT for ARMv7-MUSL with the linux-4.4 kernel enclosed in the source tree. But iptables 1.3.7 failed to compile complaining of missing headers, e.g.,

Code:
linux/netfilter_ipv4/ip_conntrack.h
linux/netfilter_ipv4/ip_conntrack_tuple.h
linux/netfilter_ipv4/ip_conntrack_tcp.h
linux/netfilter_ipv4/ip_conntrack_icmp.h
linux/netfilter_ipv4/ip_conntrack_proto_gre.h
linux/netfilter_ipv4/ip_conntrack_rtsp.h
linux/netfilter_ipv4/ip_conntrack_amanda.h
linux/netfilter_ipv4/ip_conntrack_ftp.h
linux/netfilter_ipv4/ip_conntrack_irc.h
linux/netfilter_ipv4/ip_conntrack_pptp.h
linux/netfilter_ipv4/ip_conntrack_sip.h
linux/netfilter_ipv4/ip_conntrack_mms.h
linux/netfilter_ipv4/ip_conntrack_h323.h


I see that starting from some version of Linux 2.6, the above headers are dropped. But at the same time iptables 1.3.7 and Linux 4.4.208-rc1 is the version of iptables and Linux in my running DD-WRT. So I wonder how BrainSlayer compiled this version of firmware from the start?

Furthermore, one more question that Linux 4.4.208 in Linux repository seems to exist, *without -rc1* extra version, is -rc1 burnt from Makefile to the compiled OS instead of being a real release from Linux?

Thanks!
kernel-panic69
DD-WRT Guru


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

PostPosted: Mon Apr 27, 2020 3:04    Post subject: Reply with quote
If an official build has -rc1 and the one in the repository does not, then the official build may be "older" than the most recent changeset on that directory. As far as the header issues, there is no telling what magic voodoo is going on. I'm sure the folks tinkering around with the Northstar stuff probably have a better idea. I haven't looked at their WIP.
_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

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


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

PostPosted: Mon Apr 27, 2020 3:06    Post subject: Reply with quote
dominic0315 wrote:
dmitrmax wrote:
Hi folks!

Given that:
# cat /proc/version
Linux version 3.10.108-d10 (root@linux) (gcc version 9.2.0 (OpenWrt GCC 9.2.0 r10890-7d542dc804) ) #3540 Fri Apr 10 13:25:57 +04 2020

I assume that is possible to build DD-WRT with OpenWRT toolchain. I've cloned OpenWRT, built its toolchain - it has prefix mipsel-openwrt-linux-musl-

How should I configure DD-WRT to use such a toolchain? First error I get is:

Code:
ccache: error: Could not find compiler "mipsel-linux-uclibc-gcc" in PATH


Code:
make -f Makefile.northstar CC=arm-linux-musleabi-gcc CROSS_COMPILE=arm-linux-musleabi- ...


should be what you are looking for.


Not if he's compiling for MIPS. Can you read? I deleted your post because you are steering someone who is compiling for MIPS the wrong direction.

EDIT: To answer the question, you have to ensure that the location to the toolchain/compiler binaries is in your path either via export or added to your .profile file.

_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

Linux User #377467 counter.li.org / linuxcounter.net


Last edited by kernel-panic69 on Mon Apr 27, 2020 3:14; edited 1 time in total
dominic0315
DD-WRT Novice


Joined: 21 Apr 2020
Posts: 10

PostPosted: Mon Apr 27, 2020 3:10    Post subject: Reply with quote
kernel-panic69 wrote:
If an official build has -rc1 and the one in the repository does not, then the official build may be "older" than the most recent changeset on that directory. As far as the header issues, there is no telling what magic voodoo is going on. I'm sure the folks tinkering around with the Northstar stuff probably have a better idea. I haven't looked at their WIP.


Thanks kernel-panic! Is -rc* abbreviation of release candidate?

Cheers!
kernel-panic69
DD-WRT Guru


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

PostPosted: Mon Apr 27, 2020 3:14    Post subject: Reply with quote
Yes, RC/rc is usually a release candidate.
_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

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


Joined: 18 Mar 2014
Posts: 6226
Location: Netherlands

PostPosted: Mon Jun 15, 2020 11:53    Post subject: Reply with quote
This is just to say thank you to all those who participated.

With the help of the pointers from this thread we were able to compile, build and run builds for Broadcom Northstar routers.

Thanks again Smile

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


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

PostPosted: Mon Jun 15, 2020 13:28    Post subject: Reply with quote
Now maybe turn some attention to MIPS, Atheros/IPQ*, etc. to submit patches for them Twisted Evil Cool Wink
_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

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


Joined: 18 Mar 2014
Posts: 6226
Location: Netherlands

PostPosted: Thu Jun 18, 2020 13:16    Post subject: Reply with quote
kernel-panic69 wrote:
Now maybe turn some attention to MIPS, Atheros/IPQ*, etc. to submit patches for them Twisted Evil Cool Wink


Indeed Atheros IPQ806x is a good challenge.

Volunteers with experience in cross compiling are welcome to help Wink

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Goto page Previous  1, 2, 3 ... , 16, 17, 18  Next Display posts from previous:    Page 17 of 18
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Generic Questions 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