rfminelli / firmware-mod-kit

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

Invalid image is reported after I do extract-ng && build-ng #82

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
0. Set up the latest "firmware-mod-kit" as here 
http://code.google.com/p/firmware-mod-kit/source/checkout
1. DL the latest ASUS FW for RT-N10U here 
http://dlcdnet.asus.com/pub/ASUS/wireless/RT-N10U/FW_RT_N10U_3004260.zip
1.5 unzip firmware
2. do sudo ./extract-ng.sh <path-to-firmware TRX file>
3. immediately after do sudo ./build-ng.sh

What is the expected output? What do you see instead?

1. (assumption) new-firmware.bin and original TRX firmware are equal. Files 
size is indeed equal, but content is very different.
2. (assumption) every time ./build-ng.sh is executed the CRC32 of 
new-firmware.bin is different. Is it expected?
3. (main issue) Both ASUS recovery tool and router's web interface say the 
new-firmware.bin image is invalid although accept original file and 3rd party 
firmwares for same router.

What version of the product are you using? On what operating system?
Linux debian 3.6-trunk-686-pae #1 SMP Debian 3.6.9-1~experimental.1 i686 
GNU/Linux

svn update firmware-mod-kit-read-only/
Updating 'firmware-mod-kit-read-only':
At revision 374.

Please provide any additional information below.

Commands outputs:

 ./extract-ng.sh FW_RT_N10U_3004260/RT-N10U_3.0.0.4_260.trx 
Firmware Mod Kit (build-ng) 0.78 beta, (c)2011-2012 Craig Heffner, Jeremy 
Collake
http://www.bitsum.com

Scanning firmware...

DECIMAL     HEX         DESCRIPTION
--------------------------------------------------------------------------------
-----------------------
0           0x0         TRX firmware header, little endian, header size: 28 
bytes,  image size: 7983104 bytes, CRC32: 0x7AC59CFC flags/version: 0x10000
1211292     0x127B9C    Squashfs filesystem, little endian, non-standard 
signature,  version 3.0, size: 6769450 bytes, 1075 inodes, blocksize: 65536 
bytes, created: Tue Nov  6 14:35:41 2012

Extracting 1211292 bytes of trx header image at offset 0
Extracting squashfs file system at offset 1211292
Extracting squashfs files...
Firmware extraction successful!
Firmware parts can be found in 'fmk/*'

===================================================

cat fmk/logs/config.log 
FW_SIZE='7983104'
HEADER_TYPE='trx'
HEADER_SIZE='28'
HEADER_IMAGE_SIZE='1211292'
HEADER_IMAGE_OFFSET='0'
FOOTER_SIZE='0'
FOOTER_OFFSET='7983104'
FS_TYPE='squashfs'
FS_OFFSET='1211292'
FS_COMPRESSION='gzip'
ENDIANESS='-le'
MKFS="./src/others/squashfs-3.2-r2-wnr1000/mksquashfs"

====================================================

./build-ng.sh 
Firmware Mod Kit (build-ng) 0.78 beta, (c)2012 Craig Heffner, Jeremy Collake
http://www.bitsum.com

Building new squashfs file system...
Parallel mksquashfs: Using 8 processors
Creating little endian 3.0 filesystem using LZMA on 
fmk/new-filesystem.squashfs, block size 65536.
[==============================================================] 1003/1003 100%
Exportable Little endian filesystem, data block size 65536, compressed data, 
compressed metadata, compressed fragments, duplicates are removed
Filesystem size 6610.72 Kbytes (6.46 Mbytes)
    30.94% of uncompressed filesystem size (21369.45 Kbytes)
Inode table size 8308 bytes (8.11 Kbytes)
    24.19% of uncompressed inode table size (34351 bytes)
Directory table size 10376 bytes (10.13 Kbytes)
    54.22% of uncompressed directory table size (19138 bytes)
Number of duplicate files found 7
Number of inodes 1075
Number of files 793
Number of fragments 114
Number of symbolic links  214
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 68
Number of uids 1
    root (0)
Number of gids 0
Remaining free bytes in firmware image: 1124
Processing 1 header(s) from fmk/new-firmware.bin...
Processing header at offset 0...checksum(s) updated OK.
CRC(s) updated successfully.
Finished! New firmware image has been saved to: fmk/new-firmware.bin

===========================================

Original issue reported on code.google.com by lhog1...@gmail.com on 27 Dec 2012 at 4:49

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by jeremy.collake@gmail.com on 11 Jun 2013 at 8:19