lorax/docs/html/livemedia-creator.html

1183 lines
83 KiB
HTML
Raw Normal View History

<!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>livemedia-creator &mdash; Lorax 28.14.33 documentation</title>
2017-11-28 17:18:51 +00:00
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
2018-05-16 20:15:10 +00:00
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="lorax-composer" href="lorax-composer.html" />
<link rel="prev" title="Lorax" href="lorax.html" />
</head>
2018-05-16 20:15:10 +00:00
<body class="wy-body-for-nav">
2017-11-28 17:18:51 +00:00
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
2016-02-13 00:06:33 +00:00
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
2016-02-13 00:06:33 +00:00
2016-02-13 00:06:33 +00:00
<a href="index.html" class="icon icon-home"> Lorax
2016-02-13 00:06:33 +00:00
</a>
2016-02-13 00:06:33 +00:00
<div class="version">
28.14.33
2016-02-13 00:06:33 +00:00
</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>
2016-02-13 00:06:33 +00:00
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
2016-02-13 00:06:33 +00:00
2017-11-28 17:18:51 +00:00
<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>
2016-02-13 00:06:33 +00:00
<li class="toctree-l1"><a class="reference internal" href="lorax.html">Lorax</a></li>
2016-11-29 17:27:44 +00:00
<li class="toctree-l1 current"><a class="current reference internal" href="#">livemedia-creator</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#livemedia-creator-cmdline-arguments">livemedia-creator cmdline arguments</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments">Named Arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#disk/fs image arguments">disk/fs image arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#appliance arguments">appliance arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#qemu arguments">qemu arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#dracut arguments">dracut arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#pxe to live arguments">pxe to live arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#OCI arguments">OCI arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#Vagrant arguments">Vagrant arguments</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="#how-iso-creation-works">How ISO creation works</a></li>
<li class="toctree-l2"><a class="reference internal" href="#kickstarts">Kickstarts</a></li>
<li class="toctree-l2"><a class="reference internal" href="#anaconda-image-install-no-virt">Anaconda image install (no-virt)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#ami-images">AMI Images</a></li>
<li class="toctree-l2"><a class="reference internal" href="#appliance-creation">Appliance Creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#filesystem-image-creation">Filesystem Image Creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#tar-file-creation">TAR File Creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#live-image-for-pxe-boot">Live Image for PXE Boot</a></li>
<li class="toctree-l2"><a class="reference internal" href="#atomic-live-image-for-pxe-boot">Atomic Live Image for PXE Boot</a></li>
2018-03-15 20:53:58 +00:00
<li class="toctree-l2"><a class="reference internal" href="#using-mock-and-no-virt-to-create-images">Using Mock and no-virt to Create Images</a></li>
2016-03-18 23:30:48 +00:00
<li class="toctree-l2"><a class="reference internal" href="#using-mock-and-qemu-to-create-images">Using Mock and qemu to Create Images</a></li>
<li class="toctree-l2"><a class="reference internal" href="#openstack-image-creation">OpenStack Image Creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#container-image-creation">Container Image Creation</a></li>
2015-12-04 18:12:19 +00:00
<li class="toctree-l2"><a class="reference internal" href="#open-container-initiative-image-creation">Open Container Initiative Image Creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#vagrant-image-creation">Vagrant Image Creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#creating-uefi-disk-images-with-virt">Creating UEFI disk images with virt</a></li>
<li class="toctree-l2"><a class="reference internal" href="#debugging-problems">Debugging problems</a></li>
<li class="toctree-l2"><a class="reference internal" href="#hacking">Hacking</a></li>
</ul>
</li>
2018-05-16 20:15:10 +00:00
<li class="toctree-l1"><a class="reference internal" href="lorax-composer.html">lorax-composer</a></li>
<li class="toctree-l1"><a class="reference internal" href="composer-cli.html">composer-cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
2016-02-13 00:06:33 +00:00
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul>
2016-02-13 00:06:33 +00:00
2016-02-13 00:06:33 +00:00
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
2018-05-16 20:15:10 +00:00
<nav class="wy-nav-top" aria-label="top navigation">
2017-11-28 17:18:51 +00:00
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a>
</nav>
<div class="wy-nav-content">
2018-05-16 20:15:10 +00:00
<div class="rst-content">
2018-05-16 20:15:10 +00:00
2016-02-13 00:06:33 +00:00
2017-11-28 17:18:51 +00:00
2016-02-13 00:06:33 +00:00
<div role="navigation" aria-label="breadcrumbs navigation">
2017-11-28 17:18:51 +00:00
<ul class="wy-breadcrumbs">
2017-11-28 17:18:51 +00:00
<li><a href="index.html">Docs</a> &raquo;</li>
<li>livemedia-creator</li>
<li class="wy-breadcrumbs-aside">
2017-11-28 17:18:51 +00:00
<a href="_sources/livemedia-creator.rst.txt" rel="nofollow"> View page source</a>
</li>
2017-11-28 17:18:51 +00:00
</ul>
2017-11-28 17:18:51 +00:00
<hr/>
</div>
2016-02-13 00:06:33 +00:00
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="livemedia-creator">
<h1>livemedia-creator<a class="headerlink" href="#livemedia-creator" title="Permalink to this headline"></a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Authors:</th><td class="field-body">Brian C. Lane &lt;<a class="reference external" href="mailto:bcl&#37;&#52;&#48;redhat&#46;com">bcl<span>&#64;</span>redhat<span>&#46;</span>com</a>&gt;</td>
</tr>
</tbody>
</table>
<p>livemedia-creator uses <a class="reference external" href="https://github.com/rhinstaller/anaconda">Anaconda</a>,
<a class="reference external" href="https://github.com/rhinstaller/pykickstart">kickstart</a> and <a class="reference external" href="https://github.com/rhinstaller/lorax">Lorax</a> to create bootable media that use the
same install path as a normal system installation. It can be used to make live
isos, bootable (partitioned) disk images, tarfiles, and filesystem images for
use with virtualization and container solutions like libvirt, docker, and
OpenStack.</p>
2016-03-18 23:30:48 +00:00
<p>The general idea is to use qemu with kickstart and an Anaconda boot.iso to
install into a disk image and then use the disk image to create the bootable
media.</p>
2018-03-15 20:53:58 +00:00
<p>livemedia-creator help will describe all of the options available. At the
minimum you need:</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">--make-iso</span></code> to create a final bootable .iso or one of the other <code class="docutils literal notranslate"><span class="pre">--make-*</span></code> options.</p>
<p><code class="docutils literal notranslate"><span class="pre">--iso</span></code> to specify the Anaconda install media to use with qemu.</p>
<p><code class="docutils literal notranslate"><span class="pre">--ks</span></code> to select the kickstart file describing what to install.</p>
<p>To use livemedia-creator with virtualization you will need to have qemu-kvm installed.</p>
2018-05-16 20:15:10 +00:00
<p>If you are going to be using Anaconda directly, with <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> mode, make sure
2016-03-18 23:30:48 +00:00
you have the anaconda-tui package installed.</p>
<p>Conventions used in this document:</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">lmc</span></code> is an abbreviation for livemedia-creator.</p>
<p><code class="docutils literal notranslate"><span class="pre">builder</span></code> is the system where livemedia-creator is being run</p>
<p><code class="docutils literal notranslate"><span class="pre">image</span></code> is the disk image being created by running livemedia-creator</p>
2016-03-18 23:30:48 +00:00
<div class="section" id="livemedia-creator-cmdline-arguments">
<h2>livemedia-creator cmdline arguments<a class="headerlink" href="#livemedia-creator-cmdline-arguments" title="Permalink to this headline"></a></h2>
<p>Create Live Install Media</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span>
<span class="p">(</span><span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">iso</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">disk</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">fsimage</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">appliance</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ami</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">tar</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">tar</span><span class="o">-</span><span class="n">disk</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">pxe</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ostree</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">oci</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">vagrant</span><span class="p">)</span>
<span class="p">[</span><span class="o">--</span><span class="n">iso</span> <span class="n">ISO</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">iso</span><span class="o">-</span><span class="n">only</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">iso</span><span class="o">-</span><span class="n">name</span> <span class="n">ISO_NAME</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">ks</span> <span class="n">KS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">only</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">virt</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">PROXY</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">anaconda</span><span class="o">-</span><span class="n">arg</span> <span class="n">ANACONDA_ARGS</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">armplatform</span> <span class="n">ARMPLATFORM</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">location</span> <span class="n">LOCATION</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">logfile</span> <span class="n">LOGFILE</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">lorax</span><span class="o">-</span><span class="n">templates</span> <span class="n">LORAX_TEMPLATES</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">tmp</span> <span class="n">TMP</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">resultdir</span> <span class="n">RESULT_DIR</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">macboot</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">nomacboot</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">extra</span><span class="o">-</span><span class="n">boot</span><span class="o">-</span><span class="n">args</span> <span class="n">EXTRA_BOOT_ARGS</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">disk</span><span class="o">-</span><span class="n">image</span> <span class="n">DISK_IMAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">keep</span><span class="o">-</span><span class="n">image</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">fs</span><span class="o">-</span><span class="n">image</span> <span class="n">FS_IMAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">name</span> <span class="n">IMAGE_NAME</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">tar</span><span class="o">-</span><span class="n">disk</span><span class="o">-</span><span class="n">name</span> <span class="n">TAR_DISK_NAME</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">fs</span><span class="o">-</span><span class="n">label</span> <span class="n">FS_LABEL</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">size</span><span class="o">-</span><span class="n">align</span> <span class="n">IMAGE_SIZE_ALIGN</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="nb">type</span> <span class="n">IMAGE_TYPE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">qemu</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">compression</span> <span class="n">COMPRESSION</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">compress</span><span class="o">-</span><span class="n">arg</span> <span class="n">COMPRESS_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">name</span> <span class="n">APP_NAME</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">template</span> <span class="n">APP_TEMPLATE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">file</span> <span class="n">APP_FILE</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">ram</span> <span class="n">MEMORY</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">vcpus</span> <span class="n">VCPUS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">vnc</span> <span class="n">VNC</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">arch</span> <span class="n">ARCH</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">kernel</span><span class="o">-</span><span class="n">args</span> <span class="n">KERNEL_ARGS</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">ovmf</span><span class="o">-</span><span class="n">path</span> <span class="n">OVMF_PATH</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">virt</span><span class="o">-</span><span class="n">uefi</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">kvm</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="k">with</span><span class="o">-</span><span class="n">rng</span> <span class="n">WITH_RNG</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">dracut</span><span class="o">-</span><span class="n">arg</span> <span class="n">DRACUT_ARGS</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">live</span><span class="o">-</span><span class="n">rootfs</span><span class="o">-</span><span class="n">size</span> <span class="n">LIVE_ROOTFS_SIZE</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">live</span><span class="o">-</span><span class="n">rootfs</span><span class="o">-</span><span class="n">keep</span><span class="o">-</span><span class="n">size</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">oci</span><span class="o">-</span><span class="n">config</span> <span class="n">OCI_CONFIG</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">oci</span><span class="o">-</span><span class="n">runtime</span> <span class="n">OCI_RUNTIME</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">vagrant</span><span class="o">-</span><span class="n">metadata</span> <span class="n">VAGRANT_METADATA</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">vagrantfile</span> <span class="n">VAGRANTFILE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">title</span> <span class="n">TITLE</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">project</span> <span class="n">PROJECT</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">releasever</span> <span class="n">RELEASEVER</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">volid</span> <span class="n">VOLID</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">squashfs_args</span> <span class="n">SQUASHFS_ARGS</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">timeout</span> <span class="n">TIMEOUT</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span>
</pre></div>
</div>
<div class="section" id="Named Arguments">
<h3>Named Arguments<a class="headerlink" href="#Named Arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>--make-iso</kbd></td>
<td><p class="first">Build a live iso</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--make-disk</kbd></td>
<td><p class="first">Build a partitioned disk image</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--make-fsimage</kbd></td>
<td><p class="first">Build a filesystem image</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--make-appliance</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Build an appliance image and XML description</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--make-ami</kbd></td>
<td><p class="first">Build an ami image</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--make-tar</kbd></td>
<td><p class="first">Build a tar of the root filesystem</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--make-tar-disk</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Build a tar of a partitioned disk image</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--make-pxe-live</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Build a live pxe boot squashfs image</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--make-ostree-live</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Build a live pxe boot squashfs image of Atomic Host</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--make-oci</kbd></td>
<td><p class="first">Build an Open Container Initiative image</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--make-vagrant</kbd></td>
<td><p class="first">Build a Vagrant Box image</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--iso</kbd></td>
<td>Anaconda installation .iso path to use for qemu</td></tr>
<tr><td class="option-group">
<kbd>--iso-only</kbd></td>
<td><p class="first">Remove all iso creation artifacts except the boot.iso, combine with iso-name to rename the boot.iso</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--iso-name</kbd></td>
<td>Name of output iso file for iso-only. Default is boot.iso</td></tr>
<tr><td class="option-group">
<kbd>--ks</kbd></td>
<td>Kickstart file defining the install.</td></tr>
<tr><td class="option-group">
<kbd>--image-only</kbd></td>
<td><p class="first">Exit after creating fs/disk image.</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--no-virt</kbd></td>
<td><p class="first">Run anaconda directly on host instead of using qemu</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--proxy</kbd></td>
<td>proxy URL to use for the install</td></tr>
<tr><td class="option-group">
<kbd>--anaconda-arg</kbd></td>
<td>Additional argument to pass to anaconda (no-virt mode). Pass once for each argument</td></tr>
<tr><td class="option-group">
<kbd>--armplatform</kbd></td>
<td>the platform to use when creating images for ARM, i.e., highbank, mvebu, omap, tegra, etc.</td></tr>
<tr><td class="option-group">
<kbd>--location</kbd></td>
<td>location of iso directory tree with initrd.img and vmlinuz. Used to run qemu with a newer initrd than the iso.</td></tr>
<tr><td class="option-group">
<kbd>--logfile</kbd></td>
<td><p class="first">Name and path for primary logfile, other logs will be created in the same directory.</p>
<p class="last">Default: ./livemedia.log</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--lorax-templates</kbd></td>
</tr>
<tr><td>&#160;</td><td>Path to mako templates for lorax</td></tr>
<tr><td class="option-group">
<kbd>--tmp</kbd></td>
<td><p class="first">Top level temporary directory</p>
<p class="last">Default: /var/tmp</p>
</td></tr>
<tr><td class="option-group">
<kbd>--resultdir</kbd></td>
<td>Directory to copy the resulting images and iso into. Defaults to the temporary working directory</td></tr>
<tr><td class="option-group">
<kbd>--macboot</kbd></td>
<td><p class="first">Make the iso bootable on UEFI based Mac systems</p>
<p class="last">Default: True</p>
</td></tr>
<tr><td class="option-group">
<kbd>--nomacboot</kbd></td>
<td><p class="first">Do not create a Mac bootable iso</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--extra-boot-args</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Extra arguments to add to the bootloader kernel cmdline in the templates</p>
<p class="last">Default: “”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--title</kbd></td>
<td><p class="first">Substituted for &#64;TITLE&#64; in bootloader config files</p>
<p class="last">Default: “Linux Live Media”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--project</kbd></td>
<td><p class="first">substituted for &#64;PROJECT&#64; in bootloader config files</p>
<p class="last">Default: “Linux”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--releasever</kbd></td>
<td><p class="first">substituted for &#64;VERSION&#64; in bootloader config files</p>
<p class="last">Default: “8”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--volid</kbd></td>
<td>volume id</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--squashfs_args</kbd></td>
</tr>
<tr><td>&#160;</td><td>additional squashfs args</td></tr>
<tr><td class="option-group">
<kbd>--timeout</kbd></td>
<td>Cancel installer after X minutes</td></tr>
<tr><td class="option-group">
<kbd>-V</kbd></td>
<td>show programs version number and exit</td></tr>
</tbody>
</table>
</div>
<div class="section" id="disk/fs image arguments">
<h3>disk/fs image arguments<a class="headerlink" href="#disk/fs image arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>--disk-image</kbd></td>
<td>Path to existing disk image to use for creating final image.</td></tr>
<tr><td class="option-group">
<kbd>--keep-image</kbd></td>
<td><p class="first">Keep raw disk image after .iso creation</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--fs-image</kbd></td>
<td>Path to existing filesystem image to use for creating final image.</td></tr>
<tr><td class="option-group">
<kbd>--image-name</kbd></td>
<td>Name of output file to create. Used for tar, fs and disk image. Default is a random name.</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--tar-disk-name</kbd></td>
</tr>
<tr><td>&#160;</td><td>Name of the archive member for make-tar-disk.</td></tr>
<tr><td class="option-group">
<kbd>--fs-label</kbd></td>
<td><p class="first">Label to set on fsimage, default is Anaconda</p>
<p class="last">Default: “Anaconda”</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--image-size-align</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Create a disk image with a size that is a multiple of this value in MiB.</p>
<p class="last">Default: 0</p>
</td></tr>
<tr><td class="option-group">
<kbd>--image-type</kbd></td>
<td>Create an image with qemu-img. See qemu-img help for supported formats.</td></tr>
<tr><td class="option-group">
<kbd>--qemu-arg</kbd></td>
<td><p class="first">Arguments to pass to qemu-img. Pass once for each argument, they will be used for ALL calls to qemu-img.</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>--qcow2</kbd></td>
<td><p class="first">Create qcow2 image instead of raw sparse image when making disk images.</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--qcow2-arg</kbd></td>
<td><p class="first">Arguments to pass to qemu-img. Pass once for each argument, they will be used for ALL calls to qemu-img.</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>--compression</kbd></td>
<td><p class="first">Compression binary for make-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default.</p>
<p class="last">Default: “xz”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--compress-arg</kbd></td>
<td><p class="first">Arguments to pass to compression. Pass once for each argument</p>
<p class="last">Default: []</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="appliance arguments">
<h3>appliance arguments<a class="headerlink" href="#appliance arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>--app-name</kbd></td>
<td>Name of appliance to pass to template</td></tr>
<tr><td class="option-group">
<kbd>--app-template</kbd></td>
<td>Path to template to use for appliance data.</td></tr>
<tr><td class="option-group">
<kbd>--app-file</kbd></td>
<td><p class="first">Appliance template results file.</p>
<p class="last">Default: “appliance.xml”</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qemu arguments">
<h3>qemu arguments<a class="headerlink" href="#qemu arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>--ram</kbd></td>
<td><p class="first">Memory to allocate for installer in megabytes.</p>
<p class="last">Default: 1024</p>
</td></tr>
<tr><td class="option-group">
<kbd>--vcpus</kbd></td>
<td>Passed to qemu -smp command</td></tr>
<tr><td class="option-group">
<kbd>--vnc</kbd></td>
<td>Passed to qemu -display command. eg. vnc=127.0.0.1:5, default is to choose the first unused vnc port.</td></tr>
<tr><td class="option-group">
<kbd>--arch</kbd></td>
<td>System arch to build for. Used to select qemu-system-* command. Defaults to qemu-system-&lt;arch&gt;</td></tr>
<tr><td class="option-group">
<kbd>--kernel-args</kbd></td>
<td>Additional argument to pass to the installation kernel</td></tr>
<tr><td class="option-group">
<kbd>--ovmf-path</kbd></td>
<td><p class="first">Path to OVMF firmware</p>
<p class="last">Default: “/usr/share/edk2/ovmf/”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--virt-uefi</kbd></td>
<td><p class="first">Use OVMF firmware to boot the VM in UEFI mode</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--no-kvm</kbd></td>
<td><p class="first">Skip using kvm with qemu even if it is available.</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--with-rng</kbd></td>
<td><p class="first">RNG device for QEMU (none for no RNG)</p>
<p class="last">Default: “/dev/random”</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="dracut arguments">
<h3>dracut arguments<a class="headerlink" href="#dracut arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>--dracut-arg</kbd></td>
<td>Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument. NOTE: this overrides the default. (default: )</td></tr>
</tbody>
</table>
</div>
<div class="section" id="pxe to live arguments">
<h3>pxe to live arguments<a class="headerlink" href="#pxe to live arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd>--live-rootfs-size</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Size of root filesystem of live image in GiB</p>
<p class="last">Default: 0</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--live-rootfs-keep-size</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Keep the original size of root filesystem in live image</p>
<p class="last">Default: False</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="OCI arguments">
<h3>OCI arguments<a class="headerlink" href="#OCI arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>--oci-config</kbd></td>
<td>config.json OCI configuration file</td></tr>
<tr><td class="option-group">
<kbd>--oci-runtime</kbd></td>
<td>runtime.json OCI configuration file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="Vagrant arguments">
<h3>Vagrant arguments<a class="headerlink" href="#Vagrant arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd>--vagrant-metadata</kbd></td>
</tr>
<tr><td>&#160;</td><td>optional metadata.json file</td></tr>
<tr><td class="option-group">
<kbd>--vagrantfile</kbd></td>
<td>optional vagrantfile</td></tr>
</tbody>
</table>
</div>
2016-03-18 23:30:48 +00:00
</div>
<div class="section" id="quickstart">
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h2>
<p>Run this to create a bootable live iso:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">iso</span> \
<span class="o">--</span><span class="n">iso</span><span class="o">=/</span><span class="n">extra</span><span class="o">/</span><span class="n">iso</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span> <span class="o">--</span><span class="n">ks</span><span class="o">=./</span><span class="n">docs</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">livemedia</span><span class="o">.</span><span class="n">ks</span>
</pre></div>
</div>
<p>You can run it directly from the lorax git repo like this:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \
--make-iso --iso=/extra/iso/boot.iso \
--ks=./docs/rhel-livemedia.ks --lorax-templates=./share/
</pre></div>
</div>
2016-03-18 23:30:48 +00:00
<p>You can observe the installation using vnc. The logs will show what port was
2018-05-16 20:15:10 +00:00
chosen, or you can use a specific port by passing it. eg. <code class="docutils literal notranslate"><span class="pre">--vnc</span> <span class="pre">vnc:127.0.0.1:5</span></code></p>
<p>This is usually a good idea when testing changes to the kickstart. lmc tries
to monitor the logs for fatal errors, but may not catch everything.</p>
</div>
<div class="section" id="how-iso-creation-works">
<h2>How ISO creation works<a class="headerlink" href="#how-iso-creation-works" title="Permalink to this headline"></a></h2>
<p>There are 2 stages, the install stage which produces a disk or filesystem image
as its output, and the boot media creation which uses the image as its input.
Normally you would run both stages, but it is possible to stop after the
2018-05-16 20:15:10 +00:00
install stage, by using <code class="docutils literal notranslate"><span class="pre">--image-only</span></code>, or to skip the install stage and use
a previously created disk image by passing <code class="docutils literal notranslate"><span class="pre">--disk-image</span></code> or <code class="docutils literal notranslate"><span class="pre">--fs-image</span></code></p>
2016-03-18 23:30:48 +00:00
<p>When creating an iso qemu boots using the passed Anaconda installer iso
2018-05-16 20:15:10 +00:00
and installs the system based on the kickstart. The <code class="docutils literal notranslate"><span class="pre">%post</span></code> section of the
kickstart is used to customize the installed system in the same way that
current spin-kickstarts do.</p>
<p>livemedia-creator monitors the install process for problems by watching the
install logs. They are written to the current directory or to the base
2018-03-15 20:53:58 +00:00
directory specified by the logfile command. You can also monitor the install
2016-03-18 23:30:48 +00:00
by using a vnc client. This is recommended when first modifying a kickstart,
since there are still places where Anaconda may get stuck without the log
monitor catching it.</p>
<p>The output from this process is a partitioned disk image. kpartx can be used
to mount and examine it when there is a problem with the install. It can also
be booted using kvm.</p>
2018-03-15 20:53:58 +00:00
<p>When creating an iso the disk images / partition is copied into a formatted
2016-03-18 23:30:48 +00:00
filesystem image which is then used as the input to lorax for creation of the
final media.</p>
<p>The final image is created by lorax, using the templates in /usr/share/lorax/live/
2018-05-16 20:15:10 +00:00
or the live directory below the directory specified by <code class="docutils literal notranslate"><span class="pre">--lorax-templates</span></code>. The
2016-03-18 23:30:48 +00:00
templates are written using the Mako template system with some extra commands
added by lorax.</p>
2016-02-13 00:06:33 +00:00
<div class="admonition note">
<p class="first admonition-title">Note</p>
2018-03-15 20:53:58 +00:00
<p class="last">The output from make-iso includes the artifacts used to create the boot.iso;
2016-02-13 00:06:33 +00:00
the kernel, initrd, the squashfs filesystem, etc. If you only want the
2018-05-16 20:15:10 +00:00
boot.iso you can pass <code class="docutils literal notranslate"><span class="pre">--iso-only</span></code> and the other files will be removed. You
can also name the iso by using <code class="docutils literal notranslate"><span class="pre">--iso-name</span> <span class="pre">my-live.iso</span></code>.</p>
2016-02-13 00:06:33 +00:00
</div>
</div>
<div class="section" id="kickstarts">
<h2>Kickstarts<a class="headerlink" href="#kickstarts" title="Permalink to this headline"></a></h2>
<p>The docs/ directory includes several example kickstarts, one to create a live
desktop iso using GNOME, and another to create a minimal disk image. When
creating your own kickstarts you should start with the minimal example, it
includes several needed packages that are not always included by dependencies.</p>
<p>Or you can use existing spin kickstarts to create live media with a few
changes. Here are the steps I used to convert the Fedora XFCE spin.</p>
<ol class="arabic">
<li><p class="first">Flatten the xfce kickstart using ksflatten</p>
</li>
2018-03-15 20:53:58 +00:00
<li><p class="first">Add zerombr so you dont get the disk init dialog</p>
</li>
2018-03-15 20:53:58 +00:00
<li><p class="first">Add clearpart all</p>
</li>
<li><p class="first">Add swap partition</p>
</li>
<li><p class="first">bootloader target</p>
</li>
<li><p class="first">Add shutdown to the kickstart</p>
</li>
2018-03-15 20:53:58 +00:00
<li><p class="first">Add network bootproto=dhcp activate to activate the network
This works for F16 builds but for F15 and before you need to pass
something on the cmdline that activate the network, like sshd:</p>
<blockquote>
2018-05-16 20:15:10 +00:00
<div><p><code class="docutils literal notranslate"><span class="pre">livemedia-creator</span> <span class="pre">--kernel-args=&quot;sshd&quot;</span></code></p>
</div></blockquote>
</li>
<li><p class="first">Add a root password:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rootpw</span> <span class="n">rootme</span>
2016-11-29 17:27:44 +00:00
<span class="n">network</span> <span class="o">--</span><span class="n">bootproto</span><span class="o">=</span><span class="n">dhcp</span> <span class="o">--</span><span class="n">activate</span>
<span class="n">zerombr</span>
<span class="n">clearpart</span> <span class="o">--</span><span class="nb">all</span>
<span class="n">bootloader</span> <span class="o">--</span><span class="n">location</span><span class="o">=</span><span class="n">mbr</span>
<span class="n">part</span> <span class="n">swap</span> <span class="o">--</span><span class="n">size</span><span class="o">=</span><span class="mi">512</span>
<span class="n">shutdown</span>
</pre></div>
</div>
</li>
<li><p class="first">In the livesys script section of the %post remove the root password. This
really depends on how the spin wants to work. You could add the live user
that you create to the %wheel group so that sudo works if you wanted to.</p>
<blockquote>
2018-05-16 20:15:10 +00:00
<div><p><code class="docutils literal notranslate"><span class="pre">passwd</span> <span class="pre">-d</span> <span class="pre">root</span> <span class="pre">&gt;</span> <span class="pre">/dev/null</span></code></p>
</div></blockquote>
</li>
<li><p class="first">Remove /etc/fstab in %post, dracut handles mounting the rootfs</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">cat</span> <span class="pre">/dev/null</span> <span class="pre">&gt;</span> <span class="pre">/dev/fstab</span></code></p>
2018-03-15 20:53:58 +00:00
<p>Do this only for live isos, the filesystem will be mounted read only if
there is no /etc/fstab</p>
</li>
2018-03-15 20:53:58 +00:00
<li><p class="first">Dont delete initramfs files from /boot in %post</p>
</li>
2018-03-15 20:53:58 +00:00
<li><p class="first">When creating live isos you need to have, at least, these packages in the %package section::
2015-10-07 18:25:53 +00:00
dracut-config-generic
dracut-live
-dracut-config-rescue
grub-efi
memtest86+
syslinux</p>
</li>
</ol>
2016-03-18 23:30:48 +00:00
<p>One drawback to using qemu is that it pulls the packages from the repo each
time you run it. To speed things up you either need a local mirror of the
packages, or you can use a caching proxy. When using a proxy you pass it to
livemedia-creator like this:</p>
<blockquote>
2018-05-16 20:15:10 +00:00
<div><code class="docutils literal notranslate"><span class="pre">--proxy=http://proxy.yourdomain.com:3128</span></code></div></blockquote>
<p>You also need to use a specific mirror instead of mirrormanager so that the
packages will get cached, so your kickstart url would look like:</p>
<blockquote>
2018-05-16 20:15:10 +00:00
<div><code class="docutils literal notranslate"><span class="pre">url</span> <span class="pre">--url=&quot;http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/&quot;</span></code></div></blockquote>
2018-03-15 20:53:58 +00:00
<p>You can also add an update repo, but dont name it updates. Add proxy to it
2016-03-18 23:30:48 +00:00
as well.</p>
</div>
<div class="section" id="anaconda-image-install-no-virt">
<h2>Anaconda image install (no-virt)<a class="headerlink" href="#anaconda-image-install-no-virt" title="Permalink to this headline"></a></h2>
2018-05-16 20:15:10 +00:00
<p>You can create images without using qemu by passing <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> on the
2018-03-15 20:53:58 +00:00
cmdline. This will use Anacondas directory install feature to handle the
2016-03-18 23:30:48 +00:00
install. There are a couple of things to keep in mind when doing this:</p>
<ol class="arabic simple">
<li>It will be most reliable when building images for the same release that the
host is running. Because Anaconda has expectations about the system it is
running under you may encounter strange bugs if you try to build newer or
older releases.</li>
2018-03-15 20:53:58 +00:00
<li>It may totally trash your host. So far I havent had this happen, but the
possibility exists that a bug in Anaconda could result in it operating on
real devices. I recommend running it in a virt or on a system that you can
afford to lose all data from.</li>
</ol>
<p>The logs from anaconda will be placed in an ./anaconda/ directory in either
2018-03-15 20:53:58 +00:00
the current directory or in the directory used for logfile</p>
<p>Example cmdline:</p>
<p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">livemedia-creator</span> <span class="pre">--make-iso</span> <span class="pre">--no-virt</span> <span class="pre">--ks=./rhel-livemedia.ks</span></code></p>
2015-12-04 18:12:19 +00:00
<div class="admonition note">
<p class="first admonition-title">Note</p>
2018-03-15 20:53:58 +00:00
<p class="last">Using no-virt to create a partitioned disk image (eg. make-disk or
make-vagrant) will only create disks usable on the host platform (BIOS
2015-12-04 18:12:19 +00:00
or UEFI). You can create BIOS partitioned disk images on UEFI by using
virt.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">As of version 30.7 SELinux can be set to Enforcing. The current state is
logged for debugging purposes and if there are SELinux denials they should
be reported as a bug.</p>
</div>
</div>
<div class="section" id="ami-images">
<h2>AMI Images<a class="headerlink" href="#ami-images" title="Permalink to this headline"></a></h2>
2018-03-15 20:53:58 +00:00
<p>Amazon EC2 images can be created by using the make-ami switch and an appropriate
kickstart file. All of the work to customize the image is handled by the kickstart.
The example currently included was modified from the cloud-kickstarts version so
that it would work with livemedia-creator.</p>
<p>Example cmdline:</p>
<p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">livemedia-creator</span> <span class="pre">--make-ami</span> <span class="pre">--iso=/path/to/boot.iso</span> <span class="pre">--ks=./docs/rhel-livemedia-ec2.ks</span></code></p>
<p>This will produce an ami-root.img file in the working directory.</p>
<p>At this time I have not tested the image with EC2. Feedback would be welcome.</p>
</div>
<div class="section" id="appliance-creation">
<h2>Appliance Creation<a class="headerlink" href="#appliance-creation" title="Permalink to this headline"></a></h2>
2018-03-15 20:53:58 +00:00
<p>livemedia-creator can now replace appliance-tools by using the make-appliance
switch. This will create the partitioned disk image and an XML file that can be
used with virt-image to setup a virtual system.</p>
<p>The XML is generated using the Mako template from
/usr/share/lorax/appliance/libvirt.xml You can use a different template by
2018-05-16 20:15:10 +00:00
passing <code class="docutils literal notranslate"><span class="pre">--app-template</span> <span class="pre">&lt;template</span> <span class="pre">path&gt;</span></code></p>
<p>Documentation on the Mako template system can be found at the <a class="reference external" href="http://docs.makotemplates.org/en/latest/index.html">Mako site</a></p>
<p>The name of the final output XML is appliance.xml, this can be changed with
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">--app-file</span> <span class="pre">&lt;file</span> <span class="pre">path&gt;</span></code></p>
<p>The following variables are passed to the template:</p>
<blockquote>
<div><dl class="docutils">
2018-05-16 20:15:10 +00:00
<dt><code class="docutils literal notranslate"><span class="pre">disks</span></code></dt>
<dd><p class="first">A list of disk_info about each disk.
Each entry has the following attributes:</p>
<blockquote class="last">
2018-05-16 20:15:10 +00:00
<div><p><code class="docutils literal notranslate"><span class="pre">name</span></code>
base name of the disk image file</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">format</span></code>
2018-03-15 20:53:58 +00:00
“raw”</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">checksum_type</span></code>
2018-03-15 20:53:58 +00:00
“sha256”</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">checksum</span></code>
sha256 checksum of the disk image</p>
</div></blockquote>
</dd>
</dl>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">name</span></code>
2018-03-15 20:53:58 +00:00
Name of appliance, from app-name argument</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">arch</span></code>
Architecture</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">memory</span></code>
Memory in KB (from <code class="docutils literal notranslate"><span class="pre">--ram</span></code>)</p>
<p><code class="docutils literal notranslate"><span class="pre">vcpus</span></code>
from <code class="docutils literal notranslate"><span class="pre">--vcpus</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">networks</span></code>
list of networks from the kickstart or []</p>
2018-05-16 20:15:10 +00:00
<p><code class="docutils literal notranslate"><span class="pre">title</span></code>
from <code class="docutils literal notranslate"><span class="pre">--title</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">project</span></code>
from <code class="docutils literal notranslate"><span class="pre">--project</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">releasever</span></code>
from <code class="docutils literal notranslate"><span class="pre">--releasever</span></code></p>
</div></blockquote>
<p>The created image can be imported into libvirt using:</p>
<blockquote>
2018-05-16 20:15:10 +00:00
<div><code class="docutils literal notranslate"><span class="pre">virt-image</span> <span class="pre">appliance.xml</span></code></div></blockquote>
<p>You can also create qcow2 appliance images using <code class="docutils literal notranslate"><span class="pre">--image-type=qcow2</span></code>, for example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">appliance</span> <span class="o">--</span><span class="n">iso</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span> <span class="o">--</span><span class="n">ks</span><span class="o">=./</span><span class="n">docs</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">minimal</span><span class="o">.</span><span class="n">ks</span> \
2016-11-29 17:27:44 +00:00
<span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="nb">type</span><span class="o">=</span><span class="n">qcow2</span> <span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">file</span><span class="o">=</span><span class="n">minimal</span><span class="o">-</span><span class="n">test</span><span class="o">.</span><span class="n">xml</span> <span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">name</span><span class="o">=</span><span class="n">minimal</span><span class="o">-</span><span class="n">test</span><span class="o">.</span><span class="n">img</span>
</pre></div>
</div>
</div>
<div class="section" id="filesystem-image-creation">
<h2>Filesystem Image Creation<a class="headerlink" href="#filesystem-image-creation" title="Permalink to this headline"></a></h2>
2016-03-18 23:30:48 +00:00
<p>livemedia-creator can be used to create un-partitined filesystem images using
2018-05-16 20:15:10 +00:00
the <code class="docutils literal notranslate"><span class="pre">--make-fsimage</span></code> option. As of version 21.8 this works with both qemu and
2016-03-18 23:30:48 +00:00
no-virt modes of operation. Previously it was only available with no-virt.</p>
<p>Kickstarts should have a single / partition with no extra mountpoints.</p>
<blockquote>
<div><code class="docutils literal notranslate"><span class="pre">livemedia-creator</span> <span class="pre">--make-fsimage</span> <span class="pre">--iso=/path/to/boot.iso</span> <span class="pre">--ks=./docs/rhel-minimal.ks</span></code></div></blockquote>
2018-05-16 20:15:10 +00:00
<p>You can name the output image with <code class="docutils literal notranslate"><span class="pre">--image-name</span></code> and set a label on the filesystem with <code class="docutils literal notranslate"><span class="pre">--fs-label</span></code></p>
</div>
<div class="section" id="tar-file-creation">
<h2>TAR File Creation<a class="headerlink" href="#tar-file-creation" title="Permalink to this headline"></a></h2>
2018-05-16 20:15:10 +00:00
<p>The <code class="docutils literal notranslate"><span class="pre">--make-tar</span></code> command can be used to create a tar of the root filesystem. By
default it is compressed using xz, but this can be changed using the
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">--compression</span></code> and <code class="docutils literal notranslate"><span class="pre">--compress-arg</span></code> options. This option works with both virt and
no-virt install methods.</p>
2018-05-16 20:15:10 +00:00
<p>As with <code class="docutils literal notranslate"><span class="pre">--make-fsimage</span></code> the kickstart should be limited to a single / partition.</p>
<p>For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">tar</span> <span class="o">--</span><span class="n">iso</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span> <span class="o">--</span><span class="n">ks</span><span class="o">=./</span><span class="n">docs</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">minimal</span><span class="o">.</span><span class="n">ks</span> \
<span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">name</span><span class="o">=</span><span class="n">rhel</span><span class="o">-</span><span class="n">root</span><span class="o">.</span><span class="n">tar</span><span class="o">.</span><span class="n">xz</span>
</pre></div>
</div>
</div>
<div class="section" id="live-image-for-pxe-boot">
<h2>Live Image for PXE Boot<a class="headerlink" href="#live-image-for-pxe-boot" title="Permalink to this headline"></a></h2>
2018-05-16 20:15:10 +00:00
<p>The <code class="docutils literal notranslate"><span class="pre">--make-pxe-live</span></code> command will produce squashfs image containing live root
filesystem that can be used for pxe boot. Directory with results will contain
the live image, kernel image, initrd image and template of pxe configuration
for the images.</p>
</div>
<div class="section" id="atomic-live-image-for-pxe-boot">
<h2>Atomic Live Image for PXE Boot<a class="headerlink" href="#atomic-live-image-for-pxe-boot" title="Permalink to this headline"></a></h2>
2018-05-16 20:15:10 +00:00
<p>The <code class="docutils literal notranslate"><span class="pre">--make-ostree-live</span></code> command will produce the same result as <code class="docutils literal notranslate"><span class="pre">--make-pxe-live</span></code>
for installations of Atomic Host. Example kickstart for such an installation
using Atomic installer iso with local repo included in the image can be found
in docs/rhel-atomic-pxe-live.ks.</p>
2018-05-16 20:15:10 +00:00
<p>The PXE images can also be created with <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> by using the example
kickstart in docs/rhel-atomic-pxe-live-novirt.ks. This also works inside the
2016-05-23 23:55:51 +00:00
mock environment.</p>
</div>
2016-03-18 23:30:48 +00:00
<div class="section" id="using-mock-and-no-virt-to-create-images">
2018-03-15 20:53:58 +00:00
<h2>Using Mock and no-virt to Create Images<a class="headerlink" href="#using-mock-and-no-virt-to-create-images" title="Permalink to this headline"></a></h2>
<p>As of lorax version 22.2 you can use livemedia-creator and anaconda version
2018-03-15 20:53:58 +00:00
22.15 inside of a mock chroot with make-iso and make-fsimage.</p>
2015-10-07 18:25:53 +00:00
<div class="admonition note">
<p class="first admonition-title">Note</p>
2018-05-16 20:15:10 +00:00
<p class="last">As of mock 1.3.4 you need to use <code class="docutils literal notranslate"><span class="pre">--old-chroot</span></code> with mock. Mock now defaults to using systemd-nspawn
which cannot create the needed loop device nodes. Passing <code class="docutils literal notranslate"><span class="pre">--old-chroot</span></code> will use the old system
where <code class="docutils literal notranslate"><span class="pre">/dev/loop*</span></code> is setup for you.</p>
2015-10-07 18:25:53 +00:00
</div>
<p>On the host system:</p>
<ol class="arabic">
<li><p class="first">yum install -y mock</p>
</li>
<li><p class="first">Add a user to the mock group to use for running mock. eg. builder</p>
</li>
<li><p class="first">Create a new /etc/mock/ config file based on the rawhide one, or modify the
existing one so that the following options are setup:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config_opts</span><span class="p">[</span><span class="s1">&#39;chroot_setup_cmd&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;install @buildsys-build anaconda-tui lorax&#39;</span>
2016-05-23 23:55:51 +00:00
<span class="c1"># build results go into /home/builder/results/</span>
<span class="n">config_opts</span><span class="p">[</span><span class="s1">&#39;plugin_conf&#39;</span><span class="p">][</span><span class="s1">&#39;bind_mount_opts&#39;</span><span class="p">][</span><span class="s1">&#39;dirs&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s1">&#39;/home/builder/results&#39;</span><span class="p">,</span><span class="s1">&#39;/results/&#39;</span><span class="p">))</span>
</pre></div>
</div>
2015-10-07 18:25:53 +00:00
<p>If you are creating images for a branched release of Fedora you should also enable
the updates-testing repository so that you get the latest builds in your mock chroot.</p>
</li>
</ol>
<p>The following steps are run as the builder user who is a member of the mock
group.</p>
2015-10-07 18:25:53 +00:00
<ol class="arabic" start="4">
<li><p class="first">Make a directory for results matching the bind mount above
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">mkdir</span> <span class="pre">~/results/</span></code></p>
</li>
<li><p class="first">Copy the example kickstarts
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">cp</span> <span class="pre">/usr/share/docs/lorax/*ks</span> <span class="pre">.</span></code></p>
</li>
<li><p class="first">Make sure tar and dracut-network are in the %packages section and that the
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">url</span> <span class="pre">points</span> <span class="pre">to</span> <span class="pre">the</span> <span class="pre">correct</span> <span class="pre">repo</span></code></p>
</li>
<li><p class="first">Init the mock
<code class="docutils literal notranslate"><span class="pre">mock</span> <span class="pre">-r</span> <span class="pre">rhel-8-x86_64</span> <span class="pre">--old-chroot</span> <span class="pre">--init</span></code></p>
</li>
<li><p class="first">Copy the kickstart inside the mock
<code class="docutils literal notranslate"><span class="pre">mock</span> <span class="pre">-r</span> <span class="pre">rhel-8-x86_64</span> <span class="pre">--old-chroot</span> <span class="pre">--copyin</span> <span class="pre">./rhel-minimal.ks</span> <span class="pre">/root/</span></code></p>
</li>
<li><p class="first">Make a minimal iso:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mock</span> <span class="o">-</span><span class="n">r</span> <span class="n">rhel</span><span class="o">-</span><span class="mi">8</span><span class="o">-</span><span class="n">x86_64</span> <span class="o">--</span><span class="n">old</span><span class="o">-</span><span class="n">chroot</span> <span class="o">--</span><span class="n">chroot</span> <span class="o">--</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">virt</span> \
2016-11-29 17:27:44 +00:00
<span class="o">--</span><span class="n">resultdir</span><span class="o">=/</span><span class="n">results</span><span class="o">/</span><span class="k">try</span><span class="o">-</span><span class="mi">1</span> <span class="o">--</span><span class="n">logfile</span><span class="o">=/</span><span class="n">results</span><span class="o">/</span><span class="n">logs</span><span class="o">/</span><span class="k">try</span><span class="o">-</span><span class="mi">1</span><span class="o">/</span><span class="k">try</span><span class="o">-</span><span class="mf">1.</span><span class="n">log</span> \
<span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">iso</span> <span class="o">--</span><span class="n">ks</span> <span class="o">/</span><span class="n">root</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">minimal</span><span class="o">.</span><span class="n">ks</span>
</pre></div>
</div>
</li>
</ol>
<p>Results will be in ./results/try-1 and logs under /results/logs/try-1/
including anaconda logs and livemedia-creator logs. The new iso will be
located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/
directory tree will also contain the vmlinuz, initrd, etc.</p>
</div>
2016-03-18 23:30:48 +00:00
<div class="section" id="using-mock-and-qemu-to-create-images">
<h2>Using Mock and qemu to Create Images<a class="headerlink" href="#using-mock-and-qemu-to-create-images" title="Permalink to this headline"></a></h2>
<p>Version 25.0 of livemedia-creator switches to using qemu for virtualization.
This allows creation of all image types, and use of the KVM on the host if
/dev/kvm is present in the mock environment.</p>
<p>On the host system:</p>
<ol class="arabic">
<li><p class="first">yum install -y mock</p>
</li>
<li><p class="first">Add a user to the mock group to use for running mock. eg. builder</p>
</li>
<li><p class="first">Create a new /etc/mock/ config file based on the rawhide one, or modify the
existing one so that the following options are setup:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config_opts</span><span class="p">[</span><span class="s1">&#39;chroot_setup_cmd&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;install @buildsys-build lorax qemu&#39;</span>
2016-03-18 23:30:48 +00:00
2016-05-23 23:55:51 +00:00
<span class="c1"># build results go into /home/builder/results/</span>
<span class="n">config_opts</span><span class="p">[</span><span class="s1">&#39;plugin_conf&#39;</span><span class="p">][</span><span class="s1">&#39;bind_mount_opts&#39;</span><span class="p">][</span><span class="s1">&#39;dirs&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s1">&#39;/home/builder/results&#39;</span><span class="p">,</span><span class="s1">&#39;/results/&#39;</span><span class="p">))</span>
2016-03-18 23:30:48 +00:00
</pre></div>
</div>
<p>If you are creating images for a branched release of Fedora you should also enable
the updates-testing repository so that you get the latest builds in your mock chroot.</p>
</li>
</ol>
<p>The following steps are run as the builder user who is a member of the mock
group.</p>
<ol class="arabic" start="4">
<li><p class="first">Make a directory for results matching the bind mount above
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">mkdir</span> <span class="pre">~/results/</span></code></p>
2016-03-18 23:30:48 +00:00
</li>
<li><p class="first">Copy the example kickstarts
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">cp</span> <span class="pre">/usr/share/docs/lorax/*ks</span> <span class="pre">.</span></code></p>
2016-03-18 23:30:48 +00:00
</li>
<li><p class="first">Make sure tar and dracut-network are in the %packages section and that the
2018-05-16 20:15:10 +00:00
<code class="docutils literal notranslate"><span class="pre">url</span> <span class="pre">points</span> <span class="pre">to</span> <span class="pre">the</span> <span class="pre">correct</span> <span class="pre">repo</span></code></p>
2016-03-18 23:30:48 +00:00
</li>
<li><p class="first">Init the mock
<code class="docutils literal notranslate"><span class="pre">mock</span> <span class="pre">-r</span> <span class="pre">rhel-8-x86_64</span> <span class="pre">--old-chroot</span> <span class="pre">--init</span></code></p>
2016-03-18 23:30:48 +00:00
</li>
<li><p class="first">Copy the kickstart inside the mock
<code class="docutils literal notranslate"><span class="pre">mock</span> <span class="pre">-r</span> <span class="pre">rhel-8-x86_64</span> <span class="pre">--old-chroot</span> <span class="pre">--copyin</span> <span class="pre">./rhel-minimal.ks</span> <span class="pre">/root/</span></code></p>
2016-03-18 23:30:48 +00:00
</li>
<li><p class="first">Copy the Anaconda boot.iso inside the mock
<code class="docutils literal notranslate"><span class="pre">mock</span> <span class="pre">-r</span> <span class="pre">rhel-8-x86_64</span> <span class="pre">--old-chroot</span> <span class="pre">--copyin</span> <span class="pre">./boot.iso</span> <span class="pre">/root/</span></code></p>
2016-03-18 23:30:48 +00:00
</li>
<li><p class="first">Make a minimal iso:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mock</span> <span class="o">-</span><span class="n">r</span> <span class="n">rhel</span><span class="o">-</span><span class="mi">8</span><span class="o">-</span><span class="n">x86_64</span> <span class="o">--</span><span class="n">old</span><span class="o">-</span><span class="n">chroot</span> <span class="o">--</span><span class="n">chroot</span> <span class="o">--</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> \
2016-11-29 17:27:44 +00:00
<span class="o">--</span><span class="n">resultdir</span><span class="o">=/</span><span class="n">results</span><span class="o">/</span><span class="k">try</span><span class="o">-</span><span class="mi">1</span> <span class="o">--</span><span class="n">logfile</span><span class="o">=/</span><span class="n">results</span><span class="o">/</span><span class="n">logs</span><span class="o">/</span><span class="k">try</span><span class="o">-</span><span class="mi">1</span><span class="o">/</span><span class="k">try</span><span class="o">-</span><span class="mf">1.</span><span class="n">log</span> \
<span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">iso</span> <span class="o">--</span><span class="n">ks</span> <span class="o">/</span><span class="n">root</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">minimal</span><span class="o">.</span><span class="n">ks</span> <span class="o">--</span><span class="n">iso</span> <span class="o">/</span><span class="n">root</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span>
2016-03-18 23:30:48 +00:00
</pre></div>
</div>
</li>
</ol>
<p>Results will be in ./results/try-1 and logs under /results/logs/try-1/
including anaconda logs and livemedia-creator logs. The new iso will be
located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/
directory tree will also contain the vmlinuz, initrd, etc.</p>
<p>This will run qemu without kvm support, which is going to be very slow. You can
2018-05-16 20:15:10 +00:00
add <code class="docutils literal notranslate"><span class="pre">mknod</span> <span class="pre">/dev/kvm</span> <span class="pre">c</span> <span class="pre">10</span> <span class="pre">232;</span></code> to create the device node before running lmc.</p>
2016-03-18 23:30:48 +00:00
</div>
<div class="section" id="openstack-image-creation">
<h2>OpenStack Image Creation<a class="headerlink" href="#openstack-image-creation" title="Permalink to this headline"></a></h2>
2018-05-16 20:15:10 +00:00
<p>OpenStack supports partitioned disk images so <code class="docutils literal notranslate"><span class="pre">--make-disk</span></code> can be used to
2018-03-15 20:53:58 +00:00
create images for importing into glance, OpenStacks image storage component.
You need to have access to an OpenStack provider that allows image uploads, or
2015-12-04 18:12:19 +00:00
setup your own using the instructions from the <a class="reference external" href="https://www.rdoproject.org/Quickstart">RDO Project</a>.</p>
<p>The example kickstart, rhel-openstack.ks, is only slightly different than the
rhel-minimal.ks one. It adds the cloud-init and cloud-utils-growpart
packages. OpenStack supports setting up the image using cloud-init, and
2018-03-15 20:53:58 +00:00
cloud-utils-growpart will grow the image to fit the instances disk size.</p>
<p>Create a qcow2 image using the kickstart like this:</p>
<blockquote>
<div><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">livemedia-creator</span> <span class="pre">--make-disk</span> <span class="pre">--iso=/path/to/boot.iso</span> <span class="pre">--ks=/path/to/rhel-openstack.ks</span> <span class="pre">--image-type=qcow2</span></code></div></blockquote>
<div class="admonition note">
<p class="first admonition-title">Note</p>
2018-05-16 20:15:10 +00:00
<p class="last">On the RHEL7 version of lmc <code class="docutils literal notranslate"><span class="pre">--image-type</span></code> isnt supported. You can only create a bare partitioned disk image.</p>
</div>
<p>Import the resulting disk image into the OpenStack system, either via the web UI, or glance on the cmdline:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">glance</span> <span class="n">image</span><span class="o">-</span><span class="n">create</span> <span class="o">--</span><span class="n">name</span> <span class="s2">&quot;rhel-openstack&quot;</span> <span class="o">--</span><span class="ow">is</span><span class="o">-</span><span class="n">public</span> <span class="n">true</span> <span class="o">--</span><span class="n">disk</span><span class="o">-</span><span class="nb">format</span> <span class="n">qcow2</span> \
<span class="o">--</span><span class="n">container</span><span class="o">-</span><span class="nb">format</span> <span class="n">bare</span> <span class="o">--</span><span class="n">file</span> <span class="o">./</span><span class="n">rhel</span><span class="o">-</span><span class="n">openstack</span><span class="o">.</span><span class="n">qcow2</span>
</pre></div>
</div>
2018-05-16 20:15:10 +00:00
<p>If qcow2 wasnt used then <code class="docutils literal notranslate"><span class="pre">--disk-format</span></code> should be set to raw.</p>
</div>
<div class="section" id="container-image-creation">
<h2>Container Image Creation<a class="headerlink" href="#container-image-creation" title="Permalink to this headline"></a></h2>
<p>Use lmc to create a tarfile as described in the <a class="reference internal" href="#tar-file-creation">TAR File Creation</a> section, but substitute the
rhel-container.ks example kickstart which removes the requirement for core files and the kernel.</p>
<p>You can then import the tarfile into podman or docker like this:</p>
<blockquote>
<div><code class="docutils literal notranslate"><span class="pre">podman</span> <span class="pre">import</span> <span class="pre">/var/tmp/root.tar.xz</span> <span class="pre">rhel-root</span></code></div></blockquote>
<p>And then run bash inside of it:</p>
<blockquote>
<div><code class="docutils literal notranslate"><span class="pre">podman</span> <span class="pre">run</span> <span class="pre">-i</span> <span class="pre">-t</span> <span class="pre">rhel-root</span> <span class="pre">/bin/bash</span></code></div></blockquote>
</div>
2015-12-04 18:12:19 +00:00
<div class="section" id="open-container-initiative-image-creation">
<h2>Open Container Initiative Image Creation<a class="headerlink" href="#open-container-initiative-image-creation" title="Permalink to this headline"></a></h2>
<p>The OCI is a new specification that is still being worked on. You can read more about it at
<a class="reference external" href="https://www.opencontainers.org/">the Open Container Initiative website</a>. You can create
OCI images using the following command:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">oci</span> <span class="o">--</span><span class="n">oci</span><span class="o">-</span><span class="n">config</span> <span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">config</span><span class="o">.</span><span class="n">json</span> <span class="o">--</span><span class="n">oci</span><span class="o">-</span><span class="n">runtime</span> <span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">runtime</span><span class="o">.</span><span class="n">json</span> \
<span class="o">--</span><span class="n">iso</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span> <span class="o">--</span><span class="n">ks</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">minimal</span><span class="o">.</span><span class="n">ks</span>
2015-12-04 18:12:19 +00:00
</pre></div>
</div>
<p>You must provide the config.json and runtime.json files to be included in the bundle,
their specifications can be found <a class="reference external" href="https://github.com/opencontainers/specs">on the OCI github project</a>
output will be in the results directory with a default name of bundle.tar.xz</p>
2018-05-16 20:15:10 +00:00
<p>This will work with <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> and inside a mock since it doesnt use any
2015-12-04 18:12:19 +00:00
partitioned disk images.</p>
</div>
<div class="section" id="vagrant-image-creation">
<h2>Vagrant Image Creation<a class="headerlink" href="#vagrant-image-creation" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="https://www.vagrantup.com/">Vagrant</a> images can be created using the following command:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">vagrant</span> <span class="o">--</span><span class="n">vagrant</span><span class="o">-</span><span class="n">metadata</span> <span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">metadata</span><span class="o">.</span><span class="n">json</span> \
<span class="o">--</span><span class="n">iso</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span> <span class="o">--</span><span class="n">ks</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">vagrant</span><span class="o">.</span><span class="n">ks</span>
2015-12-04 18:12:19 +00:00
</pre></div>
</div>
<p>The image created is a <a class="reference external" href="https://github.com/pradels/vagrant-libvirt">vagrant-libvirt</a> provider image and needs to have
vagrant setup with libvirt before you can use it.</p>
2018-05-16 20:15:10 +00:00
<p>The <code class="docutils literal notranslate"><span class="pre">--vagrant-metadata</span></code> file is optional, it will create a minimal one by
2015-12-04 18:12:19 +00:00
default, and if one is passed it will make sure the disk size is setup
2018-05-16 20:15:10 +00:00
correctly. If you pass a <code class="docutils literal notranslate"><span class="pre">--vagrant-vagrantfile</span></code> it will be included in the
2015-12-04 18:12:19 +00:00
image verbatim. By default no vagrantfile is created.</p>
<p>There is an example Vagrant kickstart file in the docs directory that sets up
the vagrant user with the default insecure SSH pubkey and a few useful
utilities.</p>
2018-05-16 20:15:10 +00:00
<p>This also works with <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code>, but will not work inside a mock due to its
2015-12-04 18:12:19 +00:00
use of partitioned disk images and qcow2.</p>
</div>
<div class="section" id="creating-uefi-disk-images-with-virt">
<h2>Creating UEFI disk images with virt<a class="headerlink" href="#creating-uefi-disk-images-with-virt" title="Permalink to this headline"></a></h2>
<p>Partitioned disk images can only be created for the same platform as the host system (BIOS or
UEFI). You can use virt to create BIOS images on UEFI systems, and it is also possible
to create UEFI images on BIOS systems using OVMF firmware and qemu.</p>
<p>Install the lorax-lmc-virt package, this will install qemu and the OVMF
firmware files.</p>
2018-05-16 20:15:10 +00:00
<p>Now you can run livemedia-creator with <code class="docutils literal notranslate"><span class="pre">--virt-uefi</span></code> to boot and install using UEFI:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">disk</span> <span class="o">--</span><span class="n">virt</span><span class="o">-</span><span class="n">uefi</span> <span class="o">--</span><span class="n">iso</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span> \
<span class="o">--</span><span class="n">ks</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">rhel</span><span class="o">-</span><span class="n">minimal</span><span class="o">.</span><span class="n">ks</span>
2015-12-04 18:12:19 +00:00
</pre></div>
</div>
<p>Make sure that the kickstart you are using creates a /boot/efi partition by including this:</p>
2018-05-16 20:15:10 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">part</span> <span class="o">/</span><span class="n">boot</span><span class="o">/</span><span class="n">efi</span> <span class="o">--</span><span class="n">fstype</span><span class="o">=</span><span class="s2">&quot;efi&quot;</span> <span class="o">--</span><span class="n">size</span><span class="o">=</span><span class="mi">500</span>
2015-12-04 18:12:19 +00:00
</pre></div>
</div>
<p>Or use <code class="docutils literal notranslate"><span class="pre">reqpart</span></code> in the kickstart and Anaconda will create the required partitions.</p>
2015-12-04 18:12:19 +00:00
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The virt-uefi method is currently only supported on the x86_64 architecture.</p>
2015-12-04 18:12:19 +00:00
</div>
</div>
<div class="section" id="debugging-problems">
<h2>Debugging problems<a class="headerlink" href="#debugging-problems" title="Permalink to this headline"></a></h2>
2016-03-18 23:30:48 +00:00
<p>Sometimes an installation will get stuck. When using qemu the logs will
be written to ./virt-install.log and most of the time any problems that happen
will be near the end of the file. lmc tries to detect common errors and will
cancel the installation when they happen. But not everything can be caught.
2016-03-18 23:30:48 +00:00
When creating a new kickstart it is helpful to use vnc so that you can monitor
the installation as it happens, and if it gets stuck without lmc detecting the
problem you can switch to tty1 and examine the system directly.</p>
<p>If it does get stuck the best way to cancel is to use kill -9 on the qemu pid,
lmc will detect that the process died and cleanup.</p>
2018-03-15 20:53:58 +00:00
<p>If lmc didnt handle the cleanup for some reason you can do this:
2018-05-16 20:15:10 +00:00
1. <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">umount</span> <span class="pre">/tmp/lmc-XXXX</span></code> to unmount the iso from its mountpoint.
2. <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">rm</span> <span class="pre">-rf</span> <span class="pre">/tmp/lmc-XXXX</span></code>
3. <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">rm</span> <span class="pre">/var/tmp/lmc-disk-XXXXX</span></code> to remove the disk image.</p>
2016-03-18 23:30:48 +00:00
<p>Note that lmc uses the lmc- prefix for all of its temporary files and
directories to make it easier to find and clean up leftovers.</p>
<p>The logs from the qemu run are stored in virt-install.log, logs from
livemedia-creator are in livemedia.log and program.log</p>
2018-05-16 20:15:10 +00:00
<p>You can add <code class="docutils literal notranslate"><span class="pre">--image-only</span></code> to skip the .iso creation and examine the resulting
disk image. Or you can pass <code class="docutils literal notranslate"><span class="pre">--keep-image</span></code> to keep it around after the iso has
been created.</p>
2018-05-16 20:15:10 +00:00
<p>Cleaning up aborted <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> installs can sometimes be accomplished by
running the <code class="docutils literal notranslate"><span class="pre">anaconda-cleanup</span></code> script. As of Fedora 18 anaconda is
multi-threaded and it can sometimes become stuck and refuse to exit. When this
happens you can usually clean up by first killing the anaconda process then
2018-05-16 20:15:10 +00:00
running <code class="docutils literal notranslate"><span class="pre">anaconda-cleanup</span></code>.</p>
</div>
<div class="section" id="hacking">
<h2>Hacking<a class="headerlink" href="#hacking" title="Permalink to this headline"></a></h2>
<p>Development on this will take place as part of the lorax project, and on the
anaconda-devel-list mailing list, and <a class="reference external" href="https://github.com/rhinstaller/lorax">on github</a></p>
<p>Feedback, enhancements and bugs are welcome. You can use <a class="reference external" href="https://bugzilla.redhat.com/enter_bug.cgi?product=RedHatEnterpriseLinux8&amp;component=lorax">bugzilla</a> to
report bugs against the lorax component.</p>
</div>
</div>
2017-11-28 17:18:51 +00:00
</div>
2018-05-16 20:15:10 +00:00
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
2018-05-16 20:15:10 +00:00
<a href="lorax-composer.html" class="btn btn-neutral float-right" title="lorax-composer" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="lorax.html" class="btn btn-neutral float-left" title="Lorax" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018-2019, Red Hat, Inc.
2016-02-13 00:06:33 +00:00
</p>
</div>
2018-05-16 20:15:10 +00:00
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/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">
jQuery(function () {
2018-06-04 23:50:39 +00:00
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>