Blame SOURCES/0348-dracut.sh-no-microcode-if-get_ucode_file-returns-emp.patch

64b87c
From 327d765512135721a323822a8b10ac1539bd20c6 Mon Sep 17 00:00:00 2001
64b87c
From: Harald Hoyer <harald@redhat.com>
64b87c
Date: Thu, 17 Sep 2015 20:03:54 +0200
64b87c
Subject: [PATCH] dracut.sh: no microcode, if get_ucode_file returns empty file
64b87c
64b87c
check, if get_ucode_file() returned an empty string.
64b87c
---
64b87c
 dracut.sh | 8 ++++----
64b87c
 1 file changed, 4 insertions(+), 4 deletions(-)
64b87c
64b87c
diff --git a/dracut.sh b/dracut.sh
64b87c
index 980c7ff..4e4f222 100755
64b87c
--- a/dracut.sh
64b87c
+++ b/dracut.sh
64b87c
@@ -1489,12 +1489,12 @@ if [[ $early_microcode = yes ]]; then
64b87c
                 dinfo "*** Constructing ${ucode_dest[$idx]} ****"
64b87c
                 if [[ $hostonly ]]; then
64b87c
                     _src=$(get_ucode_file)
64b87c
-                    if ! [[ -r $_fwdir/$_fw/$_src ]];then
64b87c
-                        break;
64b87c
-                    fi
64b87c
+                    [[ $src ]] || break
64b87c
+                    [[ -r $_fwdir/$_fw/$_src ]] || break
64b87c
                 fi
64b87c
+
64b87c
                 for i in $_fwdir/$_fw/$_src; do
64b87c
-                    [ -e $i ] && break
64b87c
+                    [ -e "$i" ] && break
64b87c
                     break 2
64b87c
                 done
64b87c
                 cat $_fwdir/$_fw/$_src > $_dest_dir/${ucode_dest[$idx]}