summaryrefslogtreecommitdiff
path: root/packages/sys-boot/dracut/files/0009-sort-fixup-creating-early-microcode.patch
blob: 1dc951585084a93050892a51421d3be99556b29f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff -Naur dracut-047/dracut.sh dracut-047-microcode/dracut.sh
--- dracut-047/dracut.sh	2018-02-19 10:00:33.000000000 +0100
+++ dracut-047-microcode/dracut.sh	2018-05-16 21:14:14.440286520 +0200
@@ -1686,10 +1686,23 @@
                     break 2
                 done
                 for i in $_fwdir/$_fw/$_src; do
-                    [[ -e "$i" ]] || continue
-                    # skip gpg files
-                    str_ends "$i" ".asc" && continue
-                    cat "$i" >> $_dest_dir/${ucode_dest[$idx]}
+			## match intel and amd ucode ignore other stuff
+                       _i=$(echo $i | egrep "[0-9a-z]\w-[0-9a-z]\w-[0-9a-z]\w$|microcode_amd.*.bin$")
+			if [[ -n $_i ]]; then
+        			j=$(file -bi $_i)
+        			case $j in
+            			     *application/octet-stream*)
+						[[ -e "$_i" ]] || continue
+						;;
+			             *)
+						## ignore also files matches names but are not data ( octet-stream )
+                    				dinfo " Ignoring '$(basename $_i)', matches ucode names but is not a data file."
+                    				continue
+                    				;;
+        			esac
+
+                    		cat "$_i" >> $_dest_dir/${ucode_dest[$idx]}
+			fi
                 done
                 create_early_cpio="yes"
             fi