Gentoo Archives: gentoo-user

From: Grant Edwards <grant.b.edwards@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?
Date: Mon, 14 Jun 2021 08:39:08
Message-Id: sa74iq$10q2$1@ciao.gmane.io
In Reply to: Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name? by Walter Dnes
1 On 2021-06-14, Walter Dnes <waltdnes@××××××××.org> wrote:
2
3 > On Mon, Jun 14, 2021 at 01:00:38AM -0000, Grant Edwards wrote
4
5 >> All my grub.cfg files looks like this:
6 >>
7 >> ========================================================================
8 >> timeout=10
9 >> root=hd0,1
10 >> default=0
11 >>
12 >> menuentry 'vmlinuz-5.10.27-gentoo' {
13 >> linux /boot/vmlinuz-5.10.27-gentoo root=/dev/sda1
14 >> }
15 >>
16 >> menuentry 'vmlinuz-5.4.97-gentoo' {
17 >> linux /boot/vmlinuz-5.4.97-gentoo root=/dev/sda1
18 >> }
19 >> ========================================================================
20 >
21 > Thanks. It's nice to have a working example. Are you booting via
22 > BIOS? I'm on a UEFI-only machine, and the generated grub.cfg has...
23
24 The example above is BIOS boot with a GPT labelled root disk.
25
26 Now that you've reminded me, I do have one UEFI system, and it does
27 contain a few extra global lines. It's also GPT labelled, and still
28 contains the original Lenovo Win10 installation -- I shrunk the Win10
29 partition and added two new partitions (Linux root, Linux
30 swap). Below is the grub.cfg for that machine:
31
32 IIRC, it worked fine without any of the gfx/font/video stuff, but like
33 you I wanted a nice big font.
34
35 Note that on this machine I just tell grub to search for the
36 filesystem with the label "root" instead of specifying it manually --
37 though it is still specified manually for the kernel argument. I don't
38 remember why I did that...
39
40
41 ========================================================================
42 timeout=5
43
44 loadfont "DejavuSansMono24"
45 set gfxmode=auto
46 set gfxpayload=keep
47 insmod all_video
48 insmod gfxterm
49 terminal_output gfxterm
50
51 search --set=root --label rootfs
52
53 sleep 2
54
55 menuentry vmlinuz-5.10.27-gentoo {
56 linux /boot/vmlinuz-5.10.27-gentoo root=/dev/nvme0n1p5
57 }
58
59 menuentry 'vmlinuz-5.4.97-gentoo' {
60 linux /boot/vmlinuz-5.4.97-gentoo root=/dev/nvme0n1p5
61 }
62
63 menuentry 'vmlinuz-4.19.175-gentoo' {
64 linux /boot/vmlinuz-4.19.175-gentoo root=/dev/nvme0n1p5
65 }
66 ========================================================================

Replies

Subject Author
Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name? Walter Dnes <waltdnes@××××××××.org>