xrobau / firmware-mod-kit

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

rebuild firmware is too large #112

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Netcomm router firmware.
http://media.netcomm.com.au/public/assets/file/0007/98521/NB304n.zip

1. extract appears ok with no errors
2. Even if making no changes to eh tfmk directory and run ./build-firmware.sh 
and it has build error with file size.
3. same result with -nopad and -min options

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

robert@HP-PC ~/Downloads/fmk $ ./build-firmware.sh -nopad -min
Firmware Mod Kit (build) 0.99, (c)2011-2013 Craig Heffner, Jeremy Collake

Preparing tools ...
Building new squashfs file system... (this may take several minutes!)
Squahfs block size is 1024 Kb
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on 
/home/robert/Downloads/fmk/fmk/new-filesystem.squashfs, block size 1048576.

[===============================================================================
=============================================================\] 449/449 100%
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 1048576
    compressed data, compressed metadata, compressed fragments, compressed xattrs
    duplicates are removed
Filesystem size 8665.59 Kbytes (8.46 Mbytes)

    29.68% of uncompressed filesystem size (29196.23 Kbytes)
Inode table size 6488 bytes (6.34 Kbytes)
    29.34% of uncompressed inode table size (22113 bytes)
Directory table size 7041 bytes (6.88 Kbytes)
    53.55% of uncompressed directory table size (13148 bytes)
Number of duplicate files found 2
Number of inodes 711
Number of files 437
Number of fragments 18
Number of symbolic links  90
Number of device nodes 130
Number of fifo nodes 1
Number of socket nodes 0
Number of directories 53
Number of ids (unique uids + gids) 1
Number of uids 1
    root (0)
Number of gids 1
    root (0)
ERROR: New firmware image will be larger than original image!
       Building firmware images larger than the original can brick your device!
       Try re-running with the -min option, or remove any unnecessary files.
       REFUSING to create new firmware image.

       Original file size: 7326378
       Current file size:  8876288 (plus footer of 2784 bytes)

       Quitting...
robert@HP-PC ~/Downloads/fmk $ 

What version of the product are you using? On what operating system?
FMK build 0.99 / Linux Mint 15 x64

Please provide any additional information below

Big difference in file sizes. Can duplicate error every time. Tested as root 
and standard user. 

Original issue reported on code.google.com by laptopt...@hotmail.com on 11 Aug 2013 at 11:22

GoogleCodeExporter commented 8 years ago
Any Openwrt image (i used images built for caramabola2 (AR9331) only) based 
router extracts fine, the rootfs is squashfs-lzma and a jffs2 one too. Without 
making any change in the rootfs, the image genrated will be larger than 
original. Adding -min does work. 

Any image either using -min or by deleting files generated using 
./build-firmware.sh fails to work for me. I may be missing something since I 
expect 2 files for the rootfs, one for squashfs, and one or empty jffs2 
partition. If anyone knows, please comment on this.

Original comment by tavishna...@gmail.com on 12 Sep 2013 at 12:21

GoogleCodeExporter commented 8 years ago
Here is my solution for EA6500v2(squashfs with LZMAv2)

I meet the same problem. Extract the original firmware and build it without any 
modification. But the script said that the file size is greater than the 
original one.

I change build-fireware.sh line 58 from "-comp lzma" to "-comp xz" and 
successfully build a run-able fireware.

I seems that Linksys EA6500v2 fireware is build with xz(AKA LZMAv2). 

Original comment by wsyc...@gmail.com on 29 Oct 2013 at 12:18