lfs-uefi: fix efivar-37 FTBFS
[linux_from_scratch_hints.git] / syslinuxen.txt
blob0e308c09f4df32109d32773c26d8a7b0829968f1
1 AUTHOR : Denis Mugnier <myou72 at orange point fr>
3 DATE : 2012-15-06
5 LICENSE : Creative Commons Attribution-Share Alike 3.0
6          (http://creativecommons.org/licenses/by-sa/3.0/)
8 SYNOPSIS : Installation of syslinux instead of grub
10 DESCRIPTION :
11  Syslinux is a small and fast bootloader.
13 PRE-REQUISITIES :
14 A working LFS (tested with a LFS 7.0). 
15   It is useful to have a LFS with GRUB installed, which can already boot.
16 nasm (see BLFS)
17 python (see BLFS : python 2.7)
19 HINT:
21 The purpose of this hint is to replace GRUB, in a working LFS, or install Syslinux
22 in a LFS you are building
24 ATTENTION : the tricks of this hint will install a bootloader; these tricks
25 are potentially dangerous for your system. If there is a problem, the system may
26 not boot anymore.
28 Step 1 : Downloading the source and untar them
29 You can download the source at:
31 http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-4.05.tar.xz
33 Next, you need to untar them
35 tar -xf syslinux-4.05.tar.xz
37 The source also contains the binaries of the files. If desired, it is possible to
38 skip compilation.
40 Step 2  : Compilation
42 The compilation is quite simple:
44 make
46 Note: The compilation needs nasm and python .
48 Step 3 : Installation of the binaries
50 Using the following command:
52 make install
54 The "syslinux" installers are now installed on your LFS
56 Step 4 : Booting with Syslinux
58 Here is the interesting part of the hint. Note that this hint only deals with
59 using extlinux, which enables a system to boot from an ext2, ext3 or ext4
60 partition. It is possible to use syslinux to boot from a CD, a FAT disk, etc...
61 For more information about the other methods, see the official website 
62 (www.syslinux.org)
64 You need to create a directory to install the bootloader 
66 mkdir /boot/extlinux
68 then use extlinux to install the bootloader
70 extlinux --install /boot/extlinux
72 Step 5 : Configuring
74 The configuration will be in a /boot/extlinux/syslinux.conf file
76 In its shortest aspect, this file will contain:
78 DEFAULT lfs
79 LABEL lfs
80    KERNEL /boot/vmlinuz.img
81    APPEND ro root=/dev/xxx
83 vmlinuz.img : kernel image, or some symlink to the kernel image
84 /dev/xxx : partition which contains your system
86 For more information about the configuration file, I suggest you to see
87 the documentation. It is possible to have a menu and choose what system you would
88 like to boot, boot in PXE, display a file, ...
90 You need to check that your partition is configured properly to boot (with the
91 boot flag) 
93 To set this flag:
95 fdisk /dev/yyy  (with yyy the disk name e.g. sda, sdb, etc)
96 then, choice a
97 then give the partition number which should have the Boot flag.
98 Press w to save
100 For example, to set the /dev/sda1 partition with the boot flag:
102 fdisk /dev/sda
103 Command (m for help): a
104 Partition number (1-4): 1
105 Command (m for help): w
107 Then, you need to set the mbr (it will replace the grub installation if it has
108 already been installed)
110 In the source tree, change to the mbr directory
112 then run the command
114 cat mbr > /dev/yyy (with yyy the boot disk name, e.g. sda, sdb ...)
116 Step 6 : test
118 Now the installation is completed, the system must be rebooted to check that
119 syslinux works properly.
121 ATTENTION : You should create a rescue boot media for your system. If 
122 syslinux has a problem, your system will not reboot. You should have a
123 liveCD, to rescue if you have a problem.
125 Normally, with the minimal configuration file created above, your computer should
126 start directly on the LFS kernel.
128 Syslinux is installed.