From: Harald Hoyer Date: Mon, 8 Mar 2021 12:17:40 +0000 (+0100) Subject: fix: use getargs with _cryptgetargsname X-Git-Tag: 054~316 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b61cfdbec388572868b6fde070833ae09c411a8;p=thirdparty%2Fdracut.git fix: use getargs with _cryptgetargsname --- diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh index 4e899fedf..b85bbdc07 100755 --- a/modules.d/90crypt/parse-crypt.sh +++ b/modules.d/90crypt/parse-crypt.sh @@ -8,13 +8,10 @@ _cryptgetargsname() { local _o _found _key unset _o unset _found - CMDLINE=$(getcmdline) _key="$1" set -- - for _o in $CMDLINE; do - if [ "$_o" = "$_key" ]; then - _found=1; - elif [ "${_o%=*}" = "${_key%=}" ]; then + for _o in $(getargs rd.luks.name); do + if [ "${_o%=*}" = "${_key%=}" ]; then [ -n "${_o%=*}" ] && set -- "$@" "${_o#*=}"; _found=1; fi @@ -56,7 +53,7 @@ else unset _uuid uuid=${uuid##luks-} - if luksname=$(_cryptgetargsname "rd.luks.name=$uuid="); then + if luksname=$(_cryptgetargsname "$uuid="); then luksname="${luksname#$uuid=}" else luksname="luks-$uuid" @@ -94,7 +91,7 @@ else unset _serialid serialid=${serialid##luks-} - if luksname=$(_cryptgetargsname "rd.luks.name=$serialid="); then + if luksname=$(_cryptgetargsname "$serialid="); then luksname="${luksname#$serialid=}" else luksname="luks-$serialid" @@ -132,7 +129,7 @@ else unset _luksid luksid=${luksid##luks-} - if luksname=$(_cryptgetargsname "rd.luks.name=$luksid="); then + if luksname=$(_cryptgetargsname "$luksid="); then luksname="${luksname#$luksid=}" else luksname="luks-$luksid"