As already noted, the Anaconda installer is a set of python modules and scripts. It also uses a number of external packages and libraries, some of which were originally created specifically for the installer. Major components of the toolset include the following packages:
pykickstart,
yum,
blivet and
pyanaconda.
pykickstart is a package that parses and validates a provided kickstart file and also provides a data structure that Anaconda uses to store values driving installation. We will focus more on the data representation and life cycle in the following paragraph.
yum is the core python package of the
yum
package manager. Anaconda uses it to interface with package repositories and handle operations related to package management during installation.
blivet is a relatively recent project which was split out from the
pyanaconda package as
pyanaconda.storage. As the old name suggests, blivet is a storage library which handles all activities related to disk management. Additionally, it provides functions for boot loader installation and configuration. The
pyanaconda package acts as a glue for holding all of the components together; it contains all of the UI code and several modules for functionality unique to anaconda, such as keyboard and timezone selection, network configuration, and user creation, as well as a number of utilities and system-oriented functions. There is also the
python-meh package which contains an exception handler that gathers and stores additional information from the system in case of a crash and passes this data to the
libreport library, which is a part of the
ABRT project.
The life cycle of the data in the installation process is simple and straightforward. If a kickstart file is provided, it is parsed and processed by the pykickstart module to behave as an in-memory, tree-like structure. If no kickstart file is given, an empty tree-like structure is created. Items in this structure are then updated with the user's choices as they are made within the UI. Next, the installation process begins, and it is driven by the values which are stored in the tree-like structure. At this point, the values are also written out as a kickstart file which can be used to perform another installation with the same configuration. Elements of the structure are defined in the pykickstart package, but some of them are overridden by modified versions from the pyanaconda.kickstart module. The important rule which governs this behavior is that there is nowhere to store configuration data, and the installation process is data-driven and relies on transactions as much as possible. This neatly enforces some nice features:
What does it mean that the installation is data-driven? The installation and configuration logic lies within the methods of the items in the tree-like structure. Every item is set up (the
setup
method)
to modify the runtime environment of the installation if needed, and then executed (the
execute
)
to perform the changes on the newly installed system. We will look at these methods closer in
Section 6, “Writing an Anaconda addon”.