Difference between revisions of "Configuring LILO"
| Line 51: | Line 51: | ||
* <code>install</code> This option specifies the type of screen which will be seen when the bootloader starts. Normally, this will be set to <code>text</code>, which presents the simple interface shown in the examples on this page. The <code>menu</code> option provides a nicer way to select an image to boot, but is usually not desirable to have on an embedded machine. The <code>bitmap</code> option provides a graphical boot screen which looks very nice on a desktop installation, but is usually only used on an embedded machine when the product calls for showing graphics as early in the boot process as possible; a logo is typically placed here in such a case. | * <code>install</code> This option specifies the type of screen which will be seen when the bootloader starts. Normally, this will be set to <code>text</code>, which presents the simple interface shown in the examples on this page. The <code>menu</code> option provides a nicer way to select an image to boot, but is usually not desirable to have on an embedded machine. The <code>bitmap</code> option provides a graphical boot screen which looks very nice on a desktop installation, but is usually only used on an embedded machine when the product calls for showing graphics as early in the boot process as possible; a logo is typically placed here in such a case. | ||
* <code>compact</code> Speeds up booting by merging read requests. | * <code>compact</code> Speeds up booting by merging read requests. | ||
| + | * <code>append</code> Various append options can be added that will be passed to the kernel during the boot process. In the example, the boot messages will be output to the serial console. | ||
====Per-Image Options==== | ====Per-Image Options==== | ||
Revision as of 13:21, 3 January 2014
Contents
Configuring LILO
LILO is easily configurable by editing the lilo.conf file then running LILO to use the new configuration options. The configuration for LILO created by EMAC and shipped with a system will usually suffice, although customization may be required. The information provided here provides a description for the important lilo configuration options.
Typical lilo.conf
boot=/dev/sda
map=/boot/map
lba32
#linear
disk=/dev/sda
bios=0x80
read-only
prompt
timeout=5
vga=normal
install=text
compact
#This is for bootloader input from the serial console (ttyS0,9600,8,n,1):
#serial=0,9600n8
image=/boot/bzImage
root=/dev/sda1
label=emac-oe
#This is for boot messages redirected to the serial console (ttyS0):
append="console=ttyS0,115200"
Sections of the LILO Configuration File
The LILO configuration file is split into two sections: global and per-image. The global section specifies options that pertain to LILO itself and to all images specified in the file. The per-image section specifies options that apply to a specific image, some of which may override the global options.
Global Options
The LILO configuration file needs the following options, at a minimum, configured for the global settings:
diskThis option specifies the disk to which the LILO bootloader needs to be written. This should always point to the device node currently associated with the disk. For example, when mounted on a desktop, this may be/dev/sdc, which is (usually) the third "SCSI" device connected to the system. If it were mounted through the IDE subsystem instead, its device node would appear like/dev/hdcinstead.mapThis option specifies the location of the map file to use. Usually, this will be/boot/map.lba32This option tells LILO to use 32-bit Logical Block Addresses instead of cylinder/head/sector addresses. This is needed for any disk with more than 1024 cylinders. Since the vast majority of modern drives have more than 1024 cylinders, this option should always be specified.bootThis option specifies the device which contains the boot sector. As with thediskoption, this should always be the device node associated with the disk on the current system. For example,boot=/dev/sdc
Additional useful options:
vgaFor systems which have video, this option specifies the video mode the device should use while booting.serialThis option allows the bootloader to accept input from a serial line and specifies a serial device and configuration to which a console should be attached. For example, to use the/dev/ttyS0serial device (the default console port on many boards) as a serial console which communicates as 115,200 baud, 8 bits, with no stop bits:serial=0,115200n8timeoutThis specifies the amount of time to wait before timing out and continuing on with the boot process using the configured defaults. This allows some time for the user to hit TAB to specify additional options to the kernel. This value is specified in deciseconds and must be greater than 0. For example, to set this value to 4.3 seconds:timeout=43read-onlyThis option tells LILO to mount the root filesystem as read-only. This is usually desired, since the Linux kernel will remount the device as writeable (if it needs to) once the boot process has been handed over to it.installThis option specifies the type of screen which will be seen when the bootloader starts. Normally, this will be set totext, which presents the simple interface shown in the examples on this page. Themenuoption provides a nicer way to select an image to boot, but is usually not desirable to have on an embedded machine. Thebitmapoption provides a graphical boot screen which looks very nice on a desktop installation, but is usually only used on an embedded machine when the product calls for showing graphics as early in the boot process as possible; a logo is typically placed here in such a case.compactSpeeds up booting by merging read requests.appendVarious append options can be added that will be passed to the kernel during the boot process. In the example, the boot messages will be output to the serial console.
Per-Image Options
The following options are needed to configure images to be available to boot with LILO:
imageThis option specifies the location of the kernel to boot. Commonly, this will be/boot/bzImageor/boot/bzImage-custom-3.10.2. bzImage is commonly a symbolic link to the actual kernel filename. This is done so that lilo.conf does not have to be changed when a new kernel is installed.rootThis option specifies the root partition of the device to mount for the image. This is typically/dev/hda1or/dev/sda1labelThis option tells LILO by what name to call the image. For instance, this is usuallylabel=emac-oefor a standard EMAC image, but for a custom product under development, it might belabel=custom-image-test-v3
Working with LILO Configurations
The above information describes the common options and how to set them. Additional information can be found by reading through the manual page for lilo.conf. This manpage is available on many sites online and on the LILO user's guide.
Using these options to create a configuration file is done most easily by copying the EMAC provided LILO configuration file, then modifying the copy. It is a good practice to make sure a bootable flash card is set aside in case of difficulties with getting the modified flash card back into a bootable state. Also, keep a separate copy of lilo.conf e.g. lilo.conf.boot to use when installing LILO from a Linux PC so that the boot and disk options can be set for installing LILO either on the target device or from the compact flash.