summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpancake <pancake@dazo>2007-06-02 05:32:43 +0200
committerpancake <pancake@dazo>2007-06-02 05:32:43 +0200
commit43d8d4591933762cec4e0f72d434aa47311419d3 (patch)
treea784a16d3debb2590b63af9be904ecaeac767fec
parentf299486ef9ee5531ebee567211eb7861ae7a93bf (diff)
download0xFFFF-43d8d4591933762cec4e0f72d434aa47311419d3.tar.bz2
* 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.
-rw-r--r--INSTALL18
-rw-r--r--Makefile4
-rw-r--r--doc/local-flash24
-rw-r--r--gui/Makefile8
-rw-r--r--gui/g0xFFFF.glade223
-rw-r--r--gui/main.c31
6 files changed, 308 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+ <widget class="GtkWindow" id="main_window">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes" context="yes">g0xFFFF</property>
+ <property name="default_width">501</property>
+ <property name="default_height">329</property>
+ <property name="icon_name">gtk-connect</property>
+ <signal name="destroy_event" handler="gtk_main_quit" object="0"/>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <child>
+ <widget class="GtkComboBox" id="combobox2">
+ <property name="visible">True</property>
+ <property name="active">0</property>
+ <property name="items" translatable="yes" context="yes">n770/n800
+HERMflasher</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="gochange">
+ <property name="width_request">32</property>
+ <property name="visible">True</property>
+ <property name="has_default">True</property>
+ <property name="label" translatable="yes" context="yes">&gt;</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <widget class="GtkTreeView" id="treeview1">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="border_width">3</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkFileChooserButton" id="filechooserbutton2">
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="combo1">
+ <property name="row_span_column">0</property>
+ <property name="column_span_column">0</property>
+ <property name="active">0</property>
+ <property name="tearoff_title">patata</property>
+ <property name="items" translatable="yes" context="yes">rootfs
+initfs
+kernel
+secondary
+xloader</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkButton" id="button2">
+ <property name="visible">True</property>
+ <property name="label" context="yes">Remove</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="add">
+ <property name="visible">True</property>
+ <property name="label" context="yes">Add</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" context="yes">USB host mode</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" context="yes">R&amp;D mode</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="reboot">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" context="yes">Reboot</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">3</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkProgressBar" id="progressbar1">
+ <property name="visible">True</property>
+ <property name="show_text">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkButton" id="info">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" context="yes">gtk-dialog-info</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="but_commit">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" context="yes">gtk-execute</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
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 <glade/glade.h>
+#include <gtk/gtk.h>
+
+#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;
+}