]> git.zerfleddert.de Git - rsbs2/blobdiff - firmware.c
begin lz implementation
[rsbs2] / firmware.c
index 706a8336ff09eb07273a29283dc6be4f77380246..2c9960fa7436ad745160b512977e108db2c3475e 100644 (file)
@@ -255,6 +255,7 @@ void syntax(char *name)
        fprintf(stderr,"\t-d\t\tdisplay all properties of the image\n");
        fprintf(stderr,"\t-u\t\tupdate checksum of the image\n");
        fprintf(stderr,"\t-b\t\tmodify BOARD_DESCRIPTION for more power-switch options\n");
+       fprintf(stderr,"\t-e\t\textract files in firmware\n");
        fprintf(stderr,"\t-t property\tset 'property' to true\n");
        fprintf(stderr,"\t-f property\tset 'property' to false\n");
        fprintf(stderr,"\t-w property\tallow read-write access to 'property'\n");
@@ -352,11 +353,12 @@ int main(int argc, char **argv)
        int update_crc = 0;
        int patch_bd = 0;
        int patch_fw = 0;
+       int extract = 0;
 
        if (argc < 2)
                syntax(argv[0]);
 
-       while ((opt = getopt(argc, argv, "dubt:f:w:r:")) != -1) {
+       while ((opt = getopt(argc, argv, "dubet:f:w:r:")) != -1) {
                switch(opt) {
                        case 'd':
                                showall = 1;
@@ -367,6 +369,9 @@ int main(int argc, char **argv)
                        case 'b':
                                patch_bd = 1;
                                break;
+                       case 'e':
+                               extract = 1;
+                               break;
                        case 't':
                        case 'f':
                        case 'w':
@@ -453,6 +458,9 @@ int main(int argc, char **argv)
        if (showall) {
                show_properties(fw, statbuf.st_size - 4);
                handle_boarddescription(fw, statbuf.st_size -4, 0);
+       }
+
+       if (extract) {
                search_lz_sections(fw, statbuf.st_size - 4);
        }
 
Impressum, Datenschutz