2119 lines
243 KiB
HTML
2119 lines
243 KiB
HTML
<!DOCTYPE html>
|
|
<html class="writer-html5" lang="en" >
|
|
<head>
|
|
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>pylorax package — Lorax 34.12 documentation</title>
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
|
|
|
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
|
<script src="_static/jquery.js"></script>
|
|
<script src="_static/underscore.js"></script>
|
|
<script src="_static/doctools.js"></script>
|
|
<script src="_static/js/theme.js"></script>
|
|
<link rel="index" title="Index" href="genindex.html" />
|
|
<link rel="search" title="Search" href="search.html" />
|
|
<link rel="prev" title="src" href="modules.html" />
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav">
|
|
<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"> Lorax
|
|
</a>
|
|
<div class="version">
|
|
34.12
|
|
</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="Navigation menu">
|
|
<ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to Lorax</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="intro.html#before-lorax">Before Lorax</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="lorax.html">Lorax</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="livemedia-creator.html">livemedia-creator</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="mkksiso.html">mkksiso</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
|
|
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">src</a><ul class="current">
|
|
<li class="toctree-l2 current"><a class="current reference internal" href="#">pylorax package</a><ul>
|
|
<li class="toctree-l3"><a class="reference internal" href="#submodules">Submodules</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.base">pylorax.base module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.buildstamp">pylorax.buildstamp module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.cmdline">pylorax.cmdline module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.creator">pylorax.creator module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.decorators">pylorax.decorators module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.discinfo">pylorax.discinfo module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.executils">pylorax.executils module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.imgutils">pylorax.imgutils module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.installer">pylorax.installer module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.ltmpl">pylorax.ltmpl module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.monitor">pylorax.monitor module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.mount">pylorax.mount module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.output">pylorax.output module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.sysutils">pylorax.sysutils module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.treebuilder">pylorax.treebuilder module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.treeinfo">pylorax.treeinfo module</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax">Module contents</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="index.html">Lorax</a>
|
|
</nav>
|
|
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content">
|
|
<div role="navigation" aria-label="Page navigation">
|
|
<ul class="wy-breadcrumbs">
|
|
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
|
<li><a href="modules.html">src</a> »</li>
|
|
<li>pylorax package</li>
|
|
<li class="wy-breadcrumbs-aside">
|
|
<a href="_sources/pylorax.rst.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">
|
|
|
|
<section id="pylorax-package">
|
|
<h1>pylorax package<a class="headerlink" href="#pylorax-package" title="Permalink to this headline">¶</a></h1>
|
|
<section id="submodules">
|
|
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
|
|
</section>
|
|
<section id="module-pylorax.base">
|
|
<span id="pylorax-base-module"></span><h2>pylorax.base module<a class="headerlink" href="#module-pylorax.base" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.base.BaseLoraxClass">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.base.</span></span><span class="sig-name descname"><span class="pre">BaseLoraxClass</span></span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.base.BaseLoraxClass.pcritical">
|
|
<span class="sig-name descname"><span class="pre">pcritical</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">msg</span></em>, <em class="sig-param"><span class="pre">fobj=<_io.TextIOWrapper</span> <span class="pre">name='<stdout>'</span> <span class="pre">mode='w'</span> <span class="pre">encoding='utf-8'></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pcritical"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pcritical" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.base.BaseLoraxClass.pdebug">
|
|
<span class="sig-name descname"><span class="pre">pdebug</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">msg</span></em>, <em class="sig-param"><span class="pre">fobj=<_io.TextIOWrapper</span> <span class="pre">name='<stdout>'</span> <span class="pre">mode='w'</span> <span class="pre">encoding='utf-8'></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pdebug"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pdebug" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.base.BaseLoraxClass.perror">
|
|
<span class="sig-name descname"><span class="pre">perror</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">msg</span></em>, <em class="sig-param"><span class="pre">fobj=<_io.TextIOWrapper</span> <span class="pre">name='<stdout>'</span> <span class="pre">mode='w'</span> <span class="pre">encoding='utf-8'></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.perror"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.perror" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.base.BaseLoraxClass.pinfo">
|
|
<span class="sig-name descname"><span class="pre">pinfo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">msg</span></em>, <em class="sig-param"><span class="pre">fobj=<_io.TextIOWrapper</span> <span class="pre">name='<stdout>'</span> <span class="pre">mode='w'</span> <span class="pre">encoding='utf-8'></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pinfo"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pinfo" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.base.BaseLoraxClass.pwarning">
|
|
<span class="sig-name descname"><span class="pre">pwarning</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">msg</span></em>, <em class="sig-param"><span class="pre">fobj=<_io.TextIOWrapper</span> <span class="pre">name='<stdout>'</span> <span class="pre">mode='w'</span> <span class="pre">encoding='utf-8'></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pwarning"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pwarning" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.base.DataHolder">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.base.</span></span><span class="sig-name descname"><span class="pre">DataHolder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#DataHolder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.DataHolder" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.base.DataHolder.copy">
|
|
<span class="sig-name descname"><span class="pre">copy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">a</span> <span class="pre">shallow</span> <span class="pre">copy</span> <span class="pre">of</span> <span class="pre">D</span></span></span><a class="reference internal" href="_modules/pylorax/base.html#DataHolder.copy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.base.DataHolder.copy" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.buildstamp">
|
|
<span id="pylorax-buildstamp-module"></span><h2>pylorax.buildstamp module<a class="headerlink" href="#module-pylorax.buildstamp" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.buildstamp.BuildStamp">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.buildstamp.</span></span><span class="sig-name descname"><span class="pre">BuildStamp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">product</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">version</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bugurl</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">isfinal</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">buildarch</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variant</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/buildstamp.html#BuildStamp"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.buildstamp.BuildStamp" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.buildstamp.BuildStamp.write">
|
|
<span class="sig-name descname"><span class="pre">write</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/buildstamp.html#BuildStamp.write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.buildstamp.BuildStamp.write" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.cmdline">
|
|
<span id="pylorax-cmdline-module"></span><h2>pylorax.cmdline module<a class="headerlink" href="#module-pylorax.cmdline" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.cmdline.lmc_parser">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.cmdline.</span></span><span class="sig-name descname"><span class="pre">lmc_parser</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dracut_default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/cmdline.html#lmc_parser"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.cmdline.lmc_parser" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return a ArgumentParser object for live-media-creator.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.cmdline.lorax_parser">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.cmdline.</span></span><span class="sig-name descname"><span class="pre">lorax_parser</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dracut_default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/cmdline.html#lorax_parser"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.cmdline.lorax_parser" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return the ArgumentParser for lorax</p>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.creator">
|
|
<span id="pylorax-creator-module"></span><h2>pylorax.creator module<a class="headerlink" href="#module-pylorax.creator" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.creator.FakeDNF">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">FakeDNF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">conf</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#FakeDNF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.FakeDNF" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>A minimal DNF object suitable for passing to RuntimeBuilder</p>
|
|
<p>lmc uses RuntimeBuilder to run the arch specific iso creation
|
|
templates, so the the installroot config value is the important part of
|
|
this. Everything else should be a nop.</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.creator.FakeDNF.reset">
|
|
<span class="sig-name descname"><span class="pre">reset</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#FakeDNF.reset"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.FakeDNF.reset" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.calculate_disk_size">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">calculate_disk_size</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ks</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#calculate_disk_size"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.calculate_disk_size" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Calculate the disk size from the kickstart</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>ks</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to the kickstart to use for the installation</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>Disk size in MiB</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
|
|
</dd>
|
|
</dl>
|
|
<p>Also takes into account the use of reqpart or reqpart --add-boot</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.check_kickstart">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">check_kickstart</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ks</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#check_kickstart"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.check_kickstart" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Check the parsed kickstart object for errors</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>ks</strong> (<em>pykickstart.parser.KickstartParser</em>) -- Parsed Kickstart object</p></li>
|
|
<li><p><strong>opts</strong> (<em>Either a DataHolder</em><em> or </em><em>ArgumentParser</em>) -- Commandline options to control the process</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>List of error strings or empty list</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.create_pxe_config">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">create_pxe_config</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">template</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">images_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">live_image_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_args</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#create_pxe_config"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.create_pxe_config" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create template for pxe to live configuration</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>images_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path of directory with images to be used</p></li>
|
|
<li><p><strong>live_image_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Name of live rootfs image file</p></li>
|
|
<li><p><strong>add_args</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- Arguments to be added to initrd= pxe config</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.dracut_args">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">dracut_args</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#dracut_args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.dracut_args" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return a list of the args to pass to dracut</p>
|
|
<p>Return the default argument list unless one of the dracut cmdline arguments
|
|
has been used.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.find_ostree_root">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">find_ostree_root</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">phys_root</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#find_ostree_root"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.find_ostree_root" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Find root of ostree deployment</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><p><strong>phys_root</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to physical root</p>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>Relative path of ostree deployment root</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
|
|
</dd>
|
|
<dt class="field-even">Raises</dt>
|
|
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.10)"><strong>Exception</strong></a> -- More than one deployment roots were found</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.get_arch">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">get_arch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mount_dir</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#get_arch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.get_arch" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get the kernel arch</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Returns</dt>
|
|
<dd class="field-odd"><p>Arch of first kernel found at mount_dir/boot/ or i386</p>
|
|
</dd>
|
|
<dt class="field-even">Return type</dt>
|
|
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.is_image_mounted">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">is_image_mounted</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#is_image_mounted"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.is_image_mounted" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Check to see if the disk_img is mounted</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Returns</dt>
|
|
<dd class="field-odd"><p>True if disk_img is in /proc/mounts</p>
|
|
</dd>
|
|
<dt class="field-even">Return type</dt>
|
|
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.make_appliance">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">make_appliance</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">template</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">networks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ram</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1024</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vcpus</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">arch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">title</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'Linux'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">project</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'Linux'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">releasever</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'34'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_appliance"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.make_appliance" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Generate an appliance description file</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Full path of the disk image</p></li>
|
|
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Name of the appliance, passed to the template</p></li>
|
|
<li><p><strong>template</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Full path of Mako template</p></li>
|
|
<li><p><strong>outfile</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Full path of file to write, using template</p></li>
|
|
<li><p><strong>networks</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- List of networks(str) from the kickstart</p></li>
|
|
<li><p><strong>ram</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Ram, in MiB, passed to template. Default is 1024</p></li>
|
|
<li><p><strong>vcpus</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- CPUs, passed to template. Default is 1</p></li>
|
|
<li><p><strong>arch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- CPU architecture. Default is 'x86_64'</p></li>
|
|
<li><p><strong>title</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Title, passed to template. Default is 'Linux'</p></li>
|
|
<li><p><strong>project</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Project, passed to template. Default is 'Linux'</p></li>
|
|
<li><p><strong>releasever</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Release version, passed to template. Default is 34</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.make_image">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">make_image</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ks</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cancel_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_image"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.make_image" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Install to a disk image</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>ks</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to the kickstart to use for the installation</p></li>
|
|
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>Path of the image created</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
|
|
</dd>
|
|
</dl>
|
|
<p>Use qemu+boot.iso or anaconda to install to a disk image.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.make_live_images">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">make_live_images</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">work_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_live_images"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.make_live_images" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create live images from direcory or rootfs image</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>work_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Directory for storing results</p></li>
|
|
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to disk image (fsimage or partitioned)</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>Path of directory with created images or None</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
|
|
</dd>
|
|
</dl>
|
|
<p>fsck.ext4 is run on the rootfs_image to make sure there are no errors and to zero
|
|
out any deleted blocks to make it compress better. If this fails for any reason
|
|
it will return None and log the error.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.make_livecd">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">make_livecd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mount_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">work_dir</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_livecd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.make_livecd" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Take the content from the disk image and make a livecd out of it</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>mount_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Directory tree to compress</p></li>
|
|
<li><p><strong>work_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Output compressed image to work_dir+images/install.img</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<dl class="simple">
|
|
<dt>This uses wwood's squashfs live initramfs method:</dt><dd><ul class="simple">
|
|
<li><p>put the real / into LiveOS/rootfs.img</p></li>
|
|
<li><p>make a squashfs of the LiveOS/rootfs.img tree</p></li>
|
|
<li><p>This is loaded by dracut when the cmdline is passed to the kernel:
|
|
root=live:CDLABEL=<volid> rd.live.image</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.make_runtime">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">make_runtime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mount_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">work_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_runtime"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.make_runtime" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Make the squashfs image from a directory</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>mount_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Directory tree to compress</p></li>
|
|
<li><p><strong>work_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Output compressed image to work_dir+images/install.img</p></li>
|
|
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Size of disk image, in GiB</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>rc of squashfs creation</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.mount_boot_part_over_root">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">mount_boot_part_over_root</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">img_mount</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#mount_boot_part_over_root"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.mount_boot_part_over_root" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Mount boot partition to /boot of root fs mounted in img_mount</p>
|
|
<p>Used for OSTree so it finds deployment configurations on live rootfs</p>
|
|
<p>param img_mount: object with mounted disk image root partition
|
|
type img_mount: imgutils.PartitionMount</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.rebuild_initrds_for_live">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">rebuild_initrds_for_live</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sys_root_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">results_dir</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#rebuild_initrds_for_live"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.rebuild_initrds_for_live" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Rebuild intrds for pxe live image (root=live:<a class="reference external" href="http://">http://</a>)</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>sys_root_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to root of the system</p></li>
|
|
<li><p><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path of directory for storing results</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.run_creator">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">run_creator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cancel_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#run_creator"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.run_creator" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Run the image creator process</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>Either a DataHolder</em><em> or </em><em>ArgumentParser</em>) -- Commandline options to control the process</p></li>
|
|
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>The result directory and the disk image path.</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p>Tuple of str</p>
|
|
</dd>
|
|
</dl>
|
|
<p>This function takes the opts arguments and creates the selected output image.
|
|
See the cmdline --help for livemedia-creator for the possible options</p>
|
|
<p>(Yes, this is not ideal, but we can fix that later)</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.creator.squashfs_args">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.creator.</span></span><span class="sig-name descname"><span class="pre">squashfs_args</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#squashfs_args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.creator.squashfs_args" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns the compression type and args to use when making squashfs</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><p><strong>opts</strong> -- ArgumentParser object with compression and compressopts</p>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>tuple of compression type and args</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.10)">tuple</a></p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.decorators">
|
|
<span id="pylorax-decorators-module"></span><h2>pylorax.decorators module<a class="headerlink" href="#module-pylorax.decorators" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.decorators.singleton">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.decorators.</span></span><span class="sig-name descname"><span class="pre">singleton</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cls</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/decorators.html#singleton"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.decorators.singleton" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.discinfo">
|
|
<span id="pylorax-discinfo-module"></span><h2>pylorax.discinfo module<a class="headerlink" href="#module-pylorax.discinfo" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.discinfo.DiscInfo">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.discinfo.</span></span><span class="sig-name descname"><span class="pre">DiscInfo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">release</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">basearch</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/discinfo.html#DiscInfo"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.discinfo.DiscInfo" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.discinfo.DiscInfo.write">
|
|
<span class="sig-name descname"><span class="pre">write</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/discinfo.html#DiscInfo.write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.discinfo.DiscInfo.write" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.dnfbase">
|
|
<span id="pylorax-dnfbase-module"></span><h2>pylorax.dnfbase module<a class="headerlink" href="#module-pylorax.dnfbase" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.dnfbase.get_dnf_base_object">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.dnfbase.</span></span><span class="sig-name descname"><span class="pre">get_dnf_base_object</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">installroot</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sources</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mirrorlists</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">repos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">enablerepos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disablerepos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tempdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/var/tmp'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">releasever</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'34'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cachedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sslverify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dnfplugins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfbase.html#get_dnf_base_object"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfbase.get_dnf_base_object" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create a dnf Base object and setup the repositories and installroot</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>installroot</strong> (<em>string</em>) -- Full path to the installroot</p></li>
|
|
<li><p><strong>sources</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- List of source repo urls to use for the installation</p></li>
|
|
<li><p><strong>enablerepos</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- List of repo names to enable</p></li>
|
|
<li><p><strong>disablerepos</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- List of repo names to disable</p></li>
|
|
<li><p><strong>mirrorlist</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- List of mirrors to use</p></li>
|
|
<li><p><strong>tempdir</strong> (<em>string</em>) -- Path of temporary directory</p></li>
|
|
<li><p><strong>proxy</strong> (<em>string</em>) -- http proxy to use when fetching packages</p></li>
|
|
<li><p><strong>releasever</strong> (<em>string</em>) -- Release version to pass to dnf</p></li>
|
|
<li><p><strong>cachedir</strong> (<em>string</em>) -- Directory to use for caching packages</p></li>
|
|
<li><p><strong>noverifyssl</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) -- Set to True to ignore the CA of ssl certs. eg. use self-signed ssl for https repos.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<p>If tempdir is not set /var/tmp is used.
|
|
If cachedir is None a dnf.cache directory is created inside tmpdir</p>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.dnfhelper">
|
|
<span id="pylorax-dnfhelper-module"></span><h2>pylorax.dnfhelper module<a class="headerlink" href="#module-pylorax.dnfhelper" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.dnfhelper.LoraxDownloadCallback">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.dnfhelper.</span></span><span class="sig-name descname"><span class="pre">LoraxDownloadCallback</span></span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">DownloadProgress</span></code></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.dnfhelper.LoraxDownloadCallback.end">
|
|
<span class="sig-name descname"><span class="pre">end</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">payload</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">status</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.end"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.end" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.dnfhelper.LoraxDownloadCallback.progress">
|
|
<span class="sig-name descname"><span class="pre">progress</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">payload</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">done</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.progress"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.progress" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.dnfhelper.LoraxDownloadCallback.start">
|
|
<span class="sig-name descname"><span class="pre">start</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">total_files</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">total_size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">total_drpms</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.start"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.start" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.dnfhelper.LoraxRpmCallback">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.dnfhelper.</span></span><span class="sig-name descname"><span class="pre">LoraxRpmCallback</span></span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">TransactionProgress</span></code></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.dnfhelper.LoraxRpmCallback.error">
|
|
<span class="sig-name descname"><span class="pre">error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback.error"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback.error" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.dnfhelper.LoraxRpmCallback.progress">
|
|
<span class="sig-name descname"><span class="pre">progress</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">package</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">action</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ti_done</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ti_total</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ts_done</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ts_total</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback.progress"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback.progress" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.executils">
|
|
<span id="pylorax-executils-module"></span><h2>pylorax.executils module<a class="headerlink" href="#module-pylorax.executils" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.executils.ExecProduct">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">ExecProduct</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stdout</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stderr</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#ExecProduct"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.ExecProduct" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.augmentEnv">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">augmentEnv</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#augmentEnv"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.augmentEnv" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.execReadlines">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">execReadlines</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">command</span></em>, <em class="sig-param"><span class="pre">argv</span></em>, <em class="sig-param"><span class="pre">stdin=None</span></em>, <em class="sig-param"><span class="pre">root='/'</span></em>, <em class="sig-param"><span class="pre">env_prune=None</span></em>, <em class="sig-param"><span class="pre">filter_stderr=False</span></em>, <em class="sig-param"><span class="pre">callback=<function</span> <span class="pre"><lambda>></span></em>, <em class="sig-param"><span class="pre">env_add=None</span></em>, <em class="sig-param"><span class="pre">reset_handlers=True</span></em>, <em class="sig-param"><span class="pre">reset_lang=True</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execReadlines"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.execReadlines" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Execute an external command and return the line output of the command
|
|
in real-time.</p>
|
|
<p>This method assumes that there is a reasonably low delay between the
|
|
end of output and the process exiting. If the child process closes
|
|
stdout and then keeps on truckin' there will be problems.</p>
|
|
<dl class="simple">
|
|
<dt>NOTE/WARNING: UnicodeDecodeError will be raised if the output of the</dt><dd><p>external command can't be decoded as UTF-8.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>command</strong> -- The command to run</p></li>
|
|
<li><p><strong>argv</strong> -- The argument list</p></li>
|
|
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
|
|
<li><p><strong>stdout</strong> -- Optional file object to redirect stdout and stderr to.</p></li>
|
|
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
|
|
<li><p><strong>env_prune</strong> -- environment variable to remove before execution</p></li>
|
|
<li><p><strong>filter_stderr</strong> -- Whether stderr should be excluded from the returned output</p></li>
|
|
<li><p><strong>callback</strong> -- method to call while waiting for process to finish, passed Popen object</p></li>
|
|
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
|
|
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
|
|
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>Iterator of the lines from the command</p>
|
|
</dd>
|
|
</dl>
|
|
<p>Output from the file is not logged to program.log
|
|
This returns an iterator with the lines from the command until it has finished</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.execWithCapture">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">execWithCapture</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">command</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">argv</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stdin</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">root</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">log_output</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_stderr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_err</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">callback</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">env_add</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_handlers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_lang</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execWithCapture"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.execWithCapture" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Run an external program and capture standard out and err.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>command</strong> -- The command to run</p></li>
|
|
<li><p><strong>argv</strong> -- The argument list</p></li>
|
|
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
|
|
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
|
|
<li><p><strong>log_output</strong> -- Whether to log the output of command</p></li>
|
|
<li><p><strong>filter_stderr</strong> -- Whether stderr should be excluded from the returned output</p></li>
|
|
<li><p><strong>callback</strong> -- method to call while waiting for process to finish, passed Popen object</p></li>
|
|
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
|
|
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
|
|
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>The output of the command</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.execWithRedirect">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">execWithRedirect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">command</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">argv</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stdin</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stdout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">root</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">env_prune</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">log_output</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">binary_output</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_err</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">callback</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">env_add</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_handlers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_lang</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execWithRedirect"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.execWithRedirect" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Run an external program and redirect the output to a file.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>command</strong> -- The command to run</p></li>
|
|
<li><p><strong>argv</strong> -- The argument list</p></li>
|
|
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
|
|
<li><p><strong>stdout</strong> -- Optional file object to redirect stdout and stderr to.</p></li>
|
|
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
|
|
<li><p><strong>env_prune</strong> -- environment variable to remove before execution</p></li>
|
|
<li><p><strong>log_output</strong> -- whether to log the output of command</p></li>
|
|
<li><p><strong>binary_output</strong> -- whether to treat the output of command as binary data</p></li>
|
|
<li><p><strong>raise_err</strong> -- whether to raise a CalledProcessError if the returncode is non-zero</p></li>
|
|
<li><p><strong>callback</strong> -- method to call while waiting for process to finish, passed Popen object</p></li>
|
|
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
|
|
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
|
|
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>The return code of the command</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.runcmd">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">runcmd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmd</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#runcmd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.runcmd" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>run execWithRedirect with raise_err=True</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.runcmd_output">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">runcmd_output</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmd</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#runcmd_output"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.runcmd_output" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>run execWithCapture with raise_err=True</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.setenv">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">setenv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#setenv"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.setenv" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Set an environment variable to be used by child processes.</p>
|
|
<p>This method does not modify os.environ for the running process, which
|
|
is not thread-safe. If setenv has already been called for a particular
|
|
variable name, the old value is overwritten.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The name of the environment variable</p></li>
|
|
<li><p><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The value of the environment variable</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.executils.startProgram">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.executils.</span></span><span class="sig-name descname"><span class="pre">startProgram</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argv</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">root</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stdin</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stdout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stderr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">env_prune</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">env_add</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_handlers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_lang</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#startProgram"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.executils.startProgram" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Start an external program and return the Popen object.</p>
|
|
<p>The root and reset_handlers arguments are handled by passing a
|
|
preexec_fn argument to subprocess.Popen, but an additional preexec_fn
|
|
can still be specified and will be run. The user preexec_fn will be run
|
|
last.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>argv</strong> -- The command to run and argument</p></li>
|
|
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
|
|
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
|
|
<li><p><strong>stdout</strong> -- The file object to write stdout to.</p></li>
|
|
<li><p><strong>stderr</strong> -- The file object to write stderr to.</p></li>
|
|
<li><p><strong>env_prune</strong> -- environment variables to remove before execution</p></li>
|
|
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
|
|
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
|
|
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
|
|
<li><p><strong>kwargs</strong> -- Additional parameters to pass to subprocess.Popen</p></li>
|
|
<li><p><strong>preexec_fn</strong> -- A function to run before execution starts.</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>A Popen object for the running command.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.imgutils">
|
|
<span id="pylorax-imgutils-module"></span><h2>pylorax.imgutils module<a class="headerlink" href="#module-pylorax.imgutils" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.DMDev">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">DMDev</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#DMDev"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.DMDev" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.DracutChroot">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">DracutChroot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bind</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#DracutChroot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.DracutChroot" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>Setup the chroot for running dracut inside it, cleanup when done</p>
|
|
<p>This mount /proc, /dev, and /var/tmp plus optional bind mounted directories
|
|
as a list of (source, destination) tuples where destination is relative to the chroot.</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.DracutChroot.Run">
|
|
<span class="sig-name descname"><span class="pre">Run</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#DracutChroot.Run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.DracutChroot.Run" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.LoopDev">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">LoopDev</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#LoopDev"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.LoopDev" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.Mount">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">Mount</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opts</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mnt</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#Mount"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.Mount" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.PartitionMount">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">PartitionMount</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mount_ok</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">submount</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#PartitionMount"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.PartitionMount" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>Mount a partitioned image file using kpartx</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.compress">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">compress</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">command</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">root</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'xz'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compressargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#compress"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.compress" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Make a compressed archive of the given rootdir or file.
|
|
command is a list of the archiver commands to run
|
|
compression should be "xz", "gzip", "lzma", "bzip2", or None.
|
|
compressargs will be used on the compression commandline.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.copytree">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">copytree</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">preserve</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#copytree"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.copytree" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Copy a tree of files using cp -a, thus preserving modes, timestamps,
|
|
links, acls, sparse files, xattrs, selinux contexts, etc.
|
|
If preserve is False, uses cp -R (useful for modeless filesystems)
|
|
raises CalledProcessError if copy fails.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.default_image_name">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">default_image_name</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">compression</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">basename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#default_image_name"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.default_image_name" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return a default image name with the correct suffix for the compression type.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>compression</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Compression type</p></li>
|
|
<li><p><strong>basename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Base filename</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>basename with compression suffix</p>
|
|
</dd>
|
|
</dl>
|
|
<p>If the compression is unknown it defaults to xz</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.dm_attach">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">dm_attach</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#dm_attach"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.dm_attach" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Attach a devicemapper device to the given device, with the given size.
|
|
If name is None, a random name will be chosen. Returns the device name.
|
|
raises CalledProcessError if dmsetup fails.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.dm_detach">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">dm_detach</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dev</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#dm_detach"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.dm_detach" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Detach the named devicemapper device. Returns False if dmsetup fails.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.do_grafts">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">do_grafts</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">grafts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">preserve</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#do_grafts"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.do_grafts" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Copy each of the items listed in grafts into dest.
|
|
If the key ends with '/' it's assumed to be a directory which should be
|
|
created, otherwise just the leading directories will be created.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.estimate_size">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">estimate_size</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">graft</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fstype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">blocksize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">4096</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">overhead</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">256</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#estimate_size"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.estimate_size" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.get_loop_name">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">get_loop_name</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#get_loop_name"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.get_loop_name" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return the loop device associated with the path.
|
|
Raises RuntimeError if more than one loop is associated</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.kpartx_disk_img">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">kpartx_disk_img</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#kpartx_disk_img"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.kpartx_disk_img" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Attach a disk image's partitions to /dev/loopX using kpartx</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The full path to a partitioned disk image</p>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>list of (loopXpN, size)</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p>list of tuples</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.loop_attach">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">loop_attach</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_attach"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.loop_attach" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Attach a loop device to the given file. Return the loop device name.</p>
|
|
<p>On rare occasions it appears that the device never shows up, some experiments
|
|
seem to indicate that it may be a race with another process using /dev/loop* devices.</p>
|
|
<p>So we now try 3 times before actually failing.</p>
|
|
<p>Raises CalledProcessError if losetup fails.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.loop_detach">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">loop_detach</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">loopdev</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_detach"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.loop_detach" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Detach the given loop device. Return False on failure.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.loop_waitfor">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">loop_waitfor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">loop_dev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_waitfor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.loop_waitfor" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Make sure the loop device is attached to the outfile.</p>
|
|
<p>It seems that on rare occasions losetup can return before the /dev/loopX is
|
|
ready for use, causing problems with mkfs. This tries to make sure that the
|
|
loop device really is associated with the backing file before continuing.</p>
|
|
<p>Raise RuntimeError if it isn't setup after 5 tries.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkbtrfsimg">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkbtrfsimg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mountargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">graft</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkbtrfsimg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkbtrfsimg" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkcpio">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkcpio</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'xz'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compressargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkcpio"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkcpio" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkdosimg">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkdosimg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mountargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'shortname=winnt,umask=0077'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">graft</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkdosimg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkdosimg" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkext4img">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkext4img</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mountargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">graft</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkext4img"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkext4img" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkfsimage">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkfsimage</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fstype</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mkfsargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mountargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">graft</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkfsimage"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkfsimage" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Generic filesystem image creation function.
|
|
fstype should be a filesystem type - "mkfs.${fstype}" must exist.
|
|
graft should be a dict: {"some/path/in/image": "local/file/or/dir"};
|
|
if the path ends with a '/' it's assumed to be a directory.
|
|
Will raise CalledProcessError if something goes wrong.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkfsimage_from_disk">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkfsimage_from_disk</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">diskimage</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fsimage</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">img_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'Anaconda'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkfsimage_from_disk"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkfsimage_from_disk" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Copy the / partition of a partitioned disk image to an un-partitioned
|
|
disk image.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>diskimage</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The full path to partitioned disk image with a /</p></li>
|
|
<li><p><strong>fsimage</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The full path of the output fs image file</p></li>
|
|
<li><p><strong>img_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Optional size of the fsimage in MiB or None to make
|
|
it as small as possible</p></li>
|
|
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The label to apply to the image. Defaults to "Anaconda"</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkhfsimg">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkhfsimg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mountargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">graft</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkhfsimg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkhfsimg" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkqcow2">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkqcow2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkqcow2"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkqcow2" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>use qemu-img to create a file of the given size.
|
|
options is a list of options passed to qemu-img</p>
|
|
<p>Default format is qcow2, override by passing "-f", fmt
|
|
in options.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkqemu_img">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkqemu_img</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkqemu_img"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkqemu_img" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>use qemu-img to create a file of the given size.
|
|
options is a list of options passed to qemu-img</p>
|
|
<p>Default format is qcow2, override by passing "-f", fmt
|
|
in options.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mkrootfsimg">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mkrootfsimg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sysroot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkrootfsimg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mkrootfsimg" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Make rootfs image from a directory</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>rootdir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Root directory</p></li>
|
|
<li><p><strong>outfile</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path of output image file</p></li>
|
|
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Filesystem label</p></li>
|
|
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Size of the image in GiB, if None computed automatically</p></li>
|
|
<li><p><strong>sysroot</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- path to system (deployment) root relative to physical root</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mksparse">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mksparse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mksparse"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mksparse" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>use os.ftruncate to create a sparse file of the given size.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mksquashfs">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mksquashfs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rootdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compressargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mksquashfs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mksquashfs" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Make a squashfs image containing the given rootdir.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mktar">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mktar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'xz'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compressargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">selinux</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mktar"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mktar" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.mount">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">mount</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dev</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opts</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mnt</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mount"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.mount" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Mount the given device at the given mountpoint, using the given opts.
|
|
opts should be a comma-separated string of mount options.
|
|
if mnt is none, a temporary directory will be created and its path will be
|
|
returned.
|
|
raises CalledProcessError if mount fails.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.round_to_blocks">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">round_to_blocks</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">blocksize</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#round_to_blocks"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.round_to_blocks" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>If size isn't a multiple of blocksize, round up to the next multiple</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.imgutils.umount">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.imgutils.</span></span><span class="sig-name descname"><span class="pre">umount</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mnt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lazy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maxretry</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">retrysleep</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delete</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#umount"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.imgutils.umount" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Unmount the given mountpoint. If lazy is True, do a lazy umount (-l).
|
|
If the mount was a temporary dir created by mount, it will be deleted.
|
|
raises CalledProcessError if umount fails.</p>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.installer">
|
|
<span id="pylorax-installer-module"></span><h2>pylorax.installer module<a class="headerlink" href="#module-pylorax.installer" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py exception">
|
|
<dt class="sig sig-object py" id="pylorax.installer.InstallError">
|
|
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">InstallError</span></span><a class="reference internal" href="_modules/pylorax/installer.html#InstallError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.InstallError" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.installer.QEMUInstall">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">QEMUInstall</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iso</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ks_paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">img_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2048</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kernel_args</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">memory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1024</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vcpus</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vnc</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">arch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cancel_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">virtio_host</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'127.0.0.1'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">virtio_port</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">6080</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">image_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">boot_uefi</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ovmf_path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#QEMUInstall"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.QEMUInstall" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>Run qemu using an iso and a kickstart</p>
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="pylorax.installer.QEMUInstall.QEMU_CMDS">
|
|
<span class="sig-name descname"><span class="pre">QEMU_CMDS</span></span><em class="property"> <span class="pre">=</span> <span class="pre">{'aarch64':</span> <span class="pre">'qemu-system-aarch64',</span> <span class="pre">'arm':</span> <span class="pre">'qemu-system-arm',</span> <span class="pre">'i386':</span> <span class="pre">'qemu-system-i386',</span> <span class="pre">'ppc64le':</span> <span class="pre">'qemu-system-ppc64',</span> <span class="pre">'x86_64':</span> <span class="pre">'qemu-system-x86_64'}</span></em><a class="headerlink" href="#pylorax.installer.QEMUInstall.QEMU_CMDS" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.anaconda_cleanup">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">anaconda_cleanup</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dirinstall_path</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#anaconda_cleanup"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.anaconda_cleanup" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Cleanup any leftover mounts from anaconda</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><p><strong>dirinstall_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path where anaconda mounts things</p>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>True if cleanups were successful. False if any of them failed.</p>
|
|
</dd>
|
|
</dl>
|
|
<p>If anaconda crashes it may leave things mounted under this path. It will
|
|
typically be set to /mnt/sysimage/</p>
|
|
<p>Attempts to cleanup may also fail. Catch these and continue trying the
|
|
other mountpoints.</p>
|
|
<p>Anaconda may also leave /run/anaconda.pid behind, clean that up as well.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.append_initrd">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">append_initrd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">initrd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">files</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#append_initrd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.append_initrd" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Append files to an initrd.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>initrd</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to initrd</p></li>
|
|
<li><p><strong>files</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- list of file paths to add</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>Path to a new initrd</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
|
|
</dd>
|
|
</dl>
|
|
<p>The files are added to the initrd by creating a cpio image
|
|
of the files (stored at /) and writing the cpio to the end of a
|
|
copy of the initrd.</p>
|
|
<p>The initrd is not changed, a copy is made before appending the
|
|
cpio archive.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.create_vagrant_metadata">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">create_vagrant_metadata</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#create_vagrant_metadata"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.create_vagrant_metadata" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create a default Vagrant metadata.json file</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to metadata.json file</p></li>
|
|
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Disk size in MiB</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.find_free_port">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">find_free_port</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">start</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5900</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5999</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">host</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'127.0.0.1'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#find_free_port"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.find_free_port" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return first free port in range.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>start</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Starting port number</p></li>
|
|
<li><p><strong>end</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Ending port number</p></li>
|
|
<li><p><strong>host</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Host IP to search</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>First free port or -1 if none found</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.novirt_cancel_check">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">novirt_cancel_check</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cancel_funcs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proc</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#novirt_cancel_check"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.novirt_cancel_check" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Check to see if there has been an error in the logs</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>cancel_funcs</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) -- list of functions to call, True from any one cancels the build</p></li>
|
|
<li><p><strong>proc</strong> (<a class="reference external" href="https://docs.python.org/3/library/subprocess.html#subprocess.Popen" title="(in Python v3.10)"><em>subprocess.Popen</em></a>) -- Popen object for the anaconda process</p></li>
|
|
</ul>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>True if the process has been terminated</p>
|
|
</dd>
|
|
</dl>
|
|
<p>The cancel_funcs functions should return a True if an error has been detected.
|
|
When an error is detected the process is terminated and this returns True</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.novirt_install">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">novirt_install</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disk_size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cancel_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tar_img</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#novirt_install"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.novirt_install" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Use Anaconda to install to a disk image</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The full path to the disk image to be created</p></li>
|
|
<li><p><strong>disk_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- The size of the disk_img in MiB</p></li>
|
|
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
|
|
<li><p><strong>tar_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- For make_tar_disk, the path to final tarball to be created</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<p>This method runs anaconda to create the image and then based on the opts
|
|
passed creates a qemu disk image or tarfile.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.update_vagrant_metadata">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">update_vagrant_metadata</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#update_vagrant_metadata"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.update_vagrant_metadata" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Update the Vagrant metadata.json file</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Path to metadata.json file</p></li>
|
|
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- Disk size in MiB</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<p>This function makes sure that the provider, format and virtual size of the
|
|
metadata file are set correctly. All other values are left untouched.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.installer.virt_install">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.installer.</span></span><span class="sig-name descname"><span class="pre">virt_install</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">install_log</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disk_img</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disk_size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cancel_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tar_img</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#virt_install"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.installer.virt_install" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Use qemu to install to a disk image</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
|
|
<li><p><strong>install_log</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The path to write the log from qemu</p></li>
|
|
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- The full path to the disk image to be created</p></li>
|
|
<li><p><strong>disk_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) -- The size of the disk_img in MiB</p></li>
|
|
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
|
|
<li><p><strong>tar_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- For make_tar_disk, the path to final tarball to be created</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<p>This uses qemu with a boot.iso and a kickstart to create a disk
|
|
image and then optionally, based on the opts passed, creates tarfile.</p>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.ltmpl">
|
|
<span id="pylorax-ltmpl-module"></span><h2>pylorax.ltmpl module<a class="headerlink" href="#module-pylorax.ltmpl" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LiveTemplateRunner">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">LiveTemplateRunner</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dbo</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fatalerrors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">templatedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LiveTemplateRunner"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LiveTemplateRunner" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#pylorax.ltmpl.TemplateRunner" title="pylorax.ltmpl.TemplateRunner"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.ltmpl.TemplateRunner</span></code></a></p>
|
|
<p>This class parses and executes a limited Lorax template. Sample usage:</p>
|
|
<blockquote>
|
|
<div><p># install a bunch of packages
|
|
runner = LiveTemplateRunner(dbo, templatedir, defaults)
|
|
runner.run("live-install.tmpl")</p>
|
|
<p>It is meant to be used with the live-install.tmpl which lists the per-arch
|
|
pacages needed to build the live-iso output.</p>
|
|
</div></blockquote>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LiveTemplateRunner.installpkg">
|
|
<span class="sig-name descname"><span class="pre">installpkg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">pkgs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LiveTemplateRunner.installpkg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LiveTemplateRunner.installpkg" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>installpkg [--required|--optional] [--except PKGGLOB [--except PKGGLOB ...]] PKGGLOB [PKGGLOB ...]</dt><dd><p>Request installation of all packages matching the given globs.
|
|
Note that this is just a <em>request</em> - nothing is <em>actually</em> installed
|
|
until the 'run_pkg_transaction' command is given.</p>
|
|
<p>--required is now the default. If the PKGGLOB can be missing pass --optional</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplate">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">LoraxTemplate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">directories</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplate" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplate.parse">
|
|
<span class="sig-name descname"><span class="pre">parse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">template_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variables</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplate.parse"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplate.parse" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">LoraxTemplateRunner</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inroot</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outroot</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dbo</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fatalerrors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">templatedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#pylorax.ltmpl.TemplateRunner" title="pylorax.ltmpl.TemplateRunner"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.ltmpl.TemplateRunner</span></code></a></p>
|
|
<p>This class parses and executes Lorax templates. Sample usage:</p>
|
|
<blockquote>
|
|
<div><p># install a bunch of packages
|
|
runner = LoraxTemplateRunner(inroot=rundir, outroot=rundir, dbo=dnf_obj)
|
|
runner.run("install-packages.ltmpl")</p>
|
|
<p># modify a runtime dir
|
|
runner = LoraxTemplateRunner(inroot=rundir, outroot=newrun)
|
|
runner.run("runtime-transmogrify.ltmpl")</p>
|
|
</div></blockquote>
|
|
<p>NOTES:</p>
|
|
<ul class="simple">
|
|
<li><p>Commands that run external programs (e.g. systemctl) currently use
|
|
the <em>host</em>'s copy of that program, which may cause problems if there's a
|
|
big enough difference between the host and the image you're modifying.</p></li>
|
|
<li><p>The commands are not executed under a real chroot, so absolute symlinks
|
|
will point <em>outside</em> the inroot/outroot. Be careful with symlinks!</p></li>
|
|
</ul>
|
|
<p>ADDING NEW COMMANDS:</p>
|
|
<ul class="simple">
|
|
<li><p>Each template command is just a method of the LoraxTemplateRunner
|
|
object - so adding a new command is as easy as adding a new function.</p></li>
|
|
<li><p>Each function gets arguments that correspond to the rest of the tokens
|
|
on that line (after word splitting and brace expansion)</p></li>
|
|
<li><p>Commands should raise exceptions for errors - don't use sys.exit()</p></li>
|
|
</ul>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.append">
|
|
<span class="sig-name descname"><span class="pre">append</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.append"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.append" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>append FILE STRING</dt><dd><p>Append STRING (followed by a newline character) to FILE.
|
|
Python character escape sequences ('n', 't', etc.) will be
|
|
converted to the appropriate characters.</p>
|
|
<p>Examples:</p>
|
|
<blockquote>
|
|
<div><p>append /etc/depmod.d/dd.conf "search updates built-in"
|
|
append /etc/resolv.conf ""</p>
|
|
</div></blockquote>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.chmod">
|
|
<span class="sig-name descname"><span class="pre">chmod</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fileglob</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.chmod"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>chmod FILEGLOB OCTALMODE</dt><dd><p>Change the mode of all the files matching FILEGLOB to OCTALMODE.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.copy">
|
|
<span class="sig-name descname"><span class="pre">copy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.copy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.copy" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>copy SRC DEST</dt><dd><p>Copy SRC to DEST.
|
|
If DEST is a directory, SRC will be copied inside it.
|
|
If DEST doesn't exist, SRC will be copied to a file with
|
|
that name, if the path leading to it exists.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.createaddrsize">
|
|
<span class="sig-name descname"><span class="pre">createaddrsize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">addr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.createaddrsize"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.createaddrsize" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>createaddrsize INITRD_ADDRESS INITRD ADDRSIZE</dt><dd><p>Create the initrd.addrsize file required in LPAR boot process.</p>
|
|
<dl class="simple">
|
|
<dt>Examples:</dt><dd><p>createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.hardlink">
|
|
<span class="sig-name descname"><span class="pre">hardlink</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.hardlink"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.hardlink" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>hardlink SRC DEST</dt><dd><p>Create a hardlink at DEST which is linked to SRC.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.install">
|
|
<span class="sig-name descname"><span class="pre">install</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">srcglob</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.install"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.install" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>install SRC DEST</dt><dd><p>Copy the given file (or files, if a glob is used) from the input
|
|
tree to the given destination in the output tree.
|
|
The path to DEST must exist in the output tree.
|
|
If DEST is a directory, SRC will be copied into that directory.
|
|
If DEST doesn't exist, SRC will be copied to a file with that name,
|
|
assuming the rest of the path exists.
|
|
This is pretty much like how the 'cp' command works.</p>
|
|
<dl class="simple">
|
|
<dt>Examples:</dt><dd><p>install usr/share/myconfig/grub.conf /boot
|
|
install /usr/share/myconfig/grub.conf.in /boot/grub.conf</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.installimg">
|
|
<span class="sig-name descname"><span class="pre">installimg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installimg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installimg" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>installimg [--xz|--gzip|--bzip2|--lzma] [-ARG|--ARG=OPTION] SRCDIR DESTFILE</dt><dd><p>Create a compressed cpio archive of the contents of SRCDIR and place
|
|
it in DESTFILE.</p>
|
|
<p>If SRCDIR doesn't exist or is empty nothing is created.</p>
|
|
<dl class="simple">
|
|
<dt>Examples:</dt><dd><p>installimg ${LORAXDIR}/product/ images/product.img
|
|
installimg ${LORAXDIR}/updates/ images/updates.img
|
|
installimg --xz -6 ${LORAXDIR}/updates/ images/updates.img
|
|
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/updates/ images/updates.img</p>
|
|
</dd>
|
|
</dl>
|
|
<p>Optionally use a different compression type and override the default args
|
|
passed to it. The default is xz -9</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.installinitrd">
|
|
<span class="sig-name descname"><span class="pre">installinitrd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">section</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installinitrd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installinitrd" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>installinitrd SECTION SRC DEST</dt><dd><p>Same as installkernel, but for "initrd".</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.installkernel">
|
|
<span class="sig-name descname"><span class="pre">installkernel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">section</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installkernel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installkernel" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>installkernel SECTION SRC DEST</dt><dd><p>Install the kernel from SRC in the input tree to DEST in the output
|
|
tree, and then add an item to the treeinfo data store, in the named
|
|
SECTION, where "kernel" = DEST.</p>
|
|
<dl class="simple">
|
|
<dt>Equivalent to:</dt><dd><p>install SRC DEST
|
|
treeinfo SECTION kernel DEST</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.installpkg">
|
|
<span class="sig-name descname"><span class="pre">installpkg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">pkgs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installpkg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installpkg" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>installpkg [--required|--optional] [--except PKGGLOB [--except PKGGLOB ...]] PKGGLOB [PKGGLOB ...]</dt><dd><p>Request installation of all packages matching the given globs.
|
|
Note that this is just a <em>request</em> - nothing is <em>actually</em> installed
|
|
until the 'run_pkg_transaction' command is given.</p>
|
|
<p>--required is now the default. If the PKGGLOB can be missing pass --optional</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd">
|
|
<span class="sig-name descname"><span class="pre">installupgradeinitrd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">section</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installupgradeinitrd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>installupgradeinitrd SECTION SRC DEST</dt><dd><p>Same as installkernel, but for "upgrade".</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.log">
|
|
<span class="sig-name descname"><span class="pre">log</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.log"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.log" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>log MESSAGE</dt><dd><p>Emit the given log message. Be sure to put it in quotes!</p>
|
|
<dl class="simple">
|
|
<dt>Example:</dt><dd><p>log "Reticulating splines, please wait..."</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.mkdir">
|
|
<span class="sig-name descname"><span class="pre">mkdir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">dirs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.mkdir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.mkdir" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>mkdir DIR [DIR ...]</dt><dd><p>Create the named DIR(s). Will create leading directories as needed.</p>
|
|
<dl class="simple">
|
|
<dt>Example:</dt><dd><p>mkdir /images</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.move">
|
|
<span class="sig-name descname"><span class="pre">move</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.move"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.move" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>move SRC DEST</dt><dd><p>Move SRC to DEST.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.remove">
|
|
<span class="sig-name descname"><span class="pre">remove</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">fileglobs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.remove"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.remove" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>remove FILEGLOB [FILEGLOB ...]</dt><dd><p>Remove all the named files or directories.
|
|
Will <em>not</em> raise exceptions if the file(s) are not found.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.removefrom">
|
|
<span class="sig-name descname"><span class="pre">removefrom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pkg</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">globs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removefrom"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removefrom" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>removefrom PKGGLOB [--allbut] FILEGLOB [FILEGLOB...]</dt><dd><p>Remove all files matching the given file globs from the package
|
|
(or packages) named.
|
|
If '--allbut' is used, all the files from the given package(s) will
|
|
be removed <em>except</em> the ones which match the file globs.</p>
|
|
<dl class="simple">
|
|
<dt>Examples:</dt><dd><p>removefrom usbutils /usr/bin/*
|
|
removefrom xfsprogs --allbut /sbin/*</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.removekmod">
|
|
<span class="sig-name descname"><span class="pre">removekmod</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">globs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removekmod"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removekmod" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>removekmod GLOB [GLOB...] [--allbut] KEEPGLOB [KEEPGLOB...]</dt><dd><p>Remove all files and directories matching the given file globs from the kernel
|
|
modules directory.</p>
|
|
<p>If '--allbut' is used, all the files from the modules will be removed <em>except</em>
|
|
the ones which match the file globs. There must be at least one initial GLOB
|
|
to search and one KEEPGLOB to keep. The KEEPGLOB is expanded to be <em>KEEPGLOB</em>
|
|
so that it will match anywhere in the path.</p>
|
|
<p>This only removes files from under /lib/modules/*/kernel/</p>
|
|
<dl class="simple">
|
|
<dt>Examples:</dt><dd><p>removekmod sound drivers/media drivers/hwmon drivers/video
|
|
removekmod drivers/char --allbut virtio_console hw_random</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.removepkg">
|
|
<span class="sig-name descname"><span class="pre">removepkg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">pkgs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removepkg"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removepkg" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>removepkg PKGGLOB [PKGGLOB...]</dt><dd><p>Delete the named package(s).</p>
|
|
<dl class="simple">
|
|
<dt>IMPLEMENTATION NOTES:</dt><dd><p>RPM scriptlets (%preun/%postun) are <em>not</em> run.
|
|
Files are deleted, but directories are left behind.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.replace">
|
|
<span class="sig-name descname"><span class="pre">replace</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pat</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">repl</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">fileglobs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.replace"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.replace" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>replace PATTERN REPLACEMENT FILEGLOB [FILEGLOB ...]</dt><dd><p>Find-and-replace the given PATTERN (Python-style regex) with the given
|
|
REPLACEMENT string for each of the files listed.</p>
|
|
<dl class="simple">
|
|
<dt>Example:</dt><dd><p>replace @VERSION@ ${product.version} /boot/grub.conf /boot/isolinux.cfg</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction">
|
|
<span class="sig-name descname"><span class="pre">run_pkg_transaction</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.run_pkg_transaction"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Actually install all the packages requested by previous 'installpkg'
|
|
commands.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.runcmd">
|
|
<span class="sig-name descname"><span class="pre">runcmd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">cmdlist</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.runcmd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.runcmd" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>runcmd CMD [ARG ...]</dt><dd><p>Run the given command with the given arguments.</p>
|
|
<p>NOTE: All paths given MUST be COMPLETE, ABSOLUTE PATHS to the file
|
|
or files mentioned. ${root}/${inroot}/${outroot} are good for
|
|
constructing these paths.</p>
|
|
<p>FURTHER NOTE: Please use this command only as a last resort!
|
|
Whenever possible, you should use the existing template commands.
|
|
If the existing commands don't do what you need, fix them!</p>
|
|
<dl class="simple">
|
|
<dt>Examples:</dt><dd><p>(this should be replaced with a "find" function)
|
|
runcmd find ${root} -name "<em>.pyo" -type f -delete
|
|
%for f in find(root, name="</em>.pyo"):
|
|
remove ${f}
|
|
%endfor</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.symlink">
|
|
<span class="sig-name descname"><span class="pre">symlink</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">target</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.symlink"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.symlink" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl class="simple">
|
|
<dt>symlink SRC DEST</dt><dd><p>Create a symlink at DEST which points to SRC.</p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.systemctl">
|
|
<span class="sig-name descname"><span class="pre">systemctl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmd</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">units</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.systemctl"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.systemctl" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>systemctl [enable|disable|mask] UNIT [UNIT...]</dt><dd><p>Enable, disable, or mask the given systemd units.</p>
|
|
<dl class="simple">
|
|
<dt>Examples:</dt><dd><p>systemctl disable lvm2-monitor.service
|
|
systemctl mask fedora-storage-init.service fedora-configure.service</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.LoraxTemplateRunner.treeinfo">
|
|
<span class="sig-name descname"><span class="pre">treeinfo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">section</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">valuetoks</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.treeinfo"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.treeinfo" title="Permalink to this definition">¶</a></dt>
|
|
<dd><dl>
|
|
<dt>treeinfo SECTION KEY ARG [ARG ...]</dt><dd><p>Add an item to the treeinfo data store.
|
|
The given SECTION will have a new item added where
|
|
KEY = ARG ARG ...</p>
|
|
<dl class="simple">
|
|
<dt>Example:</dt><dd><p>treeinfo images-${kernel.arch} boot.iso images/boot.iso</p>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.TemplateRunner">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">TemplateRunner</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fatalerrors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">templatedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builtins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#TemplateRunner"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.TemplateRunner" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>This class parses and executes Lorax templates. Sample usage:</p>
|
|
<blockquote>
|
|
<div><p># install a bunch of packages
|
|
runner = LoraxTemplateRunner(inroot=rundir, outroot=rundir, dbo=dnf_obj)
|
|
runner.run("install-packages.ltmpl")</p>
|
|
</div></blockquote>
|
|
<p>NOTES:</p>
|
|
<ul>
|
|
<li><p>Parsing procedure is roughly:
|
|
1. Mako template expansion (on the whole file)
|
|
2. For each line of the result,</p>
|
|
<blockquote>
|
|
<div><ol class="loweralpha simple">
|
|
<li><p>Whitespace splitting (using shlex.split())</p></li>
|
|
<li><p>Brace expansion (using brace_expand())</p></li>
|
|
<li><p>If the first token is the name of a function, call that function
|
|
with the rest of the line as arguments</p></li>
|
|
</ol>
|
|
</div></blockquote>
|
|
</li>
|
|
<li><p>Parsing and execution are <em>separate</em> passes - so you can't use the result
|
|
of a command in an %if statement (or any other control statements)!</p></li>
|
|
</ul>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.TemplateRunner.run">
|
|
<span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">templatefile</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">variables</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#TemplateRunner.run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.TemplateRunner.run" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.brace_expand">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">brace_expand</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#brace_expand"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.brace_expand" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.rexists">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">rexists</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pathname</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">root</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#rexists"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.rexists" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.rglob">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">rglob</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pathname</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">root</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fatal</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#rglob"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.rglob" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.ltmpl.split_and_expand">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.ltmpl.</span></span><span class="sig-name descname"><span class="pre">split_and_expand</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">line</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#split_and_expand"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ltmpl.split_and_expand" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.monitor">
|
|
<span id="pylorax-monitor-module"></span><h2>pylorax.monitor module<a class="headerlink" href="#module-pylorax.monitor" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogMonitor">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.monitor.</span></span><span class="sig-name descname"><span class="pre">LogMonitor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">log_path=None</span></em>, <em class="sig-param"><span class="pre">host='localhost'</span></em>, <em class="sig-param"><span class="pre">port=0</span></em>, <em class="sig-param"><span class="pre">timeout=None</span></em>, <em class="sig-param"><span class="pre">log_request_handler_class=<class</span> <span class="pre">'pylorax.monitor.LogRequestHandler'></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogMonitor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogMonitor" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>Setup a server to monitor the logs output by the installation</p>
|
|
<p>This needs to be running before the virt-install runs, it expects
|
|
there to be a listener on the port used for the virtio log port.</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogMonitor.shutdown">
|
|
<span class="sig-name descname"><span class="pre">shutdown</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogMonitor.shutdown"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogMonitor.shutdown" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Force shutdown of the monitoring thread</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogRequestHandler">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.monitor.</span></span><span class="sig-name descname"><span class="pre">LogRequestHandler</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client_address</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">server</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/socketserver.html#socketserver.BaseRequestHandler" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">socketserver.BaseRequestHandler</span></code></a></p>
|
|
<p>Handle monitoring and saving the logfiles from the virtual install</p>
|
|
<p>Incoming data is written to self.server.log_path and each line is checked
|
|
for patterns that would indicate that the installation failed.
|
|
self.server.log_error is set True when this happens.</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogRequestHandler.finish">
|
|
<span class="sig-name descname"><span class="pre">finish</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.finish"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.finish" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogRequestHandler.handle">
|
|
<span class="sig-name descname"><span class="pre">handle</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.handle"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.handle" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Write incoming data to a logfile and check for errors</p>
|
|
<p>Split incoming data into lines and check for any Tracebacks or other
|
|
errors that indicate that the install failed.</p>
|
|
<p>Loops until self.server.kill is True</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogRequestHandler.iserror">
|
|
<span class="sig-name descname"><span class="pre">iserror</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">line</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.iserror"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.iserror" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Check a line to see if it contains an error indicating installation failure</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- log line to check for failure</p>
|
|
</dd>
|
|
</dl>
|
|
<p>If the line contains IGNORED it will be skipped.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogRequestHandler.re_tests">
|
|
<span class="sig-name descname"><span class="pre">re_tests</span></span><em class="property"> <span class="pre">=</span> <span class="pre">['packaging:</span> <span class="pre">base</span> <span class="pre">repo</span> <span class="pre">.*</span> <span class="pre">not</span> <span class="pre">valid',</span> <span class="pre">'packaging:</span> <span class="pre">.*</span> <span class="pre">requires</span> <span class="pre">.*']</span></em><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.re_tests" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogRequestHandler.setup">
|
|
<span class="sig-name descname"><span class="pre">setup</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.setup"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.setup" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Start writing to self.server.log_path</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogRequestHandler.simple_tests">
|
|
<span class="sig-name descname"><span class="pre">simple_tests</span></span><em class="property"> <span class="pre">=</span> <span class="pre">['Traceback</span> <span class="pre">(',</span> <span class="pre">'traceback</span> <span class="pre">script(s)</span> <span class="pre">have</span> <span class="pre">been</span> <span class="pre">run',</span> <span class="pre">'Out</span> <span class="pre">of</span> <span class="pre">memory:',</span> <span class="pre">'Call</span> <span class="pre">Trace:',</span> <span class="pre">'insufficient</span> <span class="pre">disk</span> <span class="pre">space:',</span> <span class="pre">'Not</span> <span class="pre">enough</span> <span class="pre">disk</span> <span class="pre">space</span> <span class="pre">to</span> <span class="pre">download</span> <span class="pre">the</span> <span class="pre">packages',</span> <span class="pre">'error</span> <span class="pre">populating</span> <span class="pre">transaction</span> <span class="pre">after',</span> <span class="pre">'crashed</span> <span class="pre">on</span> <span class="pre">signal',</span> <span class="pre">'packaging:</span> <span class="pre">Missed:</span> <span class="pre">NoSuchPackage',</span> <span class="pre">'packaging:</span> <span class="pre">Installation</span> <span class="pre">failed',</span> <span class="pre">'The</span> <span class="pre">following</span> <span class="pre">error</span> <span class="pre">occurred</span> <span class="pre">while</span> <span class="pre">installing.</span>  <span class="pre">This</span> <span class="pre">is</span> <span class="pre">a</span> <span class="pre">fatal</span> <span class="pre">error',</span> <span class="pre">'Error</span> <span class="pre">in</span> <span class="pre">POSTIN</span> <span class="pre">scriptlet</span> <span class="pre">in</span> <span class="pre">rpm</span> <span class="pre">package']</span></em><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.simple_tests" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogServer">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.monitor.</span></span><span class="sig-name descname"><span class="pre">LogServer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">log_path</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogServer"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogServer" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/socketserver.html#socketserver.TCPServer" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">socketserver.TCPServer</span></code></a></p>
|
|
<p>A TCP Server that listens for log data</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogServer.log_check">
|
|
<span class="sig-name descname"><span class="pre">log_check</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogServer.log_check"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.monitor.LogServer.log_check" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Check to see if an error has been found in the log</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Returns</dt>
|
|
<dd class="field-odd"><p>True if there has been an error</p>
|
|
</dd>
|
|
<dt class="field-even">Return type</dt>
|
|
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></p>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="pylorax.monitor.LogServer.timeout">
|
|
<span class="sig-name descname"><span class="pre">timeout</span></span><em class="property"> <span class="pre">=</span> <span class="pre">60</span></em><a class="headerlink" href="#pylorax.monitor.LogServer.timeout" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.mount">
|
|
<span id="pylorax-mount-module"></span><h2>pylorax.mount module<a class="headerlink" href="#module-pylorax.mount" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.mount.IsoMountpoint">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.mount.</span></span><span class="sig-name descname"><span class="pre">IsoMountpoint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">iso_path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initrd_path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/mount.html#IsoMountpoint"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.mount.IsoMountpoint" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>Mount the iso and check to make sure the vmlinuz and initrd.img files exist</p>
|
|
<p>Also check the iso for a a stage2 image and set a flag and extract the
|
|
iso's label.</p>
|
|
<p>stage2 can be either LiveOS/squashfs.img or images/install.img</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.mount.IsoMountpoint.get_iso_label">
|
|
<span class="sig-name descname"><span class="pre">get_iso_label</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/mount.html#IsoMountpoint.get_iso_label"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.mount.IsoMountpoint.get_iso_label" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get the iso's label using isoinfo</p>
|
|
<p>Sets self.label if one is found</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.mount.IsoMountpoint.umount">
|
|
<span class="sig-name descname"><span class="pre">umount</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/mount.html#IsoMountpoint.umount"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.mount.IsoMountpoint.umount" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Unmount the iso</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.output">
|
|
<span id="pylorax-output-module"></span><h2>pylorax.output module<a class="headerlink" href="#module-pylorax.output" title="Permalink to this headline">¶</a></h2>
|
|
</section>
|
|
<section id="module-pylorax.sysutils">
|
|
<span id="pylorax-sysutils-module"></span><h2>pylorax.sysutils module<a class="headerlink" href="#module-pylorax.sysutils" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.sysutils.chmod_">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.sysutils.</span></span><span class="sig-name descname"><span class="pre">chmod_</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">recursive</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#chmod_"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.sysutils.chmod_" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.sysutils.chown_">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.sysutils.</span></span><span class="sig-name descname"><span class="pre">chown_</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">user</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">group</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">recursive</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#chown_"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.sysutils.chown_" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.sysutils.joinpaths">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.sysutils.</span></span><span class="sig-name descname"><span class="pre">joinpaths</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#joinpaths"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.sysutils.joinpaths" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.sysutils.linktree">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.sysutils.</span></span><span class="sig-name descname"><span class="pre">linktree</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dst</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#linktree"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.sysutils.linktree" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.sysutils.remove">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.sysutils.</span></span><span class="sig-name descname"><span class="pre">remove</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">target</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#remove"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.sysutils.remove" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.sysutils.replace">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.sysutils.</span></span><span class="sig-name descname"><span class="pre">replace</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fname</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">find</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sub</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#replace"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.sysutils.replace" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.sysutils.touch">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.sysutils.</span></span><span class="sig-name descname"><span class="pre">touch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fname</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#touch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.sysutils.touch" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.treebuilder">
|
|
<span id="pylorax-treebuilder-module"></span><h2>pylorax.treebuilder module<a class="headerlink" href="#module-pylorax.treebuilder" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.treebuilder.</span></span><span class="sig-name descname"><span class="pre">RuntimeBuilder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">product</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">arch</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dbo</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">templatedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">installpkgs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excludepkgs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_templates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_template_vars</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skip_branding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>Builds the anaconda runtime image.</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.cleanup">
|
|
<span class="sig-name descname"><span class="pre">cleanup</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.cleanup"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.cleanup" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Remove unneeded packages and files with runtime-cleanup.tmpl</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.create_ext4_runtime">
|
|
<span class="sig-name descname"><span class="pre">create_ext4_runtime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/var/tmp/squashfs.img'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'xz'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compressargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.create_ext4_runtime"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.create_ext4_runtime" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create a squashfs compressed ext4 runtime</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.create_squashfs_runtime">
|
|
<span class="sig-name descname"><span class="pre">create_squashfs_runtime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/var/tmp/squashfs.img'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'xz'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compressargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.create_squashfs_runtime"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.create_squashfs_runtime" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create a plain squashfs runtime</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.finished">
|
|
<span class="sig-name descname"><span class="pre">finished</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.finished"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.finished" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Done using RuntimeBuilder</p>
|
|
<p>Close the dnf base object</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.generate_module_data">
|
|
<span class="sig-name descname"><span class="pre">generate_module_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.generate_module_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.generate_module_data" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.get_branding">
|
|
<span class="sig-name descname"><span class="pre">get_branding</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">skip</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">product</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.get_branding"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.get_branding" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Select the branding from the available 'system-release' packages
|
|
The <em>best</em> way to control this is to have a single package in the repo provide 'system-release'
|
|
When there are more than 1 package it will:
|
|
- Make a list of the available packages
|
|
- If variant is set look for a package ending with lower(variant) and use that
|
|
- If there are one or more non-generic packages, use the first one after sorting</p>
|
|
<p>Returns the package names of the system-release and release logos package</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.install">
|
|
<span class="sig-name descname"><span class="pre">install</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.install"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.install" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Install packages and do initial setup with runtime-install.tmpl</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.postinstall">
|
|
<span class="sig-name descname"><span class="pre">postinstall</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.postinstall"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.postinstall" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Do some post-install setup work with runtime-postinstall.tmpl</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.verify">
|
|
<span class="sig-name descname"><span class="pre">verify</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.verify"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.verify" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Ensure that contents of the installroot can run</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.writepkglists">
|
|
<span class="sig-name descname"><span class="pre">writepkglists</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pkglistdir</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkglists"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkglists" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>debugging data: write out lists of package contents</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.RuntimeBuilder.writepkgsizes">
|
|
<span class="sig-name descname"><span class="pre">writepkgsizes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pkgsizefile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkgsizes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkgsizes" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>debugging data: write a big list of pkg sizes</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.TreeBuilder">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.treebuilder.</span></span><span class="sig-name descname"><span class="pre">TreeBuilder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">product</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">arch</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inroot</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outroot</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">runtime</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">isolabel</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domacboot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">doupgrade</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">templatedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_templates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_template_vars</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">workdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">extra_boot_args</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<p>Builds the arch-specific boot images.
|
|
inroot should be the installtree root (the newly-built runtime dir)</p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.TreeBuilder.build">
|
|
<span class="sig-name descname"><span class="pre">build</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.build"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.build" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.TreeBuilder.copy_dracut_hooks">
|
|
<span class="sig-name descname"><span class="pre">copy_dracut_hooks</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hooks</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.copy_dracut_hooks"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.copy_dracut_hooks" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Copy the hook scripts in hooks into the installroot's /tmp/
|
|
and return a list of commands to pass to dracut when creating the
|
|
initramfs</p>
|
|
<p>hooks is a list of tuples with the name of the hook script and the
|
|
target dracut hook directory
|
|
(eg. [("99anaconda-copy-ks.sh", "/lib/dracut/hooks/pre-pivot")])</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py property">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.TreeBuilder.dracut_hooks_path">
|
|
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">dracut_hooks_path</span></span><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.dracut_hooks_path" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return the path to the lorax dracut hooks scripts</p>
|
|
<p>Use the configured share dir if it is setup,
|
|
otherwise default to /usr/share/lorax/dracut_hooks</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.TreeBuilder.implantisomd5">
|
|
<span class="sig-name descname"><span class="pre">implantisomd5</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.implantisomd5"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.implantisomd5" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py property">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.TreeBuilder.kernels">
|
|
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">kernels</span></span><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.kernels" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.TreeBuilder.rebuild_initrds">
|
|
<span class="sig-name descname"><span class="pre">rebuild_initrds</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">add_args</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">backup</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefix</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.rebuild_initrds"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.rebuild_initrds" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Rebuild all the initrds in the tree. If backup is specified, each
|
|
initrd will be renamed with backup as a suffix before rebuilding.
|
|
If backup is empty, the existing initrd files will be overwritten.
|
|
If suffix is specified, the existing initrd is untouched and a new
|
|
image is built with the filename "${prefix}-${kernel.version}.img"</p>
|
|
<p>If the initrd doesn't exist its name will be created based on the
|
|
name of the kernel.</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.findkernels">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.treebuilder.</span></span><span class="sig-name descname"><span class="pre">findkernels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'boot'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#findkernels"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.findkernels" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.generate_module_info">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.treebuilder.</span></span><span class="sig-name descname"><span class="pre">generate_module_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">moddir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#generate_module_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.generate_module_info" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.string_lower">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.treebuilder.</span></span><span class="sig-name descname"><span class="pre">string_lower</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">string</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#string_lower"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.string_lower" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Return a lowercase string.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><p><strong>string</strong> -- String to lowercase</p>
|
|
</dd>
|
|
</dl>
|
|
<p>This is used as a filter in the templates.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.treebuilder.udev_escape">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.treebuilder.</span></span><span class="sig-name descname"><span class="pre">udev_escape</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">label</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#udev_escape"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treebuilder.udev_escape" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax.treeinfo">
|
|
<span id="pylorax-treeinfo-module"></span><h2>pylorax.treeinfo module<a class="headerlink" href="#module-pylorax.treeinfo" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.treeinfo.TreeInfo">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.treeinfo.</span></span><span class="sig-name descname"><span class="pre">TreeInfo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">product</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">version</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variant</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">basearch</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">packagedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treeinfo.TreeInfo.add_section">
|
|
<span class="sig-name descname"><span class="pre">add_section</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">section</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo.add_section"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo.add_section" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.treeinfo.TreeInfo.write">
|
|
<span class="sig-name descname"><span class="pre">write</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">outfile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo.write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo.write" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</section>
|
|
<section id="module-pylorax">
|
|
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pylorax" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.ArchData">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.</span></span><span class="sig-name descname"><span class="pre">ArchData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">buildarch</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#ArchData"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.ArchData" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.DataHolder</span></code></a></p>
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="pylorax.ArchData.bcj_arch">
|
|
<span class="sig-name descname"><span class="pre">bcj_arch</span></span><em class="property"> <span class="pre">=</span> <span class="pre">{'arm':</span> <span class="pre">'arm',</span> <span class="pre">'armhfp':</span> <span class="pre">'arm',</span> <span class="pre">'i386':</span> <span class="pre">'x86',</span> <span class="pre">'ppc64le':</span> <span class="pre">'powerpc',</span> <span class="pre">'x86_64':</span> <span class="pre">'x86'}</span></em><a class="headerlink" href="#pylorax.ArchData.bcj_arch" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py attribute">
|
|
<dt class="sig sig-object py" id="pylorax.ArchData.lib64_arches">
|
|
<span class="sig-name descname"><span class="pre">lib64_arches</span></span><em class="property"> <span class="pre">=</span> <span class="pre">('x86_64',</span> <span class="pre">'ppc64le',</span> <span class="pre">'s390x',</span> <span class="pre">'ia64',</span> <span class="pre">'aarch64')</span></em><a class="headerlink" href="#pylorax.ArchData.lib64_arches" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py class">
|
|
<dt class="sig sig-object py" id="pylorax.Lorax">
|
|
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">pylorax.</span></span><span class="sig-name descname"><span class="pre">Lorax</span></span><a class="reference internal" href="_modules/pylorax.html#Lorax"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.Lorax" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.BaseLoraxClass" title="pylorax.base.BaseLoraxClass"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.BaseLoraxClass</span></code></a></p>
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.Lorax.configure">
|
|
<span class="sig-name descname"><span class="pre">configure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">conf_file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/etc/lorax/lorax.conf'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.configure"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.Lorax.configure" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.Lorax.init_file_logging">
|
|
<span class="sig-name descname"><span class="pre">init_file_logging</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">logdir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logname</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'pylorax.log'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.init_file_logging"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.Lorax.init_file_logging" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.Lorax.init_stream_logging">
|
|
<span class="sig-name descname"><span class="pre">init_stream_logging</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.init_stream_logging"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.Lorax.init_stream_logging" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py method">
|
|
<dt class="sig sig-object py" id="pylorax.Lorax.run">
|
|
<span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dbo</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">product</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">version</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">release</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variant</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bugurl</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">isfinal</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">workdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outputdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">buildarch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">volid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domacboot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">doupgrade</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">remove_temp</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">installpkgs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excludepkgs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_templates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_template_vars</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_arch_templates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_arch_template_vars</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">user_dracut_args</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">squashfs_only</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skip_branding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.Lorax.run" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py property">
|
|
<dt class="sig sig-object py" id="pylorax.Lorax.templatedir">
|
|
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">templatedir</span></span><a class="headerlink" href="#pylorax.Lorax.templatedir" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Find the template directory.</p>
|
|
<p>Pick the first directory under sharedir/templates.d/ if it exists.
|
|
Otherwise use the sharedir</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.find_templates">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.</span></span><span class="sig-name descname"><span class="pre">find_templates</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">templatedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'/usr/share/lorax'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#find_templates"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.find_templates" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Find the templates to use.</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><p><strong>templatedir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) -- Top directory to search for templates</p>
|
|
</dd>
|
|
<dt class="field-even">Returns</dt>
|
|
<dd class="field-even"><p>Path to templates</p>
|
|
</dd>
|
|
<dt class="field-odd">Return type</dt>
|
|
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
|
|
</dd>
|
|
</dl>
|
|
<p>If there is a templates.d directory under templatedir the
|
|
lowest numbered directory entry is returned.</p>
|
|
<p>eg. /usr/share/lorax/templates.d/99-generic/</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.get_buildarch">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.</span></span><span class="sig-name descname"><span class="pre">get_buildarch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dbo</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#get_buildarch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.get_buildarch" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.log_selinux_state">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.</span></span><span class="sig-name descname"><span class="pre">log_selinux_state</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#log_selinux_state"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.log_selinux_state" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Log the current state of selinux</p>
|
|
</dd></dl>
|
|
|
|
<dl class="py function">
|
|
<dt class="sig sig-object py" id="pylorax.setup_logging">
|
|
<span class="sig-prename descclassname"><span class="pre">pylorax.</span></span><span class="sig-name descname"><span class="pre">setup_logging</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">logfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">theLogger</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#setup_logging"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pylorax.setup_logging" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Setup the various logs</p>
|
|
<dl class="field-list simple">
|
|
<dt class="field-odd">Parameters</dt>
|
|
<dd class="field-odd"><ul class="simple">
|
|
<li><p><strong>logfile</strong> (<em>string</em>) -- filename to write the log to</p></li>
|
|
<li><p><strong>theLogger</strong> (<a class="reference external" href="https://docs.python.org/3/library/logging.html#logging.Logger" title="(in Python v3.10)"><em>logging.Logger</em></a>) -- top-level logger</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</dd></dl>
|
|
|
|
</section>
|
|
</section>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
|
<a href="modules.html" class="btn btn-neutral float-left" title="src" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<p>© Copyright 2018, Red Hat, Inc..</p>
|
|
</div>
|
|
|
|
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<script>
|
|
jQuery(function () {
|
|
SphinxRtdTheme.Navigation.enable(true);
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html> |