Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] GRUB: Configuring a softlevel for grub
Date: Thu, 30 Jun 2016 18:40:13
Message-Id: 20160630193947.2af50df2@digimed.co.uk
In Reply to: [gentoo-user] GRUB: Configuring a softlevel for grub by Ian Zimmerman
1 On Thu, 30 Jun 2016 10:51:13 -0700, Ian Zimmerman wrote:
2
3 > > Edit the bootloader configuration and add a new entry for the offline
4 > > runlevel. In that entry, add softlevel=offline as a boot parameter.
5 >
6 > In my case the bootloader is grub2. Looking at the way
7 > /boot/grub/grub.cfg is generated, the Linux menu entries come from
8 > /etc/grub.d/10_linux, and that script is hardwired to create exactly one
9 > normal entry per kernel version, plus maybe a rescue entry that boots
10 > into single user. There is no provision for additional multiuser
11 > entries. So I have to create my own, but this seems to imply I have to
12 > do one of:
13 >
14 > 1. modify 10_linux itself: huge, complex, dangerous
15 >
16 > 2. copy 10_linux into a new file and edit just the single line with boot
17 > params: ugly, fragile if 10_linux changes
18 >
19 > Any other way? I dream of somehow "referencing" 10_linux with just the
20 > GRUB_CMDLINE_LINUX_DEFAULT variable changed.
21
22 Use the 40_custom file, renumbering it if you need to change the order.
23
24 Or you can replace 10_linux with your own script. It's just a shell
25 script that spits out menuentry stanzas. 10_linux is quite complex
26 because it has to handle everything, but something customised for your
27 own needs can be much simpler.
28
29 Or run grub2-mkconfig then hand edit grub.cfg to add the extra entries.
30
31 There are always plenty of choices with GRUB.
32
33
34 --
35 Neil Bothwick
36
37 If at first you do succeed, try to hide your astonishment.

Replies

Subject Author
[gentoo-user] Re: GRUB: Configuring a softlevel for grub Ian Zimmerman <itz@××××.org>