Ticket #100: fr.5.swapopts.patch

File fr.5.swapopts.patch, 5.6 KB (added by stuge, 5 months ago)

applies to r3276, will gladly rebase if this is agreed on

  • flashrom.5.swapopts/flashrom.8

    flashrom: Change start/end -s and -e to -S and -E, and change erase -E to -e.
    
    Signed-off-by: Peter Stuge <peter@stuge.se>
    
    
     
    22.SH NAME 
    33flashrom \- a universal BIOS/ROM/flash programming utility 
    44.SH SYNOPSIS 
    5 .B flashrom \fR[\fB\-rwvEVfLhR\fR] [\fB\-c\fR chipname] [\fB\-s\fR exclude_start] [\fB\-e\fR exclude_end] 
     5.B flashrom \fR[\fB\-rwveVfLhR\fR] [\fB\-c\fR chipname] [\fB\-S\fR exclude_start] [\fB\-E\fR exclude_end] 
    66         [\fB-m\fR vendor:part] [\fB-l\fR file.layout] [\fB-i\fR image_name] [file] 
    77.SH DESCRIPTION 
    88.B flashrom 
     
    2525.B "\-v, \-\-verify" 
    2626Verify the flash ROM contents against the given file. 
    2727.TP 
    28 .B "\-E, \-\-erase" 
     28.B "\-e, \-\-erase" 
    2929Erase the flash ROM device. 
    3030.TP 
    3131.B "\-V, \-\-verbose" 
     
    3434.B "\-c, \-\-chip" <chipname> 
    3535Probe only for specified flash ROM chip. 
    3636.TP 
    37 .B "\-s, \-\-estart" <addr> 
     37.B "\-S, \-\-estart" <addr> 
    3838Exclude start position (obsolete). 
    3939.TP 
    40 .B "\-e, \-\-eend" <addr>  
     40.B "\-E, \-\-eend" <addr>  
    4141Exclude end postion (obsolete). 
    4242.TP 
    4343.B "\-m, \-\-mainboard" <[vendor:]part> 
  • flashrom.5.swapopts/flashrom.c

     
    213213 
    214214void usage(const char *name) 
    215215{ 
    216         printf("usage: %s [-rwvEVfLhR] [-c chipname] [-s exclude_start]\n", name); 
    217         printf("       [-e exclude_end] [-m [vendor:]part] [-l file.layout] [-i imagename] [file]\n"); 
     216        printf("usage: %s [-rwveVfLhR] [-c chipname] [-S exclude_start]\n", name); 
     217        printf("       [-E exclude_end] [-m [vendor:]part] [-l file.layout] [-i imagename] [file]\n"); 
    218218        printf 
    219219            ("   -r | --read:                      read flash and save into file\n" 
    220220             "   -w | --write:                     write file into flash\n" 
    221221             "   -v | --verify:                    verify flash against file\n" 
    222              "   -E | --erase:                     erase flash device\n" 
     222             "   -e | --erase:                     erase flash device\n" 
    223223             "   -V | --verbose:                   more verbose output\n" 
    224224             "   -c | --chip <chipname>:           probe only for specified flash chip\n" 
    225              "   -s | --estart <addr>:             exclude start position\n" 
    226              "   -e | --eend <addr>:               exclude end postion\n" 
     225             "   -S | --estart <addr>:             exclude start position\n" 
     226             "   -E | --eend <addr>:               exclude end postion\n" 
    227227             "   -m | --mainboard <[vendor:]part>: override mainboard settings\n" 
    228228             "   -f | --force:                     force write without checking image\n" 
    229229             "   -l | --layout <file.layout>:      read rom layout from file\n" 
     
    255255        static struct option long_options[] = { 
    256256                {"read", 0, 0, 'r'}, 
    257257                {"write", 0, 0, 'w'}, 
    258                 {"erase", 0, 0, 'E'}, 
     258                {"erase", 0, 0, 'e'}, 
    259259                {"verify", 0, 0, 'v'}, 
    260260                {"chip", 1, 0, 'c'}, 
    261                 {"estart", 1, 0, 's'}, 
    262                 {"eend", 1, 0, 'e'}, 
     261                {"estart", 1, 0, 'S'}, 
     262                {"eend", 1, 0, 'E'}, 
    263263                {"mainboard", 1, 0, 'm'}, 
    264264                {"verbose", 0, 0, 'V'}, 
    265265                {"force", 0, 0, 'f'}, 
     
    285285        } 
    286286 
    287287        setbuf(stdout, NULL); 
    288         while ((opt = getopt_long(argc, argv, "rRwvVEfc:s:e:m:l:i:Lh", 
     288        while ((opt = getopt_long(argc, argv, "rRwvVefc:S:E:m:l:i:Lh", 
    289289                                  long_options, &option_index)) != EOF) { 
    290290                switch (opt) { 
    291291                case 'r': 
     
    303303                case 'V': 
    304304                        verbose = 1; 
    305305                        break; 
    306                 case 'E': 
     306                case 'e': 
    307307                        erase_it = 1; 
    308308                        break; 
    309                 case 's': 
     309                case 'S': 
    310310                        tempstr = strdup(optarg); 
    311311                        sscanf(tempstr, "%x", &exclude_start_position); 
    312312                        break; 
    313                 case 'e': 
     313                case 'E': 
    314314                        tempstr = strdup(optarg); 
    315315                        sscanf(tempstr, "%x", &exclude_end_position); 
    316316                        break; 
  • flashrom.5.swapopts/README

     
    2222Usage 
    2323----- 
    2424 
    25  $ flashrom [-rwvEVfh] [-c chipname] [-s exclude_start] [-e exclude_end] 
     25 $ flashrom [-rwveVfh] [-c chipname] [-S exclude_start] [-E exclude_end] 
    2626            [-m [vendor:]part] [-l file.layout] [-i imagename] [file] 
    2727   -r | --read:                      read flash and save into file 
    2828   -w | --write:                     write file into flash (default when 
    2929                                     file is specified) 
    3030   -v | --verify:                    verify flash against file 
    31    -E | --erase:                     erase flash device 
     31   -e | --erase:                     erase flash device 
    3232   -V | --verbose:                   more verbose output 
    3333   -c | --chip <chipname>:           probe only for specified flash chip 
    34    -s | --estart <addr>:             exclude start position 
    35    -e | --eend <addr>:               exclude end postion 
     34   -S | --estart <addr>:             exclude start position 
     35   -E | --eend <addr>:               exclude end postion 
    3636   -m | --mainboard <[vendor:]part>: override mainboard settings 
    3737   -f | --force:                     force write without checking image 
    3838   -l | --layout <file.layout>:      read rom layout from file 
     
    9090  
    9191Currently overlapping sections are not supported. 
    9292 
    93 ROM layouts should replace the -s and -e option since they are more  
     93ROM layouts should replace the -S and -E option since they are more  
    9494flexible and they should lead to a ROM update file format with the  
    9595ROM layout and the ROM image in one file (cpio, zip or something?). 
    9696