Rockbox

Tasklist

FS#2960 - Unix command line interface to Iriver fwpatcher utility

Attached to Project: Rockbox
Opened by James Teh (jteh) - Monday, 30 January 2006, 15:19 GMT
Last edited by Jonas Häggqvist (rasher) - Friday, 22 August 2008, 22:18 GMT
Task Type Patches
Category
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch provides a Unix command line interface to
the fwpatcher utility. The command line code (cli.c)
substitutes for main.c, but shares iriver.*, md5.* and
h???sums.h with the fwpatcher GUI. The patch also
modifies iriver.h to not use TCHAR, _tfopen and TEXT()
if not compiling for WIN32.

Compiling:
The Makefile has not yet been modified for
fwpatchercli, so something like the following will
compile it:
gcc -o fwpatchercli cli.c iriver.c md5.c

Usage:
fwpatchercli expects bootloader-h100.bin, bootloader-
h120.bin or bootloader-h300.bin, depending on the
firmware to be patched, to reside in the current
directory. An error will be reported if the required
bootloader binary does not exist. Usage is as follows:
./fwpatchercli firmware_filename
where firmware_filename is the name of the firmware
file to be patched; e.g. h300.hex.

Problems:
* The #ifdef in iriver.h which defines TCHAR as char,
_tfopen as fopen, etc. is a bit of a dirty hack. I'm
not familiar with Windows C library extensions, so am
not sure why these are used. If this hack is not
acceptable, either main.c needs ot be modified to use
char or ifdefs need to be used everywhere in iriver.c
and iriver.h where TCHAR, _tfopen, etc. are used.
* I'm not sure how best to integrate this into the
Makefile for fwpatcher. A different cc needs to be
used (we don't want to be using the cross compiler)
and I'm not sure how to go about setting this up.
* It'd be better to separate interface from back-end
and share the bits of code that do the actual work
between the GUI and CLI to make maintanence easier.
This pretty much means rewriting large chunks of the
code, though, and I'm not sure it is worth it, as I
doubt fwpatcher will change much now.
This task depends upon

Closed by  Jonas Häggqvist (rasher)
Friday, 22 August 2008, 22:18 GMT
Reason for closing:  Rejected
Additional comments about closing:  Fwpatcher is more or less deprecated in favour of rbutil, the comandline tools are still available and the attached script can probably still work.

No need for any change in Rockbox SVN.
Comment by James Teh (jteh) - Monday, 30 January 2006, 16:53 GMT

Patch version 2006013102:
* Added a missing \n.
* Now using FILENAME_MAX rather than self-defined MAX_PATH.
* Removed comment stating that temp files are stored in
temp dir.

One issue I forgot to mention in the description is that I
am not certain #ifdef __WIN32__ is the right way to check
if we are compiling for Win32 in iriver.h. I don't have a
Win32 cross-compiler to test this.
Comment by Daniel Stenberg (bagder) - Wednesday, 08 February 2006, 09:47 GMT

won't it suffice to write a minor shell script around the
existing tools?
Comment by Jonas Häggqvist (rasher) - Saturday, 10 June 2006, 11:53 GMT
Like so. I have tested it a bit, but you may want to check it a bit more if you want to use it. Just a quick hack, really.

Loading...