added my Recipes
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
From ee9f7b6e764be5668bc958f8bb97a46e5056d050 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 25 May 2020 23:22:55 -0700
|
||||
Subject: [PATCH] add explicit dependency on libraries
|
||||
|
||||
[snip]
|
||||
gcc/i686-overc-linux/10.1.0/ld: cannot find -lmpathpersist
|
||||
collect2: error: ld returned 1 exit status
|
||||
Makefile:36: recipe for target 'multipathd' failed
|
||||
make[1]: *** [multipathd] Error 1
|
||||
make[1]: Leaving directory 'git/multipathd'
|
||||
Makefile:29: recipe for target 'multipathd' failed
|
||||
make: *** [multipathd] Error 2
|
||||
ln -sf libmpathpersist.so.0 libmpathpersist.so
|
||||
[snip]
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f195b570..2d22881c 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -78,6 +78,7 @@ libmultipath: libmpathutil
|
||||
libmpathpersist libmpathvalid multipath multipathd: libmultipath
|
||||
libmultipath/prioritizers libmultipath/checkers libmultipath/foreign: libmultipath
|
||||
mpathpersist multipathd: libmpathpersist
|
||||
+libmultipath mpathpersist multipath multipathd: libmpathcmd
|
||||
|
||||
DEPS_ON_MULTIPATH := \
|
||||
multipath \
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From 51f1f351262a31d94c10504e4d135526c6a7caeb Mon Sep 17 00:00:00 2001
|
||||
From: Wang Mingyu <wangmy@cn.fujitsu.com>
|
||||
Date: Sun, 10 May 2020 21:22:53 +0800
|
||||
Subject: [PATCH] fix bug of do_compile and do_install
|
||||
|
||||
when multiple processes make run in parallel,
|
||||
because of dependency error will occur.
|
||||
|
||||
Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
|
||||
|
||||
[OP: Rebase to 0.9.3]
|
||||
[OP: Drop dependencies that are already present in the 0.9.3 Makefile]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
Makefile | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 27b4641f..f195b570 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -79,6 +79,16 @@ libmpathpersist libmpathvalid multipath multipathd: libmultipath
|
||||
libmultipath/prioritizers libmultipath/checkers libmultipath/foreign: libmultipath
|
||||
mpathpersist multipathd: libmpathpersist
|
||||
|
||||
+DEPS_ON_MULTIPATH := \
|
||||
+ multipath \
|
||||
+ multipathd \
|
||||
+ mpathpersist \
|
||||
+ libmpathpersist
|
||||
+
|
||||
+$(DEPS_ON_MULTIPATH:=.install): libmultipath.install
|
||||
+mpathpersist.install: libmpathpersist.install
|
||||
+libdmmp.install libmultipath/foreign.install: mpathpersist.install
|
||||
+
|
||||
libmultipath/checkers.install \
|
||||
libmultipath/prioritizers.install \
|
||||
libmultipath/foreign.install: libmultipath.install
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From 9a941729d3c0d19d30d65e16b291c380e589eeb3 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Thu, 13 Apr 2017 07:22:23 -0500
|
||||
Subject: [PATCH] RH: fixup udev rules for redhat
|
||||
|
||||
The multipath rules need to run after scsi_id is run. This means moving
|
||||
them after 60-persistent-storage.rules for redhat. Redhat also uses a
|
||||
different naming scheme for partitions than SuSE. Also, there are some
|
||||
false warnings that gcc throws because of the changed options. Fix these
|
||||
too.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Update patch to 0.8.0
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
Makefile.inc | 2 +-
|
||||
kpartx/kpartx.rules | 2 +-
|
||||
multipath/Makefile | 4 ++--
|
||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 4d843ce5..57779fd8 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -81,7 +81,7 @@ endif
|
||||
prefix =
|
||||
exec_prefix = $(prefix)
|
||||
usr_prefix = $(prefix)
|
||||
-bindir = $(exec_prefix)/sbin
|
||||
+bindir = $(exec_prefix)/usr/sbin
|
||||
libudevdir = $(prefix)/$(SYSTEMDPATH)/udev
|
||||
tmpfilesdir = $(prefix)/$(SYSTEMDPATH)/tmpfiles.d
|
||||
udevrulesdir = $(libudevdir)/rules.d
|
||||
diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules
|
||||
index 1969dee0..d2b28233 100644
|
||||
--- a/kpartx/kpartx.rules
|
||||
+++ b/kpartx/kpartx.rules
|
||||
@@ -39,6 +39,6 @@ LABEL="mpath_kpartx_end"
|
||||
GOTO="kpartx_end"
|
||||
|
||||
LABEL="run_kpartx"
|
||||
-RUN+="/sbin/kpartx -un -p -part /dev/$name"
|
||||
+RUN+="/sbin/kpartx -un /dev/$name"
|
||||
|
||||
LABEL="kpartx_end"
|
||||
diff --git a/multipath/Makefile b/multipath/Makefile
|
||||
index 116348e2..8482de6a 100644
|
||||
--- a/multipath/Makefile
|
||||
+++ b/multipath/Makefile
|
||||
@@ -23,7 +23,7 @@ install:
|
||||
$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
|
||||
$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
|
||||
$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
|
||||
- $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)$(udevrulesdir)/56-multipath.rules
|
||||
+ $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)$(udevrulesdir)/62-multipath.rules
|
||||
$(INSTALL_PROGRAM) -d $(DESTDIR)$(modulesloaddir)
|
||||
$(INSTALL_PROGRAM) -m 644 modules-load.conf $(DESTDIR)$(modulesloaddir)/multipath.conf
|
||||
$(INSTALL_PROGRAM) -d $(DESTDIR)$(tmpfilesdir)
|
||||
@@ -43,7 +43,7 @@ uninstall:
|
||||
$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules
|
||||
$(RM) $(DESTDIR)$(modulesloaddir)/multipath.conf
|
||||
$(RM) $(DESTDIR)$(modulesloaddir)/scsi_dh.conf
|
||||
- $(RM) $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules
|
||||
+ $(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules
|
||||
$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8
|
||||
$(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5
|
||||
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17
|
||||
00:00:00 2001 From:Benjamin Marzinski <bmarzins@redhat.com> Date: Wed, 2 Jul
|
||||
2014 12:49:53 -0500 Subject: [PATCH] RH: Remove the property blacklist
|
||||
exception builtin
|
||||
|
||||
Multipath set the default property blacklist exceptions to
|
||||
(ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal
|
||||
devices. These devices may never have multiple paths, but it is nice
|
||||
to be able to set multipath up on them all the same. This patch simply
|
||||
removes the default, and makes it so that if no property
|
||||
blacklist_exception is given, then devices aren't failed for not matching
|
||||
it.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Upsteam-Status: Pending
|
||||
|
||||
Update patch to 0.8.2
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
libmultipath/blacklist.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
|
||||
index 8d15d2ea..820b0d68 100644
|
||||
--- a/libmultipath/blacklist.c
|
||||
+++ b/libmultipath/blacklist.c
|
||||
@@ -198,9 +198,6 @@ setup_default_blist (struct config * conf)
|
||||
struct hwentry *hwe;
|
||||
int i;
|
||||
|
||||
- if (store_ble(conf->blist_devnode, "!^(sd[a-z]|dasd[a-z]|nvme[0-9])", ORIGIN_DEFAULT))
|
||||
- return 1;
|
||||
-
|
||||
if (store_ble(conf->elist_property, "(SCSI_IDENT_|ID_WWN)", ORIGIN_DEFAULT))
|
||||
return 1;
|
||||
|
||||
@@ -435,8 +432,11 @@ filter_property(const struct config *conf, struct udev_device *udev,
|
||||
r = MATCH_NOTHING;
|
||||
}
|
||||
|
||||
- log_filter(devname, NULL, NULL, NULL, env, NULL, r, lvl);
|
||||
- return r;
|
||||
+ if (VECTOR_SIZE(conf->elist_property)) {
|
||||
+ log_filter(devname, NULL, NULL, NULL, env, NULL, r, lvl);
|
||||
+ return r;
|
||||
+ }
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static void free_ble(struct blentry *ble)
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
From 056fdaece0f1a3a5ca92e8c08912730faa89875d Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Fri, 23 Nov 2018 17:25:15 +0800
|
||||
Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17
|
||||
00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Wed, 15
|
||||
Oct 2014 10:39:30 -0500 Subject: [PATCH] RH: don't start without a config
|
||||
file
|
||||
|
||||
If /etc/multipath.conf doesn't exist, don't start multipathd and blacklist
|
||||
all devices when running multipath. A completely blank configuration file
|
||||
is almost never what users want. Also, people may have the multipath
|
||||
packages installed but don't want to use them. This patch provides a
|
||||
simple way to disable multipath. Simply removing or renaming
|
||||
/etc/multipath.conf will keep multipath from doing anything.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
update this patch to new version
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
libmultipath/config.c | 18 ++++++++++++++++++
|
||||
libmultipath/config.h | 1 +
|
||||
multipath/multipath.rules.in | 1 +
|
||||
multipathd/multipathd.8 | 2 ++
|
||||
multipathd/multipathd.service | 1 +
|
||||
5 files changed, 23 insertions(+)
|
||||
|
||||
diff --git a/libmultipath/config.c b/libmultipath/config.c
|
||||
index 5c5c0726..31894810 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "mpath_cmd.h"
|
||||
#include "propsel.h"
|
||||
#include "foreign.h"
|
||||
+#include "version.h"
|
||||
|
||||
/*
|
||||
* We don't support re-initialization after
|
||||
@@ -966,6 +967,23 @@ int _init_config (const char *file, struct config *conf)
|
||||
}
|
||||
factorize_hwtable(conf->hwtable, builtin_hwtable_size, file);
|
||||
validate_pctable(conf->overrides, 0, file);
|
||||
+ } else {
|
||||
+ condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices.");
|
||||
+ if (conf->blist_devnode == NULL) {
|
||||
+ conf->blist_devnode = vector_alloc();
|
||||
+ if (!conf->blist_devnode) {
|
||||
+ conf->blist_devnode = vector_alloc();
|
||||
+ if (!conf->blist_devnode) {
|
||||
+ condlog(0, "cannot allocate blacklist\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ if (store_ble(conf->blist_devnode, strdup(".*"),
|
||||
+ ORIGIN_NO_CONFIG)) {
|
||||
+ condlog(0, "cannot store default no-config blacklist\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
conf->processed_main_config = 1;
|
||||
diff --git a/libmultipath/config.h b/libmultipath/config.h
|
||||
index 87947469..0dc89c16 100644
|
||||
--- a/libmultipath/config.h
|
||||
+++ b/libmultipath/config.h
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#define ORIGIN_DEFAULT 0
|
||||
#define ORIGIN_CONFIG 1
|
||||
+#define ORIGIN_NO_CONFIG 2
|
||||
|
||||
enum devtypes {
|
||||
DEV_NONE,
|
||||
diff --git a/multipath/multipath.rules.in b/multipath/multipath.rules.in
|
||||
index 8d3cf33a..5c4447a2 100644
|
||||
--- a/multipath/multipath.rules.in
|
||||
+++ b/multipath/multipath.rules.in
|
||||
@@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath"
|
||||
ENV{nompath}=="?*", GOTO="end_mpath"
|
||||
IMPORT{cmdline}="multipath"
|
||||
ENV{multipath}=="off", GOTO="end_mpath"
|
||||
+TEST!="/etc/multipath.conf", GOTO="end_mpath"
|
||||
|
||||
ENV{DEVTYPE}!="partition", GOTO="test_dev"
|
||||
IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH"
|
||||
diff --git a/multipathd/multipathd.8 b/multipathd/multipathd.8
|
||||
index bdf102eb..a16a0bd5 100644
|
||||
--- a/multipathd/multipathd.8
|
||||
+++ b/multipathd/multipathd.8
|
||||
@@ -48,6 +48,8 @@ map regains its maximum performance and redundancy.
|
||||
With the \fB-k\fR option, \fBmultipathd\fR acts as a client utility that
|
||||
sends commands to a running instance of the multipathd daemon (see
|
||||
\fBCOMMANDS\fR below).
|
||||
+
|
||||
+In this Linux distribution, multipathd does not run unless a /etc/multipath.conf file exists.
|
||||
.
|
||||
.
|
||||
.\" ----------------------------------------------------------------------------
|
||||
diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service
|
||||
index aec62dbb..ab7585de 100644
|
||||
--- a/multipathd/multipathd.service
|
||||
+++ b/multipathd/multipathd.service
|
||||
@@ -5,6 +5,7 @@ Before=local-fs-pre.target blk-availability.service shutdown.target
|
||||
Wants=systemd-udevd-kernel.socket
|
||||
After=systemd-udevd-kernel.socket
|
||||
After=multipathd.socket systemd-remount-fs.service
|
||||
+ConditionPathExists=/etc/multipath.conf
|
||||
Before=initrd-cleanup.service
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From cc38276a5d3926fd96e58366e15ba887d7d02ed0 Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Mon, 26 Nov 2018 09:19:17 +0800
|
||||
Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep
|
||||
|
||||
17
|
||||
00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Wed,
|
||||
19
|
||||
Apr 2017 06:10:01 -0500 Subject: [PATCH] RH: use rpm optflags if
|
||||
present
|
||||
|
||||
Use the passed in optflags when compiling as an RPM, and keep the
|
||||
default flags as close as possible to the current fedora flags, while
|
||||
still being generic.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
update this patch to new version
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
Makefile.inc | 28 ++++++++++++++++++----------
|
||||
1 file changed, 18 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 57779fd8..34f2cc6d 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -140,20 +140,28 @@ FORTIFY_OPT := $(shell \
|
||||
echo "-D_FORTIFY_SOURCE=2"; \
|
||||
fi)
|
||||
|
||||
-STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector)
|
||||
-ERROR_DISCARDED_QUALIFIERS := $(call TEST_CC_OPTION,-Werror=discarded-qualifiers,)
|
||||
-WNOCLOBBERED := $(call TEST_CC_OPTION,-Wno-clobbered -Wno-error=clobbered,)
|
||||
-WFORMATOVERFLOW := $(call TEST_CC_OPTION,-Wformat-overflow=2,)
|
||||
-
|
||||
-OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4
|
||||
-WARNFLAGS := -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implicit-int \
|
||||
- -Werror=implicit-function-declaration -Werror=format-security \
|
||||
- $(WNOCLOBBERED) -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS)
|
||||
+ifndef RPM_OPT_FLAGS
|
||||
+ STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector)
|
||||
+ OPTFLAGS = -O2 -g -pipe -Wall -Werror=format-security \
|
||||
+ -Wp,-D_FORTIFY_SOURCE=2 -fexceptions \
|
||||
+ $(STACKPROT) --param=ssp-buffer-size=4 \
|
||||
+ -grecord-gcc-switches
|
||||
+ ifeq ($(shell test -f /usr/lib/rpm/redhat/redhat-hardened-cc1 && echo 1),1)
|
||||
+ OPTFLAGS += -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
|
||||
+ endif
|
||||
+else
|
||||
+ OPTFLAGS = $(RPM_OPT_FLAGS)
|
||||
+endif
|
||||
+OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 -Werror=implicit-int \
|
||||
+ -Werror=implicit-function-declaration -Wno-sign-compare \
|
||||
+ -Wno-unused-parameter -Werror=cast-qual \
|
||||
+ -Werror=discarded-qualifiers
|
||||
+
|
||||
CPPFLAGS := $(FORTIFY_OPT) \
|
||||
-DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(plugindir)\" -DRUN_DIR=\"${RUN}\" \
|
||||
-DRUNTIME_DIR=\"$(runtimedir)\" \
|
||||
-DCONFIG_DIR=\"$(configdir)\" -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
|
||||
-CFLAGS := --std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe
|
||||
+CFLAGS := --std=gnu99 $(CFLAGS) $(OPTFLAGS) -pipe
|
||||
BIN_CFLAGS = -fPIE -DPIE
|
||||
LIB_CFLAGS = -fPIC
|
||||
SHARED_FLAGS = -shared
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,655 @@
|
||||
From b0b4cca566e3e0c3a232b3754555c41d4e0c1273 Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Mon, 26 Nov 2018 09:55:12 +0800
|
||||
Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17
|
||||
00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Thu, 16
|
||||
Oct 2014 15:49:01 -0500 Subject: [PATCH] RH: add mpathconf
|
||||
|
||||
mpathconf is a program (largely based on lvmcomf) to help users
|
||||
configure /etc/multipath.conf and enable or disable multipathing. It
|
||||
has a couple of built-in options that can be set directly from the
|
||||
command line. But, mostly it is used to get a multipath.conf file
|
||||
with the OS defaults, and to enable and disable multipathing via
|
||||
a single command.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
update this patch to new version
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
libmultipath/config.c | 1 +
|
||||
multipath/Makefile | 4 +
|
||||
multipath/mpathconf | 464 ++++++++++++++++++++++++++++++++++++++++++
|
||||
multipath/mpathconf.8 | 101 +++++++++
|
||||
4 files changed, 570 insertions(+)
|
||||
create mode 100644 multipath/mpathconf
|
||||
create mode 100644 multipath/mpathconf.8
|
||||
|
||||
diff --git a/libmultipath/config.c b/libmultipath/config.c
|
||||
index 31894810..af59dd3c 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -969,6 +969,7 @@ int _init_config (const char *file, struct config *conf)
|
||||
validate_pctable(conf->overrides, 0, file);
|
||||
} else {
|
||||
condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices.");
|
||||
+ condlog(0, "You can run /sbin/mpathconf to create or modify /etc/multipath.conf");
|
||||
if (conf->blist_devnode == NULL) {
|
||||
conf->blist_devnode = vector_alloc();
|
||||
if (!conf->blist_devnode) {
|
||||
diff --git a/multipath/Makefile b/multipath/Makefile
|
||||
index 8482de6a..780b1b73 100644
|
||||
--- a/multipath/Makefile
|
||||
+++ b/multipath/Makefile
|
||||
@@ -21,6 +21,7 @@ $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so
|
||||
install:
|
||||
$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
|
||||
$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
|
||||
+ $(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/
|
||||
$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
|
||||
$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
|
||||
$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)$(udevrulesdir)/62-multipath.rules
|
||||
@@ -32,6 +33,7 @@ install:
|
||||
$(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(man8dir)
|
||||
$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
|
||||
$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5 $(DESTDIR)$(man5dir)
|
||||
+ $(INSTALL_PROGRAM) -m 644 mpathconf.8 $(DESTDIR)$(man8dir)
|
||||
ifneq ($(SCSI_DH_MODULES_PRELOAD),)
|
||||
$(INSTALL_PROGRAM) -m 644 scsi_dh.conf $(DESTDIR)$(modulesloaddir)/scsi_dh.conf
|
||||
for _x in $(SCSI_DH_MODULES_PRELOAD); do echo "$$_x"; done \
|
||||
@@ -44,8 +46,10 @@ uninstall:
|
||||
$(RM) $(DESTDIR)$(modulesloaddir)/multipath.conf
|
||||
$(RM) $(DESTDIR)$(modulesloaddir)/scsi_dh.conf
|
||||
$(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules
|
||||
+ $(RM) $(DESTDIR)$(bindir)/mpathconf
|
||||
$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8
|
||||
$(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5
|
||||
+ $(RM) $(DESTDIR)$(man8dir)/mpathconf.8
|
||||
|
||||
clean: dep_clean
|
||||
$(RM) core *.o $(EXEC) multipath.rules tmpfiles.conf
|
||||
diff --git a/multipath/mpathconf b/multipath/mpathconf
|
||||
new file mode 100644
|
||||
index 00000000..e8391347
|
||||
--- /dev/null
|
||||
+++ b/multipath/mpathconf
|
||||
@@ -0,0 +1,464 @@
|
||||
+#!/bin/bash
|
||||
+#
|
||||
+# Copyright (C) 2010 Red Hat, Inc. All rights reserved.
|
||||
+#
|
||||
+# This file is part of the device-mapper-multipath package.
|
||||
+#
|
||||
+# This copyrighted material is made available to anyone wishing to use,
|
||||
+# modify, copy, or redistribute it subject to the terms and conditions
|
||||
+# of the GNU General Public License v.2.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software Foundation,
|
||||
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+
|
||||
+#
|
||||
+# Simple editting of /etc/multipath.conf
|
||||
+# This program was largely ripped off from lvmconf
|
||||
+#
|
||||
+
|
||||
+unset ENABLE FIND FRIENDLY MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST
|
||||
+
|
||||
+DEFAULT_CONFIG="# device-mapper-multipath configuration file
|
||||
+
|
||||
+# For a complete list of the default configuration values, run either:
|
||||
+# # multipath -t
|
||||
+# or
|
||||
+# # multipathd show config
|
||||
+
|
||||
+# For a list of configuration options with descriptions, see the
|
||||
+# multipath.conf man page.
|
||||
+
|
||||
+defaults {
|
||||
+ user_friendly_names yes
|
||||
+ find_multipaths yes
|
||||
+}
|
||||
+
|
||||
+blacklist_exceptions {
|
||||
+ property \"(SCSI_IDENT_|ID_WWN)\"
|
||||
+}"
|
||||
+
|
||||
+CONFIGFILE="/etc/multipath.conf"
|
||||
+OUTPUTFILE="/etc/multipath.conf"
|
||||
+MULTIPATHDIR="/etc/multipath"
|
||||
+TMPFILE="/etc/multipath/.multipath.conf.tmp"
|
||||
+WWIDS=0
|
||||
+
|
||||
+function usage
|
||||
+{
|
||||
+ echo "usage: $0 <command>"
|
||||
+ echo ""
|
||||
+ echo "Commands:"
|
||||
+ echo "Enable: --enable "
|
||||
+ echo "Disable: --disable"
|
||||
+ echo "Only allow certain wwids (instead of enable): --allow <WWID>"
|
||||
+ echo "Set user_friendly_names (Default y): --user_friendly_names <y|n>"
|
||||
+ echo "Set find_multipaths (Default y): --find_multipaths <y|n>"
|
||||
+ echo "Load the dm-multipath modules on enable (Default y): --with_module <y|n>"
|
||||
+ echo "start/stop/reload multipathd (Default n): --with_multipathd <y|n>"
|
||||
+ echo "select output file (Default /etc/multipath.conf): --outfile <FILE>"
|
||||
+ echo ""
|
||||
+}
|
||||
+
|
||||
+function add_wwid
|
||||
+{
|
||||
+ INDEX=0
|
||||
+ while [ "$INDEX" -lt "$WWIDS" ] ; do
|
||||
+ if [ "$1" = "${WWID_LIST[$INDEX]}" ] ; then
|
||||
+ return
|
||||
+ fi
|
||||
+ ((INDEX++))
|
||||
+ done
|
||||
+ WWID_LIST[$WWIDS]="$1"
|
||||
+ ((WWIDS++))
|
||||
+}
|
||||
+
|
||||
+function get_dm_deps
|
||||
+{
|
||||
+ shift 3
|
||||
+ while [ -n "$1" -a -n "$2" ]; do
|
||||
+ MAJOR=$(echo $1 | tr -d '(,')
|
||||
+ MINOR=$(echo $2 | tr -d ')')
|
||||
+ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null`
|
||||
+ if [ -n "$UUID" ] ; then
|
||||
+ set_dm_wwid $UUID
|
||||
+ fi
|
||||
+ shift 2
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+function set_dm_wwid
|
||||
+{
|
||||
+ if [[ "$1" =~ ^part[[:digit:]]+-mpath- ]] ; then
|
||||
+ add_wwid "${1##part*-mpath-}"
|
||||
+ elif [[ "$1" =~ ^mpath- ]] ; then
|
||||
+ add_wwid "${1##mpath-}"
|
||||
+ else
|
||||
+ get_dm_deps `dmsetup deps -u $1`
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+function set_wwid
|
||||
+{
|
||||
+ UUID=""
|
||||
+ if [[ "$1" =~ ^[[:digit:]]+:[[:digit:]]+$ ]] ; then
|
||||
+ MAJOR=${1%%:*}
|
||||
+ MINOR=${1##*:}
|
||||
+ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null`
|
||||
+ else
|
||||
+ UUID=`dmsetup info -c --noheadings -o uuid $1 2> /dev/null`
|
||||
+ fi
|
||||
+ if [ -n "$UUID" ] ; then
|
||||
+ set_dm_wwid $UUID
|
||||
+ else
|
||||
+ add_wwid "$1"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+function parse_args
|
||||
+{
|
||||
+ while [ -n "$1" ]; do
|
||||
+ case $1 in
|
||||
+ --enable)
|
||||
+ ENABLE=1
|
||||
+ shift
|
||||
+ ;;
|
||||
+ --disable)
|
||||
+ ENABLE=0
|
||||
+ shift
|
||||
+ ;;
|
||||
+ --allow)
|
||||
+ ENABLE=2
|
||||
+ if [ -n "$2" ]; then
|
||||
+ set_wwid $2
|
||||
+ shift 2
|
||||
+ else
|
||||
+ usage
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ ;;
|
||||
+ --user_friendly_names)
|
||||
+ if [ -n "$2" ]; then
|
||||
+ FRIENDLY=$2
|
||||
+ shift 2
|
||||
+ else
|
||||
+ usage
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ ;;
|
||||
+ --find_multipaths)
|
||||
+ if [ -n "$2" ]; then
|
||||
+ FIND=$2
|
||||
+ shift 2
|
||||
+ else
|
||||
+ usage
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ ;;
|
||||
+ --with_module)
|
||||
+ if [ -n "$2" ]; then
|
||||
+ MODULE=$2
|
||||
+ shift 2
|
||||
+ else
|
||||
+ usage
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ ;;
|
||||
+ --with_multipathd)
|
||||
+ if [ -n "$2" ]; then
|
||||
+ MULTIPATHD=$2
|
||||
+ shift 2
|
||||
+ else
|
||||
+ usage
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ ;;
|
||||
+ --outfile)
|
||||
+ if [ -n "$2" ]; then
|
||||
+ OUTPUTFILE=$2
|
||||
+ HAVE_OUTFILE=1
|
||||
+ shift 2
|
||||
+ else
|
||||
+ usage
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ ;;
|
||||
+ *)
|
||||
+ usage
|
||||
+ exit
|
||||
+ esac
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+function validate_args
|
||||
+{
|
||||
+ if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$MODULE" ]; then
|
||||
+ echo "ignoring extra parameters on disable"
|
||||
+ FRIENDLY=""
|
||||
+ FIND=""
|
||||
+ MODULE=""
|
||||
+ fi
|
||||
+ if [ -n "$FRIENDLY" ] && [ "$FRIENDLY" != "y" -a "$FRIENDLY" != "n" ]; then
|
||||
+ echo "--user_friendly_names must be either 'y' or 'n'"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ if [ -n "$FIND" ] && [ "$FIND" != "y" -a "$FIND" != "n" ]; then
|
||||
+ echo "--find_multipaths must be either 'y' or 'n'"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" ]; then
|
||||
+ SHOW_STATUS=1
|
||||
+ fi
|
||||
+ if [ -n "$MODULE" ] && [ "$MODULE" != "y" -a "$MODULE" != "n" ]; then
|
||||
+ echo "--with_module must be either 'y' or 'n'"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ if [ -n "$MULTIPATHD" ] && [ "$MULTIPATHD" != "y" -a "$MULTIPATHD" != "n" ]; then
|
||||
+ echo "--with_multipathd must be either 'y' or 'n'"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ if [ "$ENABLE" = 2 -a -z "$HAVE_OUTFILE" ]; then
|
||||
+ echo "Because --allow makes changes that cannot be automatically reversed,"
|
||||
+ echo "you must set --outfile when you set --allow"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+function add_blacklist_exceptions
|
||||
+{
|
||||
+ INDEX=0
|
||||
+ while [ "$INDEX" -lt "$WWIDS" ] ; do
|
||||
+ sed -i '/^blacklist_exceptions[[:space:]]*{/ a\
|
||||
+ wwid '"\"${WWID_LIST[$INDEX]}\""'
|
||||
+' $TMPFILE
|
||||
+ ((INDEX++))
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+umask 0077
|
||||
+
|
||||
+parse_args "$@"
|
||||
+
|
||||
+validate_args
|
||||
+
|
||||
+if [ ! -d "$MULTIPATHDIR" ]; then
|
||||
+ echo "/etc/multipath/ does not exist. failing"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+rm $TMPFILE 2> /dev/null
|
||||
+echo "$DEFAULT_CONFIG" > $TMPFILE
|
||||
+if [ -f "$CONFIGFILE" ]; then
|
||||
+ cp $CONFIGFILE $TMPFILE
|
||||
+fi
|
||||
+
|
||||
+if grep -q "^blacklist[[:space:]]*{" $TMPFILE ; then
|
||||
+ HAVE_BLACKLIST=1
|
||||
+fi
|
||||
+
|
||||
+if grep -q "^blacklist_exceptions[[:space:]]*{" $TMPFILE ; then
|
||||
+ HAVE_EXCEPTIONS=1
|
||||
+fi
|
||||
+
|
||||
+if grep -q "^defaults[[:space:]]*{" $TMPFILE ; then
|
||||
+ HAVE_DEFAULTS=1
|
||||
+fi
|
||||
+
|
||||
+if [ -z "$MODULE" -o "$MODULE" = "y" ]; then
|
||||
+ if lsmod | grep -q "dm_multipath" ; then
|
||||
+ HAVE_MODULE=1
|
||||
+ else
|
||||
+ HAVE_MODULE=0
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ "$MULTIPATHD" = "y" ]; then
|
||||
+ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then
|
||||
+ HAVE_MULTIPATHD=1
|
||||
+ else
|
||||
+ HAVE_MULTIPATHD=0
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ "$HAVE_BLACKLIST" = "1" ]; then
|
||||
+ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*devnode \"\.\?\*\"" ; then
|
||||
+ HAVE_DISABLE=1
|
||||
+ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*devnode \"\.\?\*\"" ; then
|
||||
+ HAVE_DISABLE=0
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ "$HAVE_BLACKLIST" = "1" ]; then
|
||||
+ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*wwid \"\.\?\*\"" ; then
|
||||
+ HAVE_WWID_DISABLE=1
|
||||
+ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"" ; then
|
||||
+ HAVE_WWID_DISABLE=0
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ "$HAVE_DEFAULTS" = "1" ]; then
|
||||
+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*find_multipaths[[:space:]]*\(yes\|1\)" ; then
|
||||
+ HAVE_FIND=1
|
||||
+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*find_multipaths[[:space:]]*\(no\|0\)" ; then
|
||||
+ HAVE_FIND=0
|
||||
+ fi
|
||||
+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]]*\(yes\|1\)" ; then
|
||||
+ HAVE_FRIENDLY=1
|
||||
+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]]*\(no\|0\)" ; then
|
||||
+ HAVE_FRIENDLY=0
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ -n "$SHOW_STATUS" ]; then
|
||||
+ if [ -z "$HAVE_DISABLE" -o "$HAVE_DISABLE" = 0 ]; then
|
||||
+ echo "multipath is enabled"
|
||||
+ else
|
||||
+ echo "multipath is disabled"
|
||||
+ fi
|
||||
+ if [ -z "$HAVE_FIND" -o "$HAVE_FIND" = 0 ]; then
|
||||
+ echo "find_multipaths is disabled"
|
||||
+ else
|
||||
+ echo "find_multipaths is enabled"
|
||||
+ fi
|
||||
+ if [ -z "$HAVE_FRIENDLY" -o "$HAVE_FRIENDLY" = 0 ]; then
|
||||
+ echo "user_friendly_names is disabled"
|
||||
+ else
|
||||
+ echo "user_friendly_names is enabled"
|
||||
+ fi
|
||||
+ if [ -n "$HAVE_MODULE" ]; then
|
||||
+ if [ "$HAVE_MODULE" = 1 ]; then
|
||||
+ echo "dm_multipath module is loaded"
|
||||
+ else
|
||||
+ echo "dm_multipath module is not loaded"
|
||||
+ fi
|
||||
+ fi
|
||||
+ if [ -z "$HAVE_MULTIPATHD" ]; then
|
||||
+ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then
|
||||
+ HAVE_MULTIPATHD=1
|
||||
+ else
|
||||
+ HAVE_MULTIPATHD=0
|
||||
+ fi
|
||||
+ fi
|
||||
+ if [ "$HAVE_MULTIPATHD" = 1 ]; then
|
||||
+ echo "multipathd is running"
|
||||
+ else
|
||||
+ echo "multipathd is not running"
|
||||
+ fi
|
||||
+ exit 0
|
||||
+fi
|
||||
+
|
||||
+if [ -z "$HAVE_BLACKLIST" ]; then
|
||||
+ cat >> $TMPFILE <<- _EOF_
|
||||
+
|
||||
+blacklist {
|
||||
+}
|
||||
+_EOF_
|
||||
+fi
|
||||
+
|
||||
+if [ -z "$HAVE_DEFAULTS" ]; then
|
||||
+ cat >> $TMPFILE <<- _EOF_
|
||||
+
|
||||
+defaults {
|
||||
+}
|
||||
+_EOF_
|
||||
+fi
|
||||
+
|
||||
+if [ "$ENABLE" = 2 ]; then
|
||||
+ if [ "$HAVE_DISABLE" = 1 ]; then
|
||||
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode \"\.\?\*\"/# devnode ".*"/' $TMPFILE
|
||||
+ fi
|
||||
+ if [ -z "$HAVE_WWID_DISABLE" ]; then
|
||||
+ sed -i '/^blacklist[[:space:]]*{/ a\
|
||||
+ wwid ".*"
|
||||
+' $TMPFILE
|
||||
+ elif [ "$HAVE_WWID_DISABLE" = 0 ]; then
|
||||
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"/ wwid ".*"/' $TMPFILE
|
||||
+ fi
|
||||
+ if [ "$HAVE_EXCEPTIONS" = 1 ]; then
|
||||
+ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ {/^[[:space:]]*wwid/ d}' $TMPFILE
|
||||
+ else
|
||||
+ cat >> $TMPFILE <<- _EOF_
|
||||
+
|
||||
+blacklist_exceptions {
|
||||
+}
|
||||
+_EOF_
|
||||
+ fi
|
||||
+ add_blacklist_exceptions
|
||||
+elif [ "$ENABLE" = 1 ]; then
|
||||
+ if [ "$HAVE_DISABLE" = 1 ]; then
|
||||
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode \"\.\?\*\"/# devnode ".*"/' $TMPFILE
|
||||
+ fi
|
||||
+elif [ "$ENABLE" = 0 ]; then
|
||||
+ if [ -z "$HAVE_DISABLE" ]; then
|
||||
+ sed -i '/^blacklist[[:space:]]*{/ a\
|
||||
+ devnode ".*"
|
||||
+' $TMPFILE
|
||||
+ elif [ "$HAVE_DISABLE" = 0 ]; then
|
||||
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*devnode \"\.\?\*\"/ devnode ".*"/' $TMPFILE
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ "$FIND" = "n" ]; then
|
||||
+ if [ "$HAVE_FIND" = 1 ]; then
|
||||
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*find_multipaths[[:space:]]*\(yes\|1\)/ find_multipaths no/' $TMPFILE
|
||||
+ CHANGED_CONFIG=1
|
||||
+ fi
|
||||
+elif [ "$FIND" = "y" ]; then
|
||||
+ if [ -z "$HAVE_FIND" ]; then
|
||||
+ sed -i '/^defaults[[:space:]]*{/ a\
|
||||
+ find_multipaths yes
|
||||
+' $TMPFILE
|
||||
+ CHANGED_CONFIG=1
|
||||
+ elif [ "$HAVE_FIND" = 0 ]; then
|
||||
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*find_multipaths[[:space:]]*\(no\|0\)/ find_multipaths yes/' $TMPFILE
|
||||
+ CHANGED_CONFIG=1
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ "$FRIENDLY" = "n" ]; then
|
||||
+ if [ "$HAVE_FRIENDLY" = 1 ]; then
|
||||
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]]*\(yes\|1\)/ user_friendly_names no/' $TMPFILE
|
||||
+ CHANGED_CONFIG=1
|
||||
+ fi
|
||||
+elif [ "$FRIENDLY" = "y" ]; then
|
||||
+ if [ -z "$HAVE_FRIENDLY" ]; then
|
||||
+ sed -i '/^defaults[[:space:]]*{/ a\
|
||||
+ user_friendly_names yes
|
||||
+' $TMPFILE
|
||||
+ CHANGED_CONFIG=1
|
||||
+ elif [ "$HAVE_FRIENDLY" = 0 ]; then
|
||||
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]]*\(no\|0\)/ user_friendly_names yes/' $TMPFILE
|
||||
+ CHANGED_CONFIG=1
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ -f "$OUTPUTFILE" ]; then
|
||||
+ cp $OUTPUTFILE $OUTPUTFILE.old
|
||||
+ if [ $? != 0 ]; then
|
||||
+ echo "failed to backup old config file, $OUTPUTFILE not updated"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+cp $TMPFILE $OUTPUTFILE
|
||||
+if [ $? != 0 ]; then
|
||||
+ echo "failed to copy new config file into place, check $OUTPUTFILE is still OK"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+rm -f $TMPFILE
|
||||
+
|
||||
+if [ "$ENABLE" = 1 ]; then
|
||||
+ if [ "$HAVE_MODULE" = 0 ]; then
|
||||
+ modprobe dm_multipath
|
||||
+ fi
|
||||
+ if [ "$HAVE_MULTIPATHD" = 0 ]; then
|
||||
+ systemctl start multipathd.service
|
||||
+ fi
|
||||
+elif [ "$ENABLE" = 0 ]; then
|
||||
+ if [ "$HAVE_MULTIPATHD" = 1 ]; then
|
||||
+ systemctl stop multipathd.service
|
||||
+ fi
|
||||
+elif [ -n "$CHANGED_CONFIG" -a "$HAVE_MULTIPATHD" = 1 ]; then
|
||||
+ systemctl reload multipathd.service
|
||||
+fi
|
||||
diff --git a/multipath/mpathconf.8 b/multipath/mpathconf.8
|
||||
new file mode 100644
|
||||
index 00000000..4cd32672
|
||||
--- /dev/null
|
||||
+++ b/multipath/mpathconf.8
|
||||
@@ -0,0 +1,101 @@
|
||||
+.TH MPATHCONF 8 "June 2010" "" "Linux Administrator's Manual"
|
||||
+.SH NAME
|
||||
+mpathconf - A tool for configuring device-mapper-multipath
|
||||
+.SH SYNOPSIS
|
||||
+.B mpathconf
|
||||
+.RB [\| commands \|]
|
||||
+.RB [\| options \|]
|
||||
+.SH DESCRIPTION
|
||||
+.B mpathconf
|
||||
+is a utility that creates or modifies
|
||||
+.B /etc/multipath.conf.
|
||||
+It can enable or disable multipathing and configure some common options.
|
||||
+.B mpathconf
|
||||
+can also load the
|
||||
+.B dm_multipath
|
||||
+module, start and stop the
|
||||
+.B multipathd
|
||||
+daemon, and configure the
|
||||
+.B multipathd
|
||||
+service to start automatically or not. If
|
||||
+.B mpathconf
|
||||
+is called with no commands, it will display the current configuration.
|
||||
+
|
||||
+The default options for mpathconf are
|
||||
+.B --with_module
|
||||
+The
|
||||
+.B --with_multipathd
|
||||
+option is not set by default. Enabling multipathing will load the
|
||||
+.B dm_multipath
|
||||
+module but it will not immediately start it. This is so
|
||||
+that users can manually edit their config file if necessary, before starting
|
||||
+.B multipathd.
|
||||
+
|
||||
+If
|
||||
+.B /etc/multipath.conf
|
||||
+already exists, mpathconf will edit it. If it does not exist, mpathconf will
|
||||
+create a default file with
|
||||
+.B user_friendly_names
|
||||
+and
|
||||
+.B find_multipaths
|
||||
+set. To disable these, use the
|
||||
+.B --user_friendly_names n
|
||||
+and
|
||||
+.B --find_multipaths n
|
||||
+options
|
||||
+.SH COMMANDS
|
||||
+.TP
|
||||
+.B --enable
|
||||
+Removes any line that blacklists all device nodes from the
|
||||
+.B /etc/multipath.conf
|
||||
+blacklist section.
|
||||
+.TP
|
||||
+.B --disable
|
||||
+Adds a line that blacklists all device nodes to the
|
||||
+.B /etc/multipath.conf
|
||||
+blacklist section. If no blacklist section exists, it will create one.
|
||||
+.TP
|
||||
+.B --user_friendly_name \fP { \fBy\fP | \fBn\fP }
|
||||
+If set to \fBy\fP, this adds the line
|
||||
+.B user_friendly_names yes
|
||||
+to the
|
||||
+.B /etc/multipath.conf
|
||||
+defaults section. If set to \fBn\fP, this removes the line, if present. This
|
||||
+command can be used along with any other command.
|
||||
+.TP
|
||||
+.B --find_multipaths\fP { \fBy\fP | \fBn\fP }
|
||||
+If set to \fBy\fP, this adds the line
|
||||
+.B find_multipaths yes
|
||||
+to the
|
||||
+.B /etc/multipath.conf
|
||||
+defaults section. If set to \fBn\fP, this removes the line, if present. This
|
||||
+command can be used aldong with any other command.
|
||||
+.SH OPTIONS
|
||||
+.TP
|
||||
+.B --with_module\fP { \fBy\fP | \fBn\fP }
|
||||
+If set to \fBy\fP, this runs
|
||||
+.B modprobe dm_multipath
|
||||
+to install the multipath modules. This option only works with the
|
||||
+.B --enable
|
||||
+command. This option is set to \fBy\fP by default.
|
||||
+.TP
|
||||
+.B --with_multipathd { \fBy\fP | \fBn\fP }
|
||||
+If set to \fBy\fP, this runs
|
||||
+.B service multipathd start
|
||||
+to start the multipathd daemon on \fB--enable\fP,
|
||||
+.B service multipathd stop
|
||||
+to stop the multipathd daemon on \fB--disable\fP, and
|
||||
+.B service multipathd reload
|
||||
+to reconfigure multipathd on \fB--user_frindly_names\fP and
|
||||
+\fB--find_multipaths\fP.
|
||||
+This option is set to \fBn\fP by default.
|
||||
+.SH FILES
|
||||
+.BR /etc/multipath.conf
|
||||
+.SH "SEE ALSO"
|
||||
+.BR multipath.conf (5),
|
||||
+.BR modprobe (8),
|
||||
+.BR multipath (8),
|
||||
+.BR multipathd (8),
|
||||
+.BR service (8),
|
||||
+.SH AUTHOR
|
||||
+Benjamin Marzinski <bmarzins@redhat.com>
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
From 262de33671ede81e424344ea9125d9e546cf8612 Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Thu, 26 Sep 2019 16:29:48 +0800
|
||||
Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep
|
||||
|
||||
17
|
||||
00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Fri,
|
||||
17
|
||||
Oct 2014 11:20:34 -0500 Subject: [PATCH] RH: add wwids from kernel
|
||||
cmdline
|
||||
mpath.wwids with -A
|
||||
|
||||
This patch adds another option to multipath, "-A", which reads
|
||||
/proc/cmdline for mpath.wwid=<WWID> options, and adds any wwids it finds
|
||||
to /etc/multipath/wwids. While this isn't usually important during
|
||||
normal operation, since these wwids should already be added, it can be
|
||||
helpful during installation, to make sure that multipath can claim
|
||||
devices as its own, before LVM or something else makes use of them. The
|
||||
patch also execs "/sbin/multipath -A" before running multipathd in
|
||||
multipathd.service
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Update this patch to new version 0.8.2
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
libmultipath/wwids.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
libmultipath/wwids.h | 1 +
|
||||
2 files changed, 45 insertions(+)
|
||||
|
||||
diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c
|
||||
index 89bb60ca..bab9aa85 100644
|
||||
--- a/libmultipath/wwids.c
|
||||
+++ b/libmultipath/wwids.c
|
||||
@@ -451,3 +451,47 @@ int unmark_failed_wwid(const char *wwid)
|
||||
print_failed_wwid_result("unmark_failed", wwid, r);
|
||||
return r;
|
||||
}
|
||||
+
|
||||
+int remember_cmdline_wwid(void)
|
||||
+{
|
||||
+ FILE *f = NULL;
|
||||
+ char buf[LINE_MAX], *next, *ptr;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ f = fopen("/proc/cmdline", "re");
|
||||
+ if (!f) {
|
||||
+ condlog(0, "can't open /proc/cmdline : %s", strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (!fgets(buf, sizeof(buf), f)) {
|
||||
+ if (ferror(f))
|
||||
+ condlog(0, "read of /proc/cmdline failed : %s",
|
||||
+ strerror(errno));
|
||||
+ else
|
||||
+ condlog(0, "couldn't read /proc/cmdline");
|
||||
+ fclose(f);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ fclose(f);
|
||||
+ next = buf;
|
||||
+ while((ptr = strstr(next, "mpath.wwid="))) {
|
||||
+ ptr += 11;
|
||||
+ next = strpbrk(ptr, " \t\n");
|
||||
+ if (next) {
|
||||
+ *next = '\0';
|
||||
+ next++;
|
||||
+ }
|
||||
+ if (strlen(ptr)) {
|
||||
+ if (remember_wwid(ptr) != 0)
|
||||
+ ret = -1;
|
||||
+ }
|
||||
+ else {
|
||||
+ condlog(0, "empty mpath.wwid kernel command line option");
|
||||
+ ret = -1;
|
||||
+ }
|
||||
+ if (!next)
|
||||
+ break;
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/libmultipath/wwids.h b/libmultipath/wwids.h
|
||||
index 0c6ee54d..e32a0b0e 100644
|
||||
--- a/libmultipath/wwids.h
|
||||
+++ b/libmultipath/wwids.h
|
||||
@@ -17,6 +17,7 @@ int remember_wwid(char *wwid);
|
||||
int check_wwids_file(char *wwid, int write_wwid);
|
||||
int remove_wwid(char *wwid);
|
||||
int replace_wwids(vector mp);
|
||||
+int remember_cmdline_wwid(void);
|
||||
|
||||
enum {
|
||||
WWID_IS_NOT_FAILED = 0,
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17
|
||||
00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Mon, 6 Nov
|
||||
2017 21:39:28 -0600 Subject: [PATCH] RH: warn on invalid regex instead of
|
||||
failing
|
||||
|
||||
multipath.conf used to allow "*" as a match everything regular expression,
|
||||
instead of requiring ".*". Instead of erroring when the old style
|
||||
regular expressions are used, it should print a warning and convert
|
||||
them.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
update this patch to 0.8.2
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
[OP: adjusted FREE() -> free(), made set_regex_value() static]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
libmultipath/dict.c | 42 +++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 35 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
|
||||
index aa93fe43..55a22d32 100644
|
||||
--- a/libmultipath/dict.c
|
||||
+++ b/libmultipath/dict.c
|
||||
@@ -155,6 +155,34 @@ set_str_noslash(vector strvec, void *ptr, const char *file, int line_nr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void *
|
||||
+set_regex_value(vector strvec)
|
||||
+{
|
||||
+ char *buff = set_value(strvec);
|
||||
+
|
||||
+ if (buff && strcmp("*", buff) == 0) {
|
||||
+ condlog(0, "Invalid regular expression \"*\" in multipath.conf. Using \".*\"");
|
||||
+ free(buff);
|
||||
+ return strdup(".*");
|
||||
+ }
|
||||
+ return buff;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+set_regex(vector strvec, void *ptr, const char *file, int line_nr)
|
||||
+{
|
||||
+ char **str_ptr = (char **)ptr;
|
||||
+
|
||||
+ if (*str_ptr)
|
||||
+ free(*str_ptr);
|
||||
+ *str_ptr = set_regex_value(strvec);
|
||||
+
|
||||
+ if (!*str_ptr)
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
set_yes_no(vector strvec, void *ptr, const char *file, int line_nr)
|
||||
{
|
||||
@@ -1679,8 +1707,8 @@ ble_ ## option ## _handler (struct config *conf, vector strvec, \
|
||||
\
|
||||
if (!conf->option) \
|
||||
return 1; \
|
||||
- \
|
||||
- buff = set_value(strvec); \
|
||||
+ \
|
||||
+ buff = set_regex_value(strvec); \
|
||||
if (!buff) \
|
||||
return 1; \
|
||||
\
|
||||
@@ -1700,7 +1728,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec, \
|
||||
if (!conf->option) \
|
||||
return 1; \
|
||||
\
|
||||
- buff = set_value(strvec); \
|
||||
+ buff = set_regex_value(strvec); \
|
||||
if (!buff) \
|
||||
return 1; \
|
||||
\
|
||||
@@ -1806,16 +1834,16 @@ device_handler(struct config *conf, vector strvec, const char *file,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-declare_hw_handler(vendor, set_str)
|
||||
+declare_hw_handler(vendor, set_regex)
|
||||
declare_hw_snprint(vendor, print_str)
|
||||
|
||||
-declare_hw_handler(product, set_str)
|
||||
+declare_hw_handler(product, set_regex)
|
||||
declare_hw_snprint(product, print_str)
|
||||
|
||||
-declare_hw_handler(revision, set_str)
|
||||
+declare_hw_handler(revision, set_regex)
|
||||
declare_hw_snprint(revision, print_str)
|
||||
|
||||
-declare_hw_handler(bl_product, set_str)
|
||||
+declare_hw_handler(bl_product, set_regex)
|
||||
declare_hw_snprint(bl_product, print_str)
|
||||
|
||||
declare_hw_handler(hwhandler, set_str)
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 16900150e02e5b367a8b33621b393975ad011130 Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Mon, 26 Nov 2018 11:12:01 +0800
|
||||
Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17
|
||||
00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Thu, 7 Jun
|
||||
2018 17:43:52 -0500 Subject: [PATCH] RH: reset default find_mutipaths value
|
||||
to off
|
||||
|
||||
Upstream has changed to default find_multipaths to "strict". For now
|
||||
Redhat will retain the previous default of "off".
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Update this patch to new version
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
---
|
||||
libmultipath/defaults.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
|
||||
index 6576939..a2404b2 100644
|
||||
--- a/libmultipath/defaults.h
|
||||
+++ b/libmultipath/defaults.h
|
||||
@@ -17,7 +17,7 @@
|
||||
#define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF
|
||||
#define DEFAULT_VERBOSITY 2
|
||||
#define DEFAULT_REASSIGN_MAPS 0
|
||||
-#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_STRICT
|
||||
+#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_OFF
|
||||
#define DEFAULT_FAST_IO_FAIL 5
|
||||
#define DEFAULT_DEV_LOSS_TMO 600
|
||||
#define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From d139474f2a6d87c1cd20dfbb916fe650bfcce968 Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Tue, 4 Jun 2019 11:39:39 +0800
|
||||
Subject: [PATCH] multipath-tools: modify Makefile.inc for cross-compilation
|
||||
|
||||
Do not look for systemd info on the host, and allow us to pass in CFLAGS
|
||||
using the OPTFLAGS variable.
|
||||
|
||||
Upstream-Status: Inappropriate [embedded specific]
|
||||
|
||||
Signed-off-by: Joe Slater <joe.slater@windriver.com>
|
||||
|
||||
Update for version 0.5.0-144-g770e6d0
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
Update for version 0.7.1
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
update for version 0.7.7
|
||||
|
||||
remove change about CFLAGS part, since patch 0024 already have similar function.
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
|
||||
update for version 0.8.1
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
Makefile.inc | 11 -----------
|
||||
1 file changed, 11 deletions(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 34f2cc6d..ee6a4c9f 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -42,17 +42,6 @@ ifndef RUN
|
||||
endif
|
||||
endif
|
||||
|
||||
-ifndef SYSTEMD
|
||||
- ifeq ($(shell $(PKGCONFIG) --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
|
||||
- SYSTEMD = $(shell $(PKGCONFIG) --modversion libsystemd | awk '{print $$1}')
|
||||
- else
|
||||
- ifeq ($(shell systemctl --version >/dev/null 2>&1 && echo 1), 1)
|
||||
- SYSTEMD = $(shell systemctl --version 2> /dev/null | \
|
||||
- sed -n 's/systemd \([0-9]*\).*/\1/p')
|
||||
- endif
|
||||
- endif
|
||||
-endif
|
||||
-
|
||||
ifndef SYSTEMDPATH
|
||||
SYSTEMDPATH=usr/lib
|
||||
endif
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
From f20d7651a62efff818ebd0d1bc920f6f362c890d Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Mon, 26 Nov 2018 11:17:41 +0800
|
||||
Subject: [PATCH] Subject: [PATCH] Always use devmapper
|
||||
|
||||
Do not try to compute several _API_ make variables
|
||||
from host information when cross-compiling.
|
||||
|
||||
Upstream-Status: Inappropriate [embedded specific]
|
||||
|
||||
Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
|
||||
Signed-off-by: Joe Slater <joe.slater@windriver.com>
|
||||
|
||||
Rebase to 0.7.1
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
Rebase to 0.7.7
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
|
||||
Rebase to 0.7.9
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
libmultipath/Makefile | 34 +++++++---------------------------
|
||||
1 file changed, 7 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/Makefile b/libmultipath/Makefile
|
||||
index 3b60a525..72aca7ca 100644
|
||||
--- a/libmultipath/Makefile
|
||||
+++ b/libmultipath/Makefile
|
||||
@@ -22,33 +22,13 @@ ifdef SYSTEMD
|
||||
endif
|
||||
endif
|
||||
|
||||
-ifneq ($(call check_func,dm_task_no_flush,$(DEVMAPPER_INCDIR)/libdevmapper.h),0)
|
||||
- CPPFLAGS += -DLIBDM_API_FLUSH
|
||||
-endif
|
||||
-
|
||||
-ifneq ($(call check_func,dm_task_get_errno,$(DEVMAPPER_INCDIR)/libdevmapper.h),0)
|
||||
- CPPFLAGS += -DLIBDM_API_GET_ERRNO
|
||||
-endif
|
||||
-
|
||||
-ifneq ($(call check_func,dm_task_set_cookie,$(DEVMAPPER_INCDIR)/libdevmapper.h),0)
|
||||
- CPPFLAGS += -DLIBDM_API_COOKIE
|
||||
-endif
|
||||
-
|
||||
-ifneq ($(call check_func,udev_monitor_set_receive_buffer_size,$(LIBUDEV_INCDIR)/libudev.h),0)
|
||||
- CPPFLAGS += -DLIBUDEV_API_RECVBUF
|
||||
-endif
|
||||
-
|
||||
-ifneq ($(call check_func,dm_task_deferred_remove,$(DEVMAPPER_INCDIR)/libdevmapper.h),0)
|
||||
- CPPFLAGS += -DLIBDM_API_DEFERRED
|
||||
-endif
|
||||
-
|
||||
-ifneq ($(call check_func,dm_hold_control_dev,$(DEVMAPPER_INCDIR)/libdevmapper.h),0)
|
||||
- CPPFLAGS += -DLIBDM_API_HOLD_CONTROL
|
||||
-endif
|
||||
-
|
||||
-ifneq ($(call check_var,ELS_DTAG_LNK_INTEGRITY,$(LINUX_HEADERS_INCDIR)/scsi/fc/fc_els.h),0)
|
||||
- CPPFLAGS += -DFPIN_EVENT_HANDLER
|
||||
-endif
|
||||
+CPPFLAGS += -DLIBDM_API_FLUSH
|
||||
+CPPFLAGS += -DLIBDM_API_GET_ERRNO
|
||||
+CPPFLAGS += -DLIBDM_API_COOKIE
|
||||
+CPPFLAGS += -DLIBUDEV_API_RECVBUF
|
||||
+CPPFLAGS += -DLIBDM_API_DEFERRED
|
||||
+CPPFLAGS += -DLIBDM_API_HOLD_CONTROL
|
||||
+CPPFLAGS += -DFPIN_EVENT_HANDLER
|
||||
|
||||
# object files referencing MULTIPATH_DIR or CONFIG_DIR
|
||||
# they need to be recompiled for unit tests
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From 820d2ef3596189041da43d1139da8689336bb918 Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Mon, 26 Nov 2018 11:19:45 +0800
|
||||
Subject: [PATCH] Subject: [PATCH] Always use devmapper for kpartx
|
||||
|
||||
Do not try to compute the LIBDM_API_COOKIE make variable
|
||||
from host information when cross-compiling.
|
||||
|
||||
Upstream-Status: Inappropriate [embedded specific]
|
||||
|
||||
Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
|
||||
Signed-off-by: Joe Slater <joe.slater@windriver.com>
|
||||
|
||||
Rebase to 0.7.1
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
Rebase to 0.7.7
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
|
||||
Rebase to 0.7.9
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
kpartx/Makefile | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kpartx/Makefile b/kpartx/Makefile
|
||||
index 742d3bcd..d886483d 100644
|
||||
--- a/kpartx/Makefile
|
||||
+++ b/kpartx/Makefile
|
||||
@@ -9,9 +9,7 @@ LDFLAGS += $(BIN_LDFLAGS)
|
||||
|
||||
LIBDEPS += -ldevmapper
|
||||
|
||||
-ifneq ($(call check_func,dm_task_set_cookie,$(DEVMAPPER_INCDIR)/libdevmapper.h),0)
|
||||
- CPPFLAGS += -DLIBDM_API_COOKIE
|
||||
-endif
|
||||
+CPPFLAGS += -DLIBDM_API_COOKIE
|
||||
|
||||
OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
|
||||
gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From 21a8680b7bd436867ac689a0b4b1b18a3359e208 Mon Sep 17 00:00:00 2001
|
||||
From: Geoff Parker <geoffrey.parker@arthrex.com>
|
||||
Date: Fri, 9 Oct 2020 17:48:47 +0000
|
||||
Subject: [PATCH] libdmmp/Makefile: replace perl with sed in install target to
|
||||
work with pseudo
|
||||
|
||||
The multipath-tools libdmmp/Makefile install target uses 'perl -i' instead
|
||||
of 'sed -i' for string substitutions. The perl method creates a temporary file
|
||||
and overwrites the original which changes the inodes and corrupts the pseudo
|
||||
db. Changes to pseduo cause a build abort rather than allow possible bad
|
||||
ownership or permissions settings on the files. 'sed -i' is compatible
|
||||
with pseudo.
|
||||
|
||||
Signed-off-by: Geoff Parker <geoffrey.parker@arthrex.com>
|
||||
[OP: Rebase to 0.9.3]
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
---
|
||||
libdmmp/Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libdmmp/Makefile b/libdmmp/Makefile
|
||||
index e4589250..34e06425 100644
|
||||
--- a/libdmmp/Makefile
|
||||
+++ b/libdmmp/Makefile
|
||||
@@ -39,11 +39,11 @@ install:
|
||||
$(LN) $(LIBS) $(DESTDIR)$(usrlibdir)/$(DEVLIB)
|
||||
$(INSTALL_PROGRAM) -m 644 -D \
|
||||
$(PKGFILE).in $(DESTDIR)$(pkgconfdir)/$(PKGFILE)
|
||||
- perl -i -pe 's|__VERSION__|$(LIBDMMP_VERSION)|g' \
|
||||
+ sed -i 's|__VERSION__|$(LIBDMMP_VERSION)|g' \
|
||||
$(DESTDIR)$(pkgconfdir)/$(PKGFILE)
|
||||
- perl -i -pe 's|__LIBDIR__|$(usrlibdir)|g' \
|
||||
+ sed -i 's|__LIBDIR__|$(usrlibdir)|g' \
|
||||
$(DESTDIR)$(pkgconfdir)/$(PKGFILE)
|
||||
- perl -i -pe 's|__INCLUDEDIR__|$(includedir)|g' \
|
||||
+ sed -i 's|__INCLUDEDIR__|$(includedir)|g' \
|
||||
$(DESTDIR)$(pkgconfdir)/$(PKGFILE)
|
||||
$(INSTALL_PROGRAM) -d 755 $(DESTDIR)$(man3dir)
|
||||
$(INSTALL_PROGRAM) -m 644 -t $(DESTDIR)$(man3dir) docs/man/*.3
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
# This is a basic configuration file with some examples, for device mapper
|
||||
# multipath.
|
||||
# For a complete list of the default configuration values, see
|
||||
# /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults
|
||||
# For a list of configuration options with descriptions, see
|
||||
# /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated
|
||||
|
||||
## By default, devices with vendor = "IBM" and product = "S/390.*" are
|
||||
## blacklisted. To enable mulitpathing on these devies, uncomment the
|
||||
## following lines.
|
||||
#blacklist_exceptions {
|
||||
# device {
|
||||
# vendor "IBM"
|
||||
# product "S/390.*"
|
||||
# }
|
||||
#}
|
||||
|
||||
## Use user friendly names, instead of using WWIDs as names.
|
||||
defaults {
|
||||
user_friendly_names yes
|
||||
}
|
||||
##
|
||||
## Here is an example of how to configure some standard options.
|
||||
##
|
||||
#
|
||||
#defaults {
|
||||
# udev_dir /dev
|
||||
# polling_interval 10
|
||||
# selector "round-robin 0"
|
||||
# path_grouping_policy multibus
|
||||
# getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
|
||||
# prio alua
|
||||
# path_checker readsector0
|
||||
# rr_min_io 100
|
||||
# max_fds 8192
|
||||
# rr_weight priorities
|
||||
# failback immediate
|
||||
# no_path_retry fail
|
||||
# user_friendly_names yes
|
||||
#}
|
||||
##
|
||||
## The wwid line in the following blacklist section is shown as an example
|
||||
## of how to blacklist devices by wwid. The 2 devnode lines are the
|
||||
## compiled in default blacklist. If you want to blacklist entire types
|
||||
## of devices, such as all scsi devices, you should use a devnode line.
|
||||
## However, if you want to blacklist specific devices, you should use
|
||||
## a wwid line. Since there is no guarantee that a specific device will
|
||||
## not change names on reboot (from /dev/sda to /dev/sdb for example)
|
||||
## devnode lines are not recommended for blacklisting specific devices.
|
||||
##
|
||||
#blacklist {
|
||||
# wwid 26353900f02796769
|
||||
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
|
||||
# devnode "^hd[a-z]"
|
||||
#}
|
||||
#multipaths {
|
||||
# multipath {
|
||||
# wwid 3600508b4000156d700012000000b0000
|
||||
# alias yellow
|
||||
# path_grouping_policy multibus
|
||||
# path_checker readsector0
|
||||
# path_selector "round-robin 0"
|
||||
# failback manual
|
||||
# rr_weight priorities
|
||||
# no_path_retry 5
|
||||
# }
|
||||
# multipath {
|
||||
# wwid 1DEC_____321816758474
|
||||
# alias red
|
||||
# }
|
||||
#}
|
||||
#devices {
|
||||
# device {
|
||||
# vendor "COMPAQ "
|
||||
# product "HSV110 (C)COMPAQ"
|
||||
# path_grouping_policy multibus
|
||||
# getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
|
||||
# path_checker readsector0
|
||||
# path_selector "round-robin 0"
|
||||
# hardware_handler "0"
|
||||
# failback 15
|
||||
# rr_weight priorities
|
||||
# no_path_retry queue
|
||||
# }
|
||||
# device {
|
||||
# vendor "COMPAQ "
|
||||
# product "MSA1000 "
|
||||
# path_grouping_policy multibus
|
||||
# }
|
||||
#}
|
||||
146
meta-openembedded/meta-oe/recipes-support/multipath-tools/files/multipathd.oe
Executable file
146
meta-openembedded/meta-oe/recipes-support/multipath-tools/files/multipathd.oe
Executable file
@@ -0,0 +1,146 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# multipathd Starts the multipath daemon
|
||||
#
|
||||
# chkconfig: - 06 87
|
||||
# description: Manages device-mapper multipath devices
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: multipathd
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start:
|
||||
# Default-Stop:
|
||||
# Short-Description: Control multipathd
|
||||
# Description: This service monitors and manages
|
||||
# device-mapper multipath devices
|
||||
### END INIT INFO
|
||||
|
||||
DAEMON=/sbin/multipathd
|
||||
prog=`basename $DAEMON`
|
||||
initdir=/etc/init.d
|
||||
lockdir=/var/lock/subsys
|
||||
sysconfig=/etc/sysconfig
|
||||
syspath=/sys/block
|
||||
|
||||
RETVAL=0
|
||||
|
||||
teardown_slaves()
|
||||
{
|
||||
pushd $1 > /dev/null
|
||||
if [ -d "slaves" ]; then
|
||||
for slave in slaves/*;
|
||||
do
|
||||
if [ "$slave" = "slaves/*" ]; then
|
||||
read dev < $1/dev
|
||||
tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
|
||||
if ! [ -z $tablename ]; then
|
||||
echo "Root is on a multipathed device, multipathd can not be stopped"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
local_slave=`readlink -f $slave`;
|
||||
teardown_slaves $local_slave;
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
read dev < $1/dev
|
||||
tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
|
||||
if ! [ -z $tablename ]; then
|
||||
echo "Root is on a multipathed device, multipathd can not be stopped"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
#
|
||||
# See how we were called.
|
||||
#
|
||||
|
||||
start() {
|
||||
test -x $DAEMON || exit 5
|
||||
echo -n $"Starting $prog daemon: "
|
||||
start-stop-daemon --start --quiet --exec $DAEMON
|
||||
RETVAL=$?
|
||||
[ $RETVAL -eq 0 ] && touch $lockdir/$prog
|
||||
echo
|
||||
}
|
||||
|
||||
force_stop() {
|
||||
echo -n $"Stopping $prog daemon: "
|
||||
killall $DAEMON
|
||||
RETVAL=$?
|
||||
[ $RETVAL -eq 0 ] && rm -f $lockdir/$prog
|
||||
echo
|
||||
}
|
||||
|
||||
stop() {
|
||||
root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab)
|
||||
dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null`
|
||||
if [ $? -eq 0 ]; then
|
||||
root_dm_device="dm-$dm_num"
|
||||
[ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device
|
||||
fi
|
||||
|
||||
force_stop
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
force_restart() {
|
||||
force_stop
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
echo -n "Reloading $prog: "
|
||||
trap "" SIGHUP
|
||||
killall $DAEMON -s SIGHUP -v
|
||||
RETVAL=$?
|
||||
echo
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
force-stop)
|
||||
force_stop
|
||||
;;
|
||||
force-reload|reload)
|
||||
reload
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
force-restart)
|
||||
force_restart
|
||||
;;
|
||||
condrestart|try-restart)
|
||||
if [ -f $lockdir/$prog ]; then
|
||||
restart
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
if pidof -o %PPID $DAEMON > /dev/null; then
|
||||
echo "Running"
|
||||
RETVAL=0
|
||||
else
|
||||
echo "Not running"
|
||||
RETVAL=1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|force-stop|status|restart|force-restart|condrestart|reload}"
|
||||
RETVAL=2
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
@@ -0,0 +1,125 @@
|
||||
SUMMARY = "The upstream project used to drive the Device Mapper multipathing driver"
|
||||
|
||||
DESCRIPTION = "It provides tools to manage multipath devices \
|
||||
by instructing the device-mapper kernel module what to do. These \
|
||||
tools include: \
|
||||
1. multipath - Scan the system for multipath devices and assemble them.\
|
||||
2. multipathd - Detects when paths fail and execs multipath to update \
|
||||
things.\
|
||||
3. mpathpersist - Persistent reservation management feature allows \
|
||||
cluster management software to manage persistent reservation through \
|
||||
mpath device. It processes management requests from callers and hides \
|
||||
the management task details. It also handles persistent reservation \
|
||||
management of data path life cycle and state changes.\
|
||||
4. kpartx - This tool, derived from util-linux's partx, reads partition \
|
||||
tables on specified device and create device maps over partitions \
|
||||
segments detected. It is called from hotplug upon device maps creation \
|
||||
and deletion"
|
||||
|
||||
HOMEPAGE = "http://christophe.varoqui.free.fr/"
|
||||
|
||||
DEPENDS = "libdevmapper \
|
||||
lvm2 \
|
||||
libaio \
|
||||
liburcu \
|
||||
readline \
|
||||
udev \
|
||||
json-c \
|
||||
"
|
||||
|
||||
LICENSE = "GPL-2.0-only"
|
||||
|
||||
SRC_URI = "git://github.com/opensvc/multipath-tools.git;protocol=http;branch=master \
|
||||
file://multipathd.oe \
|
||||
file://multipath.conf.example \
|
||||
file://0021-RH-fixup-udev-rules-for-redhat.patch \
|
||||
file://0022-RH-Remove-the-property-blacklist-exception-builtin.patch \
|
||||
file://0023-RH-don-t-start-without-a-config-file.patch \
|
||||
file://0024-RH-use-rpm-optflags-if-present.patch \
|
||||
file://0025-RH-add-mpathconf.patch \
|
||||
file://0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch \
|
||||
file://0027-RH-warn-on-invalid-regex-instead-of-failing.patch \
|
||||
file://0028-RH-reset-default-find_mutipaths-value-to-off.patch \
|
||||
file://0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch \
|
||||
file://0030-Always-use-devmapper.patch \
|
||||
file://0031-Always-use-devmapper-for-kpartx.patch \
|
||||
file://0032-libdmmp-Makefile-replace-perl-with-sed-in-install-ta.patch \
|
||||
file://0001-fix-bug-of-do_compile-and-do_install.patch \
|
||||
file://0001-add-explicit-dependency-on-libraries.patch \
|
||||
"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
|
||||
|
||||
SRCREV = "1332947447133fdf26246012b836868a3d974f0e"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit systemd pkgconfig
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "multipathd.service"
|
||||
SYSTEMD_AUTO_ENABLE = "disable"
|
||||
|
||||
TARGET_CC_ARCH += "${LDFLAGS}"
|
||||
|
||||
# multipath-tools includes a copy of the valgrind.h header
|
||||
# file and uses the macros to suppress some false positives. However,
|
||||
# that only works on ARM when thumb is disabled. Otherwise one gets:
|
||||
# Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r12,r12,ror#3'
|
||||
# ../Makefile.inc:66: recipe for target 'debug.o' failed
|
||||
ARM_INSTRUCTION_SET:armv4 = "arm"
|
||||
ARM_INSTRUCTION_SET:armv5 = "arm"
|
||||
|
||||
# The exact version of SYSTEMD does not matter but should be greater than 209.
|
||||
#
|
||||
EXTRA_OEMAKE = 'MULTIPATH_VERSION=${PV} DESTDIR=${D} syslibdir=${base_libdir} \
|
||||
OPTFLAGS="${CFLAGS}" \
|
||||
prefix=${prefix} \
|
||||
bindir=${base_sbindir} \
|
||||
LIB=${base_libdir} libdir=${base_libdir}/multipath \
|
||||
usrlibdir=${libdir} \
|
||||
plugindir=${base_libdir}/multipath \
|
||||
unitdir=${systemd_system_unitdir} \
|
||||
libudevdir=${nonarch_base_libdir}/udev \
|
||||
modulesloaddir=${sysconfdir}/modules-load.d \
|
||||
tmpfilesdir=${sysconfdir}/tmpfiles.d \
|
||||
${@bb.utils.contains("DISTRO_FEATURES", "systemd", "SYSTEMD=216", "", d)} \
|
||||
'
|
||||
|
||||
do_install() {
|
||||
oe_runmake install
|
||||
|
||||
# We copy an initscript, but do not start multipathd at init time.
|
||||
#
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)};then
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
cp ${WORKDIR}/multipathd.oe ${D}${sysconfdir}/init.d/multipathd
|
||||
fi
|
||||
|
||||
sed -i "s:/usr/lib/udev/kpartx_id:${nonarch_base_libdir}/udev/kpartx_id:g" \
|
||||
${D}${nonarch_base_libdir}/udev/rules.d/11-dm-mpath.rules
|
||||
|
||||
install -d ${D}${sysconfdir}
|
||||
install -m 0644 ${WORKDIR}/multipath.conf.example \
|
||||
${D}${sysconfdir}/multipath.conf.example
|
||||
}
|
||||
|
||||
FILES:${PN}-dbg += "${base_libdir}/multipath/.debug"
|
||||
|
||||
PACKAGES =+ "${PN}-libs"
|
||||
FILES:${PN}-libs = "${base_libdir}/lib*.so.* \
|
||||
${base_libdir}/multipath/lib*.so*"
|
||||
RDEPENDS:${PN} += "${PN}-libs bash libgcc"
|
||||
|
||||
PROVIDES += "device-mapper-multipath"
|
||||
RPROVIDES:${PN} += "device-mapper-multipath"
|
||||
RPROVIDES:${PN}-libs += "device-mapper-multipath-libs"
|
||||
|
||||
FILES:${PN}-dev += "${base_libdir}/pkgconfig"
|
||||
|
||||
PACKAGES =+ "kpartx"
|
||||
FILES:kpartx = "${base_sbindir}/kpartx \
|
||||
${nonarch_base_libdir}/udev/kpartx_id \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN} += "kpartx"
|
||||
PARALLEL_MAKE = ""
|
||||
Reference in New Issue
Block a user