]> git.pld-linux.org Git - packages/grub2.git/blob - intel-ucode.patch
- rel 2; make grub-mkconfig add ucode to grub config when needed
[packages/grub2.git] / intel-ucode.patch
1 diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
2 index de9044c..f5d3e78 100644
3 --- a/util/grub.d/10_linux.in
4 +++ b/util/grub.d/10_linux.in
5 @@ -133,13 +133,15 @@ linux_entry ()
6         echo    '$(echo "$message" | grub_quote)'
7         linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
8  EOF
9 -  if test -n "${initrd}" ; then
10 +  if test -n "${initrd}" -o -n "${initrd_extra}" ; then
11      # TRANSLATORS: ramdisk isn't identifier. Should be translated.
12      message="$(gettext_printf "Loading initial ramdisk ...")"
13 -    sed "s/^/$submenu_indentation/" << EOF
14 -       echo    '$(echo "$message" | grub_quote)'
15 -       initrd  ${rel_dirname}/${initrd}
16 -EOF
17 +    printf '   %s\n' "echo     '$(echo "$message" | grub_quote)'" | sed "s/^/$submenu_indentation/"
18 +    printf '   %s ' 'initrd' | sed "s/^/$submenu_indentation/"
19 +    for i in ${initrd_extra} ${initrd}; do
20 +       printf ' %s/%s' "${rel_dirname}" "${i}"
21 +    done
22 +    printf '\n'
23    fi
24    sed "s/^/$submenu_indentation/" << EOF
25  }
26 @@ -202,6 +204,12 @@ while [ "x$list" != "x" ] ; do
27        break
28      fi
29    done
30 +  initrd_extra=
31 +  for i in intel-ucode.img; do
32 +    if test -e "${dirname}/${i}" ; then
33 +      initrd_extra="${initrd_extra} ${i}"
34 +    fi
35 +  done
36  
37    config=
38    for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
39 @@ -226,8 +226,8 @@ while [ "x$list" != "x" ] ; do
40        initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
41    fi
42  
43 -  if test -n "${initrd}" ; then
44 -    gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3
45 +  if test -n "${initrd}" -o -n "${initrd_extra}" ; then
46 +    gettext_printf "Found initrd image(s) in %s:%s\n" "${dirname}" "${initrd_extra} ${initrd}" >&2
47    elif test -z "${initramfs}" ; then
48      # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs.  Since there's
49      # no initrd or builtin initramfs, it can't work here.
50
This page took 0.064933 seconds and 3 git commands to generate.