If the boot device is a local hard disk, the sector loaded is the MBR - Master Boot Record - which then loads the boot sector into memory and passes control of the boot process to it. Up to this point, the boot process is OS and disk-format independent.
The first-stage boot-loader (installed via the MBR) then locates the
second-stage boot-loader (normally GRUB when booting under
DICE), and loads and runs that which, in turn, loads and runs the
kernel (passing control to that kernel).
The Install Process and the role of InstallRoot
When installing a DICE machine, at least two methods are
possible:
Both methods involve an initial BIOS utility to select the boot method, followed by the loading of the relevant type of SYSLINUX boot-loader - which then prompts for installation method or version, and goes on to load the kernel image and hand control over to it.
Once the kernel is loaded and run, it starts the installroot process - which prompts for the type of installation required (source media or OS version), and the machine configuration and installation begins.
During the DICE install phase, GRUB is not used - instead, a
SYSLINUX image is loaded (the isolinux boot loader,
isolinux.bin
, directly from the CD
- or the pxelinux boot-loader, pxelinux.0
, over the
network). The version of isolinux.bin
on CD is copied
from /usr/lib/syslinux/isolinux.bin
(provided by the
Redhat RPM syslinux-3.10), and is part of the CD image created by the
BuildInstallRoot process.
Install procedure from CD
The BIOS initially treats an install CD like a floppy, and expects to
find a bootable floppy image on it. This "virtual boot floppy" is
assumed to have CDROM drivers on it, which can somehow access the CD
in full - however, this requires more configuration information to be
supplied. This is where ISOLINUX helps, as it simplifies booting from a
CD because a special floppy image is no longer needed - it can read
all the files on an ISO9660 format CD.
A program to boot Linux kernels off a CD-ROM using the El Torito boot standard in "no emulation" mode, making the entire filesystem available. It is based on the SYSLINUX boot loader for MS-DOS floppies.
isolinux.bin
, is loaded
from CDisolinux.cfg
) and presents LCFG boot optionsboot.msg
)
vmlinux
(/boot/vmlinuz
) image.
isolinux.bin
on the CD is configured
at CD-creation time... the mkisofs
command is given
appropriate arguments, which include:
-b isolinux/isolinux.bin -c isolinux/boot.catthe "
-b
" option is the one that specifies the boot
location for an "El Torito" bootable CD, and the "-c
"
option specifies the boot catalog (list of bootable images).
The BIOS, by means of interrupts (INT 13, INT 19), accesses the
"Booting Catalog" in the CD-ROM header and verifies the existence of
a boot image on the CD ROM. If verified, it reads the Initial/Default
Entry and boots from the disk image specified in this entry which
points to isolinux.bin
(details of how this happens need not concern us here!). The default
behaviour when booting from a CD is to redirect boot floppy access
requests to the CD - but the use of ISOLINUX makes this unnecessary.
Once the isolinux boot-loader has loaded, it parses the config file
/isolinux/isolinux.cfg
(supplied on CD, and created as
part of the BuildInstallRoot process) to find out what install options
are available, and how to implement them (as already mentioned,
ISOLINUX can read all the files on an ISO9660 format CD).
serial 0 9600 default cd prompt 1 timeout 600 display boot.msg label cd kernel vmlinuz append root=/dev/hdc sushell=/etc/rc_install ramdisk_size=8192 ...Using the above configuration file, the boot options are given (as listed in the local version of
/isolinux/boot.msg
,
retained as /var/lcfg/conf/installroot/boot.msg
, after
install):
... Type one of the following :- <CR> boot off CD cd boot off CD serial boot off CD (serial console) floppy boot off CD (IP configuration via floppy) rescue boot off CD (drops to shell) disk boot off hard disk hd[a-c] boot off hd[a-c] ...- and the "
boot:
" prompt is displayed ("prompt
1
") for 60 seconds ("timeout 600
"), and if nothing
is typed, it boots vmlinuz
from the CD ("default
cd
") setting the root device (root=/dev/hdc
, the
kernel's path to an IDE CD drive - note that this is hardware specific, and
could easily be /dev/hda
, or /dev/sr0
) and
the size of the RAM disk (ramdisk_size=8192
, because the
size must be specified if greater than 4Mb uncompressed).
isolinux.cfg
.
The boot-loader (isolinux
) then loads the (customised)
compressed kernel image (/isolinux/vmlinuz
) into memory
(retained as /boot/vmlinuz
after install). The
customised kernel is generated by the Managed Platform Unit.
NOTE:
the ramdisk image
(/boot/initrd-
<version-build-OS>.img) is
not needed for CD install, but is used via PXE (to load drivers
necessary to boot the system).
Once the kernel is loaded into memory, the boot-loader hands control of the boot process to it:
Uncompressing Linux... Ok. Booting the kernelwhich then initializes and configures the memory and various hardware attached to the system.
If the boot fails, PXELINUX (unlike SYSLINUX) will not wait
forever - if it has not received any input for approximately five
minutes after displaying an error message, it will reset the machine.
This allows an unattended machine to recover in case it tried to boot
from a unresponsive server.
Overview
pxelinux.0
, is loaded
from TFTP server ("PXELINUX <version>
<date>")...
pxelinux.cfg/81D4
) and
displays LCFG boot options offered via
lcfgbootblurb
.
vmlinux
(/boot/vmlinuz
) and initrd.gz
images.
The PXELINUX boot-loader /tftpboot/pxelinux.0
is
downloaded via TFTP from DHCP/TFTP server
(the ".0
" extension is recognised by PXELINUX as a PXE
bootstrap program file).
Behaviour of this boot-loader is controlled by associated
configuration information, which pxelinux.0
looks for in
a filename determined by the IP address of the client it is running
on. The current default is to use
/tftpboot/pxelinux.cfg/81D7
(for anything on 129.215):
default fc5 timeout 100 prompt 1 display lcfgbootblurb allowoptions 1 label fc5 kernel /kernel-pxe-install-fc5/vmlinuz append initrd=/kernel-pxe-install-fc5/initrd.gz rw NFS_DIR=/export/linux/installroot/fc5 ...Using the above configuration file, the boot options are given (as listed in
/tftpboot/lcfgbootblurb
):
... fc3:- boot to the fc3 install system fc5:- boot to the fc5 install system fc6:- boot to the fc6 install system fc664:- boot to the fc6 (x86_64) install system fc3serial:- boot to the fc3 install system with serial console fc5serial:- boot to the fc5 install system with serial console fc6serial:- boot to the fc6 install system with serial console fc664serial:- boot to the fc6 (x86_64) install system with serial consoleand the "boot:" prompt displayed ("
prompt 1
") for 10
seconds ("timeout 100
").
If the default is taken, or "fc5" is selected, the boot-loader loads
/kernel-pxe-install-fc5/vmlinuz
and
/kernel-pxe-install-fc5/initrd.gz
(which contains
required drivers, especially all the network drivers), also setting
the NFS root directory, NFS_DIR=/export/linux/installroot/fc5
.
Once the kernel is loaded into memory, the boot-loader hands control of the boot process to it:
Uncompressing Linux... Ok. Booting the kernelwhich then initializes and configures the memory and various hardware attached to the system.
When the kernel is loaded, it immediately initializes and configures the memory and the various hardware attached to the system, including all processors, I/O subsystems, and storage devices. The kernel then creates a root device, mounts the root partition read-only, and frees any unused memory.
At this point, the kernel is loaded into memory and operational.
However, since there are no user applications that allow meaningful
input to the system, not much can be done with it. In order to set up
the user environment, the kernel executes the
/sbin/init
program.
The /sbin/init
program then co-ordinates the rest of the
boot process (via /etc/inittab
) and configures the
environment.
[RHL9]
Once the kernel is running and has access to a filesystem, the
init
process runs, and the /etc/inittab
file
is consulted - which (in the install case) contains an instruction to
start a single-user shell and wait until it exits:
S0:S:wait:/sbin/suloginWhen
sulogin
runs, it looks for the $sushell
(or $SUSHELL
) environment variable to determine what
shell to start, and then starts it. If using ISOLINUX, this variable
was passed into the kernel environment by the isolinux boot-loader
using a setting from the isolinux.cfg
file:
"sushell=/etc/rc_install
".
However, there does not appear to be a similar setting in the
corresponding pxelinux.cfg/81D4
file, so how is this set
when using PXELINUX?
The sulogin
program is run first, rather than
/etc/rc_install
directly, so that job control is
available (and ^C
!). The root account is given a null
password so that the user isn't prompted for a password by
sulogin
(no password is requested if
/etc/passwd
doesn't exist).
Once this is done, it hands over to the installroot (effectively the
rc_install
script), issuing a message to this effect:
INIT: version 2.86 booting(last thing reported by
/sbin/init
- at this point
filesystems are mounted read-only) and:
---------- University of Edinburgh LCFG installroot ---------- Version: 0.99.35 Date: 17/02/06 15:40(first thing reported by
/etc/rc_install
).
rc_install
script) and
configuration (running the 'install' component and associated
'install' methods, called from the rc_install
script).
rc_install
ScriptAfter issuing a banner giving version and date for the current installroot (as mentioned above), some initial configuration is carried out, and the above subroutines are called as required:
/build.timestamp
at install time).
LoadLocalCFG()
is called to set environment variables such as locale and
timezone, which are set from
/etc/installparams.default
(and over-ridden by
/etc/installparams
, if present).
/dev/console
or /dev/tty2
)
MakeDevRW()
is called to create a writeable filesystem in RAM disk, and
mounted under /dev
. Contents are then copied
(via rsync) from the RO location (the boot image) to the
writeable directory.
/proc
& /sys
are also created,
just after /dev
, to allow other configuration
tools to communicate with the kernel (for example, the
dynamic device management utility, udev
).
InitLoopback()
is called to configure
the loopback interface (via ifconfig
) and made
available (via "route add
").
/var
, and
/etc
) are created by calling
MakeVarRW()
&
MakeEtcRW()
,
populated (using rsync
), and then remounted (the
remainder of the filesystem is still mounted RO from CD, or
over the network).
loadkeys
) by
LoadKeys()
.
This uses $KEYS_LOCALE, which was loaded from
/etc/installparams
.
NssSwitch()
, via
nsswitch.conf
. Other than hosts
(which has the option of using DNS), all services are set to
use local files.
SetTZ()
is called,
and timezone is set using $DEFAULT_TZ from
/etc/installparams
(loaded earlier).
DepMod()
, which creates
/etc/modules.conf
(using entries supplied in the
rc_install script).
ModProbeClass(USB)
,
and then
ProbeforSCSIDisk()
,
ProbeforIDEDisk()
,
&
ProbeforRAIDDisk()
.
ProbeforEther()
then tests to see if a configured ethernet network card is
present (as determined by ifconfig
), and if not,
the relevant kernel modules (as determined by
kmodule
or kudzu
) are loaded by
ProbeforEtherModule()
and a configured ethernet network interface is again tested
for. If not found,
ProbeforEtherPCMCIA()
is called to test for a PCMCIA card.
LoadFloppyIP()
is called to check for IP
configuration information supplied in the file
ip.cfg
on the floppy.
LoadUSBDiskIP()
is called to start D-BUS
(system-wide message bus) and HAL (Hardware Abstraction
Layer) daemons and check if /media/usbdisk
appears, it also sources ip.cfg
(if present on
USB disk) to load network values.
ip.cfg
file on floppy or USB
device) IP information is requested from a local DHCP server
(via /sbin/dhclient
, which broadcasts a DHCP
request on all local networks and saves the response), having
configured each network interface "up" if required (although
no hostname is set).
The server-based configuration information in held in
/etc/dhcpd.conf
. As well as the host name and IP
address, this file contains information such as the
network-mounted root filesystem, and location of host
profiles.
The response from the DHCP server is saved in
The /tmp/dhcp_response
, the location of which is
determined via /etc/dhclient.conf
, which
explicitly calls /sbin/dhclient-lcfg-script
(would normally default to
/sbin/dhclient-script
), and this creates the
above file based on the DHCP response.
/sbin/dhclient-lcfg-script
expects
instantiated variables which it uses to set LCFG DHCP
variables in the response file: /sbin/dhclient
exports these to the environment before calling the
/sbin/dhclient-lcfg-script
.
dhclient
output).
ConfigureResolver()
is called to
configure the resolver by creating
/etc/resolv.conf
and
/etc/hesiod.conf
, constructing the entries using
DHCP variables.
SetHostname()
is called to set
hostname (via /bin/ipcalc
and IP address, which
sets $HOSTNAME), dropping to shell if this fails.
/etc/hosts
file is generated by
CreateEtcHosts()
,
containing localhost entry and one for $DHCP_IPADDR.
http://lcfghost.inf.ed.ac.uk/profiles/inf.ed.ac.uk/
<host>/XML/profile.xml
,
which is equivalent to
/var/lcfg/conf/server/web/profiles/
<host>/XML/profile.xml
),
and installation of software can begin. The web location of the
profiles is equivalent to the filesystem location
/var/lcfg/conf/server/web/profiles
on the LCFG server.
(Note that XML files do not exist for non-DICE machines - for example,
self-managed machines - even though they may be in the
inf.ed.ac.uk
domain.)
A machine's profile is only
downloaded once, at this point (by the
/etc/rc_install
script, before the install component is
called):
DownloadProfile()
is called and, if
$DHCP_LCFGURL has been defined (usually
ValidateURL()
, it uses
"/usr/lib/lcfg/components/client install $DHCP_LCFGURL
/"
to download the XML to the
/var/lcfg/conf/profile/xml
directory (note that
no hostname is specified - this is determined automagically
by
install
component (/usr/lib/lcfg/components/install
) is
run - which calls each component with the "install" method.
Components (other than "install
") available at
installroot time are:
DoReboot()
is called to reboot on
completion.
install
component (which only exists at install-time) is
run with the 'install' method (which is almost the last thing the
rc_install
script does), the following actions are taken:
qxprof -e install
" to export selected resources
to the environment variables. (Note that the name
"LoadProfile" is a bit of a misnomer - "LoadResources" might
have been better.)
Note that the install resources (including
install.installmethods
) are defined in
install.h
, which is part of the
lcfg/core/include/lcfg/defaults
structure.
How does this get pulled in? Presumably it's #included in another
header file somewhere? (It's certainly #included from
lcfg/core/include/lcfg/defaults.h
.)
- once the install methods have been identified (as defined by the
install.installmethods
resource, which is used to set
$LCFG_install_installmethods via "qxprof -e
"):
% qxprof install.installmethods installmethods= setctx lcfguser lcfggroup loadctx gettime mk_etcfiles logserver fstab_disks mkdir_rpm mkdir_lcfgconf mkdir_dev mkdir_vartmp mkdir_etc mk_retcfiles nsswitch auth fstab hardware get_rpmcfg copydev mkvarlib updaterpms network dns grub kernel setctxnormal setctxbase clienttarget init settz_root setclock configclock mkloginstalldir loginstall umountd end %- each is called in turn (in the order listed in the
install.installmethods
resource). For each install method
above, there is a corresponding environment variable
($LCFG_install_imethod_<method>) and resource
(install.imethod_<method>) holding the command to execute.
Actions to execute can be of three types:
install.installmethods
resource includes the
"lcfguser
" method.
imethod_lcfguser
"
resource, which holds the command to be executed
(namely "%oneshot% "echo lcfg:x:980:980:LCFG
user:/tmp:/bin/false >> /etc/passwd"
").
imethod_lcfguser
resource is exported to
the environment ($LCFG_install_imethod_lcfguser,
via "qxprof -e install
").
%oneshot%
" key in the
install
component's 'install' method, and just
passes all parameters to be evaluated.
install.installmethods
resource includes the
"configclock
" method.
imethod_configclock
"
resource, which holds the command to be executed
(namely "%configclock% /root
").
imethod_configclock
resource is exported to
the environment ($LCFG_install_imethod_configclock,
via "qxprof -e install
").
install
component's 'install' method (using the
"%configclock%
" key) and runs the
"ConfigClock()
" subroutine.
install.installmethods
resource includes the
"auth
" method.
imethod_auth
"
resource, which holds the command to be executed (namely
"auth install /root
").
imethod_auth
resource is exported to
the environment ($LCFG_install_imethod_auth,
via "qxprof -e install
").
install
component's 'install' method using /usr/bin/om
plus the environment variable $LCFG_install_imethod_auth.
%oneshot% setctx install=true
", which:
.context
file
under /var/lcfg/conf/profile/context
.
On a fully running machine the lcfg-client daemon
(rdxprof
) would notice that the context had changed when
setctx
was called, but in the installroot the daemon
isn't running so the client component has to be called explicitly to
change to the new context.
%oneshot% "echo lcfg:x:980:980:LCFG
user:/tmp:/bin/false >> /etc/passwd"
", which:
%oneshot% "echo lcfg:x:980: >> /etc/group"
", which:
client install none:
", which:
.context
file in
/var/lcfg/conf/profile/context
.
%gettime% ntpdate ntp0.inf.ed.ac.uk
ntp1.inf.ed.ac.uk ntp2.inf.ed.ac.uk
", which:
%gettime%
invokes GetTime()
with
supplied parameters).
%oneshot% touch /etc/fstab /etc/mtab
", which:
/etc/fstab
&
/etc/mtab
logserver start
", which:
fstab preparedisks /root
", which - for each
disk in fstab.disks resource:
AddDisk(
disk, /root)
%oneshot% mkdir -p /root/var/lib/rpm
", which:
[/root]/var/lib/rpm
directory, to
contain RPM management info.
%oneshot% mkdir -p /root/var/lcfg/conf
",
which:
[/root]/var/lcfg/conf
directory, to
contain LCFG configuration info.
%oneshot% mkdir /root/dev
", which:
[/root]/dev
" devices directory only.
%oneshot% mkdir -p /root/var/tmp
", which:
[/root]/var/tmp
directory only.
%oneshot% mkdir /root/etc
", which:
[/root]/etc
directory only.
%oneshot% touch /root/etc/fstab /root/etc/mtab
",
which:
/root/etc/fstab
&
/root/etc/mtab
.
nsswitch install /root
", which:
LoadProfile
from ngeneric
BuildNSSwitch(/root)
/etc/nsswitch.conf
.
auth install /root
", which:
LoadProfile()
from ngeneric
PasswdGroup()
/etc/passwd
& /etc/group
respectively (this must be done before packages are installed
on the new machine so that files are installed with the
correct ownership). The root password is supplied via
sxprof
.
fstab install /root
", which:
LoadProfile()
from ngeneric
Buildfstab(/root)
/etc/fstab
entries for each
disk in fstab.disks resource.
MkMountPoint()
/etc/fstab
(these will be picked up later).
hardware install /root
", which:
LoadProfile()
from ngeneric
UpdateModuleConf(/root)
/etc/modprobe.conf
using 'sxprof'.
RequestReboot()
when
/etc/modprobe.conf
has changed.
%oneshot% /usr/sbin/rdxprof -u $DHCP_LCFGURL
diceinstallbase-fc5-develop
", which:
/var/lcfg/conf/profile/dbm/ /var/lcfg/conf/profile/ngcomponents.pl /var/lcfg/conf/profile/rpmcfg/ /var/lcfg/conf/profile/xml/
- and also appropriate versions of
diceinstallbase-fc5-develop
in the dbm
,
rpmcfg
, and xml
directories.
%oneshot% rsync -a /dev/. /root/dev/.
", which:
/root/dev
.
%oneshot% mkdir -p /var/lib/rpm
", which:
updaterpms install /root
", which:
LoadProfile()
from ngeneric:
/bin/rpm -r /root --initdb
" to initialise
(create new) RPM database.
UpdateRPMs(/root)
:
/usr/sbin/updaterpms
(plus various flags),
and then "/bin/rpm --rebuilddb
" to rebuild RPM
database.
/usr/sbin/updatepkgs
if SunOS)
RequestReboot()
from ngeneric, which issues
reboot message via lcfgmsg
.
om kernel configure
", which makes sure kernel
(file) configuration is up to date.
network install /root
", which:
LoadProfile()
from ngeneric
ConfigureNetwork(/root)
:
network.interfaces
resource, rebuilds
/etc/sysconfig/network-scripts/ifcfg-interface
file
/etc/hosts
RequestReboot()
dns install /root $DHCP_DOMAINSERVERS
" (where
$DHCP_DOMAINSERVERS is normally 129.215.155.241), which:
LoadProfile()
from ngeneric:
/etc/resolv.conf
file using
$DHCP_DOMAINSERVERS & dns.installservers
resource
grub install /root
" which:
LoadProfile()
from ngeneric:
grub.grubconfdir
,
grub.localconf
,
grub.pxegrubconfdir
,
grub.pxegrubbin
, &
grub.grubfiles
resources.
kernel install /root
", which:
MakeLinks()
:
/boot
%oneshot% setctx install=
" which:
.context
file
in /var/lcfg/conf/profile/context
%oneshot% setctx installbase=true
", which:
.context
file.
client install file: /root
", which is used at
install time to get initial profile, and:
rdxprof
to read and convert profile
(via local file URL, rather than fetching it via HTTP)
init install /root
", which:
LoadProfile()
from ngeneric:
BuildInittab(/root)
sxprof
to generate
[/root]/etc/inittab
from supplied template
/sbin/telinit q
to force
init
to re-read inittab
.
%settz% /root
", which:
SetTZ(/root)
LoadProfile()
from ngeneric
/etc/localtime
%setclock%
", which:
SetClock()
%configclock% /root
", which:
ConfigClock(/root)
/etc/sysconfig/clock
%oneshot% mkdir -p
/root/var/lcfg/installlog
", which:
%oneshot% rsync -a /var/lcfg/log/.
/root/var/lcfg/installlog/.
", which:
/var/lcfg/log
%oneshot% umount -al
", which:
%oneshot% echo End of install
", which:
rc_install
script does is to call
DoReboot()
, which kills all
processes, unmounts filesystems, and calls /sbin/reboot
.
The system reboots, installing rest of the 2500+ RPMs on way back up.
File(s) |
Source (container or generator) of file(s) |
---|---|
(short description) | |
Location at install time | |
Location on installed system | |
Maintainer |
isolinux.cfg |
lcfg-buildinstallroot-0.99.23 |
---|---|
(configuration file for booting CD) | |
Install CD | |
/var/lcfg/conf/installroot/isolinux.cfg |
|
MP Unit | |
|
|
isolinux.bin |
syslinux-3.10 |
(bootloader executable) | |
Install CD |
|
/usr/lib/syslinux/ |
|
Red Hat (Standard Distribution) | |
|
|
boot.msg |
lcfg-buildinstallroot-0.99.23 |
(display options) | |
Install CD | |
/var/lcfg/conf/installroot/boot.msg |
|
MP Unit | |
|
|
vmlinuz |
/usr/sbin/buildinstallroot |
Install CD | |
/boot/vmlinuz |
|
MP Unit | |
|
|
pxelinux.0 |
syslinux-3.10 |
DHCP server | |
/usr/lib/syslinux/ , link from
/tftpboot/ (DHCP server only) |
|
Red Hat (Standard Distribution) | |
|
|
pxelinux.cfg/ |
pxelinux component |
TFTP/DHCP server | |
/tftpboot/ (DHCP server only) |
|
MP Unit | |
|
|
initrd.img |
kernel-smp-2.6.18-1.2257_FC5_dice_1.2 |
Install CD | |
/boot/ |
|
MP Unit | |
|
|
dhcpd.conf |
dhcp-3.0.3-28 (updates via dhcpd component) |
DHCP server | |
/etc/ (DHCP server only) |
|
MP Unit | |
|
|
lcfgbootblurb |
|
Install CD | |
/tftpboot/lcfgbootblurb |
|
MP Unit | |
|
|
lcfgng.lss |
|
Install CD | |
/var/lcfg/conf/installroot/ |
|
MP Unit | |
|
|
initrd.gz
| |
/tftpboot/kernel-pxe-install-fc5/ |
|
MP Unit | |
|