Build for WNDR3700v1/v2 / WNDR3800 (discontinued)

Just a quick note, FastPath does not seem to work with traffic shaping on ingress, it reportedly works with egress shaping though. (Also I believe it is not clear wether/how it interferes with cake's internal deNATing mode that allows per-internal-IP-fairness). This is not intended as a complaint, just a notification of known issues...

@hnyman

Is there any (easy) way to make benchmarks between some clients / scenarios ?

Hi, thanks for the firmware. I am coming from OpenWrt. Which version do you recommend for my WNDR3700? LEDE master vs LEDE 17.01?

Extroot is not enabled by default, right?

Both master and 17.01 are naturally successors for Openwrt. Both are stable, but 17.01 is more "guaranteed to work". But not much difference in practice, as ar71xx target still uses Linux kernel 4.4 also in the 17.01 branch.

I use master myself.

Extroot is not enabled.

1 Like

Thank you, one more question: how can i disable automount for particular device? I enabled extroot, but now my usb is double mounted (mnt/sda2, /overlay).

Keep up the good work, thank you for the build.

You might start by setting the anon_mount item to 0 in /etc/config/fstab, as that is the only change that I have done for the build. And if that does not help, set also the auto-mount to 0.

I have no experience with extroot, so wiki is yout best friend.

For kicks, I downloaded @hnyman version "WNDR3800-lede-r4668-b70a96285c-20170803-2135-sqfs-sysupgrade" which includes fastpath. I loaded it on an extra WNDR3800 to see how it would perform, and to my surprise it wasn't much different than my WNDR3800 with 17.01.2. Perhaps my expectations are off. My internet is capable of 150Mbps down. With 17.01.2 I get 80Mps over wireless. With the Fastpath firmware, I get about the same. What gives?

@hnyman

Something wrong("Clock skew detected. Your build may be incomplete) while I try to build WNDR3700-lede1701-r3506-bb6a8b2cbf-20170906-2058

is that ok ,I did not change anything

jack@jack-ThinkPad-T400:~/3700-1701-original/lede1701$ hnscripts/updateNmake.sh
...update main source...
Already up-to-date.
...update feeds...
Updating feed 'packages' from 'https://git.lede-project.org/feed/packages.git;lede-17.01' ...
Already up-to-date.
Create index file './feeds/packages.index'
make: Warning: File '/home/jack/3700-1701-original/lede1701/include/verbose.mk' has modification time 25244 s in the future
make: warning: Clock skew detected. Your build may be incomplete.
make: Warning: File '/home/jack/3700-1701-original/lede1701/feeds/packages.tmp/info/.files-packageinfo.mk' has modification time 25289 s in the future
make[1]: Warning: File '/home/jack/3700-1701-original/lede1701/include/verbose.mk' has modification time 25244 s in the future
make[1]: warning: Clock skew detected. Your build may be incomplete.
make: warning: Clock skew detected. Your build may be incomplete.
make: Warning: File '/home/jack/3700-1701-original/lede1701/feeds/packages.tmp/info/.files-targetinfo.mk' has modification time 25289 s in the future
make[1]: Warning: File '/home/jack/3700-1701-original/lede1701/include/verbose.mk' has modification time 25243 s in the future
make[1]: warning: Clock skew detected. Your build may be incomplete.
make: warning: Clock skew detected. Your build may be incomplete.

Something goes wrong with your build system's system time. Sounds like you have copied the files from a drive that uses local timezone to a drive that uses UTC, or something like that.

@hnyman
Yes it is,you are so good !

by the way, I can't build my netgear 4300 yet,please pull me out there

as your post I do the following changes

BinDir=$PWD/bin/targets/ar71xx/generic
Device=WNDR3700
Prefix=lede-ar71xx-generic

change to

BinDir=$PWD/bin/targets/ar71xx/nand
Device=WNDR4300
Prefix=lede-ar71xx-nand

cd $BinDir
mv *.manifest WNDR3700-$VersTime.manifest
mv *wndr3700-squashfs-sysupgrade.bin WNDR3700-$VersTime-sqfs-sysupgrade.bin
mv *wndr3700-squashfs-factory.img WNDR3700-$VersTime-sqfs-factory.img
mv *wndr3700v2-squashfs-sysupgrade.bin WNDR3700v2-$VersTime-sqfs-sysupgrade.bin
mv *wndr3700v2-squashfs-factory.img WNDR3700v2-$VersTime-sqfs-factory.img
mv *wndr3800-squashfs-sysupgrade.bin WNDR3800-$VersTime-sqfs-sysupgrade.bin
mv *wndr3800-squashfs-factory.img WNDR3800-$VersTime-sqfs-factory.img

change to

cd $BinDir
mv *.manifest WNDR4300V1-$VersTime.manifest
mv *WNDR4300V1-squashfs-sysupgrade.bin WNDR4300V1-$VersTime-sqfs-sysupgrade.bin
mv *WNDR4300V1-squashfs-factory.img WNDR4300V1-$VersTime-sqfs-factory.img

then do hnscripts/updateNmake.sh after making menuconfig and select WNDR4300V1

but get erros

make[3]: Entering directory '/home/jack/3700master/lede/feeds/luci/applications/luci-app-bcp38'
make[3]: Entering directory '/home/jack/3700master/lede/feeds/luci/applications/luci-app-ddns'
make[3]: Entering directory '/home/jack/3700master/lede/feeds/luci/collections/luci-ssl-openssl'
make[2]: Entering directory '/home/jack/3700master/lede'
make[3]: Entering directory '/home/jack/3700master/lede'
make[2]: Entering directory '/home/jack/3700master/lede'
make[3]: Entering directory '/home/jack/3700master/lede/target/linux'
make[4]: Entering directory '/home/jack/3700master/lede/target/linux/ar71xx'
make[5]: Entering directory '/home/jack/3700master/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_nand/linux-4.4.87'
make[5]: Entering directory '/home/jack/3700master/lede/target/linux/ar71xx/image'
make[2]: Entering directory '/home/jack/3700master/lede'
make[2]: Entering directory '/home/jack/3700master/lede'
...create build info: process lede...
mv: target 'WNDR4300V1-lede-r4831-9c500db-20170915-2025.manifest' is not a directory
mv: cannot stat '*WNDR4300V1-squashfs-sysupgrade.bin': No such file or directory
mv: cannot stat '*WNDR4300V1-squashfs-factory.img': No such file or directory

Hey, just check the contents of the compilation directory and modify filenames in the scripts accordingly. Most likely you have the actual filenames starting with small caps (like in my original script), and you have replaced that with LARGE CAPS

See the difference below????

mv *wndr3700-squashfs-sysupgrade.bin WNDR3700-$VersTime-sqfs-sysupgrade.bin
vs.
mv *WNDR4300V1-squashfs-sysupgrade.bin WNDR4300V1-$VersTime-sqfs-sysupgrade.bin

But this again quite general file handling advice, nothing to with my build scripts specifically. Please just look at the files and directories and double check that you have details right in the scripts. There is no way I can remotely debug your changes........

@hnyman

Any suggestion to this error:

root@LEDE:~# opkg install kmod-wireguard
Installing kmod-wireguard (4.4.87+0.0.20170907-1) to root...
Downloading http://downloads.lede-project.org/snapshots/targets/ar71xx/generic/packages/kmod-wireguard_4.4.87+0.0.20170907-1_mips_24kc.ipk
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-wireguard:
 * 	kernel (= 4.4.87-1-48cdaa48961822c7096597d7ef9f957b) * 
 * opkg_install_cmd: Cannot install package kmod-wireguard.
root@LEDE:~# uname -a
Linux LEDE 4.4.83 #0 Mon Aug 21 15:14:07 2017 mips GNU/Linux
root@LEDE:~#

I tried install with --force-depends, but I can't find the module in lsmod. I think it's not loaded, also modprobre wireguard says that it failed to find module named wireguard. :rage:

You can't install kernel modules from a different kernel version . 4.4.87 modules do not fit to 4.4.83. Dependency override will not help with that.

Good to know that, thanks.

What are my options? Is there any (easy) way to upgrade the kernel? Or I must forget about it?

I think I need to compile my own version? If I am not wrong the Lede SDK is the tool for this. I already downloaded, but I need some help to how to set target to .83 kernel.

All suggestions are welcomed.

1 Like

There is a rather strict kernel version checksum based on kernel options used in compilation. As buildbot builds all kernel modules, the checksum is different than in a private build. In practice you need to install kernel modules (kmod-*) from the same build run that built the main firmware. you should build everything by yourself and include the kmods in compilation.

(Same goes buildbot snapshots. You can install kmods from the same build, but if you wait a few days, and try installing then something, you will fail as the next buildbot run has different checksums)

In practice you need to install kernel modules (kmod-*) from the same build run that built the main firmware.

Either

  • use a third-party firmware as it is, (as you can't install kmods from the release repo)
  • use an official release like 17.01.2 so that you can install kernel modules from the official repo
  • use buildbot snapshots and install kmods immediately after flashing the firmware
  • compile everything by yourself to create a personal firmware that included the needes kmods. Either compile from full sources, or use imagegenerator to cook it from release/snapshot packages.
    • Using SDK will likely not work, as current SDK will be for the current kernel 4.4.87 and your router has 4.4.83.

Thanks hnyman, last question: you as the developer for this custom version for WNDR models, I think you have all the toolchain for compiling (for older kernel version). Can't you make a custom feed for enabling all packages (kmods) to be installed in our images with older kernel? Or at least compile wireguard VPN server. :+1::raised_hand:

No.
What you are asking, would actually to mean that I should
a) compile all packages (a few thousand) or at least the kmods (a few hundred)
b) store them on the download server for each compilation round I make, so that you could install later the package to your old version. The disk space requirements would be enormous.

I have created the build mainly for my own needs and have deciced to share it. But if you want extra kernel modules, you pretty much have just the options I wrote in the previous message.

1 Like

@hnyman

Hey hnyman,I can’t build my netgear 4300v1 yet ,your build environment
is attractive to me,please do me a favor again

Here are my steps
...Downlaod 5 files with prefix
WNDR3700-lede1701-r3506-bb6a8b2cbf-20170906-2058 to a folder

...run WNDR3700-lede1701-r3506-bb6a8b2cbf-20170906-2058-newBuildroot.sh to build your environment first

...change createbuildinfo.sh to following

#!/bin/sh

createbuildinfo - Create info on current config and source code changes

getGitInfo() {
#params: directory patchfile infofile
echo "\n######################################################\n" >> $3
(cd $1
git diff HEAD > $2
git remote -v show | grep fetch >> $3
git branch --list >> $3
git show --format="%cd %h %s" --abbrev=7 --date=short | head -n 1 | cut -b1-60 >> $3
git status --porcelain >> $3
)
}

BinDir=$PWD/bin/targets/ar71xx/nand
Device=WNDR4300
Prefix=lede-ar71xx-nand

Branch=lede1701
#Branch=basename $PWD
echo process $Branch...
VersTime=$Branch-scripts/getver.sh-date +%Y%m%d-%H%M
TFile=$BinDir/$Device-$VersTime

cleanup old binaries & patches

rm -f $BinDir/WNDR3*

remove unnecessary files

rm -f $BinDir/root $BinDir/vmlinux $BinDir/uImage
rm -f $BinDir/*-NA.img $BinDir/3800ch $BinDir/wndrmac

create status info and patches

echo "$VersTime" > $TFile-status.txt
getGitInfo . $TFile-main.patch $TFile-status.txt
getGitInfo feeds/luci $TFile-luci.patch $TFile-status.txt
getGitInfo feeds/packages $TFile-packages.patch $TFile-status.txt
getGitInfo feeds/routing $TFile-routing.patch $TFile-status.txt
sed -i -e 's/$/\r/' $TFile-status.txt

collect config info

cp .config $TFile.config
cp .config.init $TFile.config.init
scripts/diffconfig.sh > $TFile.diffconfig 2>/dev/null

copy buildroot creation script and patch timestamp info

cp hnscripts/newBuildroot.sh $TFile-newBuildroot.sh
sed -i "s/^FILESTAMP=.*/FILESTAMP=$Device-$VersTime/" $TFile-newBuildroot.sh

cleanup checksum files

grep -sh wndr3.*-squashfs $BinDir/md5sums $BinDir/sha256sums
| sed -e 's/$/\r/' -e 's/'$Prefix'-//' -e 's/squash/sq/' \

$TFile-checksums.txt
rm -f $BinDir/md5sums $BinDir/sha256sums

rename manifest and firmware files

cd $BinDir
mv *.manifest $Device-$VersTime.manifest
mv $Prefix-$Device-squashfs-sysupgrade.tar $Device-$VersTime-sqfs-sysupgrade.tar
mv $Prefix-$Device-squashfs-factory.img $Device-$VersTime-sqfs-factory.img

...change mountNcopy.sh to following

#!/bin/sh

mount & copy - Mount the Virtualbox shared folder and copy files to PC

Mounttype=vboxsf
Mountname=PCSHARE
Mountpoint=/media/windows-share
BinDir=bin/targets/ar71xx/nand

echo Check for existing mount of the shared folder $Mountpoint
df | grep $Mountpoint
if [ "$?" -ne 0 ]; then
echo Mounting $Mountpoint as $Mountname...
sudo mount -t $Mounttype $Mountname $Mountpoint
[ "$?" -ne 0 ] && echo "Sudo/mount failed." && exit 1
fi

echo "\nCopy from $PWD ..."
cp $BinDir/*bin $Mountpoint
sleep 2
cp $BinDir/*img $Mountpoint
sleep 2
cp $BinDir/*patch $Mountpoint
sleep 1
cp $BinDir/*sh $Mountpoint
sleep 1
cp $BinDir/*manifest $Mountpoint
sleep 1
cp $BinDir/*txt $Mountpoint
sleep 1
cp $BinDir/config $Mountpoint
echo done.

...then make menuconfig to select 4300v1

....excute hnscripts/updateNmake.sh

….after 20 minutes get following erro log

…………..
make[2]: Entering directory '/home/jack/370001701906/lede1701'
make[2]: Entering directory '/home/jack/370001701906/lede1701'
...create build info: process lede1701...
mv: cannot stat 'lede-ar71xx-nand-WNDR4300-squashfs-sysupgrade.tar': No such file or directory
mv: cannot stat 'lede-ar71xx-nand-WNDR4300-squashfs-factory.img': No such file or directory

That says pretty clearly that you have got the filename ‘lede-ar71xx-nand-WNDR4300-squashfs-sysupgrade.tar’ wrong. There is no such file.

Just check the dir bin/target/ar17xx/nand for the actual files names and change createbuildinfo accordingly. Like I said earlier, you may have smallcap/LARGECAP problem.
There may be the file ‘lede-ar71xx-nand-wndr4300-squashfs-sysupgrade.tar’, but you have told the script to find ‘lede-ar71xx-nand-WNDR4300-squashfs-sysupgrade.tar’...

with ar71xx it is quite possible that you have to edit the move/rename commands a bit, like I have done for my wndr3700 build:

mv *.manifest WNDR3700-$VersTime.manifest
mv *wndr3700-squashfs-sysupgrade.bin WNDR3700-$VersTime-sqfs-sysupgrade.bin
mv *wndr3700-squashfs-factory.img WNDR3700-$VersTime-sqfs-factory.img
mv *wndr3700v2-squashfs-sysupgrade.bin WNDR3700v2-$VersTime-sqfs-sysupgrade.bin
mv *wndr3700v2-squashfs-factory.img WNDR3700v2-$VersTime-sqfs-factory.img
mv *wndr3800-squashfs-sysupgrade.bin WNDR3800-$VersTime-sqfs-sysupgrade.bin
mv *wndr3800-squashfs-factory.img WNDR3800-$VersTime-sqfs-factory.img

I can't debug your files remotely, so fixing this is up to you.

It is not complicated, but you need some script skills and general Linux file system understanding. And you need to be meticulous about smallcaps/LARGECAPS.

Ps. and if you include scripts in your posts, you should quote them properly. otherwise they are pretty unreadable.