1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
6 <title>BootCD v3.x Technical Documentation</title>
9 <firstname>Aaron</firstname>
11 <surname>Klingaman</surname>
13 <email>alk@absarokasoft.com</email>
17 <orgname>Princeton University</orgname>
22 <revnumber>1.0</revnumber>
24 <date>November 16, 2005</date>
26 <authorinitials>AK</authorinitials>
29 <para>Initial draft.</para>
36 <title>Overview</title>
38 <para>This document describes in detail how the PlanetLab boot CD is built
39 and operates when running on a node. Older boot CDs, including 2.x cds,
40 are not the focus of this document, and are no longer being deployed on
41 production systems.</para>
45 <title>Background</title>
47 <para>Since the early days of PlanetLab, all production nodes are
48 configured during setup to only start up off of the cdrom, with a
49 PlanetLab boot cd always left in the drive. The intention is to allow a
50 machine to be able to restart into a known environment, for debugging
51 system problems, or as a way to still access the machine but not have any
52 potentially compromised code to run if the system is believed to be
57 <title>Soure Code</title>
59 <para>All 3.x boot cd source code is located in the repository 'bootcd_v3'
60 on the PlanetLab CVS system. For information on how to access CVS, consult
61 the PlanetLab website. Unless otherwise noted, all file references refer
62 to this repository.</para>
66 <title>Basic Operation</title>
68 <para>The operation of the boot cd, when a machine is started off of one,
69 is fairly straight forward. Essentially, it loads a linux kernel,
70 configures the hardware and network, and fetches a signed script to
71 execute. This generic operation allows for the boot cds to be used for any
72 number of operations, whether they are installing machines or debug
75 <para>The full operation of a boot cd, from the moment it is booted, is
76 described in the following diagram.</para>
80 <title>Hardware Detection</title>
82 <para>When a node is being installed, the BootManager must identify which
83 hardware the machine has that is applicable to a running node, and
84 configure the node properly so it can boot properly post-install. The
85 general procedure for doing so is outline in this section. It is
86 implemented in the <filename>source/systeminfo.py</filename> file.</para>
88 <para>The process for identifying which kernel module needs to be load
93 <para>Create a lookup table of all modules, and which PCI ids
94 coorespond to this module.</para>
98 <para>For each PCI device on the system, lookup its module in the
103 <para>If a module is found, put in into one of two categories of
104 modules, either network module or scsi module, based on the PCI device
109 <para>For each network module, write out an 'eth<index>' entry
110 in the modprobe.conf configuration file.</para>
114 <para>For each scsi module, write out a
115 'scsi_hostadapter<index>' entry in the modprobe.conf
116 configuration file.</para>
120 <para>This process is fairly straight forward, and is simplified by the
121 fact that we currently do not need support for USB, sound, or video
122 devices when the node is fully running. The boot cd itself uses a similar
123 process, but includes USB devices. Consult the boot cd technical
124 documentation for more information.</para>
126 <para>The creation of the PCI id to kernel module table lookup uses three
127 different sources of information, and merges them together into a single
128 table for easier lookups. With these three sources of information, a
129 fairly comprehensive lookup table can be generated for the devices that
130 PlanetLab nodes need to have configured. They include:</para>
134 <para>The installed <filename>/usr/share/hwdata/pcitable
135 </filename>file</para>
137 <para>Created at the time the hwdata rpm was built, this file contains
138 mappings of PCI ids to devices for a large number of devices. It is
139 not necessarily complete, and doesn't take into account the modules
140 that are actually available by the built PlanetLab kernel, which is a
141 subset of the full set available (again, PlanetLab nodes do not have a
142 use for network or video drivers, and thus are not typically
147 <para>From the built kernel, the <filename>modules.pcimap</filename>
148 from the <filename>/lib/modules/<kernelversion>/</filename>
151 <para>This file is generated at the time the kernel is installed, and
152 pulls the PCI ids out of each module, for the modules list they
153 devices they support. Not all modules list all devices they sort, and
154 some contain wild cards (that match any device of a single
155 manufacturer).</para>
159 <para>From the built kernel, the <filename>modules.dep</filename> from
160 the <filename>/lib/modules/<kernelversion>/</filename>
163 <para>This file is also generated at the time the kernel is installed,
164 but lists the dependencies between various modules. It is used to
165 generate a list of modules that are actually available.</para>
169 <para>It should be noted here that SATA (Serial ATA) devices have been
170 known to exist with both a PCI SCSI device class, and with a PCI IDE
171 device class. Under linux 2.6 kernels, all SATA modules need to be listed
172 in modprobe.conf under 'scsi_hostadapter' lines. This case is handled in
173 the hardware loading scripts by making the assumption that if an IDE
174 device matches a loadable module, it should be put in the modprobe.conf
175 file, as 'real' IDE drivers are all currently built into the kernel, and
176 do not need to be loaded. SATA devices that have a PCI SCSI device class
177 are easily identified.</para>
179 <para>It is enssential that the modprobe.conf configuration file contain
180 the correct drivers for the disks on the system, if they are present, as
181 during kernel installation the creation of the initrd (initial ramdisk)
182 which is responsible for booting the system uses this file to identify
183 which drivers to include in it. A failure to do this typically results in
184 an kernel panic at boot with a 'no init found' message.</para>