Blame SOURCES/0524-Simplify-microcode-lookup-for-for-AMD-CPUs.patch

18971c
From a0e7bc11c8d95e18be89bc96a82d3482b929c0b5 Mon Sep 17 00:00:00 2001
18971c
From: Daniel Molkentin <dmolkentin@suse.com>
18971c
Date: Thu, 14 Dec 2017 12:24:53 +0100
18971c
Subject: [PATCH] Simplify microcode lookup for for AMD CPUs
18971c
18971c
Suggested by Tom Lendacky <thomas.lendacky@amd.com>
18971c
18971c
Cherry-picked from: 19453dc8744e6a59725c43b61b2e3db01cb4c57c
18971c
Resolves: #1476039
18971c
---
18971c
 dracut-functions.sh | 9 ++-------
18971c
 1 file changed, 2 insertions(+), 7 deletions(-)
18971c
18971c
diff --git a/dracut-functions.sh b/dracut-functions.sh
18971c
index ef52274f..98a4b88b 100755
18971c
--- a/dracut-functions.sh
18971c
+++ b/dracut-functions.sh
18971c
@@ -1738,13 +1738,8 @@ get_ucode_file ()
18971c
     local stepping=`grep -E "stepping" /proc/cpuinfo | head -1 | sed s/.*:\ //`
18971c
 
18971c
     if [[ "$(get_cpu_vendor)" == "AMD" ]]; then
18971c
-        # If family greater or equal than 0x15
18971c
-        if [[ $family -ge 23 ]]; then
18971c
-            printf "microcode_amd_fam17h.bin"
18971c
-        elif [[ $family -eq 22 ]]; then
18971c
-            printf "microcode_amd_fam16h.bin"
18971c
-        elif [[ $family -eq 21 ]]; then
18971c
-            printf "microcode_amd_fam15h.bin"
18971c
+        if [[ $family -ge 21 ]]; then
18971c
+            printf "microcode_amd_fam%xh.bin" $family
18971c
         else
18971c
             printf "microcode_amd.bin"
18971c
         fi