Closed GoogleCodeExporter closed 9 years ago
extract-ng will not build firmware images that are larger than the original, as
this could potentially cause problems when writing the firmware image to the
device. The reason the image is larger, even when un-modified, is likely due to
differences in compression optimizations in our mksquashfs vs tomato's
mksquashfs.
You have two options:
1) Remove anything that you don't need from the Tomato file system in order to
reduce the size.
2) Comment out the file size checks in the extract-ng script (it will
*probably* be OK, but there are no guarantees!! Doing this could brick your
router!!!)
I should probably add an option to extract-ng that allows you to continue even
if the firmware image size is too large, accompanied by an appropriate warning
about the dangers of doing so.
Original comment by heffne...@gmail.com
on 29 Oct 2011 at 10:30
I'd be really careful about that.. people ignore warnings. I'd continue forcing
this behavior, and explain it. Make over-riding it a chore that only
semi-advanced users can do. I mean, it doesn't take much to modify the script.
If they can't modify the script, then they shouldn't be allowed to build
over-size images. It is just too risky. You don't want people whining about
bricked routers. Just my two cents on this.
Original comment by jeremy.collake@gmail.com
on 29 Oct 2011 at 10:39
Good point Jeremy.
I put in a more descriptive error message describing why build-ng won't build
firmware images larger than the original and suggesting simple mitigations
(decreasing file system size).
Original comment by heffne...@gmail.com
on 4 Nov 2011 at 3:18
Excellent work ;). Thanks. I apologize for not having done more lately myself,
I have been engaged in a deadline to finish a new version of one of my
products. Obviously I somehow find time to come and run my mouth though ;p
Original comment by jeremy.collake@gmail.com
on 4 Nov 2011 at 4:22
No apologies needed, I've got a big project at my day job too, at least 4 or 5
personal projects I'm always trying to work on, plus a wife and kids, so I get
not having free time to work on stuff. :) It took me a week to make this
change, which was three short sentences. :P
Original comment by heffne...@gmail.com
on 4 Nov 2011 at 4:29
Such is life .. I recently put off a chore for a month due to constant
distractions. Took 5 minutes to do ;p.
Original comment by jeremy.collake@gmail.com
on 4 Nov 2011 at 4:42
It should really also delete the new-firmware.bin file as it exits. Because I
saw the file existed, and the file size looked something like what it said the
firmware would be, so I thought maybe this limitation had been removed, just
with the textual warning. So now I bricked my device since the tool didn't
write the final parts of the .bin firmware. (as I saw in the build-ng.sh file
_after_ I was in a hurry to upload my modifications)
Original comment by haakon.n...@gmail.com
on 17 Nov 2011 at 5:10
[deleted comment]
Ignore previous comment, I forgot where were 'at' with this back and forth.
Yes, I could have just read above ;p.
Deletion of any existing firmware in the output folder is probably a good idea.
Though, again, please do refer to the pre-requisites of use of the FMK being
able to unbrick your device (something easily done most of the time).
Original comment by jeremy.collake@gmail.com
on 17 Nov 2011 at 7:57
So, accepted on the basis that we need additional protections for this scenario
of user mis-use. Hey, I'm a user myself, as well as a coder, so I do the same
type of mistakes.
Original comment by jeremy.collake@gmail.com
on 17 Nov 2011 at 7:58
Recommend firmware images be built, but renamed to something like
'do-not-flash-me-unless-you-are-sure-i-am-going-to-fit-and-can-ubrick.bin', if
you get my drift ;). Up to you. Close if you want to, this is really user error.
Original comment by jeremy.collake@gmail.com
on 18 Nov 2011 at 6:21
Changed to enhancement since was user error, and note that non-NG (my old crap)
will not be updated.
Original comment by jeremy.collake@gmail.com
on 18 Nov 2011 at 6:25
Original comment by jeremy.collake@gmail.com
on 18 Nov 2011 at 6:25
Updated build-ng to delete the firmware image if the file size is to large.
Advanced users can always change the script to skip the file size check as
before; non-advanced users probably shouldn't risk flashing a firmware image of
the wrong size.
Original comment by heffne...@gmail.com
on 23 Nov 2011 at 12:15
Best solution I think. I mean, the script is really simple, and any user who is
flashing firmwares should be able to modify if, if needed. That then puts the
liability 100% on them.
Original comment by jeremy.collake@gmail.com
on 23 Nov 2011 at 12:41
Original issue reported on code.google.com by
ogamys...@gmail.com
on 29 Oct 2011 at 7:32Attachments: