483 lines
66 KiB
HTML
483 lines
66 KiB
HTML
|
|
|
|
<!DOCTYPE html>
|
|
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
|
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>pylorax.cmdline — Lorax 25.2 documentation</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="top" title="Lorax 25.2 documentation" href="../../index.html"/>
|
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
|
|
|
|
|
<script src="../../_static/js/modernizr.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav" role="document">
|
|
|
|
<div class="wy-grid-for-nav">
|
|
|
|
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
<div class="wy-side-scroll">
|
|
<div class="wy-side-nav-search">
|
|
|
|
|
|
|
|
<a href="../../index.html" class="icon icon-home"> Lorax
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<div class="version">
|
|
25.2
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div role="search">
|
|
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
|
<input type="text" name="q" placeholder="Search docs" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
|
|
|
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../intro.html">Introduction to 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="../../product-images.html">Product and Updates Images</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
|
|
|
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="../../index.html">Lorax</a>
|
|
</nav>
|
|
|
|
|
|
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
<ul class="wy-breadcrumbs">
|
|
<li><a href="../../index.html">Docs</a> »</li>
|
|
|
|
<li><a href="../index.html">Module code</a> »</li>
|
|
|
|
<li><a href="../pylorax.html">pylorax</a> »</li>
|
|
|
|
<li>pylorax.cmdline</li>
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
</div>
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
<div itemprop="articleBody">
|
|
|
|
<h1>Source code for pylorax.cmdline</h1><div class="highlight"><pre>
|
|
<span class="c">#</span>
|
|
<span class="c"># cmdline.py</span>
|
|
<span class="c">#</span>
|
|
<span class="c"># Copyright (C) 2016 Red Hat, Inc.</span>
|
|
<span class="c">#</span>
|
|
<span class="c"># This program is free software; you can redistribute it and/or modify</span>
|
|
<span class="c"># it under the terms of the GNU General Public License as published by</span>
|
|
<span class="c"># the Free Software Foundation; either version 2 of the License, or</span>
|
|
<span class="c"># (at your option) any later version.</span>
|
|
<span class="c">#</span>
|
|
<span class="c"># This program is distributed in the hope that it will be useful,</span>
|
|
<span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
|
<span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
|
<span class="c"># GNU General Public License for more details.</span>
|
|
<span class="c">#</span>
|
|
<span class="c"># You should have received a copy of the GNU General Public License</span>
|
|
<span class="c"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
|
<span class="c">#</span>
|
|
<span class="c"># Red Hat Author(s): Brian C. Lane <bcl@redhat.com></span>
|
|
|
|
<span class="kn">import</span> <span class="nn">os</span>
|
|
<span class="kn">import</span> <span class="nn">sys</span>
|
|
<span class="kn">import</span> <span class="nn">argparse</span>
|
|
|
|
<div class="viewcode-block" id="lorax_parser"><a class="viewcode-back" href="../../pylorax.html#pylorax.cmdline.lorax_parser">[docs]</a><span class="k">def</span> <span class="nf">lorax_parser</span><span class="p">():</span>
|
|
<span class="sd">""" Return the ArgumentParser for lorax"""</span>
|
|
|
|
<span class="c"># get lorax version</span>
|
|
<span class="k">try</span><span class="p">:</span>
|
|
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="kn">import</span> <span class="n">version</span>
|
|
<span class="n">vernum</span> <span class="o">=</span> <span class="n">version</span><span class="o">.</span><span class="n">num</span>
|
|
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
|
|
<span class="n">vernum</span> <span class="o">=</span> <span class="s">"devel"</span>
|
|
|
|
<span class="n">version</span> <span class="o">=</span> <span class="s">"{0}-{1}"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> <span class="n">vernum</span><span class="p">)</span>
|
|
|
|
<span class="n">parser</span> <span class="o">=</span> <span class="n">argparse</span><span class="o">.</span><span class="n">ArgumentParser</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s">"Create the Anaconda boot.iso"</span><span class="p">)</span>
|
|
|
|
<span class="c"># required arguments for image creation</span>
|
|
<span class="n">required</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"required arguments"</span><span class="p">)</span>
|
|
<span class="n">required</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-p"</span><span class="p">,</span> <span class="s">"--product"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"product name"</span><span class="p">,</span> <span class="n">required</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"PRODUCT"</span><span class="p">)</span>
|
|
<span class="n">required</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-v"</span><span class="p">,</span> <span class="s">"--version"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"version identifier"</span><span class="p">,</span> <span class="n">required</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"VERSION"</span><span class="p">)</span>
|
|
<span class="n">required</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-r"</span><span class="p">,</span> <span class="s">"--release"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"release information"</span><span class="p">,</span> <span class="n">required</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"RELEASE"</span><span class="p">)</span>
|
|
<span class="n">required</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-s"</span><span class="p">,</span> <span class="s">"--source"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"source repository (may be listed multiple times)"</span><span class="p">,</span>
|
|
<span class="n">metavar</span><span class="o">=</span><span class="s">"REPOSITORY"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[])</span>
|
|
<span class="n">required</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--repo"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"source dnf repository file"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">dest</span><span class="o">=</span><span class="s">"repos"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"REPOSITORY"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[])</span>
|
|
|
|
<span class="c"># optional arguments</span>
|
|
<span class="n">optional</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"optional arguments"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-m"</span><span class="p">,</span> <span class="s">"--mirrorlist"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"mirrorlist repository (may be listed multiple times)"</span><span class="p">,</span>
|
|
<span class="n">metavar</span><span class="o">=</span><span class="s">"REPOSITORY"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[])</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-t"</span><span class="p">,</span> <span class="s">"--variant"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"variant name"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"VARIANT"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-b"</span><span class="p">,</span> <span class="s">"--bugurl"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"bug reporting URL for the product"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"URL"</span><span class="p">,</span>
|
|
<span class="n">default</span><span class="o">=</span><span class="s">"your distribution provided bug reporting tool"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--isfinal"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">""</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"isfinal"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-c"</span><span class="p">,</span> <span class="s">"--config"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"/etc/lorax/lorax.conf"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"config file"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"CONFIGFILE"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--proxy"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"repo proxy url:port"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"HOST"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-i"</span><span class="p">,</span> <span class="s">"--installpkgs"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"PACKAGE"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"package glob to install before runtime-install.tmpl runs. (may be listed multiple times)"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--buildarch"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"build architecture"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"ARCH"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--volid"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"volume id"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"VOLID"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--macboot"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">""</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"domacboot"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--nomacboot"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">""</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"store_false"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"domacboot"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--noupgrade"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">""</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"store_false"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"doupgrade"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--logfile"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"./lorax.log"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Path to logfile"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--tmp"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"/var/tmp"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Top level temporary directory"</span> <span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--cachedir"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"DNF cache directory. Default is a temporary dir."</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--workdir"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Work directory, overrides --tmp. Default is a temporary dir under /var/tmp"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--force"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Run even when the destination directory exists"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--add-template"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"add_templates"</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"Additional template for runtime image"</span><span class="p">,</span>
|
|
<span class="n">default</span><span class="o">=</span><span class="p">[])</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--add-template-var"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"add_template_vars"</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"Set variable for runtime image template"</span><span class="p">,</span>
|
|
<span class="n">default</span><span class="o">=</span><span class="p">[])</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--add-arch-template"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"add_arch_templates"</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"Additional template for architecture-specific image"</span><span class="p">,</span>
|
|
<span class="n">default</span><span class="o">=</span><span class="p">[])</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--add-arch-template-var"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"add_arch_template_vars"</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"Set variable for architecture-specific image"</span><span class="p">,</span>
|
|
<span class="n">default</span><span class="o">=</span><span class="p">[])</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--noverify"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_false"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"verify"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Do not verify the install root"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--sharedir"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"SHAREDIR"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Directory containing all the templates. Overrides config file sharedir"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--enablerepo"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span> <span class="n">dest</span><span class="o">=</span><span class="s">"enablerepos"</span><span class="p">,</span>
|
|
<span class="n">metavar</span><span class="o">=</span><span class="s">"[repo]"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"Names of repos to enable"</span><span class="p">)</span>
|
|
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--disablerepo"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span> <span class="n">dest</span><span class="o">=</span><span class="s">"disablerepos"</span><span class="p">,</span>
|
|
<span class="n">metavar</span><span class="o">=</span><span class="s">"[repo]"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"Names of repos to disable"</span><span class="p">)</span>
|
|
|
|
<span class="c"># add the show version option</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"-V"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"show program's version number and exit"</span><span class="p">,</span>
|
|
<span class="n">action</span><span class="o">=</span><span class="s">"version"</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="n">version</span><span class="p">)</span>
|
|
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"outputdir"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"Output directory"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"OUTPUTDIR"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">)</span>
|
|
|
|
<span class="k">return</span> <span class="n">parser</span>
|
|
|
|
</div>
|
|
<div class="viewcode-block" id="lmc_parser"><a class="viewcode-back" href="../../pylorax.html#pylorax.cmdline.lmc_parser">[docs]</a><span class="k">def</span> <span class="nf">lmc_parser</span><span class="p">(</span><span class="n">dracut_default</span><span class="o">=</span><span class="s">""</span><span class="p">):</span>
|
|
<span class="sd">""" Return a ArgumentParser object for live-media-creator."""</span>
|
|
<span class="n">parser</span> <span class="o">=</span> <span class="n">argparse</span><span class="o">.</span><span class="n">ArgumentParser</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s">"Create Live Install Media"</span><span class="p">,</span>
|
|
<span class="n">fromfile_prefix_chars</span><span class="o">=</span><span class="s">"@"</span><span class="p">)</span>
|
|
|
|
<span class="c"># These are mutually exclusive, one is required</span>
|
|
<span class="n">action</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_mutually_exclusive_group</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-iso"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build a live iso"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-disk"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build a partitioned disk image"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-fsimage"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build a filesystem image"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-appliance"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build an appliance image and XML description"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-ami"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build an ami image"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-tar"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build a tar of the root filesystem"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-pxe-live"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build a live pxe boot squashfs image"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-ostree-live"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build a live pxe boot squashfs image of Atomic Host"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-oci"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build an Open Container Initiative image"</span><span class="p">)</span>
|
|
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--make-vagrant"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Build a Vagrant Box image"</span><span class="p">)</span>
|
|
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--iso"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Anaconda installation .iso path to use for qemu"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--iso-only"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Remove all iso creation artifacts except the boot.iso, "</span>
|
|
<span class="s">"combine with --iso-name to rename the boot.iso"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--iso-name"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Name of output iso file for --iso-only. Default is boot.iso"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--ks"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Kickstart file defining the install."</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--image-only"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Exit after creating fs/disk image."</span><span class="p">)</span>
|
|
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--no-virt"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Run anaconda directly on host instead of using qemu"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--proxy"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"proxy URL to use for the install"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--anaconda-arg"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"anaconda_args"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Additional argument to pass to anaconda (no-virt "</span>
|
|
<span class="s">"mode). Pass once for each argument"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--armplatform"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"the platform to use when creating images for ARM, "</span>
|
|
<span class="s">"i.e., highbank, mvebu, omap, tegra, etc."</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--location"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"location of iso directory tree with initrd.img "</span>
|
|
<span class="s">"and vmlinuz. Used to run qemu with a newer initrd "</span>
|
|
<span class="s">"than the iso."</span><span class="p">)</span>
|
|
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--logfile"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"./livemedia.log"</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Name and path for primary logfile, other logs will "</span>
|
|
<span class="s">"be created in the same directory."</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--lorax-templates"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Path to mako templates for lorax"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--tmp"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"/var/tmp"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Top level temporary directory"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--resultdir"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"result_dir"</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Directory to copy the resulting images and iso into. "</span>
|
|
<span class="s">"Defaults to the temporary working directory"</span><span class="p">)</span>
|
|
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--macboot"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
|
|
<span class="n">dest</span><span class="o">=</span><span class="s">"domacboot"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--nomacboot"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_false"</span><span class="p">,</span>
|
|
<span class="n">dest</span><span class="o">=</span><span class="s">"domacboot"</span><span class="p">)</span>
|
|
|
|
<span class="n">image_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"disk/fs image arguments"</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--disk-image"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Path to existing disk image to use for creating final image."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--keep-image"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Keep raw disk image after .iso creation"</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--fs-image"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Path to existing filesystem image to use for creating final image."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--image-name"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Name of output file to create. Used for tar, fs and disk image. Default is a random name."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--fs-label"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"Anaconda"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Label to set on fsimage, default is 'Anaconda'"</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--image-type"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Create an image with qemu-img. See qemu-img --help for supported formats."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--qemu-arg"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"qemu_args"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Arguments to pass to qemu-img. Pass once for each argument, they will be used for ALL calls to qemu-img."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--qcow2"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Create qcow2 image instead of raw sparse image when making disk images."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--qcow2-arg"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"qemu_args"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Arguments to pass to qemu-img. Pass once for each argument, they will be used for ALL calls to qemu-img."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--compression"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"xz"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Compression binary for make-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default."</span><span class="p">)</span>
|
|
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--compress-arg"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"compress_args"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Arguments to pass to compression. Pass once for each argument"</span><span class="p">)</span>
|
|
<span class="c"># Group of arguments for appliance creation</span>
|
|
<span class="n">app_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"appliance arguments"</span><span class="p">)</span>
|
|
<span class="n">app_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--app-name"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Name of appliance to pass to template"</span><span class="p">)</span>
|
|
<span class="n">app_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--app-template"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Path to template to use for appliance data."</span><span class="p">)</span>
|
|
<span class="n">app_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--app-file"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"appliance.xml"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Appliance template results file."</span><span class="p">)</span>
|
|
|
|
<span class="c"># Group of arguments to pass to qemu</span>
|
|
<span class="n">virt_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"qemu arguments"</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--ram"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">"MEMORY"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Memory to allocate for installer in megabytes."</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--vcpus"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Passed to qemu -smp command"</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--vnc"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Passed to qemu -display command. eg. vnc=127.0.0.1:5, default is to "</span>
|
|
<span class="s">"choose the first unused vnc port."</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--arch"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"System arch to build for. Used to select qemu-system-* command. "</span>
|
|
<span class="s">"Defaults to qemu-system-<arch>"</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--kernel-args"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Additional argument to pass to the installation kernel"</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--ovmf-path"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"/usr/share/OVMF/"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Path to OVMF firmware"</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--virt-uefi"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Use OVMF firmware to boot the VM in UEFI mode"</span><span class="p">)</span>
|
|
<span class="n">virt_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--no-kvm"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Skip using kvm with qemu even if it is available."</span><span class="p">)</span>
|
|
|
|
<span class="c"># dracut arguments</span>
|
|
<span class="n">dracut_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"dracut arguments"</span><span class="p">)</span>
|
|
<span class="n">dracut_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--dracut-arg"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"append"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s">"dracut_args"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Argument to pass to dracut when "</span>
|
|
<span class="s">"rebuilding the initramfs. Pass this "</span>
|
|
<span class="s">"once for each argument. NOTE: this "</span>
|
|
<span class="s">"overrides the default. (default: </span><span class="si">%s</span><span class="s">)"</span> <span class="o">%</span> <span class="n">dracut_default</span><span class="p">)</span>
|
|
|
|
<span class="c"># pxe to live arguments</span>
|
|
<span class="n">pxelive_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"pxe to live arguments"</span><span class="p">)</span>
|
|
<span class="n">pxelive_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--live-rootfs-size"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Size of root filesystem of live image in GiB"</span><span class="p">)</span>
|
|
<span class="n">pxelive_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--live-rootfs-keep-size"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s">"store_true"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Keep the original size of root filesystem in live image"</span><span class="p">)</span>
|
|
|
|
<span class="c"># OCI specific commands</span>
|
|
<span class="n">oci_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"OCI arguments"</span><span class="p">)</span>
|
|
<span class="n">oci_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--oci-config"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"config.json OCI configuration file"</span><span class="p">)</span>
|
|
<span class="n">oci_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--oci-runtime"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"runtime.json OCI configuration file"</span><span class="p">)</span>
|
|
|
|
<span class="c"># Vagrant specific commands</span>
|
|
<span class="n">vagrant_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s">"Vagrant arguments"</span><span class="p">)</span>
|
|
<span class="n">vagrant_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--vagrant-metadata"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"optional metadata.json file"</span><span class="p">)</span>
|
|
<span class="n">vagrant_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--vagrantfile"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"optional vagrantfile"</span><span class="p">)</span>
|
|
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--title"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"Linux Live Media"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Substituted for @TITLE@ in bootloader config files"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--project"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"Linux"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"substituted for @PROJECT@ in bootloader config files"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--releasever"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s">"25"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"substituted for @VERSION@ in bootloader config files"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--volid"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s">"volume id"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--squashfs_args"</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"additional squashfs args"</span><span class="p">)</span>
|
|
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--timeout"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span>
|
|
<span class="n">help</span><span class="o">=</span><span class="s">"Cancel installer after X minutes"</span><span class="p">)</span>
|
|
|
|
<span class="k">return</span> <span class="n">parser</span></div>
|
|
</pre></div>
|
|
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<p>
|
|
© Copyright 2015, Red Hat, Inc..
|
|
|
|
</p>
|
|
</div>
|
|
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT:'../../',
|
|
VERSION:'25.2',
|
|
COLLAPSE_INDEX:false,
|
|
FILE_SUFFIX:'.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
|
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
|
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function () {
|
|
SphinxRtdTheme.StickyNav.enable();
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html> |