From 43d8d4591933762cec4e0f72d434aa47311419d3 Mon Sep 17 00:00:00 2001 From: pancake Date: Sat, 2 Jun 2007 05:32:43 +0200 Subject: * Initial import of the offline work of the GUI environment - Not yet usable, it's just a sketch with glade O:) - But you can get fun hacking on the source! * Add deinstall target to the Makefile * Add INSTALL file for build & install instructions * Add documentation for local flashing. --- INSTALL | 18 +++++ Makefile | 4 + doc/local-flash | 24 ++++++ gui/Makefile | 8 ++ gui/g0xFFFF.glade | 223 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ gui/main.c | 31 ++++++++ 6 files changed, 308 insertions(+) create mode 100644 INSTALL create mode 100644 doc/local-flash create mode 100644 gui/Makefile create mode 100644 gui/g0xFFFF.glade create mode 100644 gui/main.c diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..cb1c382 --- /dev/null +++ b/INSTALL @@ -0,0 +1,18 @@ +Installation instructions: +========================== + +To build the flasher you will need gcc, make and libusb. For crosscompiling +to arm you can use scratchbox. But you will probably need the libusb.so of +the scratchbox environment to the device. + +Just type: + + $ make + +The installation procedure is quite simple and you can define a new PREFIX +manually from the command line: + + $ make install PREFIX=/usr + +The default one is /usr/local (not very userfriendly but standards are +standards :P hehe) diff --git a/Makefile b/Makefile index fa09b21..7dafa38 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,7 @@ clean: install: cp src/0xFFFF ${PREFIX}/bin cp logotool/logotool ${PREFIX}/bin + +deinstall: + rm -f ${PREFIX}/bin/0xFFFF + rm -f ${PREFIX}/bin/logotool diff --git a/doc/local-flash b/doc/local-flash new file mode 100644 index 0000000..a09d682 --- /dev/null +++ b/doc/local-flash @@ -0,0 +1,24 @@ +It is possible to flash directly from the device, so this brings the possibility +to completely replace the bootloader flasher by a userland one with extended +features for backuping and recovering data. + +The way to flash is using mtd-utils: + + $ flash_eraseall -j /dev/mtd3 + $ nandwrite -a -p /dev/mtd3 initfs.jffs2 + +This is an specific example plagied from initfs_flasher of bootmenu. + +The '-j' flag says that this is a jffs2 partition. Theorically this +flag is not required for zImage, and the bootloader pieces. + +The '-a' creates the OOB data automatically, and the '-p' flag pads +the data to fill the block. + +These flags are only fine for initfs, so this will be probably wrong +for other pieces. Using the dump functionality you can check if you +have flashed properly every piece inside the device, but keep in mind +that it is dangerous and you can brick your device. + +But feel free to send feedback to provide a full support for local +flashing on n770 and n800. diff --git a/gui/Makefile b/gui/Makefile new file mode 100644 index 0000000..7f9f684 --- /dev/null +++ b/gui/Makefile @@ -0,0 +1,8 @@ +OBJ=main.o +BIN=goxf + +CFLAGS=`pkg-config gladeui-1.0 libglade-2.0 --cflags` +LDFLAGS=`pkg-config gladeui-1.0 libglade-2.0 --libs` + +all: ${OBJ} + ${CC} ${LDFLAGS} ${OBJ} -o ${BIN} diff --git a/gui/g0xFFFF.glade b/gui/g0xFFFF.glade new file mode 100644 index 0000000..f6fbdf3 --- /dev/null +++ b/gui/g0xFFFF.glade @@ -0,0 +1,223 @@ + + + + + + 5 + g0xFFFF + 501 + 329 + gtk-connect + + + + True + 3 + + + True + GTK_BUTTONBOX_START + + + True + 0 + n770/n800 +HERMflasher + + + False + False + + + + + 32 + True + True + > + + + False + False + 1 + + + + + False + False + + + + + True + 6 + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + + + True + + + + + + + True + 3 + 2 + + + + + False + + + + + 0 + 0 + 0 + patata + rootfs +initfs +kernel +secondary +xloader + + + False + 1 + + + + + True + + + True + Remove + + + + + True + Add + + + 1 + + + + + False + 2 + + + + + True + USB host mode + True + + + False + False + 3 + + + + + True + R&D mode + True + + + False + False + 4 + + + + + True + Reboot + True + + + False + False + 5 + + + + + False + GTK_PACK_END + 1 + + + + + 3 + 1 + + + + + True + 6 + + + True + True + + + + + True + + + True + gtk-dialog-info + True + + + False + False + + + + + True + gtk-execute + True + + + False + False + 1 + + + + + False + False + GTK_PACK_END + 1 + + + + + False + False + 2 + + + + + + diff --git a/gui/main.c b/gui/main.c new file mode 100644 index 0000000..1f0c20b --- /dev/null +++ b/gui/main.c @@ -0,0 +1,31 @@ +#include +#include + +#define U(x) printf("%d\n",x); fflush(stdout); + +int main(int argc, char **argv) +{ + GtkWidget *w; + GladeXML *xml; + + gtk_init(&argc, &argv); + + xml = glade_xml_new("g0xFFFF.glade", "main_window", ""); + //xml = glade_xml_new("test.glade", "window1", NULL); + if(!xml) { + g_warning("We could not load the interface!"); + return 1; + } + + glade_xml_signal_autoconnect(xml); + + w = glade_xml_get_widget(xml, "main_window"); + gtk_signal_connect(GTK_OBJECT(w), "destroy", + GTK_SIGNAL_FUNC(gtk_main_quit),NULL); + gtk_widget_show_all(w); + + gtk_object_unref(GTK_OBJECT(xml)); + + gtk_main(); + return 0; +} -- cgit v1.2.3