From: Jason Heeris on
I use runlevel 3 for non-X boots (gdm, etc is disabled), and to boot
into it I append "3" to my "normal use" entry in the GRUB2 menu. I'd
like to just automatically generate the extra line, so that even after
a kernel upgrade it'll still be there (but obviously for the new
kernel).

There was a way to do this in legacy GRUB, but it's been so long I
can't remember what it was (I think there was an automagic kernel
entry generation section in menu.lst?).

Is there an easy way to do this with GRUB2? I know my way around the
GRUB2 config scripts and defaults file to some extent, but I'm no
expert.

Cheers,
Jason Heeris


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTikI7ZOsXhB9WBF-LLIL_J4ZWgCSw97Ua8E2Gi9v(a)mail.gmail.com
From: Florian Kulzer on
On Tue, Jun 08, 2010 at 21:35:53 +0800, Jason Heeris wrote:
> I use runlevel 3 for non-X boots (gdm, etc is disabled), and to boot
> into it I append "3" to my "normal use" entry in the GRUB2 menu. I'd
> like to just automatically generate the extra line, so that even after
> a kernel upgrade it'll still be there (but obviously for the new
> kernel).
>
> There was a way to do this in legacy GRUB, but it's been so long I
> can't remember what it was (I think there was an automagic kernel
> entry generation section in menu.lst?).
>
> Is there an easy way to do this with GRUB2? I know my way around the
> GRUB2 config scripts and defaults file to some extent, but I'm no
> expert.

If you want to append additional parameters to the kernel command line,
configure it via GRUB_CMDLINE_LINUX_DEFAULT or GRUB_CMDLINE_LINUX in
/etc/default/grub.

If you want to add further entries to the grub boot menu, that can be
handled by a script in /etc/grub.d/ (see the README in that directory).

--
Regards, |
Florian |


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100608205626.GA3967(a)isar.localhost
From: Jason Heeris on
> If you want to append additional parameters to the kernel command line,
> configure it via GRUB_CMDLINE_LINUX_DEFAULT or GRUB_CMDLINE_LINUX in
> /etc/default/grub.

No, I want to generate an extra entry for each kernel for runlevel 3,
automatically.

> f you want to add further entries to the grub boot menu, that can be
> handled by a script in /etc/grub.d/ (see the README in that directory).

It's not worth duplicating and hacking a 130 line bash script just to
save some typing at boot time, I think :)

<rant>
Incidentally, that README file doesn't really achieve much. What are the
parameters to those scripts? What is the specification for their output?
(Presumably something approximating the example file in
/usr/share/doc/grub-pc/examples?) This information isn't available in
the man pages for grub, update-grub or grub-mkconfig either.
</rant>

Thanks anyway :)

- Jason


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4C0FBCC4.5050000(a)gmail.com
From: Tom H on
On Tue, Jun 8, 2010 at 9:35 AM, Jason Heeris <jason.heeris(a)gmail.com> wrote:
> I use runlevel 3 for non-X boots (gdm, etc is disabled), and to boot
> into it I append "3" to my "normal use" entry in the GRUB2 menu. I'd
> like to just automatically generate the extra line, so that even after
> a kernel upgrade it'll still be there (but obviously for the new
> kernel).
>
> There was a way to do this in legacy GRUB, but it's been so long I
> can't remember what it was (I think there was an automagic kernel
> entry generation section in menu.lst?).
>
> Is there an easy way to do this with GRUB2? I know my way around the
> GRUB2 config scripts and defaults file to some extent, but I'm no
> expert.

You can either populate "/etc/grub.d/40_custom" manually or duplicate
"/etc/grub.d/10_linux" and edit it to suit your purpose.

For grub1, the only way that I can see doing this
automatically/automagically is to replace the single/recovery entries
by init3 entries. You could do the same for grub2 by editing 10_linux
but grub-pc updates will most probably overwrite your changes (simple
ones though).


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTinRkrS9pj2ruc5B0wf6Wtiawpe4W6PNLx4UOiRF(a)mail.gmail.com
From: Jason Heeris on
> For grub1, the only way that I can see doing this
> automatically/automagically is to replace the single/recovery entries
> by init3 entries.

I just found my old menu.lst - there was a section that started:

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

You could add an arbitrary number of entries for each kernel, to be
generated automatically:

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(single-user) single
# altoptions=(console only) 3
# altoptions=(recovery mode) single

So you could have three for each kernel.

It's a minor convenience though, and like I said in my other email, not
really worth the effort of rewriting a bash script (I hate them, and I
dream of a day when bash scripts longer than five lines are banned by
the UN, punished by having to manually sort through a 10TB filesystem
full of filenames with spaces in them).

If I were going to do anything, I'd patch the existing script to do
something like this and submit a patch. But no promises.

Cheers,
Jason


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4C103075.1080308(a)gmail.com