add deprecated sys-boot/grub:0
[portage-squeep] / sys-boot / grub / files / grub-2.02_beta2-KERNEL_GLOBS.patch
1 From 43e3295aaad5278a1e53c5282e2660b72cd76d28 Mon Sep 17 00:00:00 2001
2 From: "Robin H. Johnson" <robbat2@gentoo.org>
3 Date: Tue, 29 Dec 2015 15:29:14 -0800
4 Subject: [PATCH] GRUB_LINUX_KERNEL_GLOBS: configurable kernel selection
5
6 * util/grub.d/10_linux.in: Implement GRUB_LINUX_KERNEL_GLOBS
7 * docs/grub.texi: Document GRUB_LINUX_KERNEL_GLOBS
8
9 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
10 ---
11 docs/grub.texi | 5 +++++
12 util/grub.d/10_linux.in | 21 +++++++++++----------
13 2 files changed, 16 insertions(+), 10 deletions(-)
14
15 diff --git a/docs/grub.texi b/docs/grub.texi
16 index 9a25a0b..d1129ec 100644
17 --- a/docs/grub.texi
18 +++ b/docs/grub.texi
19 @@ -1490,6 +1490,11 @@ This option may be set to a list of GRUB module names separated by spaces.
20 Each module will be loaded as early as possible, at the start of
21 @file{grub.cfg}.
22
23 +@item GRUB_LINUX_KERNEL_GLOBS
24 +This option may be set to override the list of path globs used to find Linux
25 +kernels. The defaults vary by architecture, and generally include both
26 +@file{/boot} and @file{/}.
27 +
28 @end table
29
30 The following options are still accepted for compatibility with existing
31 diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
32 index 859b608..e5ac11d 100644
33 --- a/util/grub.d/10_linux.in
34 +++ b/util/grub.d/10_linux.in
35 @@ -145,18 +145,19 @@ EOF
36 }
37
38 machine=`uname -m`
39 -case "x$machine" in
40 +globs="$GRUB_LINUX_KERNEL_GLOBS"
41 +[ -z "$globs" ] && case "x$machine" in
42 xi?86 | xx86_64)
43 - list=
44 - for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
45 - if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
46 - done ;;
47 - *)
48 - list=
49 - for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
50 - if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
51 - done ;;
52 + globs="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*"
53 + ;;
54 + *)
55 + globs="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-*"
56 + ;;
57 esac
58 +list=
59 +for i in ${globs} ; do
60 + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
61 +done
62
63 case "$machine" in
64 i?86) GENKERNEL_ARCH="x86" ;;
65 --
66 2.3.0
67