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

34 lines
1.2 KiB
Diff
Raw Normal View History

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