From 122657b2fedf13991597830cca4d4ddbc8038233 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Sat, 10 Apr 2021 00:57:32 +0800 Subject: [PATCH] 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 --- dracut-functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index 14cc90d05c..5af4e45862 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