Using tsynik's patches for Firewall.asp and Wireless_Basic.asp and removing optimizefiles from the kromo Makefile I was able to compile more or less working web interface.
Inability to get fully working GUI may have something to do with missing repugly command, referred by the above Makefile. Thanks Broly for this and other tickets
http://svn.dd-wrt.com/ticket/6057
quarkysg wrote:
Firmware GUI issues
The source from the SVN repo apparently could not be used to successfully build a working GUI for the firmware image. The Javascript optimisation part always messes it up, resulting in corrupted Javascripts being generated and built into the firmware. Instead of troubleshooting, I took the shortcut of extracting the Javascript files in the released binary (downloaded from the dd-wrt website) and including them in my build. I replaced the Javascripts I extracted from the working binary located in this location: /src/router/kromo/.
Can you please elaborate little bit more what javascript files you have extracted and what method was used? _________________ Asus RT-AC66R Target:brcm47xx SubTarget:mips74k Packages:mipsel_74kc
Netgear R7000 Target:bcm53xx Packages:arm_cortex-a9
Can you please elaborate little bit more what javascript files you have extracted and what method was used?
All I did was extract all Javascripts files from working firmware released in the official BrainSlayer build and replaced my build’s Javascript files. IIRC the minification of JS files during the image build process messes it up. So I just extracted the monified JS files from released builds.
Here's my experience compiling dd-wrt from sources for the ARM platform. Previous posts were very helpful in setting up the build platform. My post will focus more on steps and errors I have encountered rather than providing "do-it-all" scripts.
In the example below I have compiled a mini image for R7000 SVN revision: 33941 Full image is not recommended at first as too many changes are required, to make it work.
After taking the notes, I have re-installed the OS and pulled fresh dd-wrt sources to make sure these steps are reproducible.
Serial recovery kit is required before attempting to load the final image!!!
DD-WRT source directory structure:
~/DD-WRT/tools It contains binaries needed to optimize and compile WebGUI
~/DD-WRT/src/router Our working directory. Here we will execute the make command. Main northstar .config and Makefile.northstar are located. Also it contains all sources for packages and libraries.
~/DD-WRT/src/router/emf_bin/arm prioprietary emf and igs binaries
~/DD-WRT/src/router/rules set of make rules for each package, used during the configure and install step.
~/DD-WRT/src/router/arm-uclibc Final image will be located here, also INSTALLDIR and TARGETDIR which be compressed into squash filesystem.
~/DD-WRT/src/linux/universal/linux-4.4 Kernel northstar SMP .config will be copied here and sources for all kernel modules.
~/DD-WRT/src/linux/universal/linux-4.4/brcm/arm Prioprietary kernel objects needed for compiling wl.ko module.
~/DD-WRT/src/linux/universal/linux-4.4/arch/arm/boot Location of zImage (compressed Linux image)
PREPARATION
What toolchain?
I downloaded BS and Kong's firmwares with the same kernel and grep'ed files to see what they used.
Code:
strings /lib/libstdc++.so.6 | grep toolchain
BS result: toolchain-arm_cortex-a9_gcc-6.3.0_musl-1.1.16_eabi
Kong result: toolchain-arm_cortex-a9_gcc-6.3.0_musl_eabi
Proprietary Broadcom wireless modules
Make following corrections because of non existent source file to compile wl.ko module
cd ~/DD-WRT/src/linux/universal/linux-4.4/brcm/arm/wl/config
Comment out in the file wl.mk line 448 WLFILES_SRC_HI += src/wl/clm/src/wlc_clm_data.c
cd ~/DD-WRT/src/router
Comment out lines 181 182 inside Makefile.northstar where it copies wlc_clm_data.c
cd ~/DD-WRT/src/linux/universal/linux-4.4/drivers/net/wl/
Append following to the line 95 $(SRCBASE_OFFSET)/wl/clm/src/wlc_clm_data.o in the file wl_generic.mk
Edit emf.mk Warning! make files are space/TAB sensitive. Need TAB before each install -D command.
cd ~/DD-WRT/src/router/rules
I needed to use serial recovery in my builds because included wireless modules would cause my router to "kernel panic" during the boot.
Replace emf.ko and igs.ko in the directory ~/DD-WRT/src/router/emf_bin/arm with modules which come from BS or Kong's firmware.
Good modules have the following sizes:
21864 emf.ko
16900 igs.ko
WebGUI
Remove optimizefiles from kromo/dd-wrt/Makefile line 1139
Final web interface will not be fully functional. Some solutions exists: using tsynik patches or extracting javascripts from the www binary. All asp and javascripts page sources are compiled into single www binary
~/DD-WRT/tools/filelist contains the exact listing of all files(web pages and images)
CONFIGURE
These packages need to be compiled first in this order. Kernel step will generate kernel.release file which is later needed for compilation of other packages.
Code:
make -f Makefile.northstar jansson-configure
make -f Makefile.northstar jansson
make -f Makefile.northstar nvram
make -f Makefile.northstar utils
make -f Makefile.northstar install_headers
make -f Makefile.northstar iptables
make -f Makefile.northstar libnet
make -f Makefile.northstar kernel
Fix the typo in the libubox.mk line 7. Include dir should be json-c not json
cd ~/DD-WRT/src/router/rules
UBOX_EXTRA_CFLAGS=-I$(TOP)/_staging/usr/include -I$(TOP)/_staging/usr/include/json-c $(COPTS) $(MIPS16_OPT)
In the previous revisions compiliation of the libubox package frequently failed. Run these steps too ensure it compiles fine.
Code:
make -f Makefile.northstar json-c-configure
make -f Makefile.northstar json-c
make -f Makefile.northstar libubox-configure
make -f Makefile.northstar libubox
Final configure and all
Code:
make -f Makefile.northstar configure
make -f Makefile.northstar clean all
INSTALL
Compile trx in opt/tools and copy to src/router/tools
These files are for Netgear and D-link. Asus and TP-Link need some fixes so I skipped those.
Original mksquashfs4 gives me illegal instruction error. I used the debian version which works fine.
Replace the line 575 in the Makefile.northstar
Code:
/usr/bin/mksquashfs $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -comp xz -nopad -root-owned -noappend -Xbcj arm
Since trx tools were not compiled for TP-Link and Asus comment out the following lines in the Makefile.northstar
583-588 for TP-Link
655-664 for Asus
668-669 for Buffalo
Final command
make -f Makefile.northstar install
Look for the firmware inside this folder:
~/DD-WRT/src/router/arm-uclibc
Some tips
R7000 Recovery:
During the boot ctrl+ C
At the CFE>tftpd
tftp -m binary 192.168.1.1 -c put K3_R7000.chk
Example of compiling single kernel module
GCCARM=/home/user/toolchain-arm_cortex-a9_gcc-6.3.0_musl-1.1.16_eabi/bin
export PATH=$GCCARM:$PATH
cd ~/DD-WRT/src/linux/universal/linux-4.4
make ARCH=arm modules SUBDIRS=drivers/net/switch
Displaying variables or paths during compilation:
Insert into Makefile.northstar following line as needed.
$(info ******************)
$(info My ARCH is $(ARCH))
$(info ******************)
33491.png
Description:
Filesize:
39.11 KB
Viewed:
23432 Time(s)
_________________ Asus RT-AC66R Target:brcm47xx SubTarget:mips74k Packages:mipsel_74kc
Netgear R7000 Target:bcm53xx Packages:arm_cortex-a9
Hi, taking my first tentative steps to building here..
First question seems to be what toolchain to use. I'm running on an linksys E4200, which is a 'mipsel'. I'm currently running beta r34080 successfully
(my goal whether I reach it or not is to add in ext3 support) and from your last post I grepped toolchain in the stdlib on the running router which gave:
'toolchain-mipsel_74kc_gcc-6.3.0_musl-1.1.16'
This is not in the .xz download, and I can't find it at the 'other downloads' location either.
Does this exist under some other name perhaps?
Also if there's any other tips on 'for that class of box, use these cfg files' or anything at all.
Hi, taking my first tentative steps to building here..
First question seems to be what toolchain to use. I'm running on an linksys E4200, which is a 'mipsel'. I'm currently running beta r34080 successfully
(my goal whether I reach it or not is to add in ext3 support) and from your last post I grepped toolchain in the stdlib on the running router which gave:
'toolchain-mipsel_74kc_gcc-6.3.0_musl-1.1.16'
This is not in the .xz download, and I can't find it at the 'other downloads' location either.
Does this exist under some other name perhaps?
Also if there's any other tips on 'for that class of box, use these cfg files' or anything at all.
Cheers & Happy Christmas/New Year!
Brainslayer updates toolchains couple times a year. If the latest one is not available try the previous one.
Grep on the E4200 firmware from December 2016 gives
Hi, taking my first tentative steps to building here..
First question seems to be what toolchain to use. I'm running on an linksys E4200, which is a 'mipsel'. I'm currently running beta r34080 successfully
(my goal whether I reach it or not is to add in ext3 support) and from your last post I grepped toolchain in the stdlib on the running router which gave:
'toolchain-mipsel_74kc_gcc-6.3.0_musl-1.1.16'
This is not in the .xz download, and I can't find it at the 'other downloads' location either.
Does this exist under some other name perhaps?
Also if there's any other tips on 'for that class of box, use these cfg files' or anything at all.
Cheers & Happy Christmas/New Year!
Brainslayer updates toolchains couple times a year. If the latest one is not available try the previous one.
Grep on the E4200 firmware from December 2016 gives
toolchain-mipsel_74kc+dsp2_gcc-6.1.0_musl-1.1.15
wish i would have found this thread sooner.
unfortunately for me, in my case, tsynik's changes produce a GUI that is no different visually from what was there before.
the key issue is the missing "common.js" in the main root. i just noticed this today after checking write4/etc.
i get a GUI similar to the one shared earlier in this thread, with the missing text.
uglifyJS is not the solution. the solution is to figure out why common.js is missing in the tree if you inspect the (broken) webgui.
this is why the webgui is ugly, because the functions in common.js are responsible for finishing the job. kong's build has this file outside of the js directory (i wish i had it, forget whether it is outside or inside any directory!), mine does not (and i suspect anyone building from SVN does not).
i commend you for getting a working build hans, and i am envious you have something that is currently more appealing visually than my build however, the best solution is probably finding out why common.js isn't being picked up.
i suspect this (small, yet visually criticial) problem holds the key to all of our qualms.
tsynik should also be commended for posting his solutions, but i'm quite certain BS made sure that anyone working on northstar should be able to produce a working webgui (and that does seem to be the case for the most part).
for everyone else, however, that is not the case. i hope someone reading this can point us in the right direction. it's the last step for me, and arguably the most important since i'd like to try flashing brainslayer's version from mine to ensure anyone who doesn't like it, isn't stuck with my build. _________________ "But of this I can assure you that there is not a movement of any body of Men however small whether on Horse-back or on foot, nor an operation or March of any description nor any Service in the field that is not formed upon some mathematical principle, and in the performance of which the knowledge and practical application of the mathematicks will be found not only useful but necessary. The application of the Mathematicks to Gunnery, Fortification, Tactics, the survey and knowledge of formal Castrametation [setting up camp] etc. cannot be acquired without study" "Only by adopting an infinitely small unit for observation, the differential in history otherwise known as human homogeneity, and perfecting the art of integration (the adding up of infinitesimals) can we have any hope of determining the laws of history"
one more thing, which i feel is worthy of a separate post:
please don't lie about what worked. for example, stating that using the etc/www unpacked from a fw obtanied on the dd-wrt site, is a blatant lie (save one case, where you somehow have access to brainslayer/kong's configuration files for each router [i doubt that you would]).
why is this a lie? how do i know this is a lie? because the www file bakes your configuration into the file. that is, it's a different size if you have tor compared to if you do not.
simply plugging in another httpd file from a separate build, even it is for the same platform, will not work (unless you were extremely lucky and configured your build identical to BS/KONG for the respective router [a rare, but possible scenario]) because of what i have said.
this isn't a pissing contest. this is dd-wrt. understand the fundamentals of what we're doing instead of saying "got it!" in order to reduce your perceived humiliation.
the webgui's appeal is supposed to reward your dedication to the fundamentals since you'd know the ins and outs of how it it is made (it is quite the piece of software. i must say. even in its current state, it is impressive).
just sayin' _________________ "But of this I can assure you that there is not a movement of any body of Men however small whether on Horse-back or on foot, nor an operation or March of any description nor any Service in the field that is not formed upon some mathematical principle, and in the performance of which the knowledge and practical application of the mathematicks will be found not only useful but necessary. The application of the Mathematicks to Gunnery, Fortification, Tactics, the survey and knowledge of formal Castrametation [setting up camp] etc. cannot be acquired without study" "Only by adopting an infinitely small unit for observation, the differential in history otherwise known as human homogeneity, and perfecting the art of integration (the adding up of infinitesimals) can we have any hope of determining the laws of history"
Kong build running DDWRT version 3 with 4.4 kernel.
I looked in the .config_ac file and it seems to be mipsel and not arm.
How do we know what config files or defconfig files correspond to which router?
Thanks for your efforts!
I want to try to add some missing kernel modules for StrongSwan support and Amazon VPC. I got pretty close but ran into this:
root@DD-WRT:~# ipsec up Tunnel1
generating QUICK_MODE request 308402199 [ HASH SA No KE ID ID ]
sending packet: from 47.32.199.75[4500] to 18.220.248.124[4500] (316 bytes)
received packet: from 18.220.248.124[4500] to 47.32.199.75[4500] (300 bytes)
received retransmit of response with ID 1908362780, resending last request
sending packet: from 47.32.199.75[4500] to 18.220.248.124[4500] (316 bytes)
received packet: from 18.220.248.124[4500] to 47.32.199.75[4500] (300 bytes)
parsed QUICK_MODE response 308402199 [ HASH SA No KE ID ID ]
received netlink error: Protocol not supported (93)
Was or has there been changes to the toolchain that it shows the gcc-6.3.0 in today releases? I'm Using mips router as my question is the same as 0ddentity that had posted back in Dec 2017 and someone had posted in the broadcom forum about the same question except he mentioned that to build it from lede and if so what what is needed to be selected in order to build it properly for these models that shows 'toolchain-mipsel_74kc_gcc-6.3.0_musl-1.1.16' or should we continue to use whats available in the current toolchains provided by dd-wrt?
Thank you
Posted: Wed Aug 15, 2018 12:14 Post subject: Compiling ipq806x kernel rootfs partition size issue
I've been trying to compile for ipq806x, specifically Netgear R7800, but I keep ending up with a build that fails upon boot with bad partition size.
During pre-boot, these checks are performed and passed on a healthy build:
Code:
** check kernel image **
Verifying Checksum ... OK
** check rootfs image **
Verifying Checksum ... OK
But I keep ending up with variants of the following error, each time with a different rootfs value:
Code:
** Bad partition size, kernel: 0x220000, rootfs: 0xe35c9a2c **
** Bad partition size, kernel: 0x220000, rootfs: 0xc4ee1dce **
** Bad partition size, kernel: 0x220000, rootfs: 0x54adf426 **
I've tried using several toolchains, including the latest few below, on both kernel K4.9 and K3.18, with the latest few revisions ending with r36527:
toolchain-arm_cortex-a9+vfpv3_gcc-8.2.0_musl_eabi
toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.2.0_musl_eabi
This only two things I commented out in the .config file are CONFIG_SPUTNIK_APD and CONFIG_ASTERISK
I would really appreciate it if someone could point me to the right direction because I feel like I've hit a solid wall.
Posted: Tue Oct 01, 2019 17:57 Post subject: Kernel build failures for 4.4 (recent?)
Hi all,
I've been trying to build kernel modules for recent kernels for my Archer c9 v1, and the builds have been breaking in various ways. This latest one has affected me a bunch:
Code:
CC arch/arm/plat-brcm/mpcore_gtimer.o
In file included from arch/arm/plat-brcm/mpcore_core.c:25:
./brcm/arm/include/bcmutils.h:87:10: fatal error: hnd_pktq.h: No such file or directory
87 | #include <hnd_pktq.h>
| ^~~~~~~~~~~~
I note that the linux-4.4_bcm4908 tree has this file (as do 4.9 / 4.14), but there's no sign of it in the generic 4.4 tree.
So... Should I be building from linux-4.4_bcm4908 instead of linux-4.4? How can one determine that for a given platform / target device?