]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm: Respect config file location in man
authorLukasz Florczak <lukasz.florczak@linux.intel.com>
Fri, 18 Mar 2022 08:26:04 +0000 (09:26 +0100)
committerJes Sorensen <jsorensen@fb.com>
Tue, 5 Apr 2022 01:12:54 +0000 (21:12 -0400)
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 <lukasz.florczak@linux.intel.com>
Acked-by: Coly Li <colyli@suse.de>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
.gitignore
Makefile
mdadm.8.in
mdadm.conf.5.in [moved from mdadm.conf.5 with 99% similarity]

index 217fe76d3807f71d4fae27ad23317f74df11988d..8d791c6ffc8326aeb459dd9a167a9abf78e75380 100644 (file)
@@ -3,6 +3,7 @@
 /*-stamp
 /mdadm
 /mdadm.8
+/mdadm.conf.5
 /mdadm.udeb
 /mdassemble
 /mdmon
index 2a51d813133c59f8ffaaf4c71d4fac00eef1b643..bf126033b841a28d8d649bfad7181846ba96e720 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
index e2a4242543f244911466c122facf42ea605973f1..8b21ffd4604bd3d4d95e8a2dd8cd78e73354f1f8 100644 (file)
@@ -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
@@ -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
@@ -3344,7 +3344,7 @@ 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
@@ -3352,7 +3352,7 @@ they contain MD super block, and gives identifying information
 .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.
similarity index 99%
rename from mdadm.conf.5
rename to mdadm.conf.5.in
index 74a21c5f0844b081184f06da5dc41eec7b48ef63..83edd008228a61df69d3229a9fe72fd7fcd973c3 100644 (file)
@@ -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