From: Antonio Alvarez Feijoo Date: Thu, 3 Nov 2022 10:09:45 +0000 (+0100) Subject: refactor(multipath): do not install the pidof binary X-Git-Tag: 058~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ec479006f268cde631b36333a9523194d40ff10;p=thirdparty%2Fdracut.git refactor(multipath): do not install the pidof binary 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 --- diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh index 0077b4398..370cab92b 100755 --- a/modules.d/90multipath/module-setup.sh +++ b/modules.d/90multipath/module-setup.sh @@ -91,7 +91,6 @@ install() { inst_multiple \ pkill \ - pidof \ kpartx \ dmsetup \ multipath \ diff --git a/modules.d/90multipath/multipathd-needshutdown.sh b/modules.d/90multipath/multipathd-needshutdown.sh index cb2602e2e..6dc68bb66 100755 --- a/modules.d/90multipath/multipathd-needshutdown.sh +++ b/modules.d/90multipath/multipathd-needshutdown.sh @@ -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 diff --git a/modules.d/90multipath/multipathd-stop.sh b/modules.d/90multipath/multipathd-stop.sh index cc5aece57..05181b4b7 100755 --- a/modules.d/90multipath/multipathd-stop.sh +++ b/modules.d/90multipath/multipathd-stop.sh @@ -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 diff --git a/modules.d/90multipath/multipathd.sh b/modules.d/90multipath/multipathd.sh index 0f45474a8..1e26c1d26 100755 --- a/modules.d/90multipath/multipathd.sh +++ b/modules.d/90multipath/multipathd.sh @@ -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