202.3. Alternate Bootloaders

Weight: 2

Description: Candidates should be aware of other bootloaders and their major features.

Key Knowledge Areas:

  • SYSLINUX, ISOLINUX, PXELINUX

  • Understanding of PXE for both BIOS and UEFI

  • Awareness of systemd-boot and U-Boot

Terms and Utilities:

  • syslinux

  • extlinux

  • isolinux.bin

  • isolinux.cfg

  • isohdpfx.bin

  • efiboot.img

  • pxelinux.0

  • pxelinux.cfg/

  • uefi/shim.efi

  • uefi/grubx64.efi

Linux Boot Loader

The grandfather of all linux boot loaders is LiLo (Linux boot Loader). LiLo has its configuration file in /etc/lilo.conf which was compiled to binary and reside on first sectors of hard disk. But all those good days of simplicity have been passed.

LiLo has some shortages which is way grub and grub2 has developed. But beside these Boot Loaders there are some other Boot Loaders which are not leaders but have been developed for specific purposes. As not all system has ext file system, we might need to load linux from inside of other files systems or partitions:

Boor Loader

Supported File System(s)

Used Media

syslinux

ms-dos (FAT32)

USB

ext linux

FAT32 , ext3, ext4

usually used on Hard Disk

iso linux

create .iso files

CD/DVD

syslinux

Lets try syslinux , we want to make a bootable usb disk using syslinux on 8 gig flash with FAT32 file system:

Lets install syslinux in our system:

And install syslinux on the flash:

This command copy tiny file /usr/lib/syslinux/mbr/mbr.bin on the first 512 bytes of flash disk and make it bootbale.

make a folder in order to put linux sources there:

syslinux configuration file is syslinux.cfg, create like this:

Now make desired folder in /syslinux/iso/... and copy source files:

as we are using FAT32 file system symbolic links are not supported so that right, lets chek:

extlinux

extlinux is another member of syslinux family, lets install and use it intead of grub in our system:

and create syslinux.cfg in /boot/extlinux/ directory like this:

and enjoy the result:

isolinux

now create isolinux.cfg file insode cdroot/ directory :

Lets create bootable media from folder that we have made:

and lets boot the system with bootcd.iso :

you can see that the system will be booted up using initrd and vmlinuz that we have put in CD and then follow next required steps from hard disk.

uefi/shim.efi & uefi/grubx64.efi

As we have talked uefi runs everything which we have put inside EFI System Partition, special FAT32 partition. So from security perspective its some how dangerous. Because boot loaders might be changed or manipulated.To avoid that we can digitally sign boot loaders. But the problem is that boot loaders update! They are changed time to time. Using a tiny fix boot loader before main boot bootloader which loads before main bootloader(grub) and run it in sub sequence. So in case of update or upgrade this tiny boot loader remains safe and secure and just watch for grub folder changes in order to refer to it. this tine bootloader is shim.efi.

lets take a look at inside and verify if its calling grub:

and to see what is inside grubx64.efi:

PXELINUX

Up to now we have booted up our system with Hard Disk, USB drive and CD/DVD ROM. The last topic here is booting up your system trough the network. Pixie or Pre Execution Environment is a name which is called to this environment. It describe standardize client-server environment at which client has a pxe-support network interface and its able to boot up from the network. Obviously client cant be alone in this environment and we need DHCP, TFTP and nfs servers.

How dose it work ?

When Client boots up it starts asking for an ip address, DHCP server receives its requests and as our client is pxe-support, DHCP gives it an IP Address and the IP address of TFTP server and required files. Now taht client has an IP address goes for TFTP server and download boot loader and the kernel stuff form TFTP server. Kernel and its modules are downloaded by the client trough the network and they are loaded into RAM. And part of kernel loading process it Tries to mount root partition by mounting it from a NFS server. and system boots up .

Last updated