Configuration - The silo.conf file
silo.conf is a configuration file for SILO which is read during
booting by the second stage boot loader.
It provides instructions for SILO, including which kernels or other
operating systems to load and what options to pass to them. Unlike the LILO
bootloader on the Intel platform, SILO reads and parses the configuration
file at boot time. This means that any changes can be made to the
configuration file and if the system is shut down properly or the config file
makes it to the disk, SILO will use it on next bootup.
SILO is able to boot kernels even without this configuration
file or if this file is crippled or contains syntax errors, but the user has
to enter full PROM names and full path of the images to load and all options
required for them manually.
Syntax
The configuration file consists of comments and variable assignments:
Comments start with a "#" character, and continue to
the end of the line.
Flag variables consist of a single keyword and are followed by
whitespace or the end of the file.
String variables consist of the variable name, optional
architecture scope, optional whitespace, an
"=" character, optional whitespace, the value and
required whitespace, or the end of the file.
Architecture scope is allowed only for
variable names image and other. It must directly follow a
variable name without any whitespace and consists of the
"[" character, a subset of case-insensitive tokens
sun4, sun4c, sun4d, sun4e, sun4m and/or sun4u, separated
by the "," character (no whitespace is allowed between
the comma character), and ends with the "]" character.
An example:
image[sun4c,sun4d,sun4m]=/boot/vmlinux32.gz
This will declare image with the specified file name only on
sun4c, sun4d or sun4m.
Device names depend on the PROM
version of the machine used during bootup.
For older PROM's (v0), the device name syntax is:
<xx>(<m>,<n>,<o>)
where:
- <xx> is one of sd, st, xd, xy, fd, le
or ie
- <m> is the controller number as decimal number
- <n> is the device id as decimal number
- <o> is the zero based partition number.
Examples:
For newer PROMs (v2) and all PROM's in the 64bit SPARC machines the syntax
is:
<fully_qualified_prom_device_name>[:<partition_letter>]
where the fully qualified PROM device name starts with a
"/" character for the root of the PROM device tree, and
contains all the nodes from the root in the tree up to the disk device node.
If some node contains more than one child node with the same name and the
path has to go through such node, an "@" character
followed by the hexadecimal address pair is desirable to resolve the
ambiguity. Optional partition number is a ":" character
followed by a letter a (for first partition) through h (for
last, 8th, partition). v2 PROM device names might look like:
/sbus@3,0/SUNW,fas@3,8800000/sd@0,0
/iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@6,0:d
/pci@1f,0/pci@1,1/ide@3/disk@2,0
/pci@1f,4000/ide/ata@0,0/cmdk@0,0
v2 PROM device names if specified as part of the file name
(see File Names below) should be followed by the
";" character to separate the device name from the optional
Linux partition number (note that there can be two partition numbers specified,
the latter takes precedence) and from the required pathname. Variable names are
case insensitive, values of string variables are case sensitive.
Variable names are case insensitive, values of string variables are
case sensitive.
Blanks and equal signs may only be part of a variable name
or a value if they are escaped by a backslash or if the value is embedded in
double quotes. An equal sign may not be the only character in a name or
value.
An escaped tab is converted to an escaped blank. An escaped
newline is removed from the input stream. An escaped backslash (i.e. two
backslashes) is converted to a backslash. Inside quoted strings, only double
quotes, backslashes and newlines can be escaped.
File names
Some string variables are expecting file names.
A file name format in SILO is:
[<devicename>][<part>]<absolute_pathname>
or
[<devicename>][<part>][[<m>-<n>]]
The first form refers to a file or directory on some supported filesystem
(currently ext2fs, ext3fs, ufs, romfs or iso9660), the latter refers to a
range of 512B blocks on a device.
For a device block range, either <devicename>, or
<part>, or [<m>-<n>] must be given. If the
last part is not given, it defaults to [1-16] (ie. 7680 bytes from offset 512
in the device, the normal SPARC boot block location).
Optional <devicename> is the PROM name of the device where the
file or range is located on. See Device Names above
for its syntax. For v2 and P1275 PROM's, the device name must be immediately
followed by the ";" character. The default is the boot
device SILO was booted from.
Optional <part> is the 1 based partition number on the device.
First partition is 1 (e.g. on /dev/sda in Linux is this
/dev/sda1). The default is the default partition (the value of the
partition variable in the config file).
<absolute_pathname> must start with a "/"
character and is the pathname from the root of the file system on that device
(unless it is the root filesystem; This is different to the pathname you will
see in Linux).
<m> is the first block number (in blocksize 512 bytes) of the
range to be loaded and <n> is the last block number plus one.
The filename can also include two special tokens: cat and
ls. Both have to be followed by whitespace and
some filename (directory name in the ls case). ls can have
options between the ls token and the directory name. cat
causes the filename to be loaded and printed to the screen instead of being
executed, ls causes a directory listing to
be generated to the screen. ls uses syntax:
ls [-[l][t][r]] <dirname>
Option l generates long listing instead of listing only filenames,
option t sorts by mtime instead of name and r reverses the
sorting. As both cat and ls require white space between
the token and the filename, you should surround them with double quotes:
image="cat /etc/passwd"
image="ls /lib/modules/"
image="ls -lt /lib/"
Global Options
/etc/silo.conf begins with a possibly empty global options section.
This section contains all variable assignments up to the first encountered
image or other setting.
The following global options are recognized:
default=name
uses the specified image as the default boot image.
If default is omitted, the image appearing first in the
configuration file is used.
message=message_filename
specifies a file containing a message that is displayed before
the boot prompt.
partition-boot
This flag causes the same functionality as the
-t command
line option for the silo program, which stores the boot block into
the same partition as the second stage loader.
password=password
This protects booting by a password.
The password is given in cleartext in the configuration file. Because
of that, the configuration file should be only readable by the super
user and the password should differ if possible from other passwords
on the system.
restricted
A password is only required to boot the image
specified in /etc/silo.conf if parameters are specified on
the command line or if the image is not specified in the
configuration file at all (ie. arbitrary file load).
secondary=filename
Forces the second stage boot loader to be other than
/boot/second.b. Same as the
-b command line option.
This can be overriden by the command line option.
timeout=tsecs
Sets a timeout (in tenths of a second) for keyboard input.
If no key is pressed for the specified time, the first image is
automatically booted.
In addition to these global options, the following
per-image options can be specified in the global
section:
- append
- device
- fill-reboot-cmd
- image
- initrd-prompt
- initrd-size
- initrd
- other
- partition
- pause-after
- pause-message
- ramdisk
- read-only
- read-write
- root
They are used as defaults if they aren't specified in the configuration
sections of the respective kernel images and will be used also for the
arbitrary images specified on the input line and not mentioned in the
configuration file (unless overridden by input line options).
Per-Image Options
A per-image section starts with either a line
image=filename
for booting from files, or
other=partition_name
for booting from device ranges.
The image or other tokens can be directly followed by an
architecture scope. In that case, the image
declaration will be only available if the architecture of the booting machine
is listed in the scope. If it is not listed, the whole image or
other line and the following related section will be treated as not
being present in the configuration file.
partition_name in the other setting is a normal filename, as
described in the section File Names, but without the
<absolute_pathname> part. So it is either a single partition
number (starting with 1), or a device name (for v2 and P1275 PROMs followed by
a ";" character) followed by a partition number.
Examples:
# Example with device for v0 PROM:
other=sd(0,2,0)3
# Example with device for v2 or P1275 PROM:
other=/iommu/sbus/espdma/esp/sd@3,0;3
From the image or other line on until next image
or other line are variable assignments and flags for this image's
section. The following options and flags are recognized:
label=name
The boot loader uses the main file name (without it's
path of each image specification to identify that image.
A different name can be used by setting the variable label.
alias=name
A second name for the same entry can be used by specifying an
alias.
partition=part_no
Specifies the default partition number (a digit between 1 and 8,
/dev/sda1 is part_no 1) to be used if some filename
does not explicitely specify a partition number.
device=string
Specifies the default device name to be
used if some filename does not specify a partition number explicitely.
This defaults to the device SILO has been booted from if you don't
specify device in either the global section or per-image
section of the configuration file.
append=string
Appends the options specified to the parameter line passed to the
kernel. This is typically used to specify parameters of hardware that
can't be entirely auto-detected or for which probing may be dangerous,
for example:
append="video=sbusfb:off"
literal=string
Like append, but removes all other options such as setting
the root device. Because vital options can be removed unintentionally
with literal, this option cannot be set in the global options
section.
ramdisk=size
This specifies the size of the optional RAM disk. A value of zero
indicates that no RAM disk should be created.
If this variable is omitted, the RAM disk size configured into the boot
image is used.
read-only
This specifies that the root file system should be mounted
read-only.
Typically, the system startup procedure re-mounts the root file system
read-write later (e.g. after fsck'ing it).
read-write - This specifies that the root file system should
be mounted read-write.
root=root-device
This specifies the device that should be mounted as root file
system.
proll=filename
This should be used only for JavaStation flash installations.
It specifies a file that will be loaded at boot time and executed in
order to emulate old Sun v2 PROM on top of IEEE P1275 called PROLL.
initrd=filename
This specifies the file that will be loaded at boot time as the
initial RAM disk. Example:
initrd=/images/initrd.img
SILO will not decompress the initial ramdisk, the Linux kernel will do
that. If the initial ramdisk does not fit on one media (usually floppy),
you can split it into several pieces and separate the file names in
the list by "|" characters. In this case, you have to provide
a non-zero initrd-size and, if the images reside on different
media, initrd-prompt as well. Example (on the first floppy is
initrd1.img, on the second one initrd2.img. Both are
always in the root directory, and the sum of the sizes of both images
is 1700000 Bytes:
initrd=/initrd1.img|/initrd2.img
initrd-size=1700000
initrd-prompt
initrd-size=size
When more than one initial ramdisk part is specified in the
initrd setting, this option is required to be the sum of both
images mentioned on that line, in Bytes. This is required so that SILO
can reserve space for the image, eventhough size of some parts has not
been determined yet.
initrd-prompt
If more than one initial ramdisk part is specified, wait for the
user pressing a key between loading the different images, so that the
user can exchange media.
This flag is needed if some initrd parts reside on the same device,
but different removable media. On the other side, if you e.g. load one
part from a floppy and the second part from a hard disk, this option
is not needed (the question is who'd write something like that into
silo.conf).
bootblock=filename
For the other image section, if booting from some
partition is desired but the boot block on that partition has been
saved off to some file and the boot block in that partition contains
something else, such as a SILO boot block),
this option specifies the name of the file where the bootblock has
been saved to. SILO loads the image from that file, pretends as if
it had loaded it from the specified partition, and executes it.
This is for instance useful if you have Sun Solaris installed on
the first partition of the disk and want to install SILO into the
master boot record (boot block of the first partition). In that case
you should first save the Solaris boot block into a file. Example:
dd if=/dev/sda of=/boot/old.b bs=512 count=15 skip=1
After this, install SILO and add the following to
/etc/silo.conf:
other=1
bootblock=/boot/old.b
Note that this does not work correctly on UltraSPARC based machines at
this moment.
fill-reboot-cmd
This flag should be used only with Linux kernels. If specified
for an image, it causes the file /proc/sys/kernel/reboot-cmd
to be initialized by the device SILO booted from, image name of the
kernel being loaded and all arguments to it specified either in the
configuration file, or in the input line. This means that if the user
does not modify that file and reboots the system, it should load the
same kernel as last time and pass it the same arguments.
pause-after
If this flag is specified, SILO will stop after loading the kernel
(and initial ramdisks if specified) and will ask the user to press a
key before continuing.
pause-message=string
If pause-after is specified, this variable specifies the
string to print to the user when asking him or her to press a key.
The default pause-message is:
Press ENTER to continue.
single-key
This enables booting the image by hitting a single key when the
cursor is located at the first character in the input line,without the
need to press <ENTER> afterwards.
single-key requires that either the label of the
image or it's alias (or both) is a single character. If you
need to specify parameters for such an image, or if you want to boot
some other image which happens to start with the same character you
will need to start the input line with at least one space which will
be removed before processing, but will disable this single-key
feature.
solaris
This flag tells SILO that the image to be loaded is a Solaris
kernel. This has been implemented so that users don't have to save the
old Solaris boot block, or in case it has been lost.
SILO then tries to use the Solaris ufsboot second stage loader to load
the specified kernel image. The usual kernel name is
/kernel/unix. SILO automatically prepends the path
/platform/<platform> when needed. SILO also
recognises the special path name /kernel/unix with any device
and/or partition, and assumes the solaris option by default.
Note that this method of loading Solaris might not work for
you, as it is quite error prone due to different versions
of Solaris and PROM's.
Updates for the OpenBoot PROM (OBP) should be installed by loading
the flash update image from a TFTP server, similar to installing an
operating system from the network.
The recommended solution for sharing Solaris and Linux on the same
disk is to install SILO into the Linux partition boot block as opposed
to the master boot block, and add PROM aliases to boot from the
different devices. For instance, if Solaris has been installed on
Linux device name /dev/sda1, and Linux on /dev/sda4,
then silo.conf could look like this:
timeout=50
partition=4
image=/boot/vmlinux
label=linux
root=/dev/sda4
other=1
label=solaris
(See also the Examples section).
After this, SILO needs to be invoked with the -t option, to
store the boot block into the same partition as the second stage
loader.
An example to set the fourth partition to be the default boot
device (from the EPROM):
setenv boot-device /sbus/espdma/esp/sd@0,0:d
or
nvalias linux /sbus/espdma/esp/sd@0,0:d
nvalias solaris /sbus/espdma/esp/sd@0,0:a
so that one could already boot from the PROM either with
"boot linux", or with "boot
solaris". This also ensures that you can re-install
an operating system without bothering another installation.
SILO configuration examples
A basic silo.conf file which can load the images with label
"linux", and "old" from the fifth partition on
the first found SCSI hard disk drive:
# basic silo.conf example
timeout=50
partition=5
default=linux
root=/dev/sda5
read-only
image=/boot/vmlinux
label=linux
image=/boot/vmlinux.old
label=old
A silo.conf that can boot the images with label "linux"
and "solaris". "linux" here is on the first partition of
the third SCSI hard disk drive, and "solaris" on the first partition
of the SCSI disk drive with SCSI ID 3.
# silo.conf example for dual boot linux and solaris
timeout=50
partition=1
default=linux
root=/dev/sdc1
image=/boot/vmlinux
label=linux
root=/dev/sdc1
read-only
other=/iommu/sbus/espdma/esp/sd@3,0;1
label=solaris
|