-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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?

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.

Example:
==============================================================
cat > /etc/grub.d/11_LFS-6.7 << "EONF" &&
#! /bin/sh -e
echo "Adding LFS-6.7" >&2
cat << EOF
menuentry "LFS-6.7" {
echo    Starting LFS-6.7...
linux   /vmlinux-2.6.35.2 root=/dev/sda6 ro
}
menuentry "LFS-6.7 (recovery)" {
echo    Starting LFS-6.7 in recovery mode...
linux   /vmlinux-2.6.35.2 root=/dev/sda6 ro single
}
EOF
EONF

cat > /etc/grub.d/12-LFS-6.6 << "EONF" &&
#! /bin/sh -e
echo "Adding LFS-6.6" >&2
cat << EOF
menuentry "LFS-6.6" {
echo    Starting LFS-6.6...
linux   /vmlinux-2.6.32.15 root=/dev/sda5 ro
}
menuentry "LFS-6.6 (recovery)" {
echo    Starting LFS-6.6 in recovery mode...
linux   /vmlinux-2.6.32.15 root=/dev/sda5 ro single
}
EOF
EONF

cat > /etc/grub.d/13_Windows << "EONF" &&
#! /bin/sh -e
echo "Adding Windows" >&2
cat << EOF
menuentry "Windows" {
set root=(hd0,1)
chainloder +1
}
EOF
EONF
chmod 755 /etc/grub.d/11_LFS-6.7 &&
chmod 755 /etc/grub.d/12_LFS-6.6 &&
chmod 755 /etc/grub.d/13_Windows &&
chmod 644 /etc/grub.d/10_linux &&
grub-mkconfig -o /boot/grub/grub.cfg
===============================================================

The first example give a little more info to the user as to what is
going on, but the alternate is to use 40_custom like so (untested):
===============================================================
cat >> /etc/grub.d/40_custom << "EOF" &&
menuentry "LFS-6.7" {
echo    Starting LFS-6.7...
linux   /vmlinux-2.6.35.2 root=/dev/sda6 ro
}
menuentry "LFS-6.7 (recovery)" {
echo    Starting LFS-6.7 in recovery mode...
linux   /vmlinux-2.6.35.2 root=/dev/sda6 ro single
}
menuentry "Windows" {
set root=(hd0,1)
chainloder +1
}
EOF
chmod 644 /etc/grub.d/10_linux &&
grub-mkconfig -o /boot/grub/grub.cfg
===============================================================

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.).  Also, I don't know
what 30_os-prober does, but thus far, it has been empty.

- -- DJ Lucas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)

iQIcBAEBAgAGBQJMczYIAAoJEIUM+xKzBYsIV/IQAIaOY64lnhf6nLtfn9TNxThN
zA3PUIP3Zs3ZaMvYeqmvfAhLCydeM9mFla+x95w0YnNTlCbCvGAhkxl394Egt7au
xZHxXKTmcR/cXo7YjXtRRvHiFI9XY8dfocv1F3tLucm/8xMRwXCJx5uHJdUOMY/T
e442lT13MJtJPG2BJVQgBTr8wVK/Bs+w72dcP88slZoI5pykk9NtKlf9Jt5qiP/L
CkFzcAC5/+aa2FVESoNGCIV2dbU3YvbDp4nAoFvKeJQzI68i0xo/XyWH8xbhxQ/p
pa8EhJektvhRU3XgPUSTV1F7rSkqdv3Xu1z7kUH72dBPgXuNCOWr/qHrcpfCaBH4
KD6PONn2zXsRcSxK18AJgghW7Wh290QIrRIercskaqAtUaEsAy1wpQDqnSeW8BXu
HvmSnXcsJMPyqUMwK2M1q8zJ/AVp/qJEy24hMIaNON1LxFkXmE/IAhKVT9dCUWeN
YI7zJz0XbyuFlhfXNe1rEnfCeZzDsvavG1MHDJw7h7bPBBaoz1Z1uO6MC58Rw+co
rqIm0qsO9iJeFcyO0soobel2kqoqSsyxmf5Khaqmg0wDAPhdJ2YC+NZSXJUB5hal
1EO0BkH99UAmHm3HqSMsPJE0NUh76CYSnPjoM3VwHutVpTnuNQbV8mciBbWDdXYS
FgoZbIYDgHiMPUSsLnUl
=xfGD
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content, and is believed to be clean.

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to