Hi.

This patch adds the commandline option of showing the version.

Thanks
Ken'ichi Ohmichi

diff -puN makedumpfile.org/makedumpfile.c makedumpfile/makedumpfile.c
--- makedumpfile.org/makedumpfile.c     2006-10-04 16:43:11.000000000 +0900
+++ makedumpfile/makedumpfile.c 2006-10-04 16:44:00.000000000 +0900
@@ -29,6 +29,13 @@ extern struct offset_table   offset_table;
 int retcd = COMPLETED; /* return code */
 struct vm_table *vt = 0;
 
+void
+show_version()
+{
+       MSG("makedumpfile: version 1.0.1 (released 04 October 2006)\n");
+       MSG("\n");
+}
+
 /*
  * Convert Physical Address to File Offest.
  *  If this function returns 0x0, File Offset isn't found.
@@ -201,7 +208,7 @@ print_usage()
        MSG("\n");
        MSG("Usage:\n");
        MSG("  makedumpfile [-c|-E] [-d dump_level] [-g config_file]|[-i 
config_file]\n");
-       MSG("  [-x vmlinux] dump_mem dump_file\n");
+       MSG("  [-v] [-x vmlinux] dump_mem dump_file\n");
        MSG("\n");
        MSG("  Making dump_file with vmlinux:\n");
        MSG("    makedumpfile [-c|-E] [-d dump_level] -x vmlinux dump_mem 
dump_file\n");
@@ -212,6 +219,9 @@ print_usage()
        MSG("  Generating config_file:\n");
        MSG("    makedumpfile -g config_file -x vmlinux\n");
        MSG("\n");
+       MSG("  Showing the version of makedumpfile:\n");
+       MSG("    makedumpfile -v\n");
+       MSG("\n");
        MSG("Available options:\n");
        MSG("  [-c]:\n");
        MSG("      This option enables the compression function of each 
page.\n");
@@ -286,6 +296,9 @@ print_usage()
        MSG("      the system under operation(Capture kernel) as the one of 
dump_mem\n");
        MSG("      (First-kernel).\n");
        MSG("\n");
+       MSG("  [-v]:\n");
+       MSG("      Show the version of makedumpfile\n");
+       MSG("\n");
        MSG("  [-x vmlinux]:\n");
        MSG("      This is a pathname to the first-kernel's vmlinux file 
compiled with\n");
        MSG("      -g option.\n");
@@ -3067,7 +3080,7 @@ main(int argc, char *argv[])
        }
        vt = &info->vm_table;
 
-       while ((opt = getopt(argc, argv, "b:cd:Eg:i:x:")) != -1) {
+       while ((opt = getopt(argc, argv, "b:cd:Eg:i:vx:")) != -1) {
                switch (opt) {
                case 'b':
                        info->block_order = atoi(optarg);
@@ -3091,6 +3104,9 @@ main(int argc, char *argv[])
                        info->flag_read_config = 1;
                        info->name_configfile = optarg;
                        break;
+               case 'v':
+                       info->flag_show_version = 1;
+                       break;
                case 'x':
                        info->flag_vmlinux = 1;
                        dwarf_info.vmlinux_name = optarg;
@@ -3101,6 +3117,10 @@ main(int argc, char *argv[])
                        goto out;
                }
        }
+       if (info->flag_show_version) {
+               show_version();
+               return COMPLETED;
+       }
        if (info->flag_generate_config) {
                /*
                 * generate the configuration file
diff -puN makedumpfile.org/makedumpfile.h makedumpfile/makedumpfile.h
--- makedumpfile.org/makedumpfile.h     2006-10-04 16:43:11.000000000 +0900
+++ makedumpfile/makedumpfile.h 2006-10-04 16:43:30.000000000 +0900
@@ -411,6 +411,7 @@ struct DumpInfo {
        int             flag_generate_config;/* flag of generating config file 
*/
        int             flag_read_config;    /* flag of reading config file */
        int             flag_exclude_free;   /* flag of excluding free page */
+       int             flag_show_version;   /* flag of showing version */
        size_t          page_size;           /* size of page */
        unsigned int    max_mapnr;           /* number of page descriptor */
        unsigned long   section_size_bits;
_

_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to