From: Florian Gamböck Date: Mon, 18 Dec 2017 10:04:05 +0000 (+0100) Subject: Use pattern matching function X-Git-Tag: 047~57^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F334%2Fhead;p=thirdparty%2Fdracut.git Use pattern matching function The needle argument in this specific case is a pattern, which cannot be matched by the "literal" string matcher strstr. This can result in fsck calls like: e2fsck -a -y /dev/sda1 Which will then exit with an error like: e2fsck: Only one of the options -p/-a, -n or -y may be specified. Hence, it is necessary to use the strglobin function to correctly match the pattern. --- diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh index 5c8315580..d39ca1b7d 100755 --- a/modules.d/99fs-lib/fs-lib.sh +++ b/modules.d/99fs-lib/fs-lib.sh @@ -100,7 +100,7 @@ fsck_drv_com() { local _ret local _out - if ! strstr "$_fop" "-[ynap]"; then + if ! strglobin "$_fop" "-[ynap]"; then _fop="-a ${_fop}" fi