<ddclass="field-odd"><p>Brian C. Lane <<aclass="reference external"href="mailto:bcl%40redhat.com">bcl<span>@</span>redhat<span>.</span>com</a>></p>
<p>You can add your own repos with <codeclass="docutils literal notranslate"><spanclass="pre">-s</span></code> and packages with higher NVRs will
override the ones in the distribution repositories.</p>
<p>Under <codeclass="docutils literal notranslate"><spanclass="pre">./results/</span></code> will be the release tree files: .discinfo, .treeinfo, everything that
goes onto the boot.iso, the pxeboot directory, and the boot.iso under <codeclass="docutils literal notranslate"><spanclass="pre">./images/</span></code>.</p>
<h2>Branding<aclass="headerlink"href="#branding"title="Permalink to this headline">¶</a></h2>
<p>By default lorax will search for the first package that provides <codeclass="docutils literal notranslate"><spanclass="pre">system-release</span></code>
that doesn’t start with <codeclass="docutils literal notranslate"><spanclass="pre">generic-</span></code> and will install it. It then selects a
corresponding logo package by using the first part of the system-release package and
appending <codeclass="docutils literal notranslate"><spanclass="pre">-logos</span></code> to it. eg. fedora-release and fedora-logos.</p>
<divclass="section"id="custom-branding">
<h3>Custom Branding<aclass="headerlink"href="#custom-branding"title="Permalink to this headline">¶</a></h3>
<p>If <codeclass="docutils literal notranslate"><spanclass="pre">--skip-branding</span></code> is passed to lorax it will skip selecting the
<codeclass="docutils literal notranslate"><spanclass="pre">system-release</span></code>, and logos packages and leave it up to the user to pass any
branding related packages to lorax using <codeclass="docutils literal notranslate"><spanclass="pre">--installpkgs</span></code>. When using
<codeclass="docutils literal notranslate"><spanclass="pre">skip-branding</span></code> you must make sure that you provide all of the expected files,
otherwise Anaconda may not work as expected. See the contents of <codeclass="docutils literal notranslate"><spanclass="pre">fedora-release</span></code>
and <codeclass="docutils literal notranslate"><spanclass="pre">fedora-logos</span></code> for examples of what to include.</p>
<p>Note that this does not prevent something else in the dependency tree from
causing these packages to be included. Using <codeclass="docutils literal notranslate"><spanclass="pre">--excludepkgs</span></code> may help if they
supports <codeclass="docutils literal notranslate"><spanclass="pre">%if/%endif</span></code> blocks as well as free-form python code inside <codeclass="docutils literal notranslate"><spanclass="pre"><%</span>
<spanclass="pre">%></span></code> tags and variable substitution with <codeclass="docutils literal notranslate"><spanclass="pre">${}</span></code>. The default templates are
shipped with lorax in <codeclass="docutils literal notranslate"><spanclass="pre">/usr/share/lorax/templates.d/99-generic/</span></code> and use the
<h3>runtime-install.tmpl<aclass="headerlink"href="#runtime-install-tmpl"title="Permalink to this headline">¶</a></h3>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">runtime-install.tmpl</span></code> template lists packages to be installed using the
<codeclass="docutils literal notranslate"><spanclass="pre">installpkg</span></code> command. This template is fairly simple, installing common packages and
architecture specific packages. It must end with the <codeclass="docutils literal notranslate"><spanclass="pre">run_pkg_transaction</span></code>
command which tells dnf to download and install the packages.</p>
</div>
<divclass="section"id="runtime-postinstall-tmpl">
<h3>runtime-postinstall.tmpl<aclass="headerlink"href="#runtime-postinstall-tmpl"title="Permalink to this headline">¶</a></h3>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">runtime-postinstall.tmpl</span></code> template is where the system configuration
happens. The installer environment is similar to a normal running system, but
needs some special handling. Configuration files are setup, systemd is told to
start the anaconda.target instead of a default system target, and a number of
unneeded services are disabled, some of which can interfere with the
installation. A number of template commands are used here:</p>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append"title="pylorax.ltmpl.LoraxTemplateRunner.append"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">append</span></code></a> to add text to a file.</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install"title="pylorax.ltmpl.LoraxTemplateRunner.install"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">install</span></code></a> to install a file into the installroot.</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.mkdir"title="pylorax.ltmpl.LoraxTemplateRunner.mkdir"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">mkdir</span></code></a> makes a new directory.</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.move"title="pylorax.ltmpl.LoraxTemplateRunner.move"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">move</span></code></a> to move a file into the installroot</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.replace"title="pylorax.ltmpl.LoraxTemplateRunner.replace"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">replace</span></code></a> does text substitution in a file</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.remove"title="pylorax.ltmpl.LoraxTemplateRunner.remove"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">remove</span></code></a> deletes a file</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.runcmd"title="pylorax.ltmpl.LoraxTemplateRunner.runcmd"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">runcmd</span></code></a> run arbitrary commands.</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.symlink"title="pylorax.ltmpl.LoraxTemplateRunner.symlink"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">symlink</span></code></a> creates a symlink</p></li>
<li><p><aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.systemctl"title="pylorax.ltmpl.LoraxTemplateRunner.systemctl"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">systemctl</span></code></a> runs systemctl in the installroot</p></li>
<h3>runtime-cleanup.tmpl<aclass="headerlink"href="#runtime-cleanup-tmpl"title="Permalink to this headline">¶</a></h3>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">runtime-cleanup.tmpl</span></code> template is used to remove files that aren’t strictly needed
by the installation environment. In addition to the <codeclass="docutils literal notranslate"><spanclass="pre">remove</span></code> template command it uses:</p>
<h3>The squashfs filesystem<aclass="headerlink"href="#the-squashfs-filesystem"title="Permalink to this headline">¶</a></h3>
<p>After <codeclass="docutils literal notranslate"><spanclass="pre">runtime-*.tmpl</span></code> templates have finished their work lorax creates an
empty ext4 filesystem, copies the remaining files to it, and makes a squashfs
filesystem of it. This file is the / of the boot.iso’s installer environment
and is what is in the LiveOS/squashfs.img file on the iso.</p>
</div>
<divclass="section"id="iso-creation">
<h3>iso creation<aclass="headerlink"href="#iso-creation"title="Permalink to this headline">¶</a></h3>
<p>The iso creation is handled by another set of templates. The one used depends
on the architecture that the iso is being created for. They are also stored in
<codeclass="docutils literal notranslate"><spanclass="pre">/usr/share/lorax/templates.d/99-generic</span></code> and are named after the arch, like
<codeclass="docutils literal notranslate"><spanclass="pre">x86.tmpl</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">aarch64.tmpl</span></code>. They handle creation of the tree, copying
metadata (via the <aclass="reference internal"href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.treeinfo"title="pylorax.ltmpl.LoraxTemplateRunner.treeinfo"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">treeinfo</span></code></a>
template command). Kernel and initrd are copied from the installroot to their
final locations and then mkisofs is run to create the boot.iso</p>
</div>
</div>
<divclass="section"id="custom-templates">
<h2>Custom Templates<aclass="headerlink"href="#custom-templates"title="Permalink to this headline">¶</a></h2>
<p>The default set of templates and configuration files from the lorax-generic-templates package
are shipped in the <codeclass="docutils literal notranslate"><spanclass="pre">/usr/share/lorax/templates.d/99-generic/</span></code> directory. You can
make a copy of them and place them into another directory under <codeclass="docutils literal notranslate"><spanclass="pre">templates.d</span></code>
and they will be used instead if their sort order is below all other directories. This
allows multiple packages to ship lorax templates without conflict. You can (and probably
should) select the specific template directory by passing <codeclass="docutils literal notranslate"><spanclass="pre">--sharedir</span></code> to lorax.</p>