Don't edit /etc/grub.d/grub.cfg

Bruce Dubbs bruce.dubbs at
Mon Aug 23 20:38:09 PDT 2010

DJ Lucas wrote:
> Wow, first time I've messed with grub 2, and I had like 6 kernels still
> hanging around and the result was just plain ugly!  Is there any reason
> we are recommending that the user edit grub.cfg manually instead of
> using the /etc/grub.d directory as intended?

Because it requires editing the /etc/grub.d files unless you name your 
kernels just right. Also, if you do customization, it trashes what you did.

Using the /etc/grub.d files is just harder for LFS users.

> The grub config files are simply shell scripts, and stdout gets put into
> the output file of grub-mkconfig (you can redirect to stderr in order to
> print a nice message to the screen as in the example below).  I'd much
> rather get rid of /etc/grub.d/10_linux (by making it not executable) and
> let the users define what is needed as opposed to searching for kernels
> to make the file.


> Additionally, we can comment out the search line in 00_header (since it
> is pretty much useless on default build) and add some additions there
> (like background image, or prettier colors, etc.).  

Wow.  I think that's a lot harder than just editing a file.  To add a 
new kernel, you just need to add 2 lines.

menuentry "LFS SVN 20100627, Linux 2.6.34" {
         linux   /linux-2.6.34 root=/dev/sda13 ro

> Also, I don't know
> what 30_os-prober does, but thus far, it has been empty.

Debian and probably other distros use it to find things like Windows and 
add them to the .cfg file.

   -- Bruce

More information about the lfs-dev mailing list