From: Kairui Song Date: Fri, 9 Apr 2021 16:57:32 +0000 (+0800) Subject: fix(dracut-functions): word splitting issue for sed in get_ucode_file X-Git-Tag: 054~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=122657b2fedf13991597830cca4d4ddbc8038233;p=thirdparty%2Fdracut.git fix(dracut-functions): word splitting issue for sed in get_ucode_file This unquated regex could be splitted into two arguments and sed will not work. I've see giving error of wrong arguments being used on my desktop. Signed-off-by: Kairui Song --- diff --git a/dracut-functions.sh b/dracut-functions.sh index 14cc90d05..5af4e4586 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -709,9 +709,9 @@ get_ucode_file() { local family local model local stepping - family=$(grep -E "cpu family" /proc/cpuinfo | head -1 | sed s/.*:\ //) - model=$(grep -E "model" /proc/cpuinfo | grep -v name | head -1 | sed s/.*:\ //) - stepping=$(grep -E "stepping" /proc/cpuinfo | head -1 | sed s/.*:\ //) + family=$(grep -E "cpu family" /proc/cpuinfo | head -1 | sed "s/.*:\ //") + model=$(grep -E "model" /proc/cpuinfo | grep -v name | head -1 | sed "s/.*:\ //") + stepping=$(grep -E "stepping" /proc/cpuinfo | head -1 | sed "s/.*:\ //") if [[ "$(get_cpu_vendor)" == "AMD" ]]; then if [[ $family -ge 21 ]]; then