[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ next ]


FAI Guide (Fully Automatic Installation)
Chapter 5 - Overview of the installation sequence


The following tasks are performed during an installation after the Linux kernel has booted on the install clients.

  1. Set up FAI

  1. Define classes

  1. Define variables

  1. Partition local disks

  1. Create and mount local file systems

  1. Install software packages

  1. Call site specific configuration scripts

  1. Save log files

  1. Reboot the new installed system

You can also define additional programs or scripts which will be run on particular occasions. They are called hooks. Hooks can add additional functions to the installation process or replace the default subtasks of FAI. So it's very easy to customize the whole installation process. Hooks are explained in detail in Hooks, Section 7.11.

The installation time is determined by the amount of software but also by the speed of the processor and hard disk. Here are some sample times. All install clients have a 100Mbit network card installed. Using a 10 Mbit LAN does not increase the installation time considerably, so the network will not be the bottleneck when installing several clients simultaneously.

     Athlon XP1600+    , 896MB,SCSI disk,   1 GB software  6 min
     AMD-K7  500MHz    , 320MB, IDE disk, 780 MB software 12 min
     PentiumPro 200MHz , 128MB, IDE disk, 800 MB software 28 min
     Pentium III 850MHz, 256MB, IDE disk, 820 MB software 10 min
     Pentium III 850MHz, 256MB, IDE disk, 180 MB software  3 min

5.1 Monitoring the installation

You can monitor the installation of all install clients with the command faimond(8). All clients check if this daemon is running on the install server (or the machine defined by the variable monserver. Then, a message is sent when a task starts and ends. The fai monitor daemon prints this messages to standard output. In the future, there will be a graphical frontend available.


5.2 Booting the kernel

The install client receives and loads the kernel and initial RAM disk. The kernel boots up and load the RAM disk. It does some hardware detection and then tries to figure where the root file system is located. When booting from network, this is determined by parameters from additional kernel parameters. When booting from CD-ROM or USB stick the kernel and initial RAM disk probes removable devices and tries to figure out where the root file system is located. This may also be a compressed file system (using squashfs). After the root file system is mounted read only, it is made writable by mounting a RAM disk via unionfs on top of it. So it's possible for programs or daemons to write to files inside a read only mounted file system. We are using the package live-initramfs to mount the nfsroot and to make this file system writable using unionfs.


5.3 Set up FAI

After the install client has booted, only the script /usr/sbin/fai[10] is executed. This is the main script which controls the sequence of tasks for FAI. No other scripts in /etc/init.d/ are executed.

Additional parameters are received from the BOOTP or DHCP daemon and the configuration space if mounted via NFS from the install server to /fai. The setup is finished after additional virtual terminals are created and the secure shell daemon for remote access is started on demand.


5.4 Defining classes, variables and loading kernel modules

Now the script fai-class(1) is used to define classes. Therefore several scripts in /fai/class/ are executed to define classes. All scripts matching [0-9][0-9]* (they start with two digits) are executed in alphabetical order. Every word that these scripts print to the standard output are interpreted as class names. Scripts ending in .source are sourced, so they can define new classes by adding these classes to the variable newclasses (see 20-hwdetect.source for an example). The output of these scripts is ignored. These classes are defined for the install client. You can also say this client belongs to these classes. A class is defined or undefined and has no value. Only defined classes are of interest for an install client. The description of all classes can be found in /usr/share/doc/fai-doc/classes_description.txt. It is advisable to document the job a new class performs. Then, this documentation is the base for composing the whole configuration from classes. The scripts 20-hwdetect.source loads kernel modules on demand. The complete description of all these scripts can be found in Scripts in /fai/scripts, Section 7.9.

After defining the classes, every file matching *.var with a prefix which matches a defined class is executed to define variables. There, you should define the variable FAI_ACTION and others. By default, FAI_ACTION is defined via the command fai-chboot(8).


5.5 Partitioning local disks, creating file systems

For disk partitioning exactly one disk configuration file from /fai/disk_config is selected using classes. This file describes how all the local disks will be partitioned, where file systems should be created (and their types like ext2, ext3, reiserfs), and how they are mounted. It's also possible to preserve the disk layout or to preserve the data on certain partitions. It's done by the command setup_harddisks, which uses sfdisk for partitioning. The format of the configuration file is described in Hard disk configuration, Section 7.7.

During the installation process all local file systems are mounted relative to /target. For example /target/home will become /home in the new installed system.


5.6 Installing software packages

When local file systems are created, they are all empty (except for preserved partitions). Now the Debian base system and all requested software packages are installed on the new file systems. First the base archive is unpacked, then the command install_packages(8) installs all packages using apt-get(8) or aptitude(1) without any manual interaction needed. If a packages requires another package, both commands resolve this dependency by installing the required package.

Classes are also used when selecting the configuration files in /fai/package_config/ for software installation. The format of the configuration files is described in Software package configuration, Section 7.8.


5.7 Site specific configuration

After all requested software packages are installed, the system is nearly ready to go. But not all default configurations of the software packages will meet your site-specific needs. So you can call arbitrary scripts which adjust the system configuration. Therefore scripts which match a class name in /fai/scripts will be executed. If /fai/scripts/classname/ is a directory, all scripts that match [0-9][0-9]* in this directory are executed. So it is possible to have several scripts of different types (shell, cfengine, ...) to be executed for one class. FAI comes with some examples for these scripts, but you can write your own Bourne, bash, Perl, cfengine or expect scripts.

More information about these scripts are described in Scripts in /fai/scripts, Section 7.9.


5.8 Save log files

When all installation tasks are finished, the log files are written to /var/log/fai/$HOSTNAME/install/ [11] on the new system and to the account on the install server if $LOGUSER is defined in /etc/fai/fai.conf. It is also possible to specify another host as log saving destination through the variable $LOGSERVER. Additionally, two symlinks will be created to indicated the last directory written to. By default log files will be copied to the log server using scp.

You can use other methods to save logs to the remote server. The currently selected method is defined by the $FAI_LOGPROTO variable in file /etc/fai/fai.conf:

rsh

Use the rcp command to copy the log files to the log server.

ftp

This option saves logs to the remote FTP server defined by the $LOGSERVER variable ($SERVER value is used if not set). Connection to the FTP server is done as user $LOGUSER using password $LOGPASSWD. The FTP server log directory is defined in $LOGREMOTEDIR. These variables are also defined in file /etc/fai/fai.conf. You need write access for the $LOGREMOTEDIR on the FTP server.

All files in the directory /tmp/fai are copied to the FTP server following this example: ftp://$LOGUSER:$LOGPASSWD@$LOGSERVER/$LOGREMOTEDIR/.

none

Don't save the log file to the install server.


5.9 Reboot the new installed system

At last the system is automatically rebooted if "reboot" was added to FAI_FLAGS. Normally this should boot the new installed system from its second boot device, the local hard disk. To skip booting from network card, you can use the command fai-chboot(8) to enable localboot. If using a boot floppy you have to remove the floppy from the floppy drive. Otherwise the installation would be performed again. Read Changing the boot device, Section 7.10 for how to change the boot device.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ next ]


FAI Guide (Fully Automatic Installation)

FAI Guide version 2.6.8, 7 December 2007 for FAI package version 3.2.1

Thomas Lange lange@informatik.uni-koeln.de