Blame SOURCES/0008-dracut-Do-not-create-early_cpio-if-no-suitable-micro.patch

712866
From ff33b576767d5e020c9f2685a0f5b0acb35a781c Mon Sep 17 00:00:00 2001
712866
From: Thomas Renninger <trenn@suse.de>
712866
Date: Fri, 27 Sep 2013 20:10:38 +0200
712866
Subject: [PATCH] dracut: Do not create early_cpio if no suitable microcode
712866
 exist in hostonly case
712866
712866
Intel microcodes only exist for very specific family/model/stepping CPUs.
712866
If no microcode gets added, there is no need to create an empty
712866
(only directories) cpio later that gets glued to the initrd.
712866
712866
This also fixes:
712866
712866
*** Constructing GenuineIntel.bin ****
712866
cat: /lib/firmware/intel-ucode/06-3c-03: No such file or directory
712866
712866
in hostonly mode if there is no suitable microcode for the CPU.
712866
712866
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
712866
Signed-off-by: Thomas Renninger <trenn@suse.de>
712866
---
712866
 dracut.sh | 5 ++++-
712866
 1 file changed, 4 insertions(+), 1 deletion(-)
712866
712866
diff --git a/dracut.sh b/dracut.sh
5c6c2a
index b3b80886..e43227e8 100755
712866
--- a/dracut.sh
712866
+++ b/dracut.sh
712866
@@ -1326,12 +1326,15 @@ if [[ $early_microcode = yes ]]; then
712866
                 dinfo "*** Constructing ${ucode_dest[$idx]} ****"
712866
                 if [[ $hostonly ]]; then
712866
                     _src=$(get_ucode_file)
712866
+                    if ! [[ -r $_fwdir/$_fw/$_src ]];then
712866
+                        break;
712866
+                    fi
712866
                 fi
712866
                 cat $_fwdir/$_fw/$_src > $_dest_dir/${ucode_dest[$idx]}
712866
+                create_early_cpio="yes"
712866
             fi
712866
         done
712866
     done
712866
-    create_early_cpio="yes"
712866
 fi
712866
 
712866
 rm -f -- "$outfile"