You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qubes-installer-qubes-os/anaconda/docs/html/user-interaction-config-fil...

382 lines
19 KiB

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Specification of the user interaction configuration file &mdash; Anaconda 25.14 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="Anaconda 25.14 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Anaconda
</a>
<div class="version">
25.14
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to Anaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="release.html">Building a Release</a></li>
<li class="toctree-l1"><a class="reference internal" href="boot-options.html">Anaconda Boot Options</a></li>
<li class="toctree-l1"><a class="reference internal" href="kickstart.html">Anaconda Kickstart Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="commit-log.html">Rules for commit messages</a></li>
<li class="toctree-l1"><a class="reference internal" href="driverdisc.html">Brief description of DriverDisc version 3</a></li>
<li class="toctree-l1"><a class="reference internal" href="iscsi.html">iSCSI and Anaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="multipath.html">Multipath and Anaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pyanaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="testing.html">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="tests/modules.html">tests</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Anaconda</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Specification of the user interaction configuration file</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/user-interaction-config-file-spec.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="specification-of-the-user-interaction-configuration-file">
<h1>Specification of the user interaction configuration file<a class="headerlink" href="#specification-of-the-user-interaction-configuration-file" title="Permalink to this headline"></a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Version:</th><td class="field-body">1.0</td>
</tr>
<tr class="field-even field"><th class="field-name">Authors:</th><td class="field-body">Martin Kolman &lt;<a class="reference external" href="mailto:mkolman&#37;&#52;&#48;redhat&#46;com">mkolman<span>&#64;</span>redhat<span>&#46;</span>com</a>&gt;</td>
</tr>
</tbody>
</table>
<p>This specification aims to establish a configuration file format that can be used
to communicate information about which installation screens have been seen by the user
during the installation. Optionally the configuration file might also contain information
about which configuration options have been changed by the user and if the user has
explicitly requested post installation setup tools to be disabled.</p>
<p>While this configuration file is primarily meant to be read (and potentially changed)
by <em>post</em> installation tools (such as for example Initial Setup and Gnome Initial setup),
Anaconda will take an existing configuration file into account at startup. This is meant
to accommodate tools that are run <em>before</em> Anaconda is started, such as a system-wide
language selection tool that runs before Anaconda is started and which sets language
for both Anaconda and a Live installation environment.</p>
<div class="section" id="configuration-file-location">
<h2>Configuration file location<a class="headerlink" href="#configuration-file-location" title="Permalink to this headline"></a></h2>
<p>The user interaction configuration file is stored in: <code class="docutils literal"><span class="pre">/etc/sysconfig/anaconda</span></code></p>
</div>
<div class="section" id="general-configuration-file-syntax">
<h2>General configuration file syntax<a class="headerlink" href="#general-configuration-file-syntax" title="Permalink to this headline"></a></h2>
<p>The configuration file is based on the INI file de-facto standard,
eq.: key=value assignments and square bracket framed section headers.</p>
<p>Comments start with a hash (#) sign and need to be on a separate line.
Inline comments (eq. behind section or key/value definitions) are not supported.</p>
<p>For Python programs this file format can be parsed and written by the ConfigParser[0] module available
from the Python standard library. For programs written in C the GKeyFile[1] parser might be a good choice.
Comparable INI file parsing and writing modules are available for most other programming languages.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># comment example - before the section headers</span>
<span class="p">[</span><span class="n">section_1</span><span class="p">]</span>
<span class="c1"># comment example - inside section 1</span>
<span class="n">key_a_in_section1</span><span class="o">=</span><span class="n">some_value</span>
<span class="n">key_b_in_section1</span><span class="o">=</span><span class="n">some_value</span>
<span class="p">[</span><span class="n">section_2</span><span class="p">]</span>
<span class="c1"># comment example - inside section 2</span>
<span class="n">key_a_in_section2</span><span class="o">=</span><span class="n">some_value</span>
</pre></div>
</div>
<p>Boolean values are marked with 1 for true and 0 for false.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">true_key</span><span class="o">=</span><span class="mi">1</span>
<span class="n">false_key</span><span class="o">=</span><span class="mi">0</span>
</pre></div>
</div>
</div>
<div class="section" id="toplevel-namespace">
<h2>Toplevel namespace<a class="headerlink" href="#toplevel-namespace" title="Permalink to this headline"></a></h2>
<p>The toplevel configuration file namespace can only contain section headers.</p>
<p>There are two section types:</p>
<ul class="simple">
<li>One special section called <em>General</em> that can contain top-level settings
not directly corresponding to any screen.</li>
<li>Other sections that correspond to Anaconda spoke screens.<ul>
<li>Hubs are not represented as sections as there is nothing that can be
directly set on a hub in Anaconda.</li>
<li>All currently visible spokes in Anaconda will be enumerated as a section headers by Anaconda in the
configuration file. Note that this can include spokes provided by addons[2], if any Anaconda addons that provide
additional spokes are present during the installation run.</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="the-general-section">
<h2>The General section<a class="headerlink" href="#the-general-section" title="Permalink to this headline"></a></h2>
<p>The <em>General</em> section is optional and is not required to be present in the config file.
At the moment it can contain only the <code class="docutils literal"><span class="pre">post_install_tools_disabled</span></code> key.</p>
<p>The <code class="docutils literal"><span class="pre">post_install_tools_disabled</span></code> key corresponds to using the <code class="docutils literal"><span class="pre">firstboot</span> <span class="pre">--disable</span></code> command in the installation kickstart file.
This requests that the post-installation setup tools be skipped. If this key is present and set to 1, any post-installation tools
that parse the user interaction file should first make sure the tool won&#8217;t be started again on next boot, and then terminate immediately.</p>
</div>
<div class="section" id="naming-of-sections-corresponding-to-anaconda-screens">
<h2>Naming of sections corresponding to Anaconda screens<a class="headerlink" href="#naming-of-sections-corresponding-to-anaconda-screens" title="Permalink to this headline"></a></h2>
<p>All section headers not named <em>General</em> are named according to the Anaconda spoke class name. For example <code class="docutils literal"><span class="pre">DatetimeSpoke</span></code>
or <code class="docutils literal"><span class="pre">KeyboardSpoke</span></code>.</p>
<p>To get a list of all such spokes run the <code class="docutils literal"><span class="pre">list_spokes</span></code> script from the <code class="docutils literal"><span class="pre">scripts</span></code> directory in the Anaconda source
code tree:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>git clone https://github.com/rhinstaller/anaconda
cd anaconda/scripts
./list_screens
</pre></div>
</div>
<p>Note that this script only lists Anaconda spokes, not spokes provided by addons[2] or Initial Setup.</p>
<p>It is also possible to check for the <em>Entered spoke:</em> entries in the <code class="docutils literal"><span class="pre">/tmp/anaconda.log</span></code> file during an installation
to correlate spokes on the screen to spoke class names.</p>
</div>
<div class="section" id="screen-section-namespace">
<h2>Screen section namespace<a class="headerlink" href="#screen-section-namespace" title="Permalink to this headline"></a></h2>
<p>Each section corresponding to a screen <em>must</em> contain the <code class="docutils literal"><span class="pre">visited</span></code> key with a value of either 1 if the user has visited
the corresponding screen or 0 if not.</p>
<p>Optionally each section can contain one or more keys with the <code class="docutils literal"><span class="pre">changed_</span></code> prefix which track if the user
has changed an option on the screen. If the option is changed by the user, the corresponding key is set
to 1. If the given option has not been changed by the user then the corresponding key can either be
omitted or set to 0.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">DatetimeSpoke</span><span class="p">]</span>
<span class="n">visited</span><span class="o">=</span><span class="mi">1</span>
<span class="n">changed_timezone</span><span class="o">=</span><span class="mi">1</span>
<span class="n">changed_ntp</span><span class="o">=</span><span class="mi">0</span>
<span class="n">changed_timedate</span><span class="o">=</span><span class="mi">1</span>
</pre></div>
</div>
<p>In this example the user has visited the date &amp; time spoke and has changed the timezone &amp; time/date,
but not the NTP settings. Note that the <code class="docutils literal"><span class="pre">changed_ntp</span></code> key could also be omitted as the user has not changed
the NTP options.</p>
<p>Another example:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">KeyboardSpoke</span><span class="p">]</span>
<span class="n">visited</span><span class="o">=</span><span class="mi">0</span>
</pre></div>
</div>
<p>Here the user has not visited the keyboard spoke and thus could not have changed any options,
so all <code class="docutils literal"><span class="pre">changed_*</span></code> keys (if any) have been omitted.</p>
<p>Note that if a spoke section is missing, it should be assumed that the corresponding screen has not been visited.
On the other hand, if a screen <em>has been visited</em>, the section <em>must</em> be present, with the <code class="docutils literal"><span class="pre">visited</span></code> key being equal to 1.</p>
</div>
<div class="section" id="full-configuration-file-example">
<h2>Full configuration file example<a class="headerlink" href="#full-configuration-file-example" title="Permalink to this headline"></a></h2>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># this is the user interaction config file</span>
<span class="p">[</span><span class="n">General</span><span class="p">]</span>
<span class="n">post_install_tools_disabled</span><span class="o">=</span><span class="mi">0</span>
<span class="p">[</span><span class="n">DatetimeSpoke</span><span class="p">]</span>
<span class="c1"># the date and time spoke has been visited</span>
<span class="n">visited</span><span class="o">=</span><span class="mi">1</span>
<span class="n">changed_timezone</span><span class="o">=</span><span class="mi">1</span>
<span class="n">changed_ntp</span><span class="o">=</span><span class="mi">0</span>
<span class="n">changed_timedate</span><span class="o">=</span><span class="mi">1</span>
<span class="p">[</span><span class="n">KeyboardSpoke</span><span class="p">]</span>
<span class="c1"># the keyboard spoke has not been visited</span>
<span class="n">visited</span><span class="o">=</span><span class="mi">0</span>
</pre></div>
</div>
<p>The first section is the special section for top-level settings called <em>General</em>.
It contains only one option, <code class="docutils literal"><span class="pre">post_install_tools_disabled</span></code>, which is in this case equal to 0
This means that post installation setup tools should proceed as usual.
In this case (being equal to 0) the <code class="docutils literal"><span class="pre">post_install_tools_disabled</span></code> key and the whole <em>General</em> section
might also be omitted.</p>
<p>Next there are two sections corresponding to two screens - <code class="docutils literal"><span class="pre">DatetimeSpoke</span></code> and <code class="docutils literal"><span class="pre">KeyboardSpoke</span></code>.</p>
<p>The user has visited the date &amp; time screen and has changed various options, but not the NTP settings.
On the other hand the keyboard screen has not been visited at all.</p>
</div>
<div class="section" id="parsing-and-writing-the-of-the-configuration-file-by-anaconda">
<h2>Parsing and writing the of the configuration file by Anaconda<a class="headerlink" href="#parsing-and-writing-the-of-the-configuration-file-by-anaconda" title="Permalink to this headline"></a></h2>
<p>If the user interaction file exists during Anaconda startup, it will be parsed and taken into account
when deciding which screens to show during the installation. This make it possible for secondary
installation setup tools to run before Anaconda and query the user for information.</p>
<p>This can be for example a tool querying the user for language settings. Then once Anaconda starts it can
skip the language selection screen as language has already been set by the tool.</p>
<p>Once the installation process is done, Anaconda will write out information about what screens the user has
and has not visited and optionally which settings have been changed by the user.</p>
<p>If Anaconda successfully parsed an existing user interaction configuration file, any valid settings present
in the file will propagate to the configuration file when it is written-out by Anaconda.</p>
<p>Note that comments present in the configuration file at the time Anaconda parses it might not be present
in the output file, therefore tools should not depend on comments being present or on information contained
in comments.</p>
</div>
<div class="section" id="parsing-and-writing-of-the-configuration-file-by-tools-other-than-anaconda">
<h2>Parsing and writing of the configuration file by tools other than Anaconda<a class="headerlink" href="#parsing-and-writing-of-the-configuration-file-by-tools-other-than-anaconda" title="Permalink to this headline"></a></h2>
<p>Non-Anaconda system configuration tools should also parse the user interaction file at startup and write it out
once done. All valid data already present in the configuration file should be kept and updated accordingly
(the user has visited a not-yet-visited screen, changed another option, etc.).</p>
<p>Non-Anaconda tools should try to keep comments present in the input file, but this is not strictly required.</p>
<p>Also note that a variable number of tools might be working with the configuration file in sequence, so no single tool
should expect that it is the first or last tool working with the configuration file.</p>
</div>
<div class="section" id="links">
<h2>Links<a class="headerlink" href="#links" title="Permalink to this headline"></a></h2>
<p>[0] <a class="reference external" href="https://docs.python.org/3/library/configparser.html">https://docs.python.org/3/library/configparser.html</a>
[1] <a class="reference external" href="https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html">https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html</a>
[2] <a class="reference external" href="https://rhinstaller.github.io/anaconda-addon-development-guide/">https://rhinstaller.github.io/anaconda-addon-development-guide/</a></p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2015, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'25.14',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>