Build for WNDR3700v1/v2 / WNDR3800 (discontinued)

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.

ok let me try to fix first it ,thank you
skip it (Could you debug them by teamviewer,please please...)

@hnyman

hi Hynman
finally,I made it,I know withou you I can do not this. thank you very much!

the firewire for my wndr4300 is ok,although there are a lot of txt and pathc ,sh files with date prefix in bin/targets/ar71xx/nand/

Yes, that is just the goal of my build scripts, that you get a full archive of source changes for each build, so that you can clearly see the made changes and you can re-install the same build environment again easily. Just as you have done.

@hnyman
hey Hnyman,Hope you have a fun weekend.
The wps button on r7800 is ok,but it's not work for my 4300v1
I do a search on Google,but have't get an answer yet,Would you please give me a little tips to find the answer
Thanks in advance

Please don't hijack device-specific threads for hardware advice for quite other devices.
I have no special knowledge about 4300v1 specifics.

Different routers have different hardware and hardware definitions.
You need to look into source code (and your /etc/rc.button directory) to see what are the differences.
At the first glance I spot no major difference in button definitions:
3700: https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/ar71xx/files/arch/mips/ath79/mach-wndr3700.c;h=1315bab03739ac99185763383b97fdebeadf71b7;hb=HEAD#l76
4300: https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/ar71xx/files/arch/mips/ath79/mach-wndr4300.c;h=2a00a0ed961faf8c0e538c04f2b2455db190b6db;hb=HEAD#l103

But in any case, you are on your own. I have no knowledge about 4300v1.

OK I got it
Thank you Hnyman

@hnyman

Hey Hnyman
According your tips
I put a wps file to /etc/rc.button from wps-hotplug.sh
when I press wps button on my WNDR4300,the led color change,I think it's work now

but I did not find the words" wps avaiable " ony my phone after forget my WNDR4300's wifi

then I try to test my r7800,it's also no words" wps avaiable "

should I add some packages on my router? just like following lik

please git me futher tips later

thanks

@hnyman
Sorry Hnyman,I should check carefully
I just find there is a option for wps in luci menu on my r7800
I'm testing...

and I also found "wpad hostapd-utils,hostapd-common" has been installed on r7800

I checked box of "Enable WPS pushbutton, requires WPA(2)-PSK" in luci menu,and press wps button on my r7800, both wifi and wps led are flashing,but I did see the " wps avaiable " yet

thanks

edit
finally I got wps on both routers worked, I'm so happy!

thank you for your tps Hnyman !

@hnyman
Are you considering adding support for "fast path" in your compilations (only in the form of additional kernel modules).
By the way - is there any sense of adding this FP support for the WNDR3800?
Example patch - https://dl.eko.one.pl/lede/17.01-SNAPSHOT/patches/target/linux/generic/patches-4.4/950-net-patch-linux-kernel-to-support-shortcut-fe.patch
Other important patches: https://dl.eko.one.pl/lede/17.01-SNAPSHOT/patches/target/linux/generic/patches-4.4/952-net-conntrack-events-support-multiple-registrant.patch
https://dl.eko.one.pl/lede/17.01-SNAPSHOT/patches/target/linux/generic/patches-4.4/951-bridge-Add-new-bridge-APIs-needed-for-network-HW-acc.patch

I already tested it in early August as I wrote in this thread...

dissent1 has made a clean patch to add it to the master. eko.one.pl seems to incorporate his patches...

I did not get so much benefit from it that I would have included it permanently. And it did misbehave with SQM.

@hnyman Oddly, whenever I'm looking for something- you seem to pop up. :smiley: I'm finding quite a bit of noise, but little signal about a prebuilt OpenVPN 2.4 based client.

I can hook up a HD and turn my WNDR3800 into a slow builder (after delving deeper into this entire system), but can you tell me offhand if it's in the local build feed? I am on a 60GB SSD, and don't have room to git the tree at this time.

Cheers!

You can check the available packages either via "opkg" tool or directly from the package download directory. OpenVPN is in the base packages
https://downloads.lede-project.org/snapshots/packages/mips_24kc/base/

Hi hnyman,

In the second post you wrote how to re-create your build environment. I did, everything compile fine, but everything compiles for the new kernel kmod-wireguard_4.4.89+0.0.20170115-1_mips_24kc.ipk. It is not possible to use older kernel while compiling packages?

Packages always compile with the current kernel.
(If you wan't to us an old kernel, you need to do some git magic for time machine... But even then, due to kernel version checksums, you should then compile the whole firmware including the packages you want.)

Ahhh, there is no essy solution. I like your mods for the wndr3700 and I am trying to avoid a full reinstall because of one module. :grimacing::grinning::raised_hand:

(If you wan’t to us an old kernel, you need to do some git magic for time machine… But even then, due to kernel version checksums, you should then compile the whole firmware including the packages you want.)

I did the git magic to get the .83 kernel, compiled the firmware and the Wireguard kmod, but still can't use them, because kernel has different checksum. :thinking: How is the checksum calculated? I can't get the same checksum again?