What flavor of Linux was this compiled in? some of the - switches don't work in other versions.
WGR614L Firmware Image Creation
Categories: WGR614L Open Source Router Setup / Configuration Open Source Projects and Firmware
Some of you have already noticed that WGR614L firmware uses a .chk extension. Let us go through the steps that is needed to create a firmware image in .chk format.
Most of the broadcom hardware uses a TRX style fimware. Netgear's WGR614L linux based open source router's .chk is also based on the same TRX format - but does add the following interesting improvements
First, the kernel is compressed using LZMA which achieves a better compression than the usual gzip or bzip2 compression. This improvement does need an addition to the CFE bootloader to support uncompression of LZMA encoded kernel
Second, this formats adds a header to trx format, that has the checksum, length, and a compatible board identifier. These checksum and length information makes the job ensuring image integrity much easier and since these checksums are stored in the flash and also checked at each system boot, boot-loader can also identify if the flashed image gets corrupted.
So to pack a image in the .chk format you will need the following files at hand Thee files are generated when you compile the downloaded linux opensource codes for WGR614L
- Download the source code the Netgear WGR614L
- Linux Kernel - vmlunx -usually compiled at the top directory of the linux kernel source.
- compatible.txt containing the boardid of the netgear boards this fimeware is targeted for.
- Root File System image - target.squashfs - usually a LZMA Squashfs file system.
- Make sure you have added the bcm5354/tools directory into the PATH
And you will need to follow these steps
1. Trim vmlinux by removing unneccessary sections in the object code
$ mipsel-linux-strip vmlinux
2. Convert to Binary format from the ELF format
$ mipsel-linux-objcopy -O binary -g vmlinux vmlinux.bin
3. Compress using lzma
$ ../../tools/lzma e vmlinux.bin vmlinux.lzma
4. Create the trx image
$ trx -o linux.trx vmlinux.lzma target.squashfs
5. Append the ".chk" header.
$ touch emptyfile; packet -k linux.trx -f emptyfile -b compatible.txt -ok kernel_image \
-oall kernel_rootfs_image -or rootfs_image -i emptyfile; rm -f emtyfile
And this will generate a new file "kernel_rootfs_image.chk" which can be uploaded to WGR614L using its Web UI or if you got the serial console you can also use the tftpd upgrade from the CFE firmware.
The format of a chk header is given below.
| Type/Variable | Size (bytes) |
| Unsigned long magic | 4 |
| Unsigned header_len; | 4 |
| unsigned char reserved[8]; | 8 |
| unsigned long kernel_chksum; | 4 |
| unsigned long rootfs_chksum; | 4 |
| unsigned long kernel_len; | 4 |
| unsigned long rootfs_len; | 4 |
| unsigned long image_chksum; | 4 |
| unsigned long header_chksum; | 4 |
| BOARD ID < 64 digits | variable length (max 64 bytes) |
Read More In: WGR614L Open Source Router Setup / Configuration Open Source Projects and Firmware
Nachiketa Prachanda discusses the hardware and software in NETGEAR routers, new processors, open source firmware, Linux, and much more.
You must login to discuss this item.


RSS