From: Martin Wilck <martin.wilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@lists.linux.dev, linux-lvm@lists.linux.dev,
Zdenek Kabelac <zkabelac@redhat.com>,
Peter Rajnoha <prajnoha@redhat.com>
Subject: [PATCH 5/6] multipath: udev rules: use configured $(bindir) in udev rules
Date: Mon, 5 Feb 2024 13:46:37 +0100 [thread overview]
Message-ID: <20240205124638.17877-6-mwilck@suse.com> (raw)
In-Reply-To: <20240205124638.17877-1-mwilck@suse.com>
This allows us to remove the lumsy MPATH_SBIN_PATH property and
related tests.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
.gitignore | 1 +
Makefile.inc | 2 +-
multipath/{11-dm-mpath.rules => 11-dm-mpath.rules.in} | 5 +----
multipath/Makefile | 2 +-
multipath/multipath.rules.in | 5 +----
5 files changed, 5 insertions(+), 10 deletions(-)
rename multipath/{11-dm-mpath.rules => 11-dm-mpath.rules.in} (97%)
diff --git a/.gitignore b/.gitignore
index 6890e4a..049ffe8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ multipath/multipath
multipath/multipath.8
multipath/multipath.conf.5
multipath/multipath.rules
+multipath/11-dm-mpath.rules
multipath/tmpfiles.conf
multipathd/multipathd
multipathd/multipathd.8
diff --git a/Makefile.inc b/Makefile.inc
index 06bdd5e..3bcc7c2 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -148,4 +148,4 @@ NV_VERSION_SCRIPT = $(DEVLIB:%.so=%-nv.version)
%: %.in
@echo creating $@
- $(Q)sed 's:@CONFIGFILE@:'$(configfile)':g;s:@CONFIGDIR@:'$(configdir)':g;s:@STATE_DIR@:'$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g' $< >$@
+ $(Q)sed 's:@CONFIGFILE@:'$(configfile)':g;s:@CONFIGDIR@:'$(configdir)':g;s:@STATE_DIR@:'$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g;s:@BINDIR@:'$(bindir)':g' $< >$@
diff --git a/multipath/11-dm-mpath.rules b/multipath/11-dm-mpath.rules.in
similarity index 97%
rename from multipath/11-dm-mpath.rules
rename to multipath/11-dm-mpath.rules.in
index 2706809..38a0132 100644
--- a/multipath/11-dm-mpath.rules
+++ b/multipath/11-dm-mpath.rules.in
@@ -35,16 +35,13 @@ ENV{DM_SUBSYSTEM_UDEV_FLAG2}=="1", ENV{MPATH_DEVICE_READY}="0", \
# This may not be reliable, as events aren't necessarily received in order.
ENV{DM_NR_VALID_PATHS}=="0", ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action"
-ENV{MPATH_SBIN_PATH}="/sbin"
-TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin"
-
# Don't run multipath -U during "coldplug" after switching root,
# because paths are just being added to the udev db.
ACTION=="add", ENV{.MPATH_DEVICE_READY_OLD}=="1", GOTO="paths_ok"
# Check the map state directly with multipath -U.
# This doesn't attempt I/O on the device.
-PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -U -v1 %k", GOTO="paths_ok"
+PROGRAM=="@BINDIR@/multipath -U -v1 %k", GOTO="paths_ok"
ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action"
LABEL="paths_ok"
diff --git a/multipath/Makefile b/multipath/Makefile
index 0efb9b2..f8c1f5e 100644
--- a/multipath/Makefile
+++ b/multipath/Makefile
@@ -5,7 +5,7 @@ include ../Makefile.inc
EXEC := multipath
MANPAGES := multipath.8 multipath.conf.5
-GENERATED := $(MANPAGES) multipath.rules tmpfiles.conf
+GENERATED := $(MANPAGES) multipath.rules tmpfiles.conf 11-dm-mpath.rules
CPPFLAGS += -I$(multipathdir) -I$(mpathutildir) -I$(mpathcmddir)
CFLAGS += $(BIN_CFLAGS)
diff --git a/multipath/multipath.rules.in b/multipath/multipath.rules.in
index 03fa4d7..780bf85 100644
--- a/multipath/multipath.rules.in
+++ b/multipath/multipath.rules.in
@@ -18,9 +18,6 @@ GOTO="end_mpath"
LABEL="test_dev"
-ENV{MPATH_SBIN_PATH}="/sbin"
-TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin"
-
# FIND_MULTIPATHS_WAIT_UNTIL is the timeout (in seconds after the
# epoch).
IMPORT{db}="FIND_MULTIPATHS_WAIT_UNTIL"
@@ -31,7 +28,7 @@ IMPORT{db}="DM_MULTIPATH_DEVICE_PATH"
# multipath -u sets DM_MULTIPATH_DEVICE_PATH and,
# if "find_multipaths smart", also FIND_MULTIPATHS_WAIT_UNTIL.
-IMPORT{program}=="$env{MPATH_SBIN_PATH}/multipath -u %k", \
+IMPORT{program}=="@BINDIR@/multipath -u %k", \
ENV{.MPATH_CHECK_PASSED}="1"
# case 1: this is definitely multipath
--
2.43.0
next prev parent reply other threads:[~2024-02-05 12:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 12:46 [PATCH 0/6] multipath-tools: udev rules and service improvements Martin Wilck
2024-02-05 12:46 ` [PATCH 1/6] 11-dm-mpath.rules: don't import properties that are already set Martin Wilck
2024-02-05 20:44 ` Benjamin Marzinski
2024-02-06 10:50 ` Martin Wilck
2024-02-09 0:30 ` Benjamin Marzinski
2024-02-09 15:35 ` Martin Wilck
2024-02-05 12:46 ` [PATCH 2/6] 11-dm-mpath.rules: fix list of imported properties Martin Wilck
2024-02-09 0:32 ` Benjamin Marzinski
2024-02-05 12:46 ` [PATCH 3/6] 11-dm-mpath.rules: use import logic like 13-dm-disk.rules Martin Wilck
2024-02-09 0:36 ` Benjamin Marzinski
2024-02-09 15:38 ` Martin Wilck
2024-02-05 12:46 ` [PATCH 4/6] 11-dm-mpath.rules: handle reloads during coldplug events Martin Wilck
2024-02-09 1:03 ` Benjamin Marzinski
2024-02-09 15:53 ` Martin Wilck
2024-02-09 16:13 ` Benjamin Marzinski
2024-02-09 16:15 ` Benjamin Marzinski
2024-02-05 12:46 ` Martin Wilck [this message]
2024-02-09 1:04 ` [PATCH 5/6] multipath: udev rules: use configured $(bindir) in udev rules Benjamin Marzinski
2024-02-05 12:46 ` [PATCH 6/6] multipathd: don't activate socket activation by default Martin Wilck
2024-02-09 1:05 ` Benjamin Marzinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240205124638.17877-6-mwilck@suse.com \
--to=martin.wilck@suse.com \
--cc=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@lists.linux.dev \
--cc=linux-lvm@lists.linux.dev \
--cc=prajnoha@redhat.com \
--cc=zkabelac@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).