]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
refactor(multipath): do not install the pidof binary
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Thu, 3 Nov 2022 10:09:45 +0000 (11:09 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Fri, 4 Nov 2022 14:48:48 +0000 (14:48 +0000)
dracut-lib.sh provides a custom version of pidof, so there is no need to install
the pidof binary. Also, source dracut-lib.sh in hook scripts when needed.

Fixes issue #2027

modules.d/90multipath/module-setup.sh
modules.d/90multipath/multipathd-needshutdown.sh
modules.d/90multipath/multipathd-stop.sh
modules.d/90multipath/multipathd.sh

index 0077b4398185385d6b69de23964fed9ba08481cb..370cab92b2599985f4aabfc187af568425967aac 100755 (executable)
@@ -91,7 +91,6 @@ install() {
 
     inst_multiple \
         pkill \
-        pidof \
         kpartx \
         dmsetup \
         multipath \
index cb2602e2e99e17c085b1b992efd807a6f9a4bd21..6dc68bb662042cd8f0408a4a62cd33e857283499 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+type need_shutdown > /dev/null 2>&1 || . /lib/dracut-lib.sh
+
 for i in $(multipath -l -v1); do
     if dmsetup table "$i" | sed -n '/.*queue_if_no_path.*/q1'; then
         need_shutdown
index cc5aece57a94a7be96ee8f981014f4b525f7160f..05181b4b7d9b04fcd8eea10a4d55b115860c6a07 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+type pidof > /dev/null 2>&1 || . /lib/dracut-lib.sh
+
 if [ -e /etc/multipath.conf ]; then
     pkill multipathd > /dev/null 2>&1
 
index 0f45474a8def3853d18de66db2854c5beffe3cd5..1e26c1d266aa3a07e1111e82c7da830f975c1287 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+
 if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; then
     # mpathconf requires /etc/multipath to already exist
     mkdir -p /etc/multipath