trivializm / firmware-mod-kit

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

after deleting files and rebuilding, image filesize is same as original #53

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using firmware mod kit 0.73 beta on fedora 16
2. extract latest dd-wrt atheros for broadcom chipset
(http://www.dd-wrt.com/site/support/other-downloads?path=others%2Feko%2FBrainSla
yer-V24-preSP2%2F2011%2F12-20-11-r18024%2F)
3. use extract-ng.sh output/
4. delete from ./output/rootfs/usr/sbin the sputnik and chilli executables
5. rebuild with build-ng.sh output (alter build-ng.sh instead of 'cat' > 'sudo 
cat' when writing filesystem into bin, otherwise it fails > or run as root)
6. result is new bin, but it has exactly the same size as the original dd-wrt 
bin file.

What is the expected output? What do you see instead?
I expect the result bin file to be smaller than the original.

What version of the product are you using? On what operating system?
using build 0.73 beta on fedora 16

Please provide any additional information below.
Added the binwalk.log and config.log that are made by the extract tool

Original issue reported on code.google.com by dswee...@gmail.com on 29 Jan 2012 at 11:53

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I get on here when I'm half functioning, gotta quit that ;p. Here is a better 
written answer:

Most of the time firmware images are aligned, meaning they have 'blocks' of 
specific sizes, usually 64KB increments. So, unless the size change was enough 
to go down to the next lower alignment boundary, it wouldn't make a difference. 
Remove more, and it will eventually decrease by (most likely) 64KB, or whatever 
the alignment is.

Original comment by jeremy.collake@gmail.com on 31 Jan 2012 at 10:27

GoogleCodeExporter commented 8 years ago

Original comment by jeremy.collake@gmail.com on 31 Jan 2012 at 10:28

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Ok I deleted 386.0 kB and the blocksize (see binwalk.log) is 128 kilobytes,
so i believe what you say is not functioning here.

The newly created new-filesystem.squashfs is 2,940,928 bytes, the old
rootfs.img is 3,073,024 bytes. So somehow the 131072 (128kB) isn't enough..
(3073024-131072=2941952) At least the bin stays the same size...

Original comment by dswee...@gmail.com on 1 Feb 2012 at 7:38

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The build-ng script pads the new firmware image out to match the size of the 
original. Any particular reason you want the firmware image to be smaller?

Original comment by heffne...@gmail.com on 2 Feb 2012 at 3:29

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I went ahead and added a -nopad switch to build-ng.sh that I'm about to commit. 
Craig, change or remove however you want of course, since the -ng's are yours ;)

Original comment by jeremy.collake@gmail.com on 3 Feb 2012 at 4:50

GoogleCodeExporter commented 8 years ago
Commit made, hopefully I didn't break anything in my haste ;). It should be 
good, Craig's ng script was clean and easy to read. The *optional* parameter 
can be supplied as -nopad. You can include just it, or include a directory, 
followed by it as the second parameter.

Original comment by jeremy.collake@gmail.com on 3 Feb 2012 at 4:59

GoogleCodeExporter commented 8 years ago

Original comment by jeremy.collake@gmail.com on 3 Feb 2012 at 5:04