projects
/
platform
/
upstream
/
gummiboot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a7d6ec0
)
setup: add --version
author
Kay Sievers
<kay@vrfy.org>
Thu, 28 Feb 2013 22:39:06 +0000
(23:39 +0100)
committer
Kay Sievers
<kay@vrfy.org>
Thu, 28 Feb 2013 22:39:06 +0000
(23:39 +0100)
Makefile
patch
|
blob
|
history
src/setup/setup.c
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
30ec9a3
..
95f3a98
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-79,6
+79,7
@@
gummiboot: src/setup/setup.c src/setup/efivars.h src/setup/efivars.c Makefile
$(E) " CCLD " $@
$(Q) $(CC) -O0 -g -Wall -Wextra \
-Wno-unused-parameter -D_GNU_SOURCE \
$(E) " CCLD " $@
$(Q) $(CC) -O0 -g -Wall -Wextra \
-Wno-unused-parameter -D_GNU_SOURCE \
+ -DVERSION=$(VERSION) \
-DMACHINE_TYPE_NAME=\"$(MACHINE_TYPE_NAME)\" \
src/setup/setup.c \
src/setup/efivars.c \
-DMACHINE_TYPE_NAME=\"$(MACHINE_TYPE_NAME)\" \
src/setup/setup.c \
src/setup/efivars.c \
diff --git
a/src/setup/setup.c
b/src/setup/setup.c
index
d36aad5
..
214aa6e
100644
(file)
--- a/
src/setup/setup.c
+++ b/
src/setup/setup.c
@@
-40,6
+40,9
@@
#include "efivars.h"
#include "efivars.h"
+#define _stringify(s) #s
+#define stringify(s) _stringify(s)
+
#define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
#define streq(a,b) (strcmp((a),(b)) == 0)
#define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
#define streq(a,b) (strcmp((a),(b)) == 0)
@@
-1246,6
+1249,7
@@
static int help(void) {
"\n"
"Install, update or remove the Gummiboot EFI boot loader.\n\n"
" -h --help Show this help\n"
"\n"
"Install, update or remove the Gummiboot EFI boot loader.\n\n"
" -h --help Show this help\n"
+ " --version Print version\n"
" --path=PATH Path to the EFI System Partition (ESP)\n"
" --no-variables Don't touch EFI variables\n"
"\n"
" --path=PATH Path to the EFI System Partition (ESP)\n"
" --no-variables Don't touch EFI variables\n"
"\n"
@@
-1265,11
+1269,13
@@
static bool arg_touch_variables = true;
static int parse_argv(int argc, char *argv[]) {
enum {
ARG_PATH = 0x100,
static int parse_argv(int argc, char *argv[]) {
enum {
ARG_PATH = 0x100,
- ARG_NO_VARIABLES
+ ARG_VERSION,
+ ARG_NO_VARIABLES,
};
static const struct option options[] = {
{ "help", no_argument, NULL, 'h' },
};
static const struct option options[] = {
{ "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, ARG_VERSION },
{ "path", required_argument, NULL, ARG_PATH },
{ "no-variables", no_argument, NULL, ARG_NO_VARIABLES },
{ NULL, 0, NULL, 0 }
{ "path", required_argument, NULL, ARG_PATH },
{ "no-variables", no_argument, NULL, ARG_NO_VARIABLES },
{ NULL, 0, NULL, 0 }
@@
-1287,6
+1293,10
@@
static int parse_argv(int argc, char *argv[]) {
help();
return 0;
help();
return 0;
+ case ARG_VERSION:
+ printf(stringify(VERSION) "\n");
+ return 0;
+
case ARG_PATH:
arg_path = optarg;
break;
case ARG_PATH:
arg_path = optarg;
break;