summaryrefslogtreecommitdiffstats
path: root/rbutil/ipodpatcher/main.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-04-13 23:28:20 +0000
committerDave Chapman <dave@dchapman.com>2007-04-13 23:28:20 +0000
commit427fff4320df478cc0d7a6fa5d68e08d70a844b8 (patch)
tree225a8c24ed7304c9fe23ffa16698cca152985801 /rbutil/ipodpatcher/main.c
parent266707f81856e4a8310f6d8dacfc7b9a7033106c (diff)
downloadrockbox-427fff4320df478cc0d7a6fa5d68e08d70a844b8.tar.gz
rockbox-427fff4320df478cc0d7a6fa5d68e08d70a844b8.tar.bz2
rockbox-427fff4320df478cc0d7a6fa5d68e08d70a844b8.zip
Add -rfb option for reading the main firmware (OSOS image) as a binary file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13148 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/ipodpatcher/main.c')
-rw-r--r--rbutil/ipodpatcher/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/rbutil/ipodpatcher/main.c b/rbutil/ipodpatcher/main.c
index e60b1d7034..6328e2df99 100644
--- a/rbutil/ipodpatcher/main.c
+++ b/rbutil/ipodpatcher/main.c
@@ -76,6 +76,7 @@ void print_usage(void)
fprintf(stderr," -r, --read-partition bootpartition.bin\n");
fprintf(stderr," -w, --write-partition bootpartition.bin\n");
fprintf(stderr," -rf, --read-firmware filename.ipod\n");
+ fprintf(stderr," -rfb, --read-firmware-bin filename.bin\n");
fprintf(stderr," -wf, --write-firmware filename.ipod\n");
fprintf(stderr," -wfb, --write-firmware-bin filename.bin\n");
fprintf(stderr," -a, --add-bootloader filename.ipod\n");
@@ -234,6 +235,15 @@ int main(int argc, char* argv[])
} else if ((strcmp(argv[i],"-rf")==0) ||
(strcmp(argv[i],"--read-firmware")==0)) {
action = READ_FIRMWARE;
+ type = FILETYPE_DOT_IPOD;
+ i++;
+ if (i == argc) { print_usage(); return 1; }
+ filename=argv[i];
+ i++;
+ } else if ((strcmp(argv[i],"-rfb")==0) ||
+ (strcmp(argv[i],"--read-firmware-bin")==0)) {
+ action = READ_FIRMWARE;
+ type = FILETYPE_DOT_BIN;
i++;
if (i == argc) { print_usage(); return 1; }
filename=argv[i];
@@ -399,7 +409,7 @@ int main(int argc, char* argv[])
fprintf(stderr,"[ERR] --write-firmware failed.\n");
}
} else if (action==READ_FIRMWARE) {
- if (read_firmware(&ipod, filename)==0) {
+ if (read_firmware(&ipod, filename, type)==0) {
fprintf(stderr,"[INFO] Firmware read to file %s.\n",filename);
} else {
fprintf(stderr,"[ERR] --read-firmware failed.\n");