We have designed our Linux system so that it is easy for volunteers to install. As such, you don't need to know very much about the installation process in order to get Linux on a computer.
Having said that, understanding the machinery behind the install can be helpful. If nothing else, it will help you troubleshoot the installation process when installs fail. Learning about the installation process helps the Linux project, too: it helps volunteers understand Linux better, and it gives the project security in case the current administrators stop volunteering.
The next section introduces FAI, and documents some resources that can help you understand the package. Next, we explain the installation process - from bootup to configuration - in some detail.
The software we use for our backend is called FAI (Fully Automated Install). It is a set of scripts that allows Linux to be installed on many workstations at once, without human intervention. FAI can be customized to suit local needs, and we have customized FAI to install our subset of Debian automatically.
In our project, FAI scripts are responsible for:
We do not yet exploit the full functionality of FAI. One problem is that we face many different hardware configurations. We have not figured out how to automatically detect and select packages specific to hardware, monitors and mice, so we rely on volunteers to configure X. Similarly, volunteers must create user accounts on the system. As our Linux installation matures, we may be able to automate some of these things as well.
The homepage for FAI is http://www.informaik.uni-koeln.de/fai . This page offers the latest version of the FAI manual, and archives of the FAI mailing list.
The FAI manual is also installed locally on the server. You can find it at
/usr/share/doc/fai/
Working through the manual and setting up FAI is the best way to understand the system. Failing that, working through the manual and comparing that to the files on our server is good too.
This problem can probably be fixed by specifying proper ownership privileges, but we don't know how to do that yet.
FAI logs configuration information and runtime messages into a directory full of logfiles. During the installation process, you can access these logfiles in the directory
/tmp/fai/
After installation, you can find the logfiles in the directory
/var/log/fai/hostname/last-install/
on the client machine, where hostname is the name of the machine.
Log files of interest include:
The boot process of our FAI installation goes through the following steps:
After these steps, the FAI installer is ready to partition the local hard disks, mount local hard drives and install program files.
The following subsections explain the startup process in more detail.
The BIOS of a computer contains basic information the computer needs to interact with its components. Part of the BIOS's job is to look for boot information for the computer's operating system.
The BIOS is not very smart. It knows some locations where the boot information may exist - the boot sequence - and it knows how to load enough information from those locations to get the rest of the boot loader going.
Most BIOSes allow you to boot from the floppy or the hard drive. Some allow booting from CD-ROMs, and a few allow direct booting off a network, using a network card.
Our installation uses a bootable floppy for installation. The first few sectors of the floppy contain LILO, a boot loader for Linux. The BIOS finds LILO, loads it into memory and executes it.
LILO stands for LInux LOader. Its job is to tell the computer where to find Linux components. LILO can also be used to boot other operating systems (such as Windows 95), but we do not use that functionality in FAI.
In order to boot Linux, LILO needs two pieces of information:
Kernel location: The Linux kernel is the core of the operating system. It is a program that serves as an interface between the computer's hardware and software, managing system resources, allowing access to hardware, and interacting with application programs.
There may be several different versions of the Linux kernel on a computer. LILO needs to know which one to use, and where to find it. In our installations, the kernel is located on the boot floppy disk.
Root location: The root directory is the top of the directory structure. The directory structure contains all of the user programs and data present on the system. The directory structure may be spread over many hard drives, but it has a single root directory. (The hard drive partition that contains the root directory is called the root partition.)
LILO needs to know the location of this root directory, so that it can mount the directory tree. Other filesystems (on hard drives, CD-ROMS or the network) can then be mounted relative to the root.
On standalone Linux systems, the root directory is often located on the same partition as the kernel. However, this is not required, and in our installation the root directory is located on the server. It is accessible via a protocol called NFS. LILO is smart enough to know about NFS, and it is able to tell the kernel where to find the root directory that should be used for booting.
On our server, the NFS root directory is:
/usr/local/share/fai/nfsroot/
Permission for the server to export this directory is contained in the /etc/exports file.
(Where should I be talking about NFS? Here, or elsewhere? -P.)
Traditionally, when Linux boots it executes startup scripts. These scripts start services, such as X-Windows and the printing daemon. On Debian, these scripts can be found in /etc/init.d/ .
To start the install, FAI includes a script in the /etc/init.d directory called rcS_fai . The Linux kernel finds this script (or rather, a symbolic link to this file) and starts executing it.
rcS_fai contains the control code for FAI. It is the installer program; its job is to co-ordinate the installation process, calling subroutines that carry out each stage of the install.
Once the installer has started, installation proceeds in the following steps:
The FAI manual goes through each of these steps in detail. Over the next few sections, we will describe the basic ideas, and document local changes we made for our project.
FAI has the capability to install many different Linux configurations at the same time. Different configurations are specified by classes - labels that specify which configuration files FAI should use in the installation.
Each installation starts out with three classes defined: DEFAULT, LAST and a class labelled with the client's hostname.
Once an installation starts, one of the installer's first jobs is to figure out what additional classes (if any) should be defined. To do this, FAI looks in
/usr/local/share/fai/installer/classes/ .
Three different kinds of files are allowed in this directory:
This would be the natural way to define classes for based upon detected hardware. We currently use it to define classes based on hostname (S01alias.sh), to decide disk partitions (S07disk.pl) and to run configuration menus (S30menu.sh, S40xserver.sh).
We use the pre-existing file DEFAULT.var for our installations, but do not define other variable files.
The installer executes any scripts matching the name of an existing class. This may define new classes, so the process iterates until no more classes have been defined. Finally, scripts of the form classname.var are executed.
We explain relevant classes in the parts of the installation where they are used. Hostnames in the classes/ directory which directly pertain to class definition are:
The names themselves are defined in S01alias.sh .
In this phase, the installer looks in /usr/local/share/fai/installer/disk_config for partitioning information. It should partition the local hard drive(s) according to the information specified in exactly one of these files, which means exactly one class should match a filename in this directory.
FAI partitions the local hard drive(s) according to the information it finds in this file. It also formats the partitions appropriately.
One big advantage of these files is that they are robust with respect to hard drive sizes. They can size partitions proportionally according to the size of the hard drive.
(What happens if there are multiple matches? -P.)
The format of these files is described in the FAI manual. We have defined the following classes:
As well, this file specifies that all partitions should be checked for errors as they are formatted. (This is the “-c” option.)
Other classes we should add include:
After the hard drives have been partitioned and formatted, they are mounted. In Linux, hard drives must be mounted before the system can access their data.
The root partition is mounted to /tmp/target/ . Any other partitions are mounted relative to this point. For example, if we create a partition that should end up at /usr/local/ , the installer will mount this partition to /tmp/target/usr/local/ .
A certain subset of the Debian distribution is labelled “required”, and another subset is labelled “important”. These packages make up a barebones Debian installation.
A program called debootstrap is responsible for downloading these packages and unpacking them into /tmp/target/ .
The packages that debootstrap installs are listed in /usr/lib/debootstrap/scripts/ on the server.
Once the local hard drives have been prepared, package installation begins. The installer NFS-mounts the local mirror on the server. It then downloads and installs packages according to the classes defined in
/usr/local/share/fai/installer/package_config/
The contents of every file matching a defined class name are used.
Again, the format of these configuration files is described in the FAI manual.
(Where can readers find out about Debian packaging policies? -P.)
Below, we document some of the more notable package configuration classes we use. This list is undoubtedly incomplete:
These packages provide most of the functionality that one would find on a standard Linux or UNIX system, with the following exceptions:
These packages are graphical. They have a lot of dependencies.
This package is obsolete, because we now include aptitude in the DEFAULT package.
Packages we should add include:
FAI's package configuration system is powerful and useful, but it has its quirks:
These unknown packages are removed from the installation list:
Unfortunately, when package dependencies are wrong FAI can still get confused, and continue the installation process without installing important packages. See Appendix B.2.1 to learn more about this problem.
It is a good idea to check the /tmp/fai/software.log file on the client before rebooting the system, to ensure that all packages installed correctly.
To get around this, we had to manually install Debian on a machine and create a package configuration file with the standard packages. To see how to do this, see Section 8.4.
(Wrong formatting -P.)
In order to make our setup look like Windows, we have to tweak some configuration files. You can find the code that executes these tweaks in the installer/hooks and installer/scripts directories.
To learn about specific tweaks we make to our applications, see Section 8.1.
The LAST class triggers operations that clean up the Linux installation.
The GRUB and BOOT classes together trigger the BOOT script, which makes the computer bootable. The kernel to install is specified in installer/class/DEFAULT.var . The corresponding kernel package is located in installer/files/packages/
2004-04-13