Table of Contents
Booting LRP is where many of the differences of the different LRP variants appear. The basics are the same, however. The following steps take place:
The master boot record of the floppy is loaded by the computer's BIOS. This is part of syslinux.
The configuration file syslinux.cfg
is read and acted upon. This includes differing kernel options and
images, text screen displays, help screens, and so on.
The filesystem image is loaded — in the case of LRP, this is
root.lrp
.
The appropriate kernel image is loaded — for LRP, this is the
file linux
.
The Linux kernel is decompressed and executed.
The filesystem image (root.lrp
)
is decompressed and loaded. A kernel patch allows a compressed
filesystem here. The kernel parameter ROOT is refered to here; if it
is not set right, Linux will stop with a
Kernel panic: VFS: Unable to mount root fs
message, since it can't find the appropriate filesystem on that
disk if ROOT is specified wrong (or if the internal value of ROOT is
wrong).
The shell script /linuxrc
is
run. In most versions of LRP, this is a symbolic link to
/var/lib/lrpkg/root.linuxrc
The
kernel patch linuxrc-always makes /linuxrc always run, instead of only
when the boot-time root volume is /dev/ram0 and the true root device
is different... [16]
From here, the differing versions vary widely — typical tasks
performed by /linuxrc
include:
Load packages from disk or TFTP or other method
Load kernel modules
Bring up network interfaces using DHCP or other method
Create
device special files in /dev
Create links to busybox and POSIXness (for various commands)
Create
RAM disks (such as for /var/log
or
/tmp
)
Finally, /sbin/init
is run by
the Linux kernel, once /linuxrc
is
complete. /sbin/init
scans through
the /etc/inittab
, performing actions
as necessary...
The /etc/init.d/rcS
file is run
by init, and loads the startup elements for LRP. The rcS file is
specified in /etc/inittab
in a line
like: si::sysinit:/etc/init.d/rcS
The /etc/init.d/rc
file is run
for the appropriate run level (given as argument 1). The rc file is
specified in /etc/inittab
in lines
like:
l0:0:wait:/etc/init.d/rc 0 l1:1:wait:/etc/init.d/rc 1 l2:2:wait:/etc/init.d/rc 2 l3:3:wait:/etc/init.d/rc 3 l4:4:wait:/etc/init.d/rc 4 l5:5:wait:/etc/init.d/rc 5 l6:6:wait:/etc/init.d/rc 6
/sbin/getty
is normally run as
part of the processing of init, providing a way to log into the
system. getty takes care of both serial consoles and virtual consoles
(though these could be two different kinds of gettys). getty is
usually specified in lines like:
1:2345:respawn:/sbin/getty 38400 tty1 1:23:respawn:/sbin/getty 38400 tty2 1:23:respawn:/sbin/getty 38400 tty3 1:23:respawn:/sbin/getty 38400 tty4 1:23:respawn:/sbin/getty 38400 tty5
The rc
(or
rcS
) file is run as an important part
of the init
startup procedure. These
files read everything in /etc/rc*.d
and /etc/rcS.d
, and run the programs
linked to in order. These programs start system daemons such as
portsentry, cron, httpd, ftpd, and others.
The getty
program is run from
init
. It normally runs
login
, which verifies the password
and username from the user, then runs whatever shell is specified in
/etc/passwd
.
[15] Booting the kernel is more complicated than this; in trying to use the standard boot sequence (without LRP patches) one needs to understand the Linux kernel boot process more fully. This is covered in a later section.
[16] See the later section on using a kernel without LRP patches for more details.