[packages/grub2] - rel 2; make grub-mkconfig add ucode to grub config when needed

arekm arekm at pld-linux.org
Mon Sep 4 09:43:42 CEST 2017


commit c28d90788d810f3f423d1ea62e455f39b0464080
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Sep 4 09:43:35 2017 +0200

    - rel 2; make grub-mkconfig add ucode to grub config when needed

 grub2.spec        |  5 ++++-
 intel-ucode.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 1 deletion(-)
---
diff --git a/grub2.spec b/grub2.spec
index b29436a..007bf58 100644
--- a/grub2.spec
+++ b/grub2.spec
@@ -47,7 +47,7 @@ Summary(pl.UTF-8):	GRUB2 - bootloader dla x86 i ppc
 Summary(pt_BR.UTF-8):	Gerenciador de inicialização GRUB2
 Name:		grub2
 Version:	2.02
-Release:	1
+Release:	2
 License:	GPL v2
 Group:		Base
 Source0:	ftp://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
@@ -70,6 +70,8 @@ Patch11:	choose-preferred-initrd.patch
 Patch12:	%{name}-cfg.patch
 Patch13:	efi-net-fix.patch
 Patch14:	blscfg.patch
+# https://git.archlinux.org/svntogit/packages.git/plain/trunk/0002-intel-ucode.patch?h=packages/grub
+Patch15:	intel-ucode.patch
 URL:		http://www.gnu.org/software/grub/
 BuildRequires:	autoconf >= 2.53
 BuildRequires:	automake >= 1:1.11.1-1
@@ -298,6 +300,7 @@ Motyw starfield dla GRUB-a.
 %patch12 -p0
 %patch13 -p1
 %patch14 -p1
+%patch15 -p1
 
 # we don't have C.utf-8 and need an UTF-8 locale for build
 sed -i -e 's/LC_ALL=C.UTF-8/LC_ALL=en_US.utf-8/g' po/Makefile* po/Rules*
diff --git a/intel-ucode.patch b/intel-ucode.patch
new file mode 100644
index 0000000..e69715c
--- /dev/null
+++ b/intel-ucode.patch
@@ -0,0 +1,50 @@
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index de9044c..f5d3e78 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -133,13 +133,15 @@ 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 ...")"
+-    sed "s/^/$submenu_indentation/" << EOF
+-	echo	'$(echo "$message" | grub_quote)'
+-	initrd	${rel_dirname}/${initrd}
+-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
++    printf '\n'
+   fi
+   sed "s/^/$submenu_indentation/" << EOF
+ }
+@@ -202,6 +204,12 @@ while [ "x$list" != "x" ] ; do
+       break
+     fi
+   done
++  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
+@@ -226,8 +226,8 @@ while [ "x$list" != "x" ] ; do
+       initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
+   fi
+ 
+-  if test -n "${initrd}" ; then
+-    gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3
++  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}" ; then
+     # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs.  Since there's
+     # no initrd or builtin initramfs, it can't work here.
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/grub2.git/commitdiff/c28d90788d810f3f423d1ea62e455f39b0464080



More information about the pld-cvs-commit mailing list