From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- sys-boot/grub/files/gfxpayload.patch | 29 +++++++++ ...97-Add-esp-to-list-of-clobbered-registers.patch | 53 ++++++++++++++++ .../grub/files/grub-0.97-ncurses-pkgconfig.patch | 18 ++++++ .../grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch | 67 ++++++++++++++++++++ sys-boot/grub/files/grub.conf.gentoo | 16 +++++ sys-boot/grub/files/grub.default-3 | 73 ++++++++++++++++++++++ 6 files changed, 256 insertions(+) create mode 100644 sys-boot/grub/files/gfxpayload.patch create mode 100644 sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch create mode 100644 sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch create mode 100644 sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch create mode 100644 sys-boot/grub/files/grub.conf.gentoo create mode 100644 sys-boot/grub/files/grub.default-3 (limited to 'sys-boot/grub/files') diff --git a/sys-boot/grub/files/gfxpayload.patch b/sys-boot/grub/files/gfxpayload.patch new file mode 100644 index 000000000000..6c63ef88b09e --- /dev/null +++ b/sys-boot/grub/files/gfxpayload.patch @@ -0,0 +1,29 @@ +From e2d5bf1bc6aaaabeba538c1ca94ea8601e4e1474 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Thu, 16 Oct 2014 23:43:51 -0400 +Subject: [PATCH] 10_linux: Default gfxpayload=keep only when booting using efi + +vesafb seems to be unreliable when using BIOS compat mode. + +--- + util/grub.d/10_linux.in | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index d2e2a8f..a54b888 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -104,7 +104,9 @@ linux_entry () + echo " load_video" | sed "s/^/$submenu_indentation/" + if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \ + && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then +- echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' if [ "x$grub_platform" = xefi ]; then' | sed "s/^/$submenu_indentation/" ++ echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' fi' | sed "s/^/$submenu_indentation/" + fi + else + if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then +-- +2.7.2 + diff --git a/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch b/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch new file mode 100644 index 000000000000..c550aabd6167 --- /dev/null +++ b/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch @@ -0,0 +1,53 @@ +From 5a52ee4b5cd152fa4ccd1c1f938ce2eba652af52 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Mon, 14 Dec 2015 23:59:17 +0000 +Subject: [PATCH] Add %esp to list of clobbered registers + +GCC assumes that it can combine stacks from +outer + grub_stage2() +and inner + trampoline doit() +functions (optimisation -fcombine-stack-adjustments). + +But doit() function clobbers %esp in inline +assebly statement as: + + asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n" + : "=&r" (realstack) : "r" (simstack)); + +which tricks gcc into computing invalid local variable +offsets from current %esp value. + +Fix by hinting gcc about %esp change in clobber list. + +Signed-off-by: Sergei Trofimovich +--- + grub/asmstub.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub/asmstub.c b/grub/asmstub.c +index 6354806..44b056f 100644 +--- a/grub/asmstub.c ++++ b/grub/asmstub.c +@@ -174,7 +174,7 @@ grub_stage2 (void) + { + /* Make sure our stack lives in the simulated memory area. */ + asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n" +- : "=&r" (realstack) : "r" (simstack)); ++ : "=&r" (realstack) : "r" (simstack) : "%esp"); + + /* Do a setjmp here for the stop command. */ + if (! setjmp (env_for_exit)) +@@ -191,7 +191,7 @@ grub_stage2 (void) + } + + /* Replace our stack before we use any local variables. */ +- asm volatile ("movl %0, %%esp\n" : : "r" (realstack)); ++ asm volatile ("movl %0, %%esp\n" : : "r" (realstack) : "%esp"); + } + + assert (grub_scratch_mem == 0); +-- +2.6.3 + diff --git a/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch b/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch new file mode 100644 index 000000000000..d62e4346c338 --- /dev/null +++ b/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch @@ -0,0 +1,18 @@ +--- a/configure.ac 2015-12-17 11:09:56.807893315 -0500 ++++ b/configure.ac 2015-12-17 11:11:06.697570856 -0500 +@@ -234,10 +234,14 @@ + + # Unless the user specify --without-curses, check for curses. + if test "x$with_curses" != "xno"; then ++ PKG_CHECK_MODULES([NCURSES],[ncurses],[ ++ AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library]) ++ GRUB_LIBS="$GRUB_LIBS $NCURSES_LIBS" ++ ],[ + AC_CHECK_LIB(ncurses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lncurses" + AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])], + [AC_CHECK_LIB(curses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lcurses" +- AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])]) ++ AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])])]) + fi + + AC_SUBST(GRUB_LIBS) diff --git a/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch new file mode 100644 index 000000000000..c66ee68dc8de --- /dev/null +++ b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch @@ -0,0 +1,67 @@ +From 43e3295aaad5278a1e53c5282e2660b72cd76d28 Mon Sep 17 00:00:00 2001 +From: "Robin H. Johnson" +Date: Tue, 29 Dec 2015 15:29:14 -0800 +Subject: [PATCH] GRUB_LINUX_KERNEL_GLOBS: configurable kernel selection + +* util/grub.d/10_linux.in: Implement GRUB_LINUX_KERNEL_GLOBS +* docs/grub.texi: Document GRUB_LINUX_KERNEL_GLOBS + +Signed-off-by: Robin H. Johnson +--- + docs/grub.texi | 5 +++++ + util/grub.d/10_linux.in | 21 +++++++++++---------- + 2 files changed, 16 insertions(+), 10 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 9a25a0b..d1129ec 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1490,6 +1490,11 @@ This option may be set to a list of GRUB module names separated by spaces. + Each module will be loaded as early as possible, at the start of + @file{grub.cfg}. + ++@item GRUB_LINUX_KERNEL_GLOBS ++This option may be set to override the list of path globs used to find Linux ++kernels. The defaults vary by architecture, and generally include both ++@file{/boot} and @file{/}. ++ + @end table + + The following options are still accepted for compatibility with existing +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 859b608..e5ac11d 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -145,18 +145,19 @@ EOF + } + + machine=`uname -m` +-case "x$machine" in ++globs="$GRUB_LINUX_KERNEL_GLOBS" ++[ -z "$globs" ] && case "x$machine" in + xi?86 | xx86_64) +- list= +- for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +- done ;; +- *) +- list= +- for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +- done ;; ++ globs="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*" ++ ;; ++ *) ++ globs="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-*" ++ ;; + esac ++list= ++for i in ${globs} ; do ++ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi ++done + + case "$machine" in + i?86) GENKERNEL_ARCH="x86" ;; +-- +2.3.0 + diff --git a/sys-boot/grub/files/grub.conf.gentoo b/sys-boot/grub/files/grub.conf.gentoo new file mode 100644 index 000000000000..984470b3860d --- /dev/null +++ b/sys-boot/grub/files/grub.conf.gentoo @@ -0,0 +1,16 @@ +# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook +# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2 +# If you are not using Genkernel and you need help creating this file, you +# should consult the handbook. Alternatively, consult the grub.conf.sample that +# is included with the Grub documentation. + +default 0 +timeout 30 +#splashimage=(hd0,0)/boot/grub/splash.xpm.gz + +#title Gentoo Linux 3.8.13 +#root (hd0,0) +#kernel /boot/kernel-genkernel-x86-3.8.13-gentoo root=/dev/sda3 +#initrd /boot/initramfs-genkernel-x86-3.8.13 + +# vim:ft=conf: diff --git a/sys-boot/grub/files/grub.default-3 b/sys-boot/grub/files/grub.default-3 new file mode 100644 index 000000000000..593b019db7d4 --- /dev/null +++ b/sys-boot/grub/files/grub.default-3 @@ -0,0 +1,73 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# +# To populate all changes in this file you need to regenerate your +# grub configuration file afterwards: +# 'grub2-mkconfig -o /boot/grub/grub.cfg' +# +# See the grub info page for documentation on possible variables and +# their associated values. + +GRUB_DISTRIBUTOR="Gentoo" + +# Default menu entry +#GRUB_DEFAULT=0 + +# Boot the default entry this many seconds after the menu is displayed +#GRUB_TIMEOUT=5 +#GRUB_TIMEOUT_STYLE=menu + +# Append parameters to the linux kernel command line +#GRUB_CMDLINE_LINUX="" +# +# Examples: +# +# Boot with network interface renaming disabled +# GRUB_CMDLINE_LINUX="net.ifnames=0" +# +# Boot with systemd instead of sysvinit (openrc) +# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd" + +# Append parameters to the linux kernel command line for non-recovery entries +#GRUB_CMDLINE_LINUX_DEFAULT="" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal. +# Note that you can use only modes which your graphic card supports via VBE. +# You can see them in real GRUB with the command `vbeinfo'. +#GRUB_GFXMODE=640x480 + +# Set to 'text' to force the Linux kernel to boot in normal text +# mode, 'keep' to preserve the graphics mode set using +# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular +# graphics mode, or a sequence of these separated by commas or +# semicolons to try several modes in sequence. +#GRUB_GFXPAYLOAD_LINUX= + +# Path to theme spec txt file. +# The starfield is by default provided with use truetype. +# NOTE: when enabling custom theme, ensure you have required font/etc. +#GRUB_THEME="/boot/grub/themes/starfield/theme.txt" + +# Background image used on graphical terminal. +# Can be in various bitmap formats. +#GRUB_BACKGROUND="/boot/grub/mybackground.png" + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +#GRUB_DISABLE_RECOVERY=true + +# Uncomment to disable generation of the submenu and put all choices on +# the top-level menu. +# Besides the visual affect of no sub menu, this makes navigation of the +# menu easier for a user who can't see the screen. +#GRUB_DISABLE_SUBMENU=y + +# Uncomment to play a tone when the main menu is displayed. +# This is useful, for example, to allow users who can't see the screen +# to know when they can make a choice on the menu. +#GRUB_INIT_TUNE="60 800 1" -- cgit v1.2.3