Anaconda/SourceOverview

From FedoraProject

< Anaconda(Difference between revisions)
Jump to: navigation, search
m (corrected typo interal --> interval)
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{autolang|base=yes}}
 
<!-- page was renamed from AnacondaSourceOverview
 
<!-- page was renamed from AnacondaSourceOverview
 
-->
 
-->
Line 6: Line 7:
  
 
== Interface ==
 
== Interface ==
cmdline.py<BR>
+
pyanaconda/cmdline.py<BR>
gui.py<BR>
+
pyanaconda/gui.py<BR>
text.py
+
pyanaconda/installinterfacebase.py<br>
 +
pyanaconda/text.py
  
 
These files handle the user interfaces.  There are three interfaces supported by anaconda:  graphical, text, and the command line mode.  Each is implemented by its own python file that contains classes for drawing various types of windows and so forth.
 
These files handle the user interfaces.  There are three interfaces supported by anaconda:  graphical, text, and the command line mode.  Each is implemented by its own python file that contains classes for drawing various types of windows and so forth.
  
iw/<BR>
+
data/ui<br>
textw/<BR>
+
pyanaconda/iw/<BR>
ui/
+
pyanaconda/textw/
  
The iw/ directory contains python files for the graphical interface screens.  The textw/ directory contains python files for the text interface screens.  The ui/ directory contains glade interface description files that are also needed for graphical mode.  In general, we are trying to move towards more glade files whenever possible.
+
The pyanaconda/iw/ directory contains python files for the graphical interface screens.  The pyanaconda/textw/ directory contains python files for the text interface screens.  The data/ui/ directory contains glade interface description files that are also needed for graphical mode.  In general, we are trying to remove as much of text mode as possible and move everything in the graphical interface to using glade.
  
dispatch.py
+
pyanaconda/dispatch.py
  
The dispatcher is a state machine that controls moving between steps in the installer.  It knows which screen to go to when a Next or Back button is clicked, and knows which steps should be skipped depending on a variety of settings.  Each mode of installation provides its own set of steps that should be skipped.
+
The dispatcher is a state machine that controls moving between steps in the installer.  It knows which screen to go to when a Next or Back button is clicked, and knows which steps should be skipped depending on a variety of settings.  Each mode of installation provides its own set of steps that should be skipped or added back in.  Install classes (covered later) may also specify steps to skip or add.  In addition, various other machine-specific details anaconda discovers and user selections can alter the set of steps.
  
vnc.py
+
pyanaconda/vnc.py
  
 
This file controls setting up VNC for when it is requested during installation.  Afterwards, installs proceed in graphical mode.
 
This file controls setting up VNC for when it is requested during installation.  Afterwards, installs proceed in graphical mode.
 
mini-wm.c<BR>
 
xutils.c
 
 
These files provide the window manager that runs during graphical installations.
 
  
 
== Partitioning ==
 
== Partitioning ==
dmraid.py<BR>
+
pyanaconda/storage/dasd.py<br>
gpt.py<BR>
+
pyanaconda/storage/devicelibs/<br>
iscsi.py<BR>
+
pyanaconda/storage/fcoe.py<br>
lvm.py<BR>
+
pyanaconda/storage/iscsi.py<br>
raid.py<BR>
+
pyanaconda/storage/zfcp.py
zfcp.py<BR>
+
  
These files handle probing, configuring, starting, and stopping the advanced storage devices that are supported by anaconda.  LVM and RAID are fairly widely used (LVM is the default partitioning), while the others are much less so.
+
These files handle probing, configuring, starting, and stopping the advanced storage systems that anaconda supports. This includes both hardware devices (FCOE, iSCSI, RAID, ZFCP, etc.) and software abstractions (encryption, lvm, etc.) LVM and RAID are heavily used while the others are much less common.
  
lvmErrors.py<BR>
+
pyanaconda/storage/formats/
partErrors.py
+
  
These files define exception classes for problems that can occur during partitioning.
+
These files handle writing some sort of filesystem or filesystem-like abstraction to a storage device.  Think of this as a layer on top of something in pyanaconda/storage/devicelibs/.  Filesystem-like abstractions include disk labels, encryption, machine-specific boot partitions, and swap.
  
partIntfHelpers.py
+
pyanaconda/partIntfHelpers.py
  
 
This file contains methods that are used for error checking, input validation, and displaying error messages.  The graphical and text interfaces make use of it.
 
This file contains methods that are used for error checking, input validation, and displaying error messages.  The graphical and text interfaces make use of it.
  
autopart.py<BR>
+
pyanaconda/storage/__init__.py<br>
cryptodev.py<BR>
+
pyanaconda/storage/errors.py<br>
fsset.py<BR>
+
pyanaconda/storage/miscutils.py<br>
gptsync/<BR>
+
pyanaconda/storage/size.py<br>
partRequests.py<BR>
+
pyanaconda/storage/storage_log.py<br>
partedUtils.py<BR>
+
pyanaconda/storage/udev.py
partitioning.py<BR>
+
partitions.py
+
  
This group of files implements the partitioning logic.  It converts the user's selections into requests, then into entries, and eventually makes partitions on disk.  It also controls making filesystems, writing out the /etc/fstab file, labelling devices, and doing automatic partitioning (which is the default).  Partitions are created on disk by using the pyparted package.
+
These files form a support library within the storage module, taking care of a variety of small tasks that don't fit well in another group.  For the most part, the names describe what they do.  pyanaconda/storage/__init__.py handles a rather large number of catch-all tasks including reading and writing storage-related configuration files, probing for existing installations, coordinating storage actions, marshalling data between storage objects, and performing sanity checks.
 +
 
 +
pyanaconda/storage/deviceaction.py<br>
 +
pyanaconda/storage/devices.py<br>
 +
pyanaconda/storage/devicetree.py<br>
 +
pyanaconda/storage/partitioning.py<br>
 +
pyanaconda/storage/partspec.py
 +
 
 +
This group of files implements the partitioning logic.  It holds the DeviceTree abstraction that stores existing partitions and requests in a meaningful way, defines the actions needed to write storage requests to disk, handles automatic partitioning (which is the default), and knows how to grow and shrink all requests until they fit in the space provided.  Partitions themselves are created on disk by using the pyparted package.
 +
 
 +
== Bootloader ==
 +
pyanaconda/bootloader.py<br>
 +
pyanaconda/booty/
 +
 
 +
These files control writing out the bootloader to the installed system.  Each type of machine has its own bootloader quirks, and therefore has its own file in the booty/ module.  bootloader.py ties it all together.  This is useful both for fresh installations as well as upgrades.
  
 
== Configuration ==
 
== Configuration ==
bootloader.py<BR>
+
pyanaconda/desktop.py<BR>
desktop.py<BR>
+
pyanaconda/firewall.py<BR>
firewall.py<BR>
+
pyanaconda/language.py<BR>
instdata.py<BR>
+
pyanaconda/network.py<BR>
language.py<BR>
+
pyanaconda/security.py<BR>
network.py<BR>
+
pyanaconda/timezone.py<BR>
security.py<BR>
+
pyanaconda/users.py
timezone.py<BR>
+
users.py<BR>
+
xsetup.py
+
  
 
These files hold the configuration settings that are either entered through the interface or through kickstart.  To some extent they affect the installation (for instance, the language and keyboard settings are used in anaconda).  However, the main purpose is to write these out to the installed system at the end of installation.
 
These files hold the configuration settings that are either entered through the interface or through kickstart.  To some extent they affect the installation (for instance, the language and keyboard settings are used in anaconda).  However, the main purpose is to write these out to the installed system at the end of installation.
  
 
== Package Installation ==
 
== Package Installation ==
backend.py<BR>
+
pyanaconda/compssort.py<br>
image.py<BR>
+
pyanaconda/backend.py<BR>
sortedtransaction.py<BR>
+
pyanaconda/image.py<BR>
whiteout.py<BR>
+
pyanaconda/sortedtransaction.py<BR>
yuminstall.py
+
pyanaconda/yuminstall.py
  
These files control package installation.  anaconda allows for multiple package installation backends, though the only real one in the tree uses yum.  Each backend provides methods for selecting groups and packages, removing groups and packages, writing out configuration settings, and so forth.  For fixing loops in package dependencies, we use the whiteout which explains how to correctly break loops.
+
These files control package installation.  anaconda allows for multiple package installation backends, though the only real one in the tree uses yum.  Each backend provides methods for selecting groups and packages, removing groups and packages, writing out configuration settings, and so forth.
  
 
== Installation Classes ==
 
== Installation Classes ==
installclass.py<BR>
+
pyanaconda/installclass.py<BR>
installclasses/<BR>
+
pyanaconda/installclasses/<BR>
product.py
+
pyanaconda/product.py
 +
 
  
 
Installation classes define settings that form a sort of installation profile.  This includes steps to show and skip, product names, installation method, enabled repositories, configuration settings, and so forth.  We primarily use it to create a difference between Fedora and RHEL installs.  Other projects or ISVs could define their own installation classes for their own defaults.
 
Installation classes define settings that form a sort of installation profile.  This includes steps to show and skip, product names, installation method, enabled repositories, configuration settings, and so forth.  We primarily use it to create a difference between Fedora and RHEL installs.  Other projects or ISVs could define their own installation classes for their own defaults.
  
 
== Special Modes ==
 
== Special Modes ==
kickstart.py
+
pyanaconda/kickstart.py
  
[wiki:Self:AnacondaKickstart Kickstart] is a way of automating installations by providing anaconda with a file that contains all the data that the user would have to provide via the UI.  This file is an interface between the parser in the pykickstart package and the anaconda intervals.  It primarily provides a way of saving the settings in the places anaconda expects.
+
[[Anaconda/Kickstart| Kickstart]] is a way of automating installations by providing anaconda with a file that contains all the data that the user would have to provide via the UI.  This file is an interface between the parser in the pykickstart package and the anaconda internals.  It primarily provides a way of saving the settings in the places anaconda expects.
  
livecd.py<BR>
+
data/icons<br>
liveinst/
+
data/liveinst<br>
 +
liveinst/<br>
 +
pyanaconda/livecd.py
  
These files implement installation from the live CD.  They provide, a special installation method, a special package installation backend, and some files needed to launch the installer from the live CD's desktop.
+
These files implement installation from the live CD.  They provide a special installation method, a special package installation backend, and some files needed to launch the installer from the live CD's desktop.
  
rescue.py<BR>
+
pyanaconda/rescue.py<BR>
upgrade.py
+
pyanaconda/upgrade.py
  
 
These files provide methods specific to rescue mode and upgrades.
 
These files provide methods specific to rescue mode and upgrades.
  
 
== Library ==
 
== Library ==
anaconda_log.py<BR>
+
pyanaconda/__init__.py<br>
constants.py<BR>
+
pyanaconda/anaconda_log.py<BR>
exception.py<BR>
+
pyanaconda/backend_log.py<br>
flags.py<BR>
+
pyanaconda/baseudev.py<br>
floppy.py<BR>
+
pyanaconda/constants.py<BR>
isys/<BR>
+
pyanaconda/errors.py<br>
iutil.py<BR>
+
pyanaconda/exception.py<BR>
packages.py<BR>
+
pyanaconda/flags.py<BR>
syslogd.py<BR>
+
pyanaconda/installmethod.py<br>
timer.py
+
pyanaconda/isys/<BR>
 +
pyanaconda/iutil.py<BR>
 +
pyanaconda/packages.py<BR>
 +
pyanaconda/platform.py<br>
 +
pyanaconda/pyudev.py<br>
 +
pyanaconda/simpleconfig.py<br>
 +
pyanaconda/sitecustomize.py<br>
 +
pyanaconda/xutils.c
  
These files provide a variety of miscellaneous methods that are used throughout the installer.  These functions include the logging framework, hardware probing, device node management, process control, handling exceptions, and other tasks.  They also contain methods that just don't fit anywhere else.
+
These files provide a variety of miscellaneous methods that are used throughout the installer.  These functions include the logging framework, hardware probing via a udev interface, process control, handling exceptions, and other tasks.  They also contain methods that just don't fit anywhere else.
  
 
== The Main Program ==
 
== The Main Program ==
Line 126: Line 140:
  
 
== Image Building ==
 
== Image Building ==
bootdisk/<BR>
+
data/bootdisk/<BR>
command-stubs/<BR>
+
data/command-stubs/<BR>
 +
data/fonts/<br>
 
scripts/<BR>
 
scripts/<BR>
stubs/<BR>
+
utils/
utils/<BR>
+
wlite/
+
  
These directories contain code that controls how the installation
+
These directories contain code that controls how the installation environment is made.  This includes creating the initial ramdisk and the
environment is made.  This includes creating the initial ramdisk and the
+
stage2 images, adding very basic versions of certain needed commands, splitting the installation tree into media-sized chunks, and other
stage2 images, adding very basic versions of certain needed commands,
+
splitting the installation tree into media-sized chunks, and other
+
 
miscellaneous tasks.
 
miscellaneous tasks.
  
 
== Loader ==
 
== Loader ==
loader2/
+
loader/
  
 
Coming soon.
 
Coming soon.

Revision as of 09:02, 4 April 2012

Contents

Source Overview

anaconda has a lot of source, and this can be a little intimidating at first. It can be difficult to figure out where to even start looking when you're trying to track a problem down. This guide is meant as a very high level overview of the various groups of source files and what sorts of things they cover. It's not incredibly detailed, and some source files don't want to fit into categories. Lots of pieces of functionality are spread out across multiple files.

Interface

pyanaconda/cmdline.py
pyanaconda/gui.py
pyanaconda/installinterfacebase.py
pyanaconda/text.py

These files handle the user interfaces. There are three interfaces supported by anaconda: graphical, text, and the command line mode. Each is implemented by its own python file that contains classes for drawing various types of windows and so forth.

data/ui
pyanaconda/iw/
pyanaconda/textw/

The pyanaconda/iw/ directory contains python files for the graphical interface screens. The pyanaconda/textw/ directory contains python files for the text interface screens. The data/ui/ directory contains glade interface description files that are also needed for graphical mode. In general, we are trying to remove as much of text mode as possible and move everything in the graphical interface to using glade.

pyanaconda/dispatch.py

The dispatcher is a state machine that controls moving between steps in the installer. It knows which screen to go to when a Next or Back button is clicked, and knows which steps should be skipped depending on a variety of settings. Each mode of installation provides its own set of steps that should be skipped or added back in. Install classes (covered later) may also specify steps to skip or add. In addition, various other machine-specific details anaconda discovers and user selections can alter the set of steps.

pyanaconda/vnc.py

This file controls setting up VNC for when it is requested during installation. Afterwards, installs proceed in graphical mode.

Partitioning

pyanaconda/storage/dasd.py
pyanaconda/storage/devicelibs/
pyanaconda/storage/fcoe.py
pyanaconda/storage/iscsi.py
pyanaconda/storage/zfcp.py

These files handle probing, configuring, starting, and stopping the advanced storage systems that anaconda supports. This includes both hardware devices (FCOE, iSCSI, RAID, ZFCP, etc.) and software abstractions (encryption, lvm, etc.) LVM and RAID are heavily used while the others are much less common.

pyanaconda/storage/formats/

These files handle writing some sort of filesystem or filesystem-like abstraction to a storage device. Think of this as a layer on top of something in pyanaconda/storage/devicelibs/. Filesystem-like abstractions include disk labels, encryption, machine-specific boot partitions, and swap.

pyanaconda/partIntfHelpers.py

This file contains methods that are used for error checking, input validation, and displaying error messages. The graphical and text interfaces make use of it.

pyanaconda/storage/__init__.py
pyanaconda/storage/errors.py
pyanaconda/storage/miscutils.py
pyanaconda/storage/size.py
pyanaconda/storage/storage_log.py
pyanaconda/storage/udev.py

These files form a support library within the storage module, taking care of a variety of small tasks that don't fit well in another group. For the most part, the names describe what they do. pyanaconda/storage/__init__.py handles a rather large number of catch-all tasks including reading and writing storage-related configuration files, probing for existing installations, coordinating storage actions, marshalling data between storage objects, and performing sanity checks.

pyanaconda/storage/deviceaction.py
pyanaconda/storage/devices.py
pyanaconda/storage/devicetree.py
pyanaconda/storage/partitioning.py
pyanaconda/storage/partspec.py

This group of files implements the partitioning logic. It holds the DeviceTree abstraction that stores existing partitions and requests in a meaningful way, defines the actions needed to write storage requests to disk, handles automatic partitioning (which is the default), and knows how to grow and shrink all requests until they fit in the space provided. Partitions themselves are created on disk by using the pyparted package.

Bootloader

pyanaconda/bootloader.py
pyanaconda/booty/

These files control writing out the bootloader to the installed system. Each type of machine has its own bootloader quirks, and therefore has its own file in the booty/ module. bootloader.py ties it all together. This is useful both for fresh installations as well as upgrades.

Configuration

pyanaconda/desktop.py
pyanaconda/firewall.py
pyanaconda/language.py
pyanaconda/network.py
pyanaconda/security.py
pyanaconda/timezone.py
pyanaconda/users.py

These files hold the configuration settings that are either entered through the interface or through kickstart. To some extent they affect the installation (for instance, the language and keyboard settings are used in anaconda). However, the main purpose is to write these out to the installed system at the end of installation.

Package Installation

pyanaconda/compssort.py
pyanaconda/backend.py
pyanaconda/image.py
pyanaconda/sortedtransaction.py
pyanaconda/yuminstall.py

These files control package installation. anaconda allows for multiple package installation backends, though the only real one in the tree uses yum. Each backend provides methods for selecting groups and packages, removing groups and packages, writing out configuration settings, and so forth.

Installation Classes

pyanaconda/installclass.py
pyanaconda/installclasses/
pyanaconda/product.py


Installation classes define settings that form a sort of installation profile. This includes steps to show and skip, product names, installation method, enabled repositories, configuration settings, and so forth. We primarily use it to create a difference between Fedora and RHEL installs. Other projects or ISVs could define their own installation classes for their own defaults.

Special Modes

pyanaconda/kickstart.py

Kickstart is a way of automating installations by providing anaconda with a file that contains all the data that the user would have to provide via the UI. This file is an interface between the parser in the pykickstart package and the anaconda internals. It primarily provides a way of saving the settings in the places anaconda expects.

data/icons
data/liveinst
liveinst/
pyanaconda/livecd.py

These files implement installation from the live CD. They provide a special installation method, a special package installation backend, and some files needed to launch the installer from the live CD's desktop.

pyanaconda/rescue.py
pyanaconda/upgrade.py

These files provide methods specific to rescue mode and upgrades.

Library

pyanaconda/__init__.py
pyanaconda/anaconda_log.py
pyanaconda/backend_log.py
pyanaconda/baseudev.py
pyanaconda/constants.py
pyanaconda/errors.py
pyanaconda/exception.py
pyanaconda/flags.py
pyanaconda/installmethod.py
pyanaconda/isys/
pyanaconda/iutil.py
pyanaconda/packages.py
pyanaconda/platform.py
pyanaconda/pyudev.py
pyanaconda/simpleconfig.py
pyanaconda/sitecustomize.py
pyanaconda/xutils.c

These files provide a variety of miscellaneous methods that are used throughout the installer. These functions include the logging framework, hardware probing via a udev interface, process control, handling exceptions, and other tasks. They also contain methods that just don't fit anywhere else.

The Main Program

anaconda

This is the main anaconda program that gets called from the loader. It handles lots of environment setup, enables updates if they exist, reads any kickstart file, sets up VNC, and other tasks. When all this is done, it hands control over to the dispatcher which deals with the rest of the installation process.

Image Building

data/bootdisk/
data/command-stubs/
data/fonts/
scripts/
utils/

These directories contain code that controls how the installation environment is made. This includes creating the initial ramdisk and the stage2 images, adding very basic versions of certain needed commands, splitting the installation tree into media-sized chunks, and other miscellaneous tasks.

Loader

loader/

Coming soon.