[flashrom] [patch] add version information similar to 'uname -mrs'
Maciej Pijanka
maciej.pijanka at gmail.com
Sat Dec 19 23:34:49 CET 2009
On Sat, 19 Dec 2009, Idwer Vollering wrote:
> Include detailed versioning information in the binary (--version).
>
> Signed-off-by: Idwer Vollering <vidwer at gmail.com>
another small addon to be added after this patch which print
libpci version used for compilation (info aquired from headers)
Signed-off-by: Maciej Pijanka <maciej.pijanka at gmail.com>
best regards
Maciej
>
> ---
>
> Future thoughts: include the used version of libpci.
> Index: flashrom.c
> ===================================================================
> --- flashrom.c (revision 808)
> +++ flashrom.c (working copy)
> @@ -1,3 +1,4 @@
> +
> /*
> * This file is part of the flashrom project.
> *
> @@ -24,6 +25,7 @@
> #include <fcntl.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> +#include <sys/utsname.h>
> #include <string.h>
> #include <stdlib.h>
> #include <getopt.h>
> @@ -968,7 +970,19 @@
>
> void print_version(void)
> {
> + struct utsname osinfo;
> + uname (&osinfo);
> +
> +/*
> printf("flashrom v%s\n", flashrom_version);
> + printf("sysname: %s\n", osinfo.sysname);
> + printf("nodename: %s\n", osinfo.nodename);
> + printf("release: %s\n", osinfo.release);
> + printf("version: %s\n", osinfo.version);
> + printf("machine: %s\n", osinfo.machine);
> +*/
> + printf("flashrom v%s, built on %s %s (%s) \n", flashrom_version, osinfo.sysname, osinfo.release,
> +osinfo.machine);
> }
>
> int main(int argc, char *argv[])
> _______________________________________________
> flashrom mailing list
> flashrom at flashrom.org
> http://www.flashrom.org/mailman/listinfo/flashrom
--
Maciej Pijanka
reg. Linux user #133161
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flashrom-r808_flashrom.c_libpci-version.diff
Type: text/x-diff
Size: 409 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20091219/0e86411a/attachment.bin>
More information about the flashrom
mailing list