Gentoo/Syslinux Bootloader

Page last edited 1,392 days 13 hours ago
From Alon Bar-Lev's Site
Jump to: navigation, search

Syslinux Bootloader

People probably don't know that sys-boot/syslinux bootloader is good replacement to other "advanced" bootloaders such as Grub.

For sure syslinux is better maintained than Grub, so after long time of using Grub I switched.

Unlike Grub syslinux is well behaved bootloader and does not need any special requirement.

syslinux components:

  • syslinux - FAT filesystem bootloader.
  • extlinux - ext2 filesystem bootloader.
  • pxelinux - network pxe bootloader.
  • isolinux - ISO-9660 (cdrom) bootloader.

This manual should be kept simple for most of common usages (extlinux, syslinux), for advanced usages refer to upstream site or other pages.

Installation

emerge sys-boot/syslinux
Warning: Assuming /dev/sda1 is the boot partition, if not make the adjustments!

Install MBR:

cat /usr/share/syslinux/mbr.bin > /dev/sda

Set boot partition as active:

fdisk /dev/sda
Command (m for help): a
Partition number (1-4): 1
Command (m for help): w

extlinux bootloader installation

Warning: Assuming /dev/sda1 is the boot partition, if not make the adjustments!
mount /dev/sda1 /boot
extlinux --install /boot
umount /boot

syslinux bootloader installation

Note: Most probably you don't need to use FAT filesystem these days, consider ext2 filesystem for your boot partition
Warning: Assuming /dev/sda1 is the boot partition, if not make the adjustments!
mount /dev/sda1 /boot
syslinux --install /dev/sda1
umount /boot

= pxelinux bootloader installation

TODO

Configuration

Configuration file varies between bootloaders:

  • syslinux - syslinux.cfg
  • extlinux - extlinux.conf
  • isolinux - isolinux.cfg

The configuration format is the same.

Simple configuration

File: extlinux.conf
LABEL x86_64-3.1.0-gentoo-r1
KERNEL kernel-x86_64-3.1.0-gentoo-r1
INITRD initramfs-x86_64-3.1.0-gentoo-r1
APPEND real_root=/dev/sda3

Menu configuration

The following configuration provides a simple text menu example.

This is done via the vesamenu module, in some cases where vesa is not compatible, the simpler menu module will work.

Logic:

  1. Do not wait for user interaction and select the "menu" configuration.
  2. The "menu" configuration entry actually loads the "vesamenu.c32" module.
  3. The vesamenu module reads the same configuration file, but now present entries as menu entries.
  4. The "menu" entry will be hidden.
  5. After 3 seconds (3*10=30) The default x86_64-3.1.0-gentoo-r1 entry will be selected.

Copy the VESA menu module into the boot filesystem.

cp /usr/share/syslinux/vesamenu.c32 /boot
File: extlinux.conf
PROMPT 0
DEFAULT menu

TIMEOUT 30
ONTIMEOUT x86_64-3.1.0-gentoo-r1

MENU TITLE Boot

LABEL x86_64-3.1.0-gentoo-r1
KERNEL kernel-x86_64-3.1.0-gentoo-r1
INITRD initramfs-x86_64-3.1.0-gentoo-r1
APPEND real_root=/dev/sda3

LABEL x86_64-3.1.0-gentoo
KERNEL kernel-x86_64-3.1.0-gentoo
INITRD initramfs-x86_64-3.1.0-gentoo
APPEND real_root=/dev/sda3

LABEL menu
MENU HIDE
KERNEL vesamenu.c32

Maintainer

Alon Bar-Lev

Authors

Originally written by: Alon Bar-Lev - 2011-11-17


Authors are people who have worked on this document and have made significant changes to its content. If you have edited this article and wish to add yourself to the authors list please read "Who are Authors".