diff mbox series

[3/6] multipath-tools: install modules-load.d/multipath.conf

Message ID 20220201234024.27675-4-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: Mike Snitzer
Headers show
Series multipath-tools: kernel module loading improvements | expand

Commit Message

Martin Wilck Feb. 1, 2022, 11:40 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

If multipath-tools is installed, we want to load the dm-multipath
module early on, because multipath -u might spit out irritating
error messages in syslog otherwise.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 Makefile.inc                | 1 +
 multipath/Makefile          | 3 +++
 multipath/modules-load.conf | 3 +++
 3 files changed, 7 insertions(+)
 create mode 100644 multipath/modules-load.conf

Comments

Benjamin Marzinski Feb. 3, 2022, 12:40 a.m. UTC | #1
On Wed, Feb 02, 2022 at 12:40:21AM +0100, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> If multipath-tools is installed, we want to load the dm-multipath
> module early on, because multipath -u might spit out irritating
> error messages in syslog otherwise.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  Makefile.inc                | 1 +
>  multipath/Makefile          | 3 +++
>  multipath/modules-load.conf | 3 +++
>  3 files changed, 7 insertions(+)
>  create mode 100644 multipath/modules-load.conf
> 
> diff --git a/Makefile.inc b/Makefile.inc
> index c5f1fa5..5223c96 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -73,6 +73,7 @@ usr_prefix	= $(prefix)
>  bindir		= $(exec_prefix)/sbin
>  libudevdir	= $(prefix)/$(SYSTEMDPATH)/udev
>  udevrulesdir	= $(libudevdir)/rules.d
> +modulesloaddir  = $(prefix)/$(SYSTEMDPATH)/modules-load.d
>  multipathdir	= $(TOPDIR)/libmultipath
>  man8dir		= $(prefix)/usr/share/man/man8
>  man5dir		= $(prefix)/usr/share/man/man5
> diff --git a/multipath/Makefile b/multipath/Makefile
> index c690368..015f73c 100644
> --- a/multipath/Makefile
> +++ b/multipath/Makefile
> @@ -23,6 +23,8 @@ install:
>  	$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
>  	$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
>  	$(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(udevrulesdir)/56-multipath.rules
> +	$(INSTALL_PROGRAM) -d $(DESTDIR)$(modulesloaddir)
> +	$(INSTALL_PROGRAM) -m 644 modules-load.conf $(DESTDIR)$(modulesloaddir)/multipath.conf
>  	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir)
>  	$(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(man8dir)
>  	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
> @@ -31,6 +33,7 @@ install:
>  uninstall:
>  	$(RM) $(DESTDIR)$(bindir)/$(EXEC)
>  	$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules
> +	$(RM) $(DESTDIR)$(modulesloaddir)/multipath.conf
>  	$(RM) $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules
>  	$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8
>  	$(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5
> diff --git a/multipath/modules-load.conf b/multipath/modules-load.conf
> new file mode 100644
> index 0000000..b517d32
> --- /dev/null
> +++ b/multipath/modules-load.conf
> @@ -0,0 +1,3 @@
> +# load dm-multipath early, both multipathd and multipath depend on it
> +# (note that multipath may be called from udev rules!)
> +dm-multipath
> -- 
> 2.34.1

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

diff --git a/Makefile.inc b/Makefile.inc
index c5f1fa5..5223c96 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -73,6 +73,7 @@  usr_prefix	= $(prefix)
 bindir		= $(exec_prefix)/sbin
 libudevdir	= $(prefix)/$(SYSTEMDPATH)/udev
 udevrulesdir	= $(libudevdir)/rules.d
+modulesloaddir  = $(prefix)/$(SYSTEMDPATH)/modules-load.d
 multipathdir	= $(TOPDIR)/libmultipath
 man8dir		= $(prefix)/usr/share/man/man8
 man5dir		= $(prefix)/usr/share/man/man5
diff --git a/multipath/Makefile b/multipath/Makefile
index c690368..015f73c 100644
--- a/multipath/Makefile
+++ b/multipath/Makefile
@@ -23,6 +23,8 @@  install:
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
 	$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(udevrulesdir)/56-multipath.rules
+	$(INSTALL_PROGRAM) -d $(DESTDIR)$(modulesloaddir)
+	$(INSTALL_PROGRAM) -m 644 modules-load.conf $(DESTDIR)$(modulesloaddir)/multipath.conf
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir)
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(man8dir)
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
@@ -31,6 +33,7 @@  install:
 uninstall:
 	$(RM) $(DESTDIR)$(bindir)/$(EXEC)
 	$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules
+	$(RM) $(DESTDIR)$(modulesloaddir)/multipath.conf
 	$(RM) $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules
 	$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8
 	$(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5
diff --git a/multipath/modules-load.conf b/multipath/modules-load.conf
new file mode 100644
index 0000000..b517d32
--- /dev/null
+++ b/multipath/modules-load.conf
@@ -0,0 +1,3 @@ 
+# load dm-multipath early, both multipathd and multipath depend on it
+# (note that multipath may be called from udev rules!)
+dm-multipath