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
6 * util/grub.d/10_linux.in: Implement GRUB_LINUX_KERNEL_GLOBS
7 * docs/grub.texi: Document GRUB_LINUX_KERNEL_GLOBS
9 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
11 docs/grub.texi | 5 +++++
12 util/grub.d/10_linux.in | 21 +++++++++++----------
13 2 files changed, 16 insertions(+), 10 deletions(-)
15 diff --git a/docs/grub.texi b/docs/grub.texi
16 index 9a25a0b..d1129ec 100644
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
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{/}.
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
40 +globs="$GRUB_LINUX_KERNEL_GLOBS"
41 +[ -z "$globs" ] && case "x$machine" in
44 - for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
45 - if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
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
52 + globs="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*"
55 + globs="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-*"
59 +for i in ${globs} ; do
60 + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
64 i?86) GENKERNEL_ARCH="x86" ;;