Blame 0149-dracut.sh-no-microcode-if-get_ucode_file-returns-emp.patch

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