Refactor code.
This tool can now either load a scrambled rockbox
firmware (in which case the model is check against the
firmware), or any ELF file. This is useful for example
for hwstub which produces a ELF file and still needs
to be loaded by producing a SB file.
Change-Id: I7aa381b3f6587788d1950793e89ce5608c53cccc
The mkimxboot was becoming messy with juge functions and
redundant code. Factor reading/writing/loading code into smaller
functions. Introduce the concept of rockbox firmware to simplify
support of other formats than scramble.
Change-Id: I3a61295ca5abca1a0eee8c9e8709c6b8dfa256a6
Add a switch to override the product and component version of the
sb file. This can usually for target like the Zen X-Fi2 where the
upader allows to drop any file named firmware.sb and prints the
version: by using a funky version the users can check they got it
right. This should not be used on the fuze+ or zenxfi3 because the
OF prevents downgrade.
Also make rbutil always zero out the option structure passed to
mkimxboot, this has already created bugs in the past.
Change-Id: I175c5def52c40c2132e11300e2f037d60a4f040e
mkimxboot requires passing a structure which got extended with another field.
This wasn't adjusted in Rockbox Utility, causing an out of bound access to an
array, which results in a segfault.
Change-Id: I0252849ed0b41f1d8804537c053debc9b0ecd08d