]> cvs.zerfleddert.de Git - rsbs2/commitdiff
add stub for adding/replacing files in the firmware image
authorMichael Gernoth <michael@gernoth.net>
Sun, 1 Feb 2009 22:32:33 +0000 (23:32 +0100)
committerMichael Gernoth <michael@gernoth.net>
Sun, 1 Feb 2009 22:32:33 +0000 (23:32 +0100)
filesystem.c
filesystem.h
firmware.c

index 2d71946d259d4b503e19518cda4052c9a4f0a29f..d05361d7304c6bae8d5ff8ceac9bf1182245713e 100644 (file)
@@ -131,6 +131,12 @@ void extract_files(unsigned char *fw, int len)
        }
 }
 
+void replace_add_file(unsigned char *fw, int len, char *fwname, char *lname)
+{
+       fprintf(stderr, "%s: Implement me!\n", __func__);
+       exit(1);
+}
+
 void mkdir_p(char *dir)
 {
        char *copy, *parent;
index ee35618b1df7d64c66d9d06bb85eef16cb038ff9..cd72929c871c5957cdb4e7ca1f60da5ac27aeba7 100644 (file)
@@ -7,4 +7,5 @@ struct file_entry {
 
 struct file_entry* get_next_file(unsigned char *fw, int len);
 void extract_files(unsigned char *fw, int len);
+void replace_add_file(unsigned char *fw, int len, char *fwname, char *lname);
 void write_file(char *fname, unsigned char *buf, int len);
index 9f599f39220e22be67d59ab715c82842308a3685..16b86183431ebd89bdba766af34f4710b75fd708 100644 (file)
@@ -259,14 +259,15 @@ void syntax(char *name)
 {
        fprintf(stderr,"Syntax: %s parameters firmware.bin\n", name);
        fprintf(stderr,"parameters as follows:\n");
-       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");
-       fprintf(stderr,"\t-r property\tallow read-only access to 'property'\n");
+       fprintf(stderr,"\t-d\t\t\tdisplay all properties of the image\n");
+       fprintf(stderr,"\t-u\t\t\tupdate checksum of the image\n");
+       fprintf(stderr,"\t-b\t\t\tmodify BOARD_DESCRIPTION for more power-switch options\n");
+       fprintf(stderr,"\t-e\t\t\textract files in firmware\n");
+       fprintf(stderr,"\t-t property\t\tset 'property' to true\n");
+       fprintf(stderr,"\t-f property\t\tset 'property' to false\n");
+       fprintf(stderr,"\t-w property\t\tallow read-write access to 'property'\n");
+       fprintf(stderr,"\t-r property\t\tallow read-only access to 'property'\n");
+       fprintf(stderr,"\t-x fw_file=local_file\treplace or add fw_file with content of local_file\n");
        exit(1);
 }
 
@@ -378,7 +379,7 @@ int main(int argc, char **argv)
        if (argc < 2)
                syntax(argv[0]);
 
-       while ((opt = getopt(argc, argv, "dubet:f:w:r:")) != -1) {
+       while ((opt = getopt(argc, argv, "dubet:f:w:r:x:")) != -1) {
                switch(opt) {
                        case 'd':
                                showall = 1;
@@ -399,6 +400,9 @@ int main(int argc, char **argv)
                                patch_fw = 1;
                                add_action(opt, optarg, &paction);
                                break;
+                       case 'x':
+                               replace_add_file(NULL, 0, NULL, NULL);
+                               break;
                        default:
                                syntax(argv[0]);
                }
Impressum, Datenschutz