1.1. Introduction to Anaconda
Anaconda is the operating system installer used in Fedora, Red Hat Enterprise Linux, and their derivatives. It is a set of Python modules and scripts together with some additional files like Gtk
widgets (written in C), systemd
units, and dracut
libraries. Together, they form a tool that allows users to set parameters of the resulting (target) system and then set such a system up on a machine. The installation process has four major steps:
installation destination preparation (usually disk partitioning)
package and data installation
boot loader installation and configuration
configuration of the newly installed system
There are three ways you can control the installer and specify installation options. The most common approach is to use the graphical user interface (GUI). This interface is meant to allow users to install the system interactively with little or no configuration required before beginning the installation, and it should cover all common use cases, including setting up complicated partitioning layouts.
The graphical interface also supports remote access over VNC
, which allows you to use the GUI even on systems with no graphics cards or even attached monitor. However, there are still cases where this is not desired, but at the same time, you may want to perform an interactive installation. For these cases, a text mode (TUI) is available. The TUI works in a way similar to a monochrome line printer, which allows it to work even on serial consoles which do not support cursor movement, colors and other advanced features. The text mode is limited in that it only allows you to customize most common options, such as network settings, language options or installation (package) source; advanced features such as manual partitioning are not available in this interface.
The third way to install a system using Anaconda is by using a Kickstart file - a plain text file with shell-like syntax which can contain data to drive the installation process. A Kickstart file allows you to partially or completely automate the installation. A certain set of commands which configures all required areas is necessary to completely automate the installation; if one or more of the required commands is missing, the installation will require interaction. If all required commands are present, the installation will be performed in a completely automatic way, without any need for interaction.
Kickstart provides the highest amount of options, covering use cases where neither the TUI nor the GUI is sufficient. Every feature in Anaconda must always be supported in Kickstart; other interfaces follow only subsets of all available options, which allows them to remain clear.
1.2. Firstboot and Initial Setup
The first boot of the newly installed system is traditionally considered a part of the installation process as well, because some parts of configuration such as user creation are often performed at this point. In older releases of Red Hat Enterprise Linux, the
Firstboot tool has been used for this purpose, allowing you to register your newly installed system or configure
Kdump. However,
Firstboot relies on no longer maintained tools such as
Gtk2
and the
pygtk2
module.
For this reason, a new tool called
Initial Setup was developed, which reuses code from
Anaconda. This allows add-ons developed for
Anaconda to be easily reused in
Initial Setup. This topic is further discussed in
Section 6, “Writing an Anaconda add-on”.
1.3. Anaconda and Initial Setup Add-ons
Installing a new operating system is a vastly complicated use case - each user may want to do something slightly different. Designing an installer for every corner case would cause it to be cluttered with rarely-used functionality. For this reason, when the installer was being rewritten into its current form, it gained support for add-ons.
Anaconda add-ons can be used to add your own Kickstart commands and options as well as new configuration screens in the graphical and text-based user interface, depending on your specific use case. Each add-on must have Kickstart support; the GUI and TUI are optional, but can be very helpful.
In current releases of Fedora
(21 and later) and Red Hat Enterprise Linux (7.1 and later), one add-on is included by default: The
Kdump add-on, which adds support for configuring kernel crash dumping during the installation. This add-on has full support in Kickstart (using the
%addon com_redhat_kdump
command and its options) and is fully integrated as an additional screen in the text-based and graphical interfaces. You can develop other add-ons in the same way and add them to the default installer using procedures described further in this guide.