Changeset 44556


Ignore:
Timestamp:
2015-02-27T18:38:14+01:00 (3 years ago)
Author:
jogo
Message:

brcm63xx: do not align squashfs rootfs start

We do not need to align the start of read only rootfs's to erase blocks.
This allows us to write the squashfs rootfs directly behind the kernel,
potentially freeing up one erase block.

We still need to align for jffs2, so add a flag for imagetag to
optionally align the rootfs start.

Signed-off-by: Jonas Gorski <jogo@…>

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm63xx/image/Makefile

    r44555 r44556  
    1818                RAMSIZE=$(RAMSIZE) 
    1919 
    20 define trxalign/jffs2-128k 
    21 -a 0x20000 
    22 endef 
    23 define trxalign/jffs2-64k 
    24 -a 0x10000 
    25 endef 
    26 define trxalign/squashfs 
    27 -a 1024 
     20define rootfspad/jffs2-128k 
     21--align-rootfs 
     22endef 
     23define rootfspad/jffs2-64k 
     24--align-rootfs 
     25endef 
     26define rootfspad/squashfs 
    2827endef 
    2928 
     
    4544                --load-addr $(LOADADDR) --rsa-signature "$(5)" \ 
    4645                --info1 "-$(call Image/LimitName16,$(4))" --info2 $(1) \ 
     46                $(call rootfspad/$(1)) \ 
    4747                $(6) $(7) $(8) $(9) 
    4848endef 
     
    5454                --boardid $(3) --chipid $(4) --entry $(KERNEL_ENTRY) \ 
    5555                --load-addr $(LOADADDR) --info1 "-$(call Image/LimitName16,$(5))" \ 
     56                $(call rootfspad/$(1)) \ 
    5657                --info2 $(1) $(6) 
    5758endef 
     
    7071                --output $(BIN_DIR)/openwrt-$(5)-$(1).tmp \ 
    7172                --boardid $(3) --chipid $(4) --entry $(KERNEL_ENTRY) \ 
     73                $(call rootfspad/$(1)) \ 
    7274                --load-addr $(LOADADDR) $(6) 
    7375        # Fix up header 
     
    8587                --boardid $(3) --chipid $(4) --entry $(KERNEL_ENTRY) \ 
    8688                --load-addr $(LOADADDR) --info1 "-$(call Image/LimitName16,$(5))" \ 
     89                $(call rootfspad/$(1)) \ 
    8790                --info2 $(1) $(6) 
    8891        # Fix up header 
  • trunk/tools/firmware-utils/src/imagetag.c

    r44554 r44556  
    8484        FILE *kernelfile = NULL, *rootfsfile = NULL, *binfile = NULL, *cfefile = NULL; 
    8585        size_t cfeoff, cfelen, kerneloff, kernellen, rootfsoff, rootfslen, \ 
    86           read, imagelen, rootfsoffpadlen = 0, kernelfslen, kerneloffpadlen = 0, oldrootfslen; 
     86          read, imagelen, rootfsoffpadlen = 0, kernelfslen, kerneloffpadlen = 0, oldrootfslen, \ 
     87          rootfsend; 
    8788        uint8_t readbuf[1024]; 
    8889        uint32_t imagecrc = IMAGETAG_CRC_START; 
     
    158159          } 
    159160           
    160           /* Build the rootfs address and length (start and end do need to be aligned on flash erase block boundaries */ 
     161          /* Build the rootfs address and length */ 
    161162          rootfsoff = kerneloff + kernellen; 
    162           rootfsoff = (rootfsoff % block_size) > 0 ? (((rootfsoff / block_size) + 1) * block_size) : rootfsoff; 
    163           rootfslen = getlen(rootfsfile); 
    164           rootfslen = ( (rootfslen % block_size) > 0 ? (((rootfslen / block_size) + 1) * block_size) : rootfslen ); 
     163          /* align the start if requested */ 
     164          if (args->align_rootfs_flag) 
     165                rootfsoff = (rootfsoff % block_size) > 0 ? (((rootfsoff / block_size) + 1) * block_size) : rootfsoff; 
     166 
     167          /* align the end */ 
     168          rootfsend = rootfsoff + getlen(rootfsfile); 
     169          if ((rootfsend % block_size) > 0) 
     170                rootfsend = (((rootfsend / block_size) + 1) * block_size); 
     171          rootfslen = rootfsend - rootfsoff; 
    165172          imagelen = rootfsoff + rootfslen - kerneloff + sizeof(deadcode); 
    166173          rootfsoffpadlen = rootfsoff - (kerneloff + kernellen); 
     
    391398        kernel = rootfs = bin = NULL; 
    392399 
    393         if (cmdline_parser(argc, argv, &parsed_args)) { 
     400        if (imagetag_cmdline(argc, argv, &parsed_args)) { 
    394401          exit(1); 
    395402        } 
  • trunk/tools/firmware-utils/src/imagetag.ggo

    r31875 r44556  
    4444option "kernel-file-has-header" - "Indicates that the kernel file includes the kernel header with correct load address and entry point, so no changes are needed" flag off 
    4545option "pad" p "Pad the image to this size if smaller (in MiB)" int typestr="size (in MiB)" optional 
     46option "align-rootfs" - "Align the rootfs start to erase block size" flag off 
  • trunk/tools/firmware-utils/src/imagetag_cmdline.c

    r31875 r44556  
    11/* 
    2   File autogenerated by gengetopt version 2.22.4 
     2  File autogenerated by gengetopt version 2.22.5 
    33  generated with the following command: 
    4   gengetopt --file-name=imagetag_cmdline --file-name=imagetag_cmdline 
     4  gengetopt -i imagetag.ggo -f imagetag_cmdline --file-name=imagetag_cmdline 
    55 
    66  The developers of gengetopt consider the fixed text that goes in all 
     
    6060  "      --kernel-file-has-header  Indicates that the kernel file includes the \n                                  kernel header with correct load address and \n                                  entry point, so no changes are needed  \n                                  (default=off)", 
    6161  "  -p, --pad=size (in MiB)       Pad the image to this size if smaller (in MiB)", 
     62  "      --align-rootfs            Align the rootfs start to erase block size  \n                                  (default=off)", 
    6263    0 
    6364}; 
     
    6768  , ARG_STRING 
    6869  , ARG_INT 
    69 } cmdline_parser_arg_type; 
     70} imagetag_cmdline_arg_type; 
    7071 
    7172static 
     
    7576 
    7677static int 
    77 cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, 
    78                         struct cmdline_parser_params *params, const char *additional_error); 
     78imagetag_cmdline_internal (int argc, char **argv, struct gengetopt_args_info *args_info, 
     79                        struct imagetag_cmdline_params *params, const char *additional_error); 
    7980 
    8081static int 
    81 cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); 
    82  
    83 const char *cmdline_parser_second_image_flag_values[] = {"0", "1", "2", 0}; /*< Possible values for second-image-flag. */ 
    84 const char *cmdline_parser_inactive_values[] = {"0", "1", "2", 0}; /*< Possible values for inactive. */ 
     82imagetag_cmdline_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); 
     83 
     84const char *imagetag_cmdline_second_image_flag_values[] = {"0", "1", "2", 0}; /*< Possible values for second-image-flag. */ 
     85const char *imagetag_cmdline_inactive_values[] = {"0", "1", "2", 0}; /*< Possible values for inactive. */ 
    8586 
    8687static char * 
     
    117118  args_info->kernel_file_has_header_given = 0 ; 
    118119  args_info->pad_given = 0 ; 
     120  args_info->align_rootfs_given = 0 ; 
    119121} 
    120122 
     
    170172  args_info->kernel_file_has_header_flag = 0; 
    171173  args_info->pad_orig = NULL; 
     174  args_info->align_rootfs_flag = 0; 
    172175   
    173176} 
     
    205208  args_info->kernel_file_has_header_help = gengetopt_args_info_help[25] ; 
    206209  args_info->pad_help = gengetopt_args_info_help[26] ; 
     210  args_info->align_rootfs_help = gengetopt_args_info_help[27] ; 
    207211   
    208212} 
    209213 
    210214void 
    211 cmdline_parser_print_version (void) 
     215imagetag_cmdline_print_version (void) 
    212216{ 
    213217  printf ("%s %s\n", 
    214      (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), 
    215      CMDLINE_PARSER_VERSION); 
     218     (strlen(IMAGETAG_CMDLINE_PACKAGE_NAME) ? IMAGETAG_CMDLINE_PACKAGE_NAME : IMAGETAG_CMDLINE_PACKAGE), 
     219     IMAGETAG_CMDLINE_VERSION); 
    216220} 
    217221 
    218222static void print_help_common(void) { 
    219   cmdline_parser_print_version (); 
     223  imagetag_cmdline_print_version (); 
    220224 
    221225  if (strlen(gengetopt_args_info_purpose) > 0) 
     
    232236 
    233237void 
    234 cmdline_parser_print_help (void) 
     238imagetag_cmdline_print_help (void) 
    235239{ 
    236240  int i = 0; 
     
    241245 
    242246void 
    243 cmdline_parser_init (struct gengetopt_args_info *args_info) 
     247imagetag_cmdline_init (struct gengetopt_args_info *args_info) 
    244248{ 
    245249  clear_given (args_info); 
     
    249253 
    250254void 
    251 cmdline_parser_params_init(struct cmdline_parser_params *params) 
     255imagetag_cmdline_params_init(struct imagetag_cmdline_params *params) 
    252256{ 
    253257  if (params) 
     
    261265} 
    262266 
    263 struct cmdline_parser_params * 
    264 cmdline_parser_params_create(void) 
    265 { 
    266   struct cmdline_parser_params *params =  
    267     (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); 
    268   cmdline_parser_params_init(params);   
     267struct imagetag_cmdline_params * 
     268imagetag_cmdline_params_create(void) 
     269{ 
     270  struct imagetag_cmdline_params *params =  
     271    (struct imagetag_cmdline_params *)malloc(sizeof(struct imagetag_cmdline_params)); 
     272  imagetag_cmdline_params_init(params);   
    269273  return params; 
    270274} 
     
    282286 
    283287static void 
    284 cmdline_parser_release (struct gengetopt_args_info *args_info) 
     288imagetag_cmdline_release (struct gengetopt_args_info *args_info) 
    285289{ 
    286290 
     
    391395 
    392396int 
    393 cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) 
     397imagetag_cmdline_dump(FILE *outfile, struct gengetopt_args_info *args_info) 
    394398{ 
    395399  int i = 0; 
     
    397401  if (!outfile) 
    398402    { 
    399       fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); 
     403      fprintf (stderr, "%s: cannot dump options to stream\n", IMAGETAG_CMDLINE_PACKAGE); 
    400404      return EXIT_FAILURE; 
    401405    } 
     
    446450    write_into_file(outfile, "rsa-signature", args_info->rsa_signature_orig, 0); 
    447451  if (args_info->second_image_flag_given) 
    448     write_into_file(outfile, "second-image-flag", args_info->second_image_flag_orig, cmdline_parser_second_image_flag_values); 
     452    write_into_file(outfile, "second-image-flag", args_info->second_image_flag_orig, imagetag_cmdline_second_image_flag_values); 
    449453  if (args_info->inactive_given) 
    450     write_into_file(outfile, "inactive", args_info->inactive_orig, cmdline_parser_inactive_values); 
     454    write_into_file(outfile, "inactive", args_info->inactive_orig, imagetag_cmdline_inactive_values); 
    451455  if (args_info->reserved2_given) 
    452456    write_into_file(outfile, "reserved2", args_info->reserved2_orig, 0); 
     
    455459  if (args_info->pad_given) 
    456460    write_into_file(outfile, "pad", args_info->pad_orig, 0); 
     461  if (args_info->align_rootfs_given) 
     462    write_into_file(outfile, "align-rootfs", 0, 0 ); 
    457463   
    458464 
     
    462468 
    463469int 
    464 cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) 
     470imagetag_cmdline_file_save(const char *filename, struct gengetopt_args_info *args_info) 
    465471{ 
    466472  FILE *outfile; 
     
    471477  if (!outfile) 
    472478    { 
    473       fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); 
     479      fprintf (stderr, "%s: cannot open file for writing: %s\n", IMAGETAG_CMDLINE_PACKAGE, filename); 
    474480      return EXIT_FAILURE; 
    475481    } 
    476482 
    477   i = cmdline_parser_dump(outfile, args_info); 
     483  i = imagetag_cmdline_dump(outfile, args_info); 
    478484  fclose (outfile); 
    479485 
     
    482488 
    483489void 
    484 cmdline_parser_free (struct gengetopt_args_info *args_info) 
    485 { 
    486   cmdline_parser_release (args_info); 
     490imagetag_cmdline_free (struct gengetopt_args_info *args_info) 
     491{ 
     492  imagetag_cmdline_release (args_info); 
    487493} 
    488494 
     
    503509 
    504510int 
    505 cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) 
    506 { 
    507   return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); 
     511imagetag_cmdline (int argc, char **argv, struct gengetopt_args_info *args_info) 
     512{ 
     513  return imagetag_cmdline2 (argc, argv, args_info, 0, 1, 1); 
    508514} 
    509515 
    510516int 
    511 cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, 
    512                    struct cmdline_parser_params *params) 
     517imagetag_cmdline_ext (int argc, char **argv, struct gengetopt_args_info *args_info, 
     518                   struct imagetag_cmdline_params *params) 
    513519{ 
    514520  int result; 
    515   result = cmdline_parser_internal (argc, argv, args_info, params, 0); 
     521  result = imagetag_cmdline_internal (argc, argv, args_info, params, 0); 
    516522 
    517523  if (result == EXIT_FAILURE) 
    518524    { 
    519       cmdline_parser_free (args_info); 
     525      imagetag_cmdline_free (args_info); 
    520526      exit (EXIT_FAILURE); 
    521527    } 
     
    525531 
    526532int 
    527 cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) 
     533imagetag_cmdline2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) 
    528534{ 
    529535  int result; 
    530   struct cmdline_parser_params params; 
     536  struct imagetag_cmdline_params params; 
    531537   
    532538  params.override = override; 
     
    536542  params.print_errors = 1; 
    537543 
    538   result = cmdline_parser_internal (argc, argv, args_info, &params, 0); 
     544  result = imagetag_cmdline_internal (argc, argv, args_info, &params, 0); 
    539545 
    540546  if (result == EXIT_FAILURE) 
    541547    { 
    542       cmdline_parser_free (args_info); 
     548      imagetag_cmdline_free (args_info); 
    543549      exit (EXIT_FAILURE); 
    544550    } 
     
    548554 
    549555int 
    550 cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) 
     556imagetag_cmdline_required (struct gengetopt_args_info *args_info, const char *prog_name) 
    551557{ 
    552558  int result = EXIT_SUCCESS; 
    553559 
    554   if (cmdline_parser_required2(args_info, prog_name, 0) > 0) 
     560  if (imagetag_cmdline_required2(args_info, prog_name, 0) > 0) 
    555561    result = EXIT_FAILURE; 
    556562 
    557563  if (result == EXIT_FAILURE) 
    558564    { 
    559       cmdline_parser_free (args_info); 
     565      imagetag_cmdline_free (args_info); 
    560566      exit (EXIT_FAILURE); 
    561567    } 
     
    565571 
    566572int 
    567 cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) 
     573imagetag_cmdline_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) 
    568574{ 
    569575  int error = 0; 
     
    632638 * @param default_value the default value (in case the option only accepts fixed values) 
    633639 * @param arg_type the type of this option 
    634  * @param check_ambiguity @see cmdline_parser_params.check_ambiguity 
    635  * @param override @see cmdline_parser_params.override 
     640 * @param check_ambiguity @see imagetag_cmdline_params.check_ambiguity 
     641 * @param override @see imagetag_cmdline_params.override 
    636642 * @param no_free whether to free a possible previous value 
    637643 * @param multiple_option whether this is a multiple option 
     
    645651               char *value, const char *possible_values[], 
    646652               const char *default_value, 
    647                cmdline_parser_arg_type arg_type, 
     653               imagetag_cmdline_arg_type arg_type, 
    648654               int check_ambiguity, int override, 
    649655               int no_free, int multiple_option, 
     
    748754 
    749755int 
    750 cmdline_parser_internal ( 
     756imagetag_cmdline_internal ( 
    751757  int argc, char **argv, struct gengetopt_args_info *args_info, 
    752                         struct cmdline_parser_params *params, const char *additional_error) 
     758                        struct imagetag_cmdline_params *params, const char *additional_error) 
    753759{ 
    754760  int c;        /* Character of the parsed option.  */ 
     
    770776 
    771777  if (initialize) 
    772     cmdline_parser_init (args_info); 
    773  
    774   cmdline_parser_init (&local_args_info); 
     778    imagetag_cmdline_init (args_info); 
     779 
     780  imagetag_cmdline_init (&local_args_info); 
    775781 
    776782  optarg = 0; 
     
    811817        { "kernel-file-has-header",     0, NULL, 0 }, 
    812818        { "pad",        1, NULL, 'p' }, 
     819        { "align-rootfs",       0, NULL, 0 }, 
    813820        { 0,  0, 0, 0 } 
    814821      }; 
     
    821828        { 
    822829        case 'h':       /* Print help and exit.  */ 
    823           cmdline_parser_print_help (); 
    824           cmdline_parser_free (&local_args_info); 
     830          imagetag_cmdline_print_help (); 
     831          imagetag_cmdline_free (&local_args_info); 
    825832          exit (EXIT_SUCCESS); 
    826833 
    827834        case 'V':       /* Print version and exit.  */ 
    828           cmdline_parser_print_version (); 
    829           cmdline_parser_free (&local_args_info); 
     835          imagetag_cmdline_print_version (); 
     836          imagetag_cmdline_free (&local_args_info); 
    830837          exit (EXIT_SUCCESS); 
    831838 
     
    10951102            if (update_arg( (void *)&(args_info->second_image_flag_arg),  
    10961103                 &(args_info->second_image_flag_orig), &(args_info->second_image_flag_given), 
    1097                 &(local_args_info.second_image_flag_given), optarg, cmdline_parser_second_image_flag_values, "2", ARG_STRING, 
     1104                &(local_args_info.second_image_flag_given), optarg, imagetag_cmdline_second_image_flag_values, "2", ARG_STRING, 
    10981105                check_ambiguity, override, 0, 0, 
    10991106                "second-image-flag", '-', 
     
    11091116            if (update_arg( (void *)&(args_info->inactive_arg),  
    11101117                 &(args_info->inactive_orig), &(args_info->inactive_given), 
    1111                 &(local_args_info.inactive_given), optarg, cmdline_parser_inactive_values, "2", ARG_STRING, 
     1118                &(local_args_info.inactive_given), optarg, imagetag_cmdline_inactive_values, "2", ARG_STRING, 
    11121119                check_ambiguity, override, 0, 0, 
    11131120                "inactive", '-', 
     
    11421149           
    11431150          } 
     1151          /* Align the rootfs start to erase block size.  */ 
     1152          else if (strcmp (long_options[option_index].name, "align-rootfs") == 0) 
     1153          { 
     1154           
     1155           
     1156            if (update_arg((void *)&(args_info->align_rootfs_flag), 0, &(args_info->align_rootfs_given), 
     1157                &(local_args_info.align_rootfs_given), optarg, 0, 0, ARG_FLAG, 
     1158                check_ambiguity, override, 1, 0, "align-rootfs", '-', 
     1159                additional_error)) 
     1160              goto failure; 
     1161           
     1162          } 
    11441163           
    11451164          break; 
     
    11491168 
    11501169        default:        /* bug: option not considered.  */ 
    1151           fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); 
     1170          fprintf (stderr, "%s: option unknown: %c%s\n", IMAGETAG_CMDLINE_PACKAGE, c, (additional_error ? additional_error : "")); 
    11521171          abort (); 
    11531172        } /* switch */ 
     
    11581177  if (check_required) 
    11591178    { 
    1160       error += cmdline_parser_required2 (args_info, argv[0], additional_error); 
    1161     } 
    1162  
    1163   cmdline_parser_release (&local_args_info); 
     1179      error += imagetag_cmdline_required2 (args_info, argv[0], additional_error); 
     1180    } 
     1181 
     1182  imagetag_cmdline_release (&local_args_info); 
    11641183 
    11651184  if ( error ) 
     
    11701189failure: 
    11711190   
    1172   cmdline_parser_release (&local_args_info); 
     1191  imagetag_cmdline_release (&local_args_info); 
    11731192  return (EXIT_FAILURE); 
    11741193} 
  • trunk/tools/firmware-utils/src/imagetag_cmdline.h

    r31875 r44556  
    11/** @file imagetag_cmdline.h 
    22 *  @brief The header file for the command line option parser 
    3  *  generated by GNU Gengetopt version 2.22.4 
     3 *  generated by GNU Gengetopt version 2.22.5 
    44 *  http://www.gnu.org/software/gengetopt. 
    55 *  DO NOT modify this file, since it can be overwritten 
     
    2020#endif /* __cplusplus */ 
    2121 
    22 #ifndef CMDLINE_PARSER_PACKAGE 
     22#ifndef IMAGETAG_CMDLINE_PACKAGE 
    2323/** @brief the program name (used for printing errors) */ 
    24 #define CMDLINE_PARSER_PACKAGE "imagetag" 
    25 #endif 
    26  
    27 #ifndef CMDLINE_PARSER_PACKAGE_NAME 
     24#define IMAGETAG_CMDLINE_PACKAGE "imagetag" 
     25#endif 
     26 
     27#ifndef IMAGETAG_CMDLINE_PACKAGE_NAME 
    2828/** @brief the complete program name (used for help and version) */ 
    29 #define CMDLINE_PARSER_PACKAGE_NAME "imagetag" 
    30 #endif 
    31  
    32 #ifndef CMDLINE_PARSER_VERSION 
     29#define IMAGETAG_CMDLINE_PACKAGE_NAME "imagetag" 
     30#endif 
     31 
     32#ifndef IMAGETAG_CMDLINE_VERSION 
    3333/** @brief the program version */ 
    34 #define CMDLINE_PARSER_VERSION "2.0.0" 
     34#define IMAGETAG_CMDLINE_VERSION "2.0.0" 
    3535#endif 
    3636 
     
    113113  char * pad_orig;      /**< @brief Pad the image to this size if smaller (in MiB) original value given at command line.  */ 
    114114  const char *pad_help; /**< @brief Pad the image to this size if smaller (in MiB) help description.  */ 
     115  int align_rootfs_flag;        /**< @brief Align the rootfs start to erase block size (default=off).  */ 
     116  const char *align_rootfs_help; /**< @brief Align the rootfs start to erase block size help description.  */ 
    115117   
    116118  unsigned int help_given ;     /**< @brief Whether help was given.  */ 
     
    141143  unsigned int kernel_file_has_header_given ;   /**< @brief Whether kernel-file-has-header was given.  */ 
    142144  unsigned int pad_given ;      /**< @brief Whether pad was given.  */ 
     145  unsigned int align_rootfs_given ;     /**< @brief Whether align-rootfs was given.  */ 
    143146 
    144147} ; 
    145148 
    146149/** @brief The additional parameters to pass to parser functions */ 
    147 struct cmdline_parser_params 
     150struct imagetag_cmdline_params 
    148151{ 
    149152  int override; /**< @brief whether to override possibly already present options (default 0) */ 
     
    168171 * @return 0 if everything went fine, NON 0 if an error took place 
    169172 */ 
    170 int cmdline_parser (int argc, char **argv, 
     173int imagetag_cmdline (int argc, char **argv, 
    171174  struct gengetopt_args_info *args_info); 
    172175 
     
    180183 * @param check_required whether to check that all required options were provided 
    181184 * @return 0 if everything went fine, NON 0 if an error took place 
    182  * @deprecated use cmdline_parser_ext() instead 
    183  */ 
    184 int cmdline_parser2 (int argc, char **argv, 
     185 * @deprecated use imagetag_cmdline_ext() instead 
     186 */ 
     187int imagetag_cmdline2 (int argc, char **argv, 
    185188  struct gengetopt_args_info *args_info, 
    186189  int override, int initialize, int check_required); 
     
    194197 * @return 0 if everything went fine, NON 0 if an error took place 
    195198 */ 
    196 int cmdline_parser_ext (int argc, char **argv, 
     199int imagetag_cmdline_ext (int argc, char **argv, 
    197200  struct gengetopt_args_info *args_info, 
    198   struct cmdline_parser_params *params); 
     201  struct imagetag_cmdline_params *params); 
    199202 
    200203/** 
     
    204207 * @return 0 if everything went fine, NON 0 if an error took place 
    205208 */ 
    206 int cmdline_parser_dump(FILE *outfile, 
     209int imagetag_cmdline_dump(FILE *outfile, 
    207210  struct gengetopt_args_info *args_info); 
    208211 
     
    214217 * @return 0 if everything went fine, NON 0 if an error took place 
    215218 */ 
    216 int cmdline_parser_file_save(const char *filename, 
     219int imagetag_cmdline_file_save(const char *filename, 
    217220  struct gengetopt_args_info *args_info); 
    218221 
     
    220223 * Print the help 
    221224 */ 
    222 void cmdline_parser_print_help(void); 
     225void imagetag_cmdline_print_help(void); 
    223226/** 
    224227 * Print the version 
    225228 */ 
    226 void cmdline_parser_print_version(void); 
    227  
    228 /** 
    229  * Initializes all the fields a cmdline_parser_params structure  
     229void imagetag_cmdline_print_version(void); 
     230 
     231/** 
     232 * Initializes all the fields a imagetag_cmdline_params structure  
    230233 * to their default values 
    231234 * @param params the structure to initialize 
    232235 */ 
    233 void cmdline_parser_params_init(struct cmdline_parser_params *params); 
    234  
    235 /** 
    236  * Allocates dynamically a cmdline_parser_params structure and initializes 
     236void imagetag_cmdline_params_init(struct imagetag_cmdline_params *params); 
     237 
     238/** 
     239 * Allocates dynamically a imagetag_cmdline_params structure and initializes 
    237240 * all its fields to their default values 
    238  * @return the created and initialized cmdline_parser_params structure 
    239  */ 
    240 struct cmdline_parser_params *cmdline_parser_params_create(void); 
     241 * @return the created and initialized imagetag_cmdline_params structure 
     242 */ 
     243struct imagetag_cmdline_params *imagetag_cmdline_params_create(void); 
    241244 
    242245/** 
     
    245248 * @param args_info the structure to initialize 
    246249 */ 
    247 void cmdline_parser_init (struct gengetopt_args_info *args_info); 
     250void imagetag_cmdline_init (struct gengetopt_args_info *args_info); 
    248251/** 
    249252 * Deallocates the string fields of the gengetopt_args_info structure 
     
    251254 * @param args_info the structure to deallocate 
    252255 */ 
    253 void cmdline_parser_free (struct gengetopt_args_info *args_info); 
     256void imagetag_cmdline_free (struct gengetopt_args_info *args_info); 
    254257 
    255258/** 
     
    260263 * @return 
    261264 */ 
    262 int cmdline_parser_required (struct gengetopt_args_info *args_info, 
     265int imagetag_cmdline_required (struct gengetopt_args_info *args_info, 
    263266  const char *prog_name); 
    264267 
    265 extern const char *cmdline_parser_second_image_flag_values[];  /**< @brief Possible values for second-image-flag. */ 
    266 extern const char *cmdline_parser_inactive_values[];  /**< @brief Possible values for inactive. */ 
     268extern const char *imagetag_cmdline_second_image_flag_values[];  /**< @brief Possible values for second-image-flag. */ 
     269extern const char *imagetag_cmdline_inactive_values[];  /**< @brief Possible values for inactive. */ 
    267270 
    268271 
Note: See TracChangeset for help on using the changeset viewer.