From e259df4e63f553c1271fa7d7612c110d2518e572 Mon Sep 17 00:00:00 2001 From: Doug Ledford Date: Wed, 17 Mar 2010 10:52:22 -0400 Subject: [PATCH 3/6] mapfile: if we putting the mapfile in a custom location via ALT_RUN, allow a custom filename too. Signed-off-by: Doug Ledford --- Makefile | 3 ++- mapfile.c | 2 +- mdadm.h | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1035ea8..2aafad0 100644 --- a/Makefile +++ b/Makefile @@ -63,8 +63,9 @@ CONFFILEFLAGS = -DCONFFILE=\"$(CONFFILE)\" -DCONFFILE2=\"$(CONFFILE2)\" # If you don't have /lib/init/rw you might want to use /dev/.something # e.g. make ALT_RUN=/dev/.mdadm ALT_RUN = /lib/init/rw +ALT_MAPFILE = map VAR_RUN = /var/run -ALTFLAGS = -DALT_RUN=\"$(ALT_RUN)\" +ALTFLAGS = -DALT_RUN=\"$(ALT_RUN)\" -DALT_MAPFILE=\"$(ALT_MAPFILE)\" VARFLAGS = -DVAR_RUN=\"$(VAR_RUN)\" CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(ALTFLAGS) $(VARFLAGS) diff --git a/mapfile.c b/mapfile.c index 89187ac..74f7256 100644 --- a/mapfile.c +++ b/mapfile.c @@ -55,7 +55,7 @@ char *mapname[3][3] = { mapnames(VAR_RUN "/map"), mapnames("/var/run/mdadm.map"), - mapnames(ALT_RUN "/map") + mapnames(ALT_RUN "/" ALT_MAPFILE) }; char *mapdir[3] = { VAR_RUN, NULL, ALT_RUN }; diff --git a/mdadm.h b/mdadm.h index 362b66b..0386129 100644 --- a/mdadm.h +++ b/mdadm.h @@ -87,6 +87,9 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); #ifndef ALT_RUN #define ALT_RUN "/lib/init/rw/mdadm" #endif /* ALT_RUN */ +#ifndef ALT_MAPFILE +#define ALT_MAPFILE "map" +#endif /* ALT_MAPFILE */ #include "md_u.h" #include "md_p.h" -- 1.6.6.1