After several times and tries I've succeeded to repack a new filesystem of dir 300b1 and upload it in emergency room! All work perfectly!!
This is the method:
Requirements:
1- have squashfs-root directory in your current dir
2- have untrx
3- have mkshashfs-lzma (from the firmware-mod-kit-read-only in the dir squashfs-3.0-lzma-damn-small-varian)
4- have v2image from dir300b toolkit (downloadable from dlink website)
I use the original firmware, untrx it and replace in the segment1 the 2nd part (where is the squashfs)
The option "-d /dev/mtdblock/2 -s wrgn23_dlwbr_dir300b" come from DIR300B1 SDK (downloadable from dlink website -> ftp://ftp.dlink.com/GPL/DIR-300_revB/dir300b.v2.02.source.tar.gz) to sign the firware. Try to google "v2image /dev/mtdblock/2", you will see a lot of scripts & infos.
PS: your firmware for wps is ready :)
archimedes wrote:
Another important thing is signing: As you can see in the script, you need a signature to sign the image with. For DIR 615 Rev D this is "wrgn22_dlwbr_dir615", or if your not on DIR615, it is {$BOARD_NAME}_{$BRAND_NAME}_{$MODEL_NAME} - the variables can be found in configs/defconfig/{$BOARD_NAME}_{$BRAND_NAME}_{$MODEL_NAME}.config
Simply use an hex editor (I use ghex on gentoo). Open segment1 and search the squashfs header: in hex 68 73 71 74 (string hsqt). In my case the start address of the header is 0xD4000 = 868352 in decimal.
For dd command the bs (block size) chose is 16. Now calc number of blocks we need to skip using seek.
Simply use an hex editor (I use ghex on gentoo). Open segment1 and search the squashfs header: in hex 68 73 71 74 (string hsqt). In my case the start address of the header is 0xD4000 = 868352 in decimal.
For dd command the bs (block size) chose is 16. Now calc number of blocks we need to skip using seek.
Thks a lot.
I found the same address from dir600b-revb-ddwrt-webflash.bin from DD-WRT router database.
dir600b-revb-ddwrt-webflash.bin can flash the router.
but I do it order by your step ,the new image could not flash ,I'd download the dir600 tools from dlink ftp site.
I'll try it tomorrow.
Ok, download the dir toolkit and use v2image to sign your firmware. After you can flash only from emergency room, bye
I made the new image order by the steps above.
but update failed by the web page. then I scp the image and run "write dir600.bin linux" in terminal ,that promoted "Bad trx header"
You can upload only from emergency room! Go in the redboot mode and upload your image.
PS: If your router is dir600b the sign command is: v2image -v -i segment1 -o dir600b-new-fw.bin -s wrgn23_dlwbr_dir600b -d "/dev/mtdblock/2"
thanks ,I just compared the dlink-dir600-factory-webflash.bin and the new image made by myself in GHex.the two begin address are same.So I see how to flash it.