summarylogtreecommitdiffstats
path: root/01-intel-ucode.patch
blob: 55b7603794398d38a1d9646089ecd8828ab1b3cd (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 4532266..892d34d 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -143,17 +143,14 @@ linux_entry ()
 	echo	'$(echo "$message" | grub_quote)'
 	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
 EOF
-  if test -n "${initrd}" ; then
+  if test -n "${initrd}" -o -n "${initrd_extra}" ; then
     # TRANSLATORS: ramdisk isn't identifier. Should be translated.
     message="$(gettext_printf "Loading initial ramdisk ...")"
-    initrd_path=
-    for i in ${initrd}; do
-      initrd_path="${initrd_path} ${rel_dirname}/${i}"
-    done
-    sed "s/^/$submenu_indentation/" << EOF
-	echo	'$(echo "$message" | grub_quote)'
-	initrd	$(echo $initrd_path)
-EOF
+    printf '	%s\n' "echo	'$(echo "$message" | grub_quote)'" | sed "s/^/$submenu_indentation/"
+    printf '	%s ' 'initrd' | sed "s/^/$submenu_indentation/"
+    for i in ${initrd_extra} ${initrd}; do
+	printf ' %s/%s' "${rel_dirname}" "${i}"
+     done
   fi
   sed "s/^/$submenu_indentation/" << EOF
 }
@@ -228,14 +225,15 @@ while [ "x$list" != "x" ] ; do
   initrd=
   if test -n "${initrd_early}" || test -n "${initrd_real}"; then
     initrd="${initrd_early} ${initrd_real}"
-
-    initrd_display=
-    for i in ${initrd}; do
-      initrd_display="${initrd_display} ${dirname}/${i}"
-    done
-    gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
   fi
 
+  initrd_extra=
+  for i in intel-ucode.img; do
+    if test -e "${dirname}/${i}" ; then
+      initrd_extra="${initrd_extra} ${i}"
+    fi
+  done
+
   config=
   for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
     if test -e "${i}" ; then
@@ -249,7 +247,9 @@ while [ "x$list" != "x" ] ; do
       initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
   fi
 
-  if test -z "${initramfs}" && test -z "${initrd_real}" ; then
+  if test -n "${initrd}" -o -n "${initrd_extra}" ; then
+    gettext_printf "Found initrd image(s) in %s:%s\n" "${dirname}" "${initrd_extra} ${initrd}" >&2
+  elif test -z "${initramfs}" && test -z "${initrd_real}" ; then
     # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs.  Since there's
     # no initrd or builtin initramfs, it can't work here.
     if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \