10.92. GRUB-2.00

The GRUB package contains the GRand Unified Bootloader.

10.92.1. Installation of GRUB

[Note]

Note

If you would like use a different bootloader than this one you can go to the following link for alternative bootloaders and the instructions to use them. http://trac.cross-lfs.org/wiki/bootloaders

[Note]

Note

This package is known to have issues when its default optimization flags (including the -march and -mtune options) are changed. If any environment variables that override default optimizations have been defined, such as CFLAGS and CXXFLAGS, unset them when building GRUB.

Glibc-2.19 does not declare gets():

sed -i -e '/gets is a/d' grub-core/gnulib/stdio.in.h

Prepare GRUB for compilation:

./configure --prefix=/usr \
    --sysconfdir=/etc --disable-werror

Compile the package:

make

To test GRUB you must have QEMU installed and then, issue:

make check

Install the package:

make install

10.92.2. Configuring GRUB

Now that grub is installed, we need to configure the defaults that will be used to generate the configuration after we install the kernel. Create this file with the following:

install -m755 -dv /etc/default
cat > /etc/default/grub << "EOF"
# Begin /etc/default/grub

GRUB_DEFAULT=0
#GRUB_SAVEDEFAULT=true
GRUB_HIDDEN_TIMEOUT=
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=Cross-LFS

GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX_DEFAULT=""

#GRUB_TERMINAL=console
#GRUB_GFXMODE=640x480
#GRUB_GFXPAYLOAD_LINUX=keep

#GRUB_DISABLE_LINUX_UUID=true
#GRUB_DISABLE_LINUX_RECOVERY=true

#GRUB_INIT_TUNE="480 440 1"

#GRUB_DISABLE_OS_PROBER=true

# End /etc/default/grub
EOF

The meaning of the above options and possible alternate values:

GRUB_DEFAULT=

Write Me

GRUB_SAVEDEFAULT=

Write Me

GRUB_HIDDEN_TIMEOUT=

Write Me

GRUB_HIDDEN_TIMEOUT_QUIET=

Write Me

GRUB_TIMEOUT=

Write Me

GRUB_DISTRIBUTOR=

Write Me

GRUB_CMDLINE_LINUX=

Write Me

GRUB_CMDLINE_LINUX_DEFAULT=

Write Me

GRUB_TERMINAL=

Write Me

GRUB_GFXMODE=

Write Me

GRUB_GFXPAYLOAD_LINUX=

Write Me

GRUB_DEFAULT=

Write Me

GRUB_DISABLE_LINUX_UUID=

Write Me

GRUB_DISABLE_LINUX_RECOVERY=

Write Me

GRUB_INIT_TUNE=

Write Me

GRUB_DISABLE_OS_PROBER=

Write Me

10.92.3. Contents of GRUB

Installed programs: grub, grub-install, grub-md5-crypt, grub-set-default, grub-terminfo, and mbchk
Installed directories: /usr/lib/grub, /boot/grub

Short Descriptions

grub

The Grand Unified Bootloader's command shell

grub-install

Installs GRUB on the given device

grub-md5-crypt

Encrypts a password in MD5 format

grub-set-default

Sets the default boot entry for GRUB

grub-terminfo

Generates a terminfo command from a terminfo name; it can be employed if an unknown terminal is being used

mbchk

Checks the format of a multi-boot kernel