Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC Bus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC Bus
Commits
5c9176a9
Commit
5c9176a9
authored
Nov 30, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: add printing version of repo
with -V switch Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
fbb8a511
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
Makefile
tools/Makefile
+2
-0
fmc-mem.c
tools/fmc-mem.c
+15
-2
fru-dump.c
tools/fru-dump.c
+13
-1
No files found.
tools/Makefile
View file @
5c9176a9
...
...
@@ -8,7 +8,9 @@
REPO_PARENT
=
../..
-include
$(REPO_PARENT)/parent_common.mk
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
CFLAGS
=
-Wall
-ggdb
-O2
-I
../kernel/include
$(EXTRACFLAGS)
CFLAGS
+=
-DGIT_VERSION
=
"
\"
$(GIT_VERSION)
\"
"
PROGS
=
fru-dump fmc-mem
all
:
$(PROGS)
...
...
tools/fmc-mem.c
View file @
5c9176a9
...
...
@@ -17,12 +17,15 @@
#include <sys/types.h>
#include <sys/stat.h>
static
char
git_version
[]
=
"git version: "
GIT_VERSION
;
static
void
help
(
char
*
prgname
)
{
fprintf
(
stderr
,
"%s: use "
"
\"
%s <device> <addr> [<value>] [+<nbytes>]
\"\n
"
"
\"
%s
-V
<device> <addr> [<value>] [+<nbytes>]
\"\n
"
" <device> is a file name, all others are hex numbers
\n
"
" bursts of
\"
nbytes
\"
use stdin/stdout (value ignored)
\n
"
,
" bursts of
\"
nbytes
\"
use stdin/stdout (value ignored)
\n
"
" -V version
\n
"
,
prgname
,
prgname
);
exit
(
1
);
}
...
...
@@ -67,6 +70,11 @@ static void r_loop(int fd, char **argv, int nbytes)
exit
(
0
);
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
fd
;
...
...
@@ -75,6 +83,11 @@ int main(int argc, char **argv)
int
dowrite
=
0
,
doloop
=
0
;
char
c
;
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
if
(
argc
<
3
||
argv
[
1
][
0
]
==
'-'
)
/* -h, --help, whatever */
help
(
argv
[
0
]);
...
...
tools/fru-dump.c
View file @
5c9176a9
...
...
@@ -18,11 +18,18 @@
#include "../kernel/fru-parse.c"
/* Aaaargh!!!!! horrible hack... */
static
char
git_version
[]
=
"git version: "
GIT_VERSION
;
void
*
fru_alloc
(
size_t
size
)
{
return
malloc
(
size
);
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
#define EEPROM_SIZE 8192
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -35,8 +42,13 @@ int main(int argc, char **argv)
FILE
*
f
=
NULL
;
int
i
,
err
=
0
;
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s <fru-image> [...]
\"\n
"
,
fprintf
(
stderr
,
"%s: Use
\"
%s
[-V]
<fru-image> [...]
\"\n
"
,
argv
[
0
],
argv
[
0
]);
exit
(
1
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment