Difference between revisions of "Configuring LILO"

From wiki.emacinc.com
Jump to: navigation, search
m (Undo revision 2419 by Mgloff (talk))
m (Fixed tag.)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{todo|(12.16.13-02:25->MD+);(12.16.13-15:15->MD+);(12.17.13-11:45->MW+);(12.17.13-15:25->KY+)|Mike Dean|project=oe 4,oe 5,md,mw,complete}}
+
{{todo|Complete (12.16.13-02:25->MD+);(12.16.13-15:15->MD+);(12.17.13-11:45->MW+);(12.17.13-15:25->KY+);(03.06.14-15:40->BS-);(03.17.14-13:10->MD-);(04.11.14-16:50->BS+);(11.13.2015-16:15->MD+)(11.13.2015-16:25->KY+);(11.13.2015-16:30->ER+)|Mike Dean|project=oe 4,oe 5,md,Complete,mw,bs,er}}
 +
 
 +
 
 +
{{#seo:
 +
|title=Configuring LILO
 +
|titlemode=append
 +
|keywords=LILO,LILO Configuration,LILO config
 +
|description=This page describes the parts of the LILO bootloader configuration file, and provides guidance on how to work with it.
 +
}}
 +
LILO is a bootloader which provides a number of useful features while remaining compact.  This document describes the details behind configuring the LILO bootloader.
 +
 
  
 
==Configuring LILO==
 
==Configuring LILO==
  
LILO is easily configurable by editing the lilo.conf file then [[Installing_LILO | 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.
+
As with any software of moderate or better complexity, configuration is required for LILO to function as desired. The configuration created by EMAC and shipped with a system will usually suffice.  However, sometimes enough customization is required that the bootloader itself will need to be reconfigured.  Even if custom configuration isn't required, some of this information is important for protecting against accidentally overwriting the bootloader on a developer's desktop with a bootloader that was intended for an embedded machine.
===Typical lilo.conf===
+
 
<pre>
+
This page describes the parts of the LILO bootloader configuration file, and provides guidance on how to work with it.  The other LILO pages describe how to install and use the bootloader after it has been configured.
 +
 
 +
===Sections of the LILO Configuration File===
 +
 
 +
The LILO configuration file is split into two sections: global and per-image.  The global section, as the name implies, 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.
 +
 
 +
Shown here is the default configuration for most EMAC boards which make use of LILO:
 +
 
 +
<syntaxhighlight lang=bash>
 +
# This tells the LILO utility where to install LILO.  This must be changed if using a desktop
 +
# system to install LILO to a CompactFlash card.
 
boot=/dev/sda
 
boot=/dev/sda
 
map=/boot/map
 
map=/boot/map
  
 
lba32
 
lba32
#linear
+
# This is where the disk is found on the current system.  See the wiki for more information.
 
disk=/dev/sda
 
disk=/dev/sda
 +
# This indicates that the BIOS will see this drive as the first drive.
 
bios=0x80
 
bios=0x80
 
read-only
 
read-only
 
prompt
 
prompt
timeout=5
+
# This sets the prompt to wait for 2.5 seconds before automatically booting the first image.
vga=normal
+
# The time is specified in deciseconds.
 +
timeout=25
 +
vga=9
 
install=text
 
install=text
 
compact
 
compact
#This is for bootloader input from the serial console (ttyS0,9600,8,n,1):
+
# This is for lilo serial console (ttyS0,9600,8,n,1):
#serial=0,9600n8
+
#serial=0,115200n8
  
 +
# The following path points to the Linux kernel that LILO should boot.
 
image=/boot/bzImage
 
image=/boot/bzImage
        root=/dev/sda1
+
root=/dev/sda1   # This is the root filesystem for the kernel to use.
        label=emac-oe
+
label=emac-oe
        #This is for boot messages redirected to the serial console (ttyS0):
+
# These are kernel commandline parameters:
        append="console=ttyS0,115200"
+
append="console=ttyS0,115200 quiet splash=silent"
 
+
</syntaxhighlight>
</pre>
 
 
 
===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====
 
====Global Options====
Line 38: Line 57:
 
The LILO configuration file needs the following options, at a minimum, configured for the global settings:
 
The LILO configuration file needs the following options, at a minimum, configured for the global settings:
  
* <code>disk</code> This 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 <code>/dev/sdc</code>, 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 <code>/dev/hdc</code> instead.
+
* <code>disk</code> This 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 <code>/dev/sdc</code>, which is (usually) the third "SCSI" device connected to the system.  The first would be <code>/dev/sda</code>, the second <code>/dev/sdb</code>, etc.  Even though the device may not be a SCSI device, it may be mounted via a generic SCSI driver, which is why it can appear as a SCSI device.  If it were mounted through the IDE subsystem instead, its device node would appear like <code>/dev/hdc</code> instead.
 
* <code>map</code> This option specifies the location of the map file to use.  Usually, this will be <code>/boot/map</code>.
 
* <code>map</code> This option specifies the location of the map file to use.  Usually, this will be <code>/boot/map</code>.
 
* <code>lba32</code> This 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.
 
* <code>lba32</code> This 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.
Line 45: Line 64:
 
'''Additional useful options:'''
 
'''Additional useful options:'''
  
* <code>vga</code> For systems which have video, this option specifies the video mode the device should use while booting.
+
* <code>vga</code> For systems which have video, this option specifies the video mode the device should use.  The parameter to pass comes from the BSP (Board Support Profile) layer for the board.  If unsure what to set here, EMAC can provide assistance with this.
* <code>serial</code> This 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 <code>/dev/ttyS0</code> serial device (the default console port on many boards) as a serial console which communicates as 115,200 baud, 8 bits, with no stop bits: <code>serial=0,115200n8</code>
+
* <code>serial</code> This useful option specifies a serial device to which a console should be attached, as well as the configuration settings for the console. For example, to use the <code>/dev/ttyS0</code> serial device (the default console port on many boards) as a serial console which communicates as 115,200 baud, 8 bits, with no stop bits: <code>serial=0,115200n8</code>
* <code>timeout</code> This 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: <code>timeout=43</code>
+
* <code>timeout</code> This specifies the amount of time to wait before timing out and continuing on with the boot process using the configured defaults. This value is specified in deciseconds.  For example, to set this value to 4.3 seconds: <code>timeout=43</code>
 
* <code>read-only</code> This 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.
 
* <code>read-only</code> This 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.
 
* <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.
 
  
 
====Per-Image Options====
 
====Per-Image Options====
Line 56: Line 74:
 
The following options are needed to configure images to be available to boot with LILO:
 
The following options are needed to configure images to be available to boot with LILO:
  
* <code>image</code> This option specifies the location of the kernel to boot.  Commonly, this will be <code>/boot/bzImage</code> or <code>/boot/bzImage-custom-3.10.2</code>. 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.
+
* <code>image</code> This option specifies the location of the kernel to boot.  Commonly, this will be <code>/boot/bzImage</code> or <code>/boot/bzImage-custom-3.10.2</code>
* <code>root</code> This option specifies the root partition of the device to mount for the image. This is typically <code>/dev/hda1</code> or <code>/dev/sda1</code>
+
* <code>root</code> This option specifies the root partition to mount for the image. This is typically <code>/dev/hda1</code> or <code>/dev/sda1</code>
 
* <code>label</code> This option tells LILO by what name to call the image.  For instance, this is usually <code>label=emac-oe</code> for a standard EMAC image, but for a custom product under development, it might be <code>label=custom-image-test-v3</code>
 
* <code>label</code> This option tells LILO by what name to call the image.  For instance, this is usually <code>label=emac-oe</code> for a standard EMAC image, but for a custom product under development, it might be <code>label=custom-image-test-v3</code>
  
 
====Working with LILO Configurations====
 
====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 <code>lilo.conf</code>.  This manpage is available on many sites online and on the [http://lilo.alioth.debian.org/olddoc/html/user_21-5.html LILO user's guide.]
+
The above information talks about the common options and how to set them.  Additional information can be found by reading through the manual page for <code>lilo.conf</code>.  This manpage is available on many sites online.
 +
 
 +
Actually 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.
 +
 
  
Using these options to create a configuration file is done most easily by copying the EMAC provided LILO configuration file, then modifying the copyIt 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 <code>boot</code> and <code>disk</code> options can be set for installing LILO either on the target device or from the compact flash.
+
<!-- /*********************************************************************************************************/ -->
 +
<!-- /******************************************    Conclusion      ******************************************/ -->
 +
<!-- /*********************************************************************************************************/ -->
 +
{{:Templateimpl:conclusion | initials=MD | title=System Logging | desc=The page describes how to system log. | project=OE 5.0 }}
 +
LILO has a straightforward configuration syntax, but the details may not be immediately apparentThis documentation should fill in the missing pieces when you are configuring LILO.
  
==Next Step==
+
<!-- /*********************************************************************************************************/ -->
 +
<!-- /******************************************  More Information  *****************************************/ -->
 +
<!-- /*********************************************************************************************************/ -->
 +
{{:Templateimpl:moreinfo | initials=MD | title=System Logging | desc=The page describes how to system log. | project=OE 5.0 }}
 +
* [[Installing_LILO | Installing LILO]]
  
[[Installing LILO]]
+
{{:Templateimpl:whatnext | initials=MD | title=System Logging | desc=The page describes how to system log. | project=OE 5.0 }}
 +
* [[LILO_Overview | LILO Overview]]

Latest revision as of 17:43, 13 November 2015

TODO: {{#todo:Complete (12.16.13-02:25->MD+);(12.16.13-15:15->MD+);(12.17.13-11:45->MW+);(12.17.13-15:25->KY+);(03.06.14-15:40->BS-);(03.17.14-13:10->MD-);(04.11.14-16:50->BS+);(11.13.2015-16:15->MD+)(11.13.2015-16:25->KY+);(11.13.2015-16:30->ER+)|Mike Dean|oe 4,oe 5,md,Complete,mw,bs,er}}


LILO is a bootloader which provides a number of useful features while remaining compact. This document describes the details behind configuring the LILO bootloader.


Configuring LILO

As with any software of moderate or better complexity, configuration is required for LILO to function as desired. The configuration created by EMAC and shipped with a system will usually suffice. However, sometimes enough customization is required that the bootloader itself will need to be reconfigured. Even if custom configuration isn't required, some of this information is important for protecting against accidentally overwriting the bootloader on a developer's desktop with a bootloader that was intended for an embedded machine.

This page describes the parts of the LILO bootloader configuration file, and provides guidance on how to work with it. The other LILO pages describe how to install and use the bootloader after it has been configured.

Sections of the LILO Configuration File

The LILO configuration file is split into two sections: global and per-image. The global section, as the name implies, 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.

Shown here is the default configuration for most EMAC boards which make use of LILO:

# This tells the LILO utility where to install LILO.  This must be changed if using a desktop
# system to install LILO to a CompactFlash card.
boot=/dev/sda
map=/boot/map

lba32
# This is where the disk is found on the current system.  See the wiki for more information.
disk=/dev/sda
# This indicates that the BIOS will see this drive as the first drive.
bios=0x80
read-only
prompt
# This sets the prompt to wait for 2.5 seconds before automatically booting the first image.
# The time is specified in deciseconds.
timeout=25
vga=9
install=text
compact
# This is for lilo serial console (ttyS0,9600,8,n,1):
#serial=0,115200n8

# The following path points to the Linux kernel that LILO should boot.
image=/boot/bzImage
	root=/dev/sda1    # This is the root filesystem for the kernel to use.
	label=emac-oe
	# These are kernel commandline parameters:
	append="console=ttyS0,115200 quiet splash=silent"

Global Options

The LILO configuration file needs the following options, at a minimum, configured for the global settings:

  • disk This 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. The first would be /dev/sda, the second /dev/sdb, etc. Even though the device may not be a SCSI device, it may be mounted via a generic SCSI driver, which is why it can appear as a SCSI device. If it were mounted through the IDE subsystem instead, its device node would appear like /dev/hdc instead.
  • map This option specifies the location of the map file to use. Usually, this will be /boot/map.
  • lba32 This 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.
  • boot This option specifies the device which contains the boot sector. As with the disk option, this should always be the device node associated with the disk on the current system. For example, boot=/dev/sdc

Additional useful options:

  • vga For systems which have video, this option specifies the video mode the device should use. The parameter to pass comes from the BSP (Board Support Profile) layer for the board. If unsure what to set here, EMAC can provide assistance with this.
  • serial This useful option specifies a serial device to which a console should be attached, as well as the configuration settings for the console. For example, to use the /dev/ttyS0 serial 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,115200n8
  • timeout This specifies the amount of time to wait before timing out and continuing on with the boot process using the configured defaults. This value is specified in deciseconds. For example, to set this value to 4.3 seconds: timeout=43
  • read-only This 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.
  • install This option specifies the type of screen which will be seen when the bootloader starts. Normally, this will be set to text, which presents the simple interface shown in the examples on this page. The menu option provides a nicer way to select an image to boot, but is usually not desirable to have on an embedded machine. The bitmap 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.

Per-Image Options

The following options are needed to configure images to be available to boot with LILO:

  • image This option specifies the location of the kernel to boot. Commonly, this will be /boot/bzImage or /boot/bzImage-custom-3.10.2
  • root This option specifies the root partition to mount for the image. This is typically /dev/hda1 or /dev/sda1
  • label This option tells LILO by what name to call the image. For instance, this is usually label=emac-oe for a standard EMAC image, but for a custom product under development, it might be label=custom-image-test-v3

Working with LILO Configurations

The above information talks about 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.

Actually 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.


Conclusion

LILO has a straightforward configuration syntax, but the details may not be immediately apparent. This documentation should fill in the missing pieces when you are configuring LILO.

Further Information

Where to Go Next
Pages with Related Content