Skip to content

Commit

Permalink
mdadm: Respect config file location in man
Browse files Browse the repository at this point in the history
Default config file location could differ depending on OS (e.g. Debian family).
This patch takes default config file into consideration when creating mdadm.man
file as well as mdadm.conf.man.

Rename mdadm.conf.5 to mdadm.conf.5.in. Now mdadm.conf.5 is generated automatically.

Signed-off-by: Lukasz Florczak <[email protected]>
Acked-by: Coly Li <[email protected]>
Signed-off-by: Jes Sorensen <[email protected]>
  • Loading branch information
Lukasz Florczak authored and Jes Sorensen committed Apr 5, 2022
1 parent 83a379c commit e9dd564
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/*-stamp
/mdadm
/mdadm.8
/mdadm.conf.5
/mdadm.udeb
/mdassemble
/mdmon
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ raid6check : raid6check.o mdadm.h $(CHECK_OBJS)

mdadm.8 : mdadm.8.in
sed -e 's/{DEFAULT_METADATA}/$(DEFAULT_METADATA)/g' \
-e 's,{MAP_PATH},$(MAP_PATH),g' mdadm.8.in > mdadm.8
-e 's,{MAP_PATH},$(MAP_PATH),g' -e 's,{CONFFILE},$(CONFFILE),g' \
-e 's,{CONFFILE2},$(CONFFILE2),g' mdadm.8.in > mdadm.8

mdadm.conf.5 : mdadm.conf.5.in
sed -e 's,{CONFFILE},$(CONFFILE),g' \
-e 's,{CONFFILE2},$(CONFFILE2),g' mdadm.conf.5.in > mdadm.conf.5

mdadm.man : mdadm.8
man -l mdadm.8 > mdadm.man
Expand Down
16 changes: 8 additions & 8 deletions mdadm.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ the exact meaning of this option in different contexts.
.TP
.BR \-c ", " \-\-config=
Specify the config file or directory. Default is to use
.B /etc/mdadm.conf
.B {CONFFILE}
and
.BR /etc/mdadm.conf.d ,
.BR {CONFFILE}.d ,
or if those are missing then
.B /etc/mdadm/mdadm.conf
.B {CONFFILE2}
and
.BR /etc/mdadm/mdadm.conf.d .
.BR {CONFFILE2}.d .
If the config file given is
.B "partitions"
then nothing will be read, but
Expand Down Expand Up @@ -2014,9 +2014,9 @@ The config file is only used if explicitly named with
or requested with (a possibly implicit)
.BR \-\-scan .
In the later case,
.B /etc/mdadm.conf
.B {CONFFILE}
or
.B /etc/mdadm/mdadm.conf
.B {CONFFILE2}
is used.

If
Expand Down Expand Up @@ -3344,15 +3344,15 @@ uses this to find arrays when
is given in Misc mode, and to monitor array reconstruction
on Monitor mode.

.SS /etc/mdadm.conf
.SS {CONFFILE} (or {CONFFILE2})

The config file lists which devices may be scanned to see if
they contain MD super block, and gives identifying information
(e.g. UUID) about known MD arrays. See
.BR mdadm.conf (5)
for more details.

.SS /etc/mdadm.conf.d
.SS {CONFFILE}.d (or {CONFFILE2}.d)

A directory containing configuration files which are read in lexical
order.
Expand Down
2 changes: 1 addition & 1 deletion mdadm.conf.5 → mdadm.conf.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.SH NAME
mdadm.conf \- configuration for management of Software RAID with mdadm
.SH SYNOPSIS
/etc/mdadm.conf
{CONFFILE}
.SH DESCRIPTION
.PP
.I mdadm
Expand Down

0 comments on commit e9dd564

Please sign in to comment.