Gentoo Archives: gentoo-dev

From: Tom H <tomh0665@×××××.com>
To: Gentoo Devel <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] grub-2 configuration
Date: Tue, 18 Oct 2016 16:45:49
Message-Id: CAOdo=SycN4o6v6J9p8m0iN4xyZ+=MBLoZyA-xQweY_USb38uHQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] grub-2 configuration by "M. J. Everitt"
1 On Tue, Oct 11, 2016 at 10:54 AM, M. J. Everitt <m.j.everitt@×××.org> wrote:
2 > On 11/10/16 15:42, Tom H wrote:
3 >>
4 >> You can use exactly the same text in 40_grub that you'd use in
5 >> grub.cfg and have the latter generated.
6 >
7 > That's a useful tit-bit .. thanks!
8
9 You're welcome.
10
11 I doubt that the grub developers intended 40_custom to be the only
12 "/etc/grub.d/" file to be executed but it's practical for generating a
13 simple grub.cfg. This is what I use in a Debian VM:
14
15 #!/bin/sh
16
17 cat <<EOF
18 # kernel
19 insmod gzio
20
21 # disk/partition
22 insmod part_msdos
23
24 # filesystem
25 insmod ext2
26
27 # /boot
28 search --no-floppy --fs-uuid --set=root e14bb0ac-4b43-41db-ac97-d67feaa7e291
29
30 # video
31 terminal_input console
32 terminal_output console
33
34 # menu
35 set default=0
36 set timeout=2
37
38 menuentry 'upstream 4.8.2' {
39 linux /boot/vmlinuz-4.8.2 root=UUID=e14bb0ac-4b43-41db-ac97-d67feaa7e291 ro
40 }
41
42 menuentry 'distro 4.6' {
43 linux /boot/vmlinuz-4.6.0-1-amd64
44 root=UUID=e14bb0ac-4b43-41db-ac97-d67feaa7e291 ro
45 initrd /boot/initrd.img-4.6.0-1-amd64
46 }
47 EOF

Replies

Subject Author
Re: [gentoo-dev] grub-2 configuration Joakim Tjernlund <Joakim.Tjernlund@××××××××.com>