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