summaryrefslogtreecommitdiffstats
path: root/src/fpid.c
diff options
context:
space:
mode:
authorpancake <pancake@dazo>2008-03-06 17:58:06 +0100
committerpancake <pancake@dazo>2008-03-06 17:58:06 +0100
commit83c25d7eb267f866968c7806c4afacf00fdfead5 (patch)
tree9873f0adc0142b9131cbbf0b6d1d5070a1b1823e /src/fpid.c
parent2ddb2923c68d023f9733fb82bb8d28140ea5b695 (diff)
download0xFFFF-83c25d7eb267f866968c7806c4afacf00fdfead5.tar.bz2
* Initial working version of the flash gui - Renamed to goxf - Needs 'sudo' to be enabled to the user without password - Identify and ban piece files while including them in the list - Support for flashing multiple piece files - progressbar and warn/error messages handled - Supports reboot mobo command
* Make qmode be functional * Lot of hardcore fixups on squeue_open - Should work now everywhere fine asumid UID 1000 as allowed user - Reduce timeouts - Add push2 method
Diffstat (limited to 'src/fpid.c')
-rw-r--r--src/fpid.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/fpid.c b/src/fpid.c
index 9220570..c2340f8 100644
--- a/src/fpid.c
+++ b/src/fpid.c
@@ -20,6 +20,29 @@
#include <stdio.h>
#include <string.h>
+/* global structs */
+char *pieces[] = {
+ "xloader", // xloader.bin
+ "2nd", // 2nd
+ "secondary", // secondary.bin
+ "kernel", // zImage
+ "initfs", // jffs'd initfs
+ "rootfs", // 80mB of blob
+ "omap-nand", // 8kB of food for the nand
+ "fiasco", // FIASCO IMAGE
+ NULL
+};
+
+long fpid_size(const char *filename)
+{
+ long sz;
+ FILE *fd = fopen(filename, "r");
+ fseek(fd, 0, SEEK_END);
+ sz = ftell(fd);
+ fclose(fd);
+ return sz;
+}
+
const char *fpid_file(const char *filename)
{
FILE *fd;
@@ -45,6 +68,9 @@ const char *fpid_file(const char *filename)
size = ftell(fd);
fclose(fd);
+ if (!memcmp(b, "\xb4", 1))
+ return pieces[PIECE_FIASCO];
+ else
if (!memcmp(b+0x34, "2NDAPE", 6))
return pieces[PIECE_2ND];
else