help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Customize grub


From: Franklin PIAT
Subject: Re: Customize grub
Date: Mon, 11 Feb 2008 09:13:26 +0100

Even though I'm not a grub developer, i'll try to answer some of your
questions..

On Mon, 2008-02-11 at 01:54 +0100, Cesare Leonardi wrote:
> I'm trying grub2 (1.96) inside qemu, using Debian Sid.
> Grub2 was installed as an upgrade from grub1 and everything went smooth.
> 
> The question is: and now how can i customize my boot loader?

Quick outlook of how grub.cfg is created :
update-grub creates /boot/grub/grub.cfg using the files
in /etc/grub.d/* (let's call them scriptlets). the behaviour of those
scriptlets can be customised  based on the variables defined
in /etc/default/grub

Generally speaking you customise your boot loader  :
1. Set variables in /etc/default/grub (GRUB_CMDLINE_LINUX GRUB_DEFAULT
GRUB_TIMEOUT   GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_PRELOAD_MODULES).
2. Add your own scriptlet (especially if you need extra entries)
3. Tweak existing scriptlets (probably not a good idea, but your changes
are preserved during upgrades since those files are considered by debian
as conffiles).

then re-run update-grub

> How can i add my boot entry with my customized settings? 
If you simply want to customize linux command line, use the variable
GRUB_CMDLINE_LINUX in /etc/default/grub

To add a menu entry, create a scriptlet in /boot/grub.d/ which simply
have to echo a valid "menuentry { [..] }" section. I recommend it
handles kernel upgrade automatically (new filename).
The scriptlet has to be prefixed with a number > 05 and it must be
executable.


> What is the configuration 
> add my boot entry with my customized settings? What is the configuration 
> file that i can edit manually to make experiments?
> If i open "/boot/grub/grub.cfg" a comment says that it is generated 
> automatically and so it may not be edited.

>  To enforce this, it's set read-only also for root.
You could "chmod 644" and modify it, but your modification would be lost
the next time update-grub is ran (i.e. when a new kernel is installed).

>  The same comment informs that the file is 
> generated from the "/etc/grub.d/" templates and from the instructions 
> found in "/etc/default/grub". The templates aren't conffile but scripts, 
> so not a comfortable place for a user to personalize (and understand).
I hope that modifying /etc/default/grub variables will address your
problem. that's easy.

> The latter conffile seems only for variable definitions.
> Man pages describes briefly only the specific command which they refers to.
> No help found in "/usr/share/doc/grub-pc/".
> Browsing "http://grub.enbug.org"; doesn't help me much more (a little 
> howto for a simple configuration should be very helpful).

I'm working on some documentation (currently non-offical), which are
available on :
http://wiki.debian.org/Grub/Grub2#manpages
I still "simply" have to merge those information in the grub-v1
manual to build an official grub-v2 manual.... work in progress ;)
Your comments are welcome.

Franklin








reply via email to

[Prev in Thread] Current Thread [Next in Thread]