sturgix / firmware-mod-kit

Automatically exported from code.google.com/p/firmware-mod-kit
0 stars 0 forks source link

the output firmware rebuilt from the one after be extracted was incorrect. #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. First I used the firmware modification tool (version 0.63) to extract the 
binary of "dlink-dir600b-factory-webflash.bin" which was downloaded from the 
DD-WRT router database and could be correctly burn into the router model of 
D-Link DIR-600 B1/B2. The size of this binary 
"dlink-dir600b-factory-webflash.bin" is 3.47 MB (3,647,334 bytes), the 
following information is the output of this command line execution.

[root@node 63]# ./extract_firmware.sh 
/v1/test1/dlink-dir600b-factory-webflash.bin /v1/10

Firmware Mod Kit (extract) v0.63 beta, (c)2010 Jeremy Collake
http://www.bitsum.com
Checking for updates ...
./check_for_upgrade.sh: line 19: [: too many arguments
You have the latest version of this kit.
LINUX system detected. Compatibility ok.
Testing file system of /v1/10 ...
Building tools ...
Build seems successful.
Preparing working directory ...
Removing any previous files ...
Creating directories ...
Extracting firmware
! untrx failed, trying splitter3
Attempting squashfs 3.0 lzma ...
Trying 'damn small' variant - used by DD-WRT v24 ...
Firmware appears extracted correctly!
Now make changes and run build_firmware.sh.

2. Then, I simply tried to use another command to rebuild the firmware of 
"dlink-dir600b-factory-webflash.bin" which had been extracted by the previous 
step, although the command was executed correctly and the output binary could 
be successfully generated, but the output firmware which name is 
"output-firmware.bin" was significantly different from the original firmware, 
the size of "output-firmware.bin" is 853.94 KB(874,438 bytes) and this output 
firmware can not be downloaded to the router of D-Link DIR-600. The following 
traces is the output information of this command execution.

[root@node 63]# ./build_firmware.sh /v1/20 /v1/10

 Firmware Mod Kit (build) v0.63, (c)2010 Jeremy Collake
 http://www.bitsum.com
 Checking for updates ...
./check_for_upgrade.sh: line 19: [: too many arguments
  You have the latest version of this kit.
 LINUX system detected. Compatibility ok.
 Testing file system of /v1/10 ...
 Building tools ...
 Build seems successful.
 Preparing output directory /v1/20 ...
 Detected linux raw type firmware.
 Building firmware from directory /v1/10 ...
 Building squashfs-lzma file system (big endian) ...
 !!! WARNING: This raw embedded linux image type is UNTESTED - added Nov 6 2010
 !!! DO NOT FLASH UNLESS YOU ARE PREPARED TO RECOVER FROM A BRICKED ROUTER
 !!! YOU HAVE BEEN WARNED AND ASSUME LIABILITY FOR DAMAGES IF YOU DO FLASH IT
 Building RAW IMAGE TYPE 3
 Firmware images built.
总计 860
-rw-r--r-- 1 root root 874438 03-02 15:47 output-firmware.bin
 All done!

3. I had checked the location of "working directory" where the intermediate 
files and the extracted file system will be stored, and I found that the folder 
of "rootfs" was empty so that the size of output firmware generated by the 
"build_firmware.sh" was too small (less than 1MB).

What is the expected output? What do you see instead?
The expected output of "output-firmware.bin" should be the firmware which is 
identical to the original firmware of "dlink-dir600b-factory-webflash.bin". 
Unfortunately, the actual result I'd seen was wrong!

What version of the product are you using? On what operating system?
The version of the product is "dlink-dir600b-factory-webflash.bin".
The operating system is "Red Hat Enterprise Linux Server release 5.4 
(Tikanga)", "Linux node.com 2.6.18-164.e15"

Please provide any additional information below.
So far, I've put a lot of time and efforts on this issue, now I really need 
your kindly helps, suggestion or solution for resolving this problem. I very 
appreciate if you would like to look into this issue and give some good ideas 
to me. Thank you very much!

Original issue reported on code.google.com by limingge...@gmail.com on 2 Mar 2011 at 10:36

Attachments:

GoogleCodeExporter commented 8 years ago
The new extract-ng/build-ng scripts properly extract and re-build this 
firmware. However, THIS FIRMWARE IS UNTESTED, USE AT YOUR OWN RISK. More 
testing is forthcoming, but consider it very beta at this point.

Original comment by heffne...@gmail.com on 5 Sep 2011 at 4:26