Files
2024-11-04 18:56:31 +00:00

1167 lines
69 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>mixer &#8212; Documentation for Clear Linux* project</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/bizstyle.css?v=5283bb3d" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=a56c686a"></script>
<script src="../../_static/bizstyle.js"></script>
<link rel="canonical" href="https://clearlinux.github.io/clear-linux-documentation/guides/clear/mixer.html" />
<link rel="icon" href="../../_static/favicon.ico"/>
<link rel="author" title="About these documents" href="../../about.html" />
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Performance" href="performance.html" />
<link rel="prev" title="Kubernetes* migration" href="k8s-migration.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!--[if lt IE 9]>
<script src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="performance.html" title="Performance"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="k8s-migration.html" title="Kubernetes* migration"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Guides</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">mixer</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="mixer">
<span id="id1"></span><h1>mixer<a class="headerlink" href="#mixer" title="Link to this heading"></a></h1>
<p>The Clear Linux* OS team uses <strong>mixer</strong> to generate official update content and
releases. The update content generated by mixer is then consumed by swupd on
a downstream client. The same mixer tool is available to those who wish to create customized update content and releases.</p>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#description" id="id7">Description</a></p></li>
<li><p><a class="reference internal" href="#how-it-works" id="id8">How it works</a></p></li>
<li><p><a class="reference internal" href="#examples" id="id9">Examples</a></p></li>
<li><p><a class="reference internal" href="#references" id="id10">References</a></p></li>
<li><p><a class="reference internal" href="#related-topics" id="id11">Related topics</a></p></li>
</ul>
</nav>
<section id="description">
<h2><a class="toc-backref" href="#id7" role="doc-backlink">Description</a><a class="headerlink" href="#description" title="Link to this heading"></a></h2>
<p>mixer uses the following sources as inputs to generate update content:</p>
<ul class="simple">
<li><p>Upstream Clear Linux OS bundles with their corresponding RPM packages</p></li>
<li><p>Locally-defined bundles with their corresponding local RPM packages</p></li>
<li><p>Locally-defined bundles with upstream RPM packages</p></li>
<li><p>Locally-defined bundles with non-RPM content</p></li>
</ul>
<p>Using the mixer tool, you select which content from these sources that
becomes part of your update. Your selection of sources produces a unique
combination of functionality for your custom update content, known as
a <strong>mix</strong>.</p>
<p>The update content that mixer generates consists of various pieces of OS
content, update metadata, as well as a complete image. The OS content
includes all files in an update, as well as zero- and delta-packs for
improved update performance. The update metadata, stored as manifests,
describes all of the bundle information for the update. Update content
produced by mixer is then published to a web server and consumed by clients
via <strong class="command">swupd</strong>. Refer to <a class="reference internal" href="swupd.html#swupd-guide"><span class="std std-ref">swupd</span></a> for additional
information regarding updates and update content.</p>
</section>
<section id="how-it-works">
<h2><a class="toc-backref" href="#id8" role="doc-backlink">How it works</a><a class="headerlink" href="#how-it-works" title="Link to this heading"></a></h2>
<p>Learn the mixer tool set up and workflow.</p>
<nav class="contents local" id="id2">
<ul class="simple">
<li><p><a class="reference internal" href="#prerequisites" id="id12">Prerequisites</a></p></li>
<li><p><a class="reference internal" href="#mix-setup" id="id13">Mix setup</a></p></li>
<li><p><a class="reference internal" href="#create-a-mix" id="id14">Create a mix</a></p></li>
<li><p><a class="reference internal" href="#maintain-or-modify-mix" id="id15">Maintain or modify mix</a></p></li>
</ul>
</nav>
<section id="prerequisites">
<h3><a class="toc-backref" href="#id12" role="doc-backlink">Prerequisites</a><a class="headerlink" href="#prerequisites" title="Link to this heading"></a></h3>
<ul>
<li><p><strong class="command">mixer</strong> bundle</p>
<p>Add the mixer tool by installing the <strong class="command">mixer</strong> bundle. Refer to
<a class="reference internal" href="swupd.html#swupd-guide"><span class="std std-ref">swupd</span></a> for more information on installing bundles.</p>
</li>
<li><p>If youre working behind a corporate proxy, configure proxy settings using
the <a class="reference internal" href="../network/proxy.html#proxy"><span class="std std-ref">General proxy settings for many applications</span></a> steps.</p></li>
<li><p>Location to host the update content and images</p>
<p>In order for <strong class="command">swupd</strong> to make use of your mix, the update content for your mix must be hosted on a web server. Your mix will be configured with an update location URL, which <strong class="command">swupd</strong> will use to pull down updates.</p>
<p>Refer to <a class="reference internal" href="#set-up-a-nginx-web-server-for-mixer">Set up a nginx web server for mixer</a> for an simple example of
setting up an update location.</p>
</li>
</ul>
</section>
<section id="mix-setup">
<h3><a class="toc-backref" href="#id13" role="doc-backlink">Mix setup</a><a class="headerlink" href="#mix-setup" title="Link to this heading"></a></h3>
<p>Follow these steps to create and initialize the mixer workspace. Complete
the setup before you create a mix.</p>
<ol class="arabic">
<li><p>Create workspace.</p>
<p>The mixer tool uses a simple workspace to contain all input and output in a
basic directory structure. The workspace is simply an empty folder from
which you execute the mixer commands. Each mix uses its own separate
workspace.</p>
</li>
<li><p>Initialize the workspace and mix.</p>
<p>Before you create a mix, you must explicitly initialize the mixer workspace.
During initialization, the mixer workspace is configured and the base for
your mix is defined. By default, your mix is based on the latest
upstream version and starts with the minimum set of bundles. Your first custom
mix version number starts at 10. Alternatively, you can select other
versions or bundle sets from which to start.</p>
<p>Initialization creates the directory structure within the workspace and adds
the <code class="file docutils literal notranslate"><span class="pre">builder.conf</span></code> file, which is used to configure the mixer tool.</p>
<p>View the <a class="reference external" href="https://github.com/clearlinux/mixer-tools/blob/master/docs/mixer.init.1.rst">mixer.init man page</a> for more information on mixer
initialization.</p>
<p>View the list of suitable <a class="reference external" href="https://github.com/clearlinux/clr-bundles/releases">releases</a> from which to mix.</p>
</li>
<li><p>Edit builder.conf.</p>
<p><code class="file docutils literal notranslate"><span class="pre">builder.conf</span></code> tells the mixer tool how to configure the mix. For
example, it allows you to configure where mixer output is located and where swupd update content will be located.</p>
<p>At minimum, set the URL of your update server so your custom OS knows where to get update content.</p>
<p>Refer to the <a class="reference internal" href="#builder-conf">builder.conf</a> section for more information.</p>
</li>
</ol>
</section>
<section id="create-a-mix">
<h3><a class="toc-backref" href="#id14" role="doc-backlink">Create a mix</a><a class="headerlink" href="#create-a-mix" title="Link to this heading"></a></h3>
<p>A mix is created with the following steps:</p>
<ol class="arabic">
<li><p>Add custom RPMs and set up local repo (optional).</p>
<p>If you are adding custom RPMs to your mix, you must add the RPMs to
your mix workspace and set up a corresponding local repository.</p>
<p>Go to the <a class="reference internal" href="autospec.html#autospec"><span class="std std-ref">autospec</span></a> guide to learn to build RPMs from
scratch. If the RPMs are not built on Clear Linux OS, make sure your
configuration and toolchain builds them correctly for Clear Linux OS. Otherwise there
is no guarantee they will be compatible.</p>
<p>Refer to the <a class="reference internal" href="autospec.html#autospec"><span class="std std-ref">autospec</span></a> guide for more information on using autospec to
build RPMs.</p>
</li>
<li><p>Update and build bundles.</p>
<p>Add, edit, or remove bundles that will be part of your content and build
them. mixer automatically updates the <code class="file docutils literal notranslate"><span class="pre">mixbundles</span></code> file when you
update the bundles in your mix.</p>
<p>View the <a class="reference external" href="https://github.com/clearlinux/mixer-tools/blob/master/docs/mixer.bundle.1.rst">mixer.bundle man page</a> for more information on configuring bundles
in a mix.</p>
<p>View the <a class="reference external" href="https://github.com/clearlinux/mixer-tools/blob/master/docs/mixer.build.1.rst">mixer.build man page</a> for more information on building bundles.</p>
<p>View the <a class="reference internal" href="#bundles">Bundles</a> section for more information on how mixer manages
bundles.</p>
</li>
<li><p>Create the update content.</p>
<p>mixer creates update content with this step. Zero-packs are created
automatically, and delta-packs can be optionally created at the same time
(for all builds after version 0).</p>
<p>A zero-pack is the full set of content needed to go from mix version 0
(nothing) to the mix version for which you just built content.</p>
<p>A delta-pack provides the content <em>delta</em> between a <cite>PAST_VERSION</cite> to a
<cite>MIX_VERSION</cite> that allows the transition from one mix version to another.</p>
<p>View <a class="reference internal" href="swupd.html#swupd-guide"><span class="std std-ref">swupd</span></a> for more information on update content.</p>
</li>
<li><p>Create image.</p>
<p>mixer creates a bootable image from your updated content using
the <a class="reference external" href="https://github.com/clearlinux/clr-installer">clr-installer</a> tool. In this step you can specify which bundles you want
<em>preinstalled</em> in the image. Users can later install other bundles available
in your mix.</p>
</li>
<li><p>Make update available.</p>
<p>Deploy update content and images to your update server.</p>
<p>View the <a class="reference internal" href="#example-5-deploy-updates-to-target">Example 5: Deploy updates to target</a> for a simple deployment
scenario.</p>
</li>
</ol>
</section>
<section id="maintain-or-modify-mix">
<h3><a class="toc-backref" href="#id15" role="doc-backlink">Maintain or modify mix</a><a class="headerlink" href="#maintain-or-modify-mix" title="Link to this heading"></a></h3>
<p>Update or modify your content to a new version by following the steps to
create a mix. Increment the mix version number for the next mix.</p>
</section>
</section>
<section id="examples">
<h2><a class="toc-backref" href="#id9" role="doc-backlink">Examples</a><a class="headerlink" href="#examples" title="Link to this heading"></a></h2>
<p>The following examples are designed to work together and in order. The examples
use:</p>
<ul class="simple">
<li><p>A stock installation of Clear Linux OS.</p></li>
<li><p>A web server that comes with Clear Linux OS to host the content updates.</p></li>
<li><p>A simple VM that updates against the locally produced content created in
Example 2.</p></li>
</ul>
<p>Complete all <a class="reference internal" href="#prerequisites">Prerequisites</a> before using these examples.</p>
<section id="example-1-mix-set-up">
<h3>Example 1: Mix set up<a class="headerlink" href="#example-1-mix-set-up" title="Link to this heading"></a></h3>
<p>This example shows the basic steps for the first-time setup of
mixer for a new mix.</p>
<ol class="arabic">
<li><p>Create a directory to use as a workspace for mixer:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mkdir<span class="w"> </span>~/mixer
</pre></div>
</div>
</li>
<li><p>In your mixer workspace, generate an initial mix based on the latest
upstream Clear Linux OS version, with minimum bundles. In the initialization
output, be aware that your initial mix version is set to 10 and that the
minimum bundles have been added.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>~/mixer
mixer<span class="w"> </span>init
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you want to add all upstream bundles in your mix,
initialize your mix as shown below.</p>
</div>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>init<span class="w"> </span>--all-upstream
</pre></div>
</div>
</li>
<li><p>Look up your IP address:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>networkctl<span class="w"> </span>status
</pre></div>
</div>
</li>
<li><p>Copy the IP “Address”, from above, for the next step.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>In this example, we put <cite>mixer</cite> and <cite>nginx</cite> on the same system. In a production environment, they would likely reside on different systems.</p>
</div>
</li>
<li><p>Edit <code class="file docutils literal notranslate"><span class="pre">builder.conf</span></code>. Paste the IP address from the previous step
as the value after http:// for CONTENTURL and VERSIONURL. For example:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">CONTENTURL=&quot;http://192.168.25.52&quot;</span>
<span class="go">VERSIONURL=&quot;http://192.168.25.52&quot;</span>
</pre></div>
</div>
</li>
<li><p><a class="reference internal" href="#set-up-a-nginx-web-server-for-mixer">Set up a nginx web server for mixer</a>.</p></li>
</ol>
</section>
<section id="example-2-create-a-simple-mix">
<h3>Example 2: Create a simple mix<a class="headerlink" href="#example-2-create-a-simple-mix" title="Link to this heading"></a></h3>
<p>This example shows how to create a simple custom mix using upstream content.
Well create an image for a QEMU virtual machine that we can use later to
test our mix.</p>
<p>We can use the default bundles that were added during initialization, but
these include the <strong class="command">native-kernel</strong> bundle that is intended to be
used on a bare metal system instead of a VM. So we will modify the default
bundle set to get a smaller kernel image, which will also be faster to load.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The only bundles available to <strong class="command">swupd</strong> for a given release are
those that were added to the mix during build time. A mix doesnt
automatically inherit all upstream bundles.</p>
</div>
<ol class="arabic">
<li><p>Ensure that you have run <cite>mixer init</cite>, shown in Example 1.</p></li>
<li><p>Update bundles in mix:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>bundle<span class="w"> </span>remove<span class="w"> </span>kernel-native
mixer<span class="w"> </span>bundle<span class="w"> </span>add<span class="w"> </span>kernel-kvm
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The mixer bundle commands operate on the bundle description files but not on the bundle contents. To remove bundle contents and their tracking completely, follow <a class="reference internal" href="#example-6-remove-a-bundle-from-client-system">Example 6: Remove a bundle from client system</a>, Advanced.</p>
</div>
</li>
<li><p>In this case, we will add the <cite>editors</cite> bundle from upstream, but we will
remove the <strong class="command">joe</strong> editor.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>bundle<span class="w"> </span>add<span class="w"> </span>editors
mixer<span class="w"> </span>bundle<span class="w"> </span>edit<span class="w"> </span>editors
</pre></div>
</div>
</li>
<li><p>Use an editor and manually remove <cite>joe</cite> from the bundle definition.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">$EDITOR</span><span class="w"> </span>./local-bundles/editors
</pre></div>
</div>
</li>
<li><p>List the bundles in the mix again to confirm removal of <strong class="command">joe</strong>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>bundle<span class="w"> </span>list<span class="w"> </span>--tree
</pre></div>
</div>
</li>
<li><p>Build bundles:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>bundles
</pre></div>
</div>
</li>
<li><p>First, browse to web server from Example 1. The web page appears yet
has no update content. Build the update content:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>update
</pre></div>
</div>
<p>After that is completed, on your web server, you can see the update
content for mix version 10.</p>
</li>
</ol>
</section>
<section id="example-3-create-an-update-for-your-mix">
<h3>Example 3: Create an update for your mix<a class="headerlink" href="#example-3-create-an-update-for-your-mix" title="Link to this heading"></a></h3>
<p>Next, lets create a new version of the mix. Well add a new bundle.</p>
<ol class="arabic">
<li><p>Create a new version of your mix, for the live image to
update to. Increment your mix version by 10:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>versions<span class="w"> </span>update
</pre></div>
</div>
</li>
<li><p>Add the upstream <strong class="command">curl</strong> bundle to version 20 of the mix:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>bundle<span class="w"> </span>add<span class="w"> </span>curl
</pre></div>
</div>
</li>
<li><p>Build your next mix version that incorporates the new bundle.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>bundles
sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>update
</pre></div>
</div>
</li>
<li><p>Optionally, you can build delta-packs, which help reduce client update
time:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>delta-packs<span class="w"> </span>--from<span class="w"> </span><span class="m">10</span><span class="w"> </span>--to<span class="w"> </span><span class="m">20</span>
</pre></div>
</div>
</li>
</ol>
<p>Refresh your web server to see the update content for mix version 20.</p>
<p>You can also look in ~/mixer/update/www/&lt;mix version&gt; to see the update
content in your workspace.</p>
</section>
<section id="example-4-build-an-image">
<h3>Example 4: Build an image<a class="headerlink" href="#example-4-build-an-image" title="Link to this heading"></a></h3>
<p>This example shows how to build a bootable image containing the
<strong class="command">kernel-kvm</strong>, <strong class="command">os-core</strong>, and the <strong class="command">os-core-update</strong>
bundles from <a class="reference internal" href="#example-2-create-a-simple-mix">Example 2: Create a simple mix</a>. Complete that example before starting this one.</p>
<p>Underneath, mixer uses <a class="reference external" href="https://github.com/clearlinux/clr-installer">clr-installer</a> to generate the image.</p>
<ol class="arabic">
<li><p>Change directory into your mix.</p></li>
<li><p>Configure image.</p>
<p>Create a YAML configuration file to specify aspects of your image
such as image name, target media, bundles, etc. See <a class="reference external" href="https://github.com/clearlinux/clr-installer/blob/master/scripts/InstallerYAMLSyntax.md">Installer YAML Syntax</a>
for more information on clr-installer configuration YAML syntax.</p>
<p>For this example, we will download a sample YAML and modify it.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>curl<span class="w"> </span>-O<span class="w"> </span>https://raw.githubusercontent.com/clearlinux/clr-installer/master/scripts/kvm.yaml
</pre></div>
</div>
<p>Make the following revisions to <code class="file docutils literal notranslate"><span class="pre">kvm.yaml</span></code>:</p>
<ul class="simple">
<li><p>Reduce overall image size and root partition size by 5GB.</p></li>
<li><p>Remove these bundles from the image: <code class="docutils literal notranslate"><span class="pre">editors</span></code>, <code class="docutils literal notranslate"><span class="pre">network-basic</span></code>,
<code class="docutils literal notranslate"><span class="pre">openssh-server</span></code>, <code class="docutils literal notranslate"><span class="pre">sysadmin-basic</span></code></p></li>
<li><p>Add <code class="docutils literal notranslate"><span class="pre">version:</span> <span class="pre">10</span></code> to tell <strong class="command">mixer</strong> to generate an image based
on mix version 10</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>When creating an image, it is not necessary to include all of the bundles
that are in your entire mix. Once you have a working image, you can use
<strong class="command">swupd</strong> to add them as needed.</p>
</div>
<p>Your <code class="file docutils literal notranslate"><span class="pre">kvm.yaml</span></code> should look like below:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="gp">#</span>clear-linux-config
<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="gp"># </span>switch<span class="w"> </span>between<span class="w"> </span>aliases<span class="w"> </span><span class="k">if</span><span class="w"> </span>you<span class="w"> </span>want<span class="w"> </span>to<span class="w"> </span>install<span class="w"> </span>to<span class="w"> </span>an<span class="w"> </span>actuall<span class="w"> </span>block<span class="w"> </span>device
<span class="linenos"> 4</span><span class="gp"># </span>i.e<span class="w"> </span>/dev/sda
<span class="linenos"> 5</span><span class="go">block-devices: [</span>
<span class="linenos"> 6</span><span class="go"> {name: &quot;bdevice&quot;, file: &quot;kvm.img&quot;}</span>
<span class="linenos"> 7</span><span class="go">]</span>
<span class="linenos"> 8</span>
<span class="linenos"> 9</span><span class="go">targetMedia:</span>
<span class="linenos">10</span><span class="go">- name: ${bdevice}</span>
<span class="hll"><span class="linenos">11</span><span class="go"> size: &quot;3.54G&quot;</span>
</span><span class="linenos">12</span><span class="go"> type: disk</span>
<span class="linenos">13</span><span class="go"> children:</span>
<span class="linenos">14</span><span class="go"> - name: ${bdevice}1</span>
<span class="linenos">15</span><span class="go"> fstype: vfat</span>
<span class="linenos">16</span><span class="go"> mountpoint: /boot</span>
<span class="linenos">17</span><span class="go"> size: &quot;512M&quot;</span>
<span class="linenos">18</span><span class="go"> type: part</span>
<span class="linenos">19</span><span class="go"> - name: ${bdevice}2</span>
<span class="linenos">20</span><span class="go"> fstype: swap</span>
<span class="linenos">21</span><span class="go"> size: &quot;32M&quot;</span>
<span class="linenos">22</span><span class="go"> type: part</span>
<span class="linenos">23</span><span class="go"> - name: ${bdevice}3</span>
<span class="linenos">24</span><span class="go"> fstype: ext4</span>
<span class="linenos">25</span><span class="go"> mountpoint: /</span>
<span class="hll"><span class="linenos">26</span><span class="go"> size: &quot;3G&quot;</span>
</span><span class="linenos">27</span><span class="go"> type: part</span>
<span class="linenos">28</span>
<span class="hll"><span class="linenos">29</span><span class="go">bundles: [</span>
</span><span class="hll"><span class="linenos">30</span><span class="go"> bootloader,</span>
</span><span class="hll"><span class="linenos">31</span><span class="go"> os-core,</span>
</span><span class="hll"><span class="linenos">32</span><span class="go"> os-core-update,</span>
</span><span class="hll"><span class="linenos">33</span><span class="go"> ]</span>
</span><span class="linenos">34</span>
<span class="linenos">35</span><span class="go">autoUpdate: false</span>
<span class="linenos">36</span><span class="go">postArchive: false</span>
<span class="linenos">37</span><span class="go">postReboot: false</span>
<span class="linenos">38</span><span class="go">telemetry: false</span>
<span class="linenos">39</span>
<span class="linenos">40</span><span class="go">keyboard: us</span>
<span class="linenos">41</span><span class="go">language: en_US.UTF-8</span>
<span class="linenos">42</span><span class="go">kernel: kernel-kvm</span>
<span class="linenos">43</span>
<span class="hll"><span class="linenos">44</span><span class="go">version: 10</span>
</span></pre></div>
</div>
</li>
<li><p>Build the image.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>image<span class="w"> </span>--template<span class="w"> </span><span class="nv">$PWD</span>/kvm.yaml
</pre></div>
</div>
<p>The output from this step will be <code class="file docutils literal notranslate"><span class="pre">kvm.img</span></code>, which is a live
image.</p>
</li>
</ol>
</section>
<section id="example-5-deploy-updates-to-target">
<h3>Example 5: Deploy updates to target<a class="headerlink" href="#example-5-deploy-updates-to-target" title="Link to this heading"></a></h3>
<p>The image created in Example 4 is directly bootable in QEMU. In this example,
well boot the image and verify it. Then well update the image from
mix version 10 to mix version 20.</p>
<ol class="arabic">
<li><p>Set up the QEMU environment.</p>
<p>Install the <strong class="command">kvm-host</strong> bundle to your Clear Linux OS:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>swupd<span class="w"> </span>bundle-add<span class="w"> </span>kvm-host
</pre></div>
</div>
</li>
<li><p>Get the virtual EFI firmware, download the image launch script, and make
it executable:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>curl<span class="w"> </span>-O<span class="w"> </span>https://download.clearlinux.org/image/OVMF.fd
curl<span class="w"> </span>-O<span class="w"> </span>https://download.clearlinux.org/image/start_qemu.sh
chmod<span class="w"> </span>+x<span class="w"> </span>start_qemu.sh
</pre></div>
</div>
</li>
<li><p>Start your VM image (created in Example 4):</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>./start_qemu.sh<span class="w"> </span>kvm.img
</pre></div>
</div>
</li>
<li><p>Log in as root and set a password.</p></li>
<li><p>By default, the <strong class="command">swupd</strong> client is designed to communicate with an
HTTPS server. For development purposes, the swupd client can talk to
an HTTP server if you add the flag <code class="docutils literal notranslate"><span class="pre">allow-insecure-http</span></code>.</p>
<p>To avoid adding a flag each time when invoking <strong class="command">swupd</strong>, enter:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/swupd
cat<span class="w"> </span>&gt;<span class="w"> </span>/etc/swupd/config<span class="w"> </span><span class="s">&lt;&lt; EOF</span>
<span class="s">[GLOBAL]</span>
<span class="s">allow_insecure_http=true</span>
<span class="s">EOF</span>
</pre></div>
</div>
</li>
<li><p>Try out your mix.</p>
<ol class="loweralpha">
<li><p>Show the version and update URLs</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>swupd<span class="w"> </span>info
</pre></div>
</div>
</li>
<li><p>List the bundles installed in your mix:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>swupd<span class="w"> </span>bundle-list
</pre></div>
</div>
</li>
<li><p>List available bundles on your update server.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>swupd<span class="w"> </span>bundle-list<span class="w"> </span>-a
</pre></div>
</div>
</li>
<li><p>Now we will add the <strong class="command">editors</strong> bundle that we modified.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>swupd<span class="w"> </span>bundle-add<span class="w"> </span>editors
</pre></div>
</div>
</li>
<li><p>Try to start the <strong class="command">joe</strong> editor.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>joe
</pre></div>
</div>
<p>It should not work because we removed it from the original
<strong class="command">editors</strong> bundle.</p>
</li>
<li><p>Next we will update from version 10 to 20 to capture the
newly-available bundles.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>swupd<span class="w"> </span>check-update
swupd<span class="w"> </span>update
swupd<span class="w"> </span>bundle-list<span class="w"> </span>-a
</pre></div>
</div>
</li>
<li><p>Now your mix should be at version 20 and <strong class="command">curl</strong> is available.
Try using <strong class="command">curl</strong>. This will fail because it is not yet installed.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">curl: command not found</span>
<span class="go">To install curl use: swupd bundle-add curl</span>
</pre></div>
</div>
</li>
<li><p>Add the new bundle from your update server to your VM. Retry <strong class="command">curl</strong>.
It works!</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>swupd<span class="w"> </span>bundle-add<span class="w"> </span>curl
curl<span class="w"> </span>-O<span class="w"> </span>https://download.clearlinux.org/image/start_qemu.sh
</pre></div>
</div>
</li>
</ol>
</li>
<li><p>Shutdown your VM:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>poweroff
</pre></div>
</div>
</li>
</ol>
</section>
<section id="example-6-remove-a-bundle-from-client-system">
<h3>Example 6: Remove a bundle from client system<a class="headerlink" href="#example-6-remove-a-bundle-from-client-system" title="Link to this heading"></a></h3>
<p>Removing a bundle in a future release requires more steps than deleting the
bundle description file, as shown in Example 2. After a bundle is built in
the mix, you must assure all of the files that are part of the bundle are
removed from the client where that bundle is installed. To do this, create a
version of this bundle in which all of its content is marked for deletion.</p>
<p>In the following example, we show how to remove the contents of the <cite>editors</cite>
bundle that we added to our mix in Example 2.</p>
<ol class="arabic">
<li><p>First update your mix version. This will set the mix to the next version.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>versions<span class="w"> </span>update
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Run this command every time that you want to build a new version.</p>
</div>
</li>
<li><p>Navigate to local-bundles:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>local-bundles
</pre></div>
</div>
</li>
<li><p>Open the <cite>editors</cite> bundle with an editor and delete
<strong>all lines</strong> that follow after the <cite>[MAINTAINERS]</cite> line.</p></li>
<li><p>Afterward, it should look like this:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp"># </span><span class="o">[</span>TITLE<span class="o">]</span>:<span class="w"> </span>editors
<span class="gp"># </span><span class="o">[</span>DESCRIPTION<span class="o">]</span>:<span class="w"> </span>Run<span class="w"> </span>popular<span class="w"> </span>terminal<span class="w"> </span>text<span class="w"> </span>editors.
<span class="gp"># </span><span class="o">[</span>STATUS<span class="o">]</span>:<span class="w"> </span>Active
<span class="gp"># </span><span class="o">[</span>CAPABILITIES<span class="o">]</span>:
<span class="gp"># </span><span class="o">[</span>TAGS<span class="o">]</span>:<span class="w"> </span>Tools<span class="w"> </span>and<span class="w"> </span>Utilities,<span class="w"> </span>Editor
<span class="gp"># </span><span class="o">[</span>MAINTAINER<span class="o">]</span>:<span class="w"> </span>Developer<span class="w"> </span>&lt;developer@intel.com&gt;
</pre></div>
</div>
</li>
<li><p>Save and exit.</p></li>
<li><p>Next, run a build to capture recently edited bundles and update your mix.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>all
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><strong class="command">mixer build all</strong> runs both <strong class="command">mixer build bundles</strong> and <strong class="command">mixer build update</strong> in one step.</p>
</div>
</li>
</ol>
<p>At this point the new mix, version 30, is complete. All the content of the
editors bundles is marked as deleted. If any clients of this mix upgraded to
mix build version 30, the content of the editors bundle would be removed.
Note that the bundle still exists and is being tracked by <strong class="command">swupd</strong>,
but it contains no files.</p>
</section>
<section id="example-7-execute-a-format-bump">
<h3>Example 7: Execute a format bump<a class="headerlink" href="#example-7-execute-a-format-bump" title="Link to this heading"></a></h3>
<p>As a maintainer of your mix, you must execute a format bump if you wish to:</p>
<ul class="simple">
<li><p>Track upstreams format bump on your downstream derivative</p></li>
<li><p>Delete any custom bundles that were added</p></li>
</ul>
<p>Follow the appropriate use case below depending on your needs.</p>
<section id="basic">
<h4>Basic<a class="headerlink" href="#basic" title="Link to this heading"></a></h4>
<p>If you maintain your own downstream derivative and you want to track
upstream, you need to do a format bump when one occurs on upstream. This
method helps you track the latest changes on upstream; however, it does not
change any local content that was added or deleted. For example, if you
deprecated bundles, this method will <strong>not remove the bundle tracking</strong>.
Refer to <a class="reference internal" href="#advanced">Advanced</a> for help on managing your local mix and removing bundle
tracking.</p>
<p>In this example, we show a mix version that was initialized to upstream
version 29740 (format 27). You need to update your mix to upstream version
30700 (format 28). To do so, you will go through a format bump.</p>
<ol class="arabic">
<li><p>Change to your mix location and verify the current version of the mix and
its format.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>versions
</pre></div>
</div>
</li>
<li><p>Update to upstream version, which has a newer format.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>versions<span class="w"> </span>update<span class="w"> </span>--upstream-version<span class="w"> </span><span class="m">30700</span>
</pre></div>
</div>
<p>The output will look like this:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">Old mix: 10</span>
<span class="go">Old upstream: 29740 (format: 27)</span>
<span class="go">New mix: 20</span>
<span class="go">New upstream: 30700 (format: 28)</span>
<span class="go">[...]</span>
</pre></div>
</div>
<p>Read the output carefully:</p>
<ul class="simple">
<li><p>The Old mix shows the current version (10) of your mix.</p></li>
<li><p>The Old upstream shows the version and format (27) on which its based.</p></li>
<li><p>The New mix shows the new version (20) of your mix.</p></li>
<li><p>The New upstream shows the version and format (28) on which its based.</p></li>
</ul>
</li>
<li><p>Given that the format in the output differs, you need to run a
format bump:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mixer<span class="w"> </span>build<span class="w"> </span>upstream-format<span class="w"> </span>--new-format<span class="w"> </span><span class="m">28</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You specify the <strong class="command">--new-format</strong> to indicate the format (28) to which you transition.</p>
</div>
</li>
<li><p>Your mix is now synchronized with the new format (28); however, you must
still advance to the desired or latest version.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mixer<span class="w"> </span>versions<span class="w"> </span>update<span class="w"> </span>--upstream-version<span class="w"> </span><span class="m">30700</span>
</pre></div>
</div>
</li>
</ol>
</section>
<section id="advanced">
<h4>Advanced<a class="headerlink" href="#advanced" title="Link to this heading"></a></h4>
<p>To properly remove a bundle from being tracked by <strong class="command">swupd</strong>,
do a manual format bump. This process can also be used to perform
customizations during the update, such as:</p>
<ul class="simple">
<li><p>Adjustment in the command parameters</p></li>
<li><p>Change the content of the chroot</p></li>
</ul>
<p>Follow the <a class="reference external" href="https://github.com/clearlinux/mixer-tools/blob/master/afb.sh">afb.sh reference script</a> to learn how to do a manual format bump. The <a class="reference external" href="https://github.com/clearlinux/mixer-tools/blob/master/afb.sh">afb.sh reference script</a> shows an example of how to:</p>
<ul class="simple">
<li><p>Create a mix</p></li>
<li><p>Add a bundle</p></li>
<li><p>Deprecate a bundle</p></li>
<li><p>Do a format bump to remove the deprecated bundle</p></li>
</ul>
</section>
</section>
</section>
<section id="references">
<h2><a class="toc-backref" href="#id10" role="doc-backlink">References</a><a class="headerlink" href="#references" title="Link to this heading"></a></h2>
<p>Reference the <a class="reference external" href="https://github.com/clearlinux/mixer-tools/blob/master/docs/mixer.1.rst">mixer man page</a> for details regarding mixer commands and options.</p>
<nav class="contents local" id="id3">
<ul class="simple">
<li><p><a class="reference internal" href="#builder-conf" id="id16">builder.conf</a></p></li>
<li><p><a class="reference internal" href="#bundles" id="id17">Bundles</a></p></li>
<li><p><a class="reference internal" href="#set-up-a-nginx-web-server-for-mixer" id="id18">Set up a nginx web server for mixer</a></p></li>
</ul>
</nav>
<section class="content-collapse" id="builder-conf">
<h3><a class="toc-backref" href="#id16" role="doc-backlink">builder.conf</a><a class="headerlink" href="#builder-conf" title="Link to this heading"></a></h3>
<p>mixer initialization creates a <code class="file docutils literal notranslate"><span class="pre">builder.conf</span></code> that stores the basic
configuration for the mixer tool. The items of primary interest are CONTENTURL
and VERSIONURL, which will be used by systems updating against your custom
content.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">#</span>builder.conf
<span class="gp">#</span>VERSION<span class="w"> </span><span class="m">1</span>.2
<span class="go">[Builder]</span>
<span class="go"> CERT = &quot;/home/clr/mix/Swupd_Root.pem&quot;</span>
<span class="go"> SERVER_STATE_DIR = &quot;/home/clr/mix/update&quot;</span>
<span class="go"> VERSIONS_PATH = &quot;/home/clr/mix&quot;</span>
<span class="go"> YUM_CONF = &quot;/home/clr/mix/.yum-mix.conf&quot;</span>
<span class="go">[Swupd]</span>
<span class="go"> BUNDLE = &quot;os-core-update&quot;</span>
<span class="go"> CONTENTURL = &quot;&lt;URL where the content will be hosted&gt;&quot;</span>
<span class="go"> VERSIONURL = &quot;&lt;URL where the version of the mix will be hosted&gt;&quot;</span>
<span class="go"> COMPRESSION = [&quot;external-xz&quot;]</span>
<span class="go"> UPSTREAM_BUNDLES_URL = &quot;https://github.com/clearlinux/clr-bundles/archive/&quot;</span>
<span class="go">[Server]</span>
<span class="go"> DEBUG_INFO_BANNED = &quot;true&quot;</span>
<span class="go"> DEBUG_INFO_LIB = &quot;/usr/lib/debug&quot;</span>
<span class="go"> DEBUG_INFO_SRC = &quot;/usr/src/debug&quot;</span>
<span class="go">[Mixer]</span>
<span class="go"> LOCAL_BUNDLE_DIR = &quot;/home/clr/mix/local-bundles&quot;</span>
<span class="go"> LOCAL_REPO_DIR = &quot;/home/clr/mix/local-yum&quot;</span>
<span class="go"> LOCAL_RPM_DIR = &quot;/home/clr/mix/local-rpms&quot;</span>
<span class="go"> OS_RELEASE_PATH = &quot;&quot;</span>
</pre></div>
</div>
<p>Additional explanation of variables in <code class="file docutils literal notranslate"><span class="pre">builder.conf</span></code> is provided in
Table 1.</p>
<table class="docutils align-default" id="id4">
<caption><span class="caption-text"><strong>Table 1</strong>: Variables in builder.conf</span><a class="headerlink" href="#id4" title="Link to this table"></a></caption>
<colgroup>
<col style="width: 50.0%" />
<col style="width: 50.0%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p><strong>Variable</strong></p></th>
<th class="head"><p><strong>Description</strong></p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><cite>CERT</cite></p></td>
<td><p>Sets the path where mixer stores the certificate file used to sign
content for verification. mixer automatically generates the
certificate if you do not provide the path to an existing one, and
signs the <code class="file docutils literal notranslate"><span class="pre">Manifest.MoM</span></code> file to provide security for the
updated content you create.</p>
<p>chroot-builder uses the certificate file to sign the root :file:`
Manifest.MoM` file to provide security for content verification.
swupd uses this certificate to verify the <code class="file docutils literal notranslate"><span class="pre">Manifest.MoM</span></code> files
signature.</p>
<p>For now, we strongly recommend that you do not modify this variable,
as swupd expects a certificate with a very specific configuration to sign and verify properly.</p>
</td>
</tr>
<tr class="row-odd"><td><p><cite>CONTENTURL</cite> and <cite>VERSIONURL</cite></p></td>
<td><p>Set these variables to the IP address of the web server hosting the
update content.</p>
<p>VERSIONURL is the IP address where the swupd client
looks to determine if a new version is available.</p>
<p>CONTENTURL is the location from which swupd pulls content updates. If
the web server is on the same machine as the SERVER_STATE_DIR
directory, you can create a symlink to the directory in your web
servers document root to easily host the content.</p>
<p>These URLs are embedded in the images created by mixer.</p>
</td>
</tr>
<tr class="row-even"><td><p><cite>LOCAL_BUNDLE_DIR</cite></p></td>
<td><p>Sets the path where mixer stores the local bundle definition files.
The bundle definition files include any new, original bundles you
create, along with any edited versions of upstream bundles.</p></td>
</tr>
<tr class="row-odd"><td><p><cite>SERVER_STATE_DIR</cite></p></td>
<td><p>Sets the path to which mixer outputs content. By default, mixer
automatically sets the path.</p></td>
</tr>
<tr class="row-even"><td><p><cite>VERSIONS_PATH</cite></p></td>
<td><p>Sets the path for the mix version and upstream versions two state
files: <code class="file docutils literal notranslate"><span class="pre">mixversion</span></code> and <code class="file docutils literal notranslate"><span class="pre">upstreamversion</span></code>. mixer creates
both files for you when you set up the workspace.</p></td>
</tr>
<tr class="row-odd"><td><p><cite>YUM_CONF</cite></p></td>
<td><p>Sets the path where mixer automatically generates the
<code class="file docutils literal notranslate"><span class="pre">.yum-mix.conf</span></code> file. The yum configuration file points the
chroot-builder to where the RPMs are stored.</p></td>
</tr>
</tbody>
</table>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><strong>Variable</strong></p></td>
<td><p><strong>Explanation</strong></p></td>
</tr>
<tr class="row-even"><td><p><cite>CERT</cite></p></td>
<td><p>Sets the path where mixer stores the certificate file
used to sign content for verification. mixer
automatically generates the certificate if you do not
provide the path to an existing one, and signs the
<code class="file docutils literal notranslate"><span class="pre">Manifest.MoM</span></code> file to provide security for the
updated content you create.</p>
<p>chroot-builder uses the certificate file to sign
the root <code class="file docutils literal notranslate"><span class="pre">Manifest.MoM</span></code> file to provide
security for content verification.</p>
<p>swupd uses this certificate to verify the
<code class="file docutils literal notranslate"><span class="pre">Manifest.MoM</span></code> files signature.</p>
<p>For now, we strongly recommend that you do not modify
this variable, as swupd expects a certificate with a
very specific configuration to sign and verify
properly.</p>
</td>
</tr>
<tr class="row-odd"><td><p><cite>CONTENTURL</cite> and <cite>VERSIONURL</cite></p></td>
<td><p>Set these variables to the IP address of the web server
hosting the update content.</p>
<p>VERSIONURL is the IP address where the swupd client
looks to determine if a new version is available.</p>
<p>CONTENTURL is the location from which swupd pulls
content updates.</p>
<p>If the web server is on the same machine as the
SERVER_STATE_DIR directory, you can create a symlink to
the directory in your web servers document root to
easily host the content.</p>
<p>These URLs are embedded in the images created by mixer.</p>
</td>
</tr>
<tr class="row-even"><td><p><cite>LOCAL_BUNDLE_DIR</cite></p></td>
<td><p>Sets the path where mixer stores the local bundle
definition files. The bundle definition files include
any new, original bundles you create, along with any
edited versions of upstream bundles.</p></td>
</tr>
<tr class="row-odd"><td><p><cite>SERVER_STATE_DIR</cite></p></td>
<td><p>Sets the path to which mixer outputs content. By
default, mixer automatically sets the path.</p></td>
</tr>
<tr class="row-even"><td><p><cite>VERSIONS_PATH</cite></p></td>
<td><p>Sets the path for the mix version and upstream versions
two state files: <code class="file docutils literal notranslate"><span class="pre">mixversion</span></code> and
<code class="file docutils literal notranslate"><span class="pre">upstreamversion</span></code>. mixer creates both files for
you when you set up the workspace.</p></td>
</tr>
<tr class="row-odd"><td><p><cite>YUM_CONF</cite></p></td>
<td><p>Sets the path where mixer automatically generates the
<code class="file docutils literal notranslate"><span class="pre">.yum-mix.conf</span></code> file.</p>
<p>The yum configuration file points the chroot-builder to
where the RPMs are stored.</p>
</td>
</tr>
<tr class="row-even"><td colspan="2"><p><strong>Table 1</strong>: <em>Variables in builder.conf</em></p></td>
</tr>
</tbody>
</table>
<section id="format-version">
<h4>Format version<a class="headerlink" href="#format-version" title="Link to this heading"></a></h4>
<p>Compatible versions of an OS are tracked with an OS <em>compatibility epoch</em>.
Versions of an OS within an epoch are fully compatible and can update to any
other version within that epoch. The compatibility epoch is set as the
<cite>Format</cite> variable in the <code class="file docutils literal notranslate"><span class="pre">mixer.state</span></code> file. Variables in the
<code class="file docutils literal notranslate"><span class="pre">mixer.state</span></code> are used by mixer between executions and should not be
manually changed.</p>
</section>
<section id="format-bump">
<h4>Format bump<a class="headerlink" href="#format-bump" title="Link to this heading"></a></h4>
<p>Mixer needs to produce content that is consumable by swupd. For swupd to
consume the content, it needs a consistent protocol that describes the
requirements of the Manifest.</p>
<p>If the <cite>Format</cite> increments to a new epoch (a “format bump”), the underlying
<cite>swupd</cite> protocol has changed such that updating from one build version in an
old format to a new build version in a new format is <strong>only</strong> allowed if one
performs a corresponding format bump.</p>
<p>Format bumps are “checkpoints” (see Figure 1). The first release (20) is
built on the previous format with a <cite>swupd</cite> that is capable of interpreting
the next format. The second release (30) has the same content, but its
built in the new format.</p>
<p>Suppose you have build version 10, but you need the tools in build version
40. Whereas version 10 belongs to Format 27, version 40 belongs to Format
28. The swupd client needs to follow formats sequentially. First, you must
update to version 20, which effectively enables a format bump to version 30.
Doing a format bump bridges the gap so your mix can progress to build
version 40.</p>
<figure class="align-default" id="id5">
<img alt="Format bump" src="../../_images/format-bump.png" />
<figcaption>
<p><span class="caption-text">Figure 1: Format bump</span><a class="headerlink" href="#id5" title="Link to this image"></a></p>
</figcaption>
</figure>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>if you update to build 20 and then check which format of the distro is
used, the new build version will show 30, and the new format will show 28.</p>
</div>
</section>
</section>
<section class="content-collapse" id="bundles">
<h3><a class="toc-backref" href="#id17" role="doc-backlink">Bundles</a><a class="headerlink" href="#bundles" title="Link to this heading"></a></h3>
<p>mixer stores information about the bundles included in a mix in a flat file
called <code class="file docutils literal notranslate"><span class="pre">mixbundles</span></code>, which is located in the path set by the
VERSIONS_PATH variable in <code class="file docutils literal notranslate"><span class="pre">builder.conf</span></code>. <code class="file docutils literal notranslate"><span class="pre">mixbundles</span></code> is
automatically created when the mix is initiated. mixer will refresh the file
each time you change the bundles in the mix.</p>
<p>Bundles belong in one of two categories: upstream or local. Upstream
bundles are those provided by Clear Linux OS. Local bundles are either modified upstream bundles or new local bundles.</p>
<section id="upstream-bundles">
<h4>Upstream bundles<a class="headerlink" href="#upstream-bundles" title="Link to this heading"></a></h4>
<p>mixer automatically downloads and caches upstream bundle definition files.
These definition files are stored in the upstream-bundles directory in the
workspace. Do not modify the files in this directory. This directory is
simply a mirror for mixer to use. mixer will automatically delete the
contents of this directory before repopulating it on-the-fly if a new
version must be downloaded.</p>
<p>The mixer tool automatically caches the bundles for the Clear Linux OS version
configured in the <code class="file docutils literal notranslate"><span class="pre">upstreamversion</span></code> file. <strong class="command">mixer</strong> also
cleans up old versions once they are no longer needed.</p>
</section>
<section id="local-bundles">
<h4>Local bundles<a class="headerlink" href="#local-bundles" title="Link to this heading"></a></h4>
<p>Local bundles are bundles that you create, or are edited versions of upstream
bundles. Local bundle definition files are stored in the local-bundles
directory in the workspace. The LOCAL_BUNDLE_DIR variable sets the path of this directory in the <code class="file docutils literal notranslate"><span class="pre">builder.conf</span></code> file.</p>
<p><em>mixer always checks for local bundles first and the upstream bundles
second.</em> So bundles in the local-bundles directory will always take
precedence over any upstream bundles that have the same name. This
precedence enables you to copy upstream bundles locally, and edit into a
local variation.</p>
</section>
<section id="bundle-definition-files">
<h4>Bundle definition files<a class="headerlink" href="#bundle-definition-files" title="Link to this heading"></a></h4>
<p>A <code class="docutils literal notranslate"><span class="pre">bundle</span> <span class="pre">definition</span></code> file consists of a header, followed by a list
of packages and directives. The header holds important meta-data, like
the TITLE, DESCRIPTION, and STATUS. Other meta-data include TAGS, which
define a bundles function in the ecosystem, and MAINTAINER, which gives
contact information.</p>
<p>Following the header are the directives, shown in Table 2.</p>
<table class="docutils align-default" id="id6">
<caption><span class="caption-text"><strong>Table 2</strong>: Bundle directives</span><a class="headerlink" href="#id6" title="Link to this table"></a></caption>
<colgroup>
<col style="width: 50.0%" />
<col style="width: 50.0%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p><strong>Directive</strong></p></th>
<th class="head"><p><strong>Description</strong></p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">include(&lt;required-bundle-name&gt;)</span></code></p></td>
<td><p>Add &lt;required-bundle-name&gt; with this bundle</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">also-add(&lt;optional-bundle-name&gt;)</span></code></p></td>
<td><p>Add &lt;optional-bundle-name&gt; unless the option <code class="docutils literal notranslate"><span class="pre">--skip-optional</span></code> is used with <code class="docutils literal notranslate"><span class="pre">swupd</span> <span class="pre">bundle-add</span></code>.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">content(&lt;full/path/to/non-packaged/content&gt;)</span></code></p></td>
<td><p>Add the non-packaged content to the bundle. Refer to <a class="reference internal" href="swupd-3rd-party.html#swupd-3rd-party"><span class="std std-ref">swupd 3rd-party</span></a> for usage of this directive.</p></td>
</tr>
</tbody>
</table>
<p>Following is <cite>cluster-tools</cite>, an upstream bundle definition file. The
directives are highlighted, and the rest are packages.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="o">[</span>TITLE<span class="o">]</span>:<span class="w"> </span>cluster-tools
<span class="o">[</span>DESCRIPTION<span class="o">]</span>:<span class="w"> </span>Utilities<span class="w"> </span>to<span class="w"> </span>manage<span class="w"> </span>computer<span class="w"> </span>clusters
<span class="o">[</span>STATUS<span class="o">]</span>:<span class="w"> </span>Active
<span class="o">[</span>CAPABILITIES<span class="o">]</span>:<span class="w"> </span>HPC
<span class="o">[</span>TAGS<span class="o">]</span>:<span class="w"> </span>Tools<span class="w"> </span>and<span class="w"> </span>Utilities
<span class="o">[</span>MAINTAINER<span class="o">]</span>:<span class="w"> </span>Juro<span class="w"> </span>Bystricky<span class="w"> </span>&lt;juro.bystricky@intel.com&gt;
<span class="hll">include<span class="o">(</span>curl<span class="o">)</span>
</span><span class="hll">include<span class="o">(</span>libglib<span class="o">)</span>
</span><span class="hll">include<span class="o">(</span>libX11client<span class="o">)</span>
</span><span class="hll">also-add<span class="o">(</span>openmpi<span class="o">)</span>
</span><span class="hll">also-add<span class="o">(</span>modules<span class="o">)</span>
</span>munge
pmix
pdsh
slurm
</pre></div>
</div>
</section>
<section id="bundle-configuration">
<h4>Bundle configuration<a class="headerlink" href="#bundle-configuration" title="Link to this heading"></a></h4>
<p>mixer provides commands to configure the bundles for a mix, such as to add a
bundle to a mix, to create a new bundle for a mix, or to remove a bundle from a mix. View the <a class="reference external" href="https://github.com/clearlinux/mixer-tools/blob/master/docs/mixer.bundle.1.rst">mixer.bundle man page</a> for a full list of commands and more information on configuring bundles in a mix.</p>
<p>Editing an existing local bundle is as simple as opening the bundle definition
file in your favorite editor, making the desired edits, and saving your changes.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Removing bundles from a mix: By default, removing a bundle will only
remove the bundle from the mix. The local bundle definition file will
still remain. To completely remove a bundle, including its local bundle definition file, use the <strong class="command">--local</strong> flag.</p>
<p>If you remove the bundle definition file for a local, edited version of an
upstream bundle in a mix, the mix reverts to reference the original upstream version of the bundle.</p>
</div>
</section>
</section>
<section class="content-collapse" id="set-up-a-nginx-web-server-for-mixer">
<span id="set-up-nginx-web-server-start"></span><h3><a class="toc-backref" href="#id18" role="doc-backlink">Set up a nginx web server for mixer</a><a class="headerlink" href="#set-up-a-nginx-web-server-for-mixer" title="Link to this heading"></a></h3>
<p>A web server is needed to host your update content. In this example,
the nginx web server is used.</p>
<ol class="arabic">
<li><p>Install the <strong class="command">nginx</strong> bundle.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>swupd<span class="w"> </span>bundle-add<span class="w"> </span>nginx
</pre></div>
</div>
</li>
<li><p>Create a symbolic link to the mixer update content directory.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/var/www
sudo<span class="w"> </span>ln<span class="w"> </span>-sf<span class="w"> </span><span class="nv">$HOME</span>/mixer/update/www<span class="w"> </span>/var/www/mixer
</pre></div>
</div>
</li>
<li><p>Set up nginx configuration files.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/nginx/conf.d
sudo<span class="w"> </span>cp<span class="w"> </span>-f<span class="w"> </span>/usr/share/nginx/conf/nginx.conf.example<span class="w"> </span>/etc/nginx/nginx.conf
</pre></div>
</div>
</li>
<li><p>Grant <code class="docutils literal notranslate"><span class="pre">$USER</span></code> permission to run the web server.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>tee<span class="w"> </span>-a<span class="w"> </span>/etc/nginx/nginx.conf<span class="w"> </span><span class="s">&lt;&lt; EOF</span>
<span class="s">user $USER;</span>
<span class="s">EOF</span>
</pre></div>
</div>
</li>
<li><p>Configure the mixer update server.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>tee<span class="w"> </span>-a<span class="w"> </span>/etc/nginx/conf.d/mixer-server.conf<span class="w"> </span><span class="s">&lt;&lt; EOF</span>
<span class="s">server {</span>
<span class="s"> server_name localhost;</span>
<span class="s"> location / {</span>
<span class="s"> root /var/www/mixer;</span>
<span class="s"> autoindex on;</span>
<span class="s"> }</span>
<span class="s">}</span>
<span class="s">EOF</span>
</pre></div>
</div>
</li>
<li><p>Restart the daemon, enable nginx on boot, and start the service.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>systemctl<span class="w"> </span>daemon-reload
sudo<span class="w"> </span>systemctl<span class="w"> </span><span class="nb">enable</span><span class="w"> </span>nginx<span class="w"> </span>--now
</pre></div>
</div>
</li>
<li><p>Verify the web server is running at http://&lt;IP-address-of-web-server&gt;.
If theres no mix content yet, the expected response from nginx will be
a <code class="docutils literal notranslate"><span class="pre">404</span> <span class="pre">Not</span> <span class="pre">Found</span></code>.</p></li>
</ol>
</section>
</section>
<section id="related-topics">
<span id="set-up-nginx-web-server-end"></span><h2><a class="toc-backref" href="#id11" role="doc-backlink">Related topics</a><a class="headerlink" href="#related-topics" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="autospec.html#autospec"><span class="std std-ref">autospec</span></a></p></li>
<li><p><a class="reference internal" href="bundles.html#bundles-guide"><span class="std std-ref">Bundles</span></a></p></li>
<li><p><a class="reference internal" href="swupd.html#swupd-guide"><span class="std std-ref">swupd</span></a></p></li>
<li><p><a class="reference internal" href="swupd-3rd-party.html#swupd-3rd-party"><span class="std std-ref">swupd 3rd-party</span></a></p></li>
</ul>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../index.html">
<img class="logo" src="../../_static/clearlinux.png" alt="Logo of Clear Linux* Project Docs"/>
</a></p>
<div>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">mixer</a><ul>
<li><a class="reference internal" href="#description">Description</a></li>
<li><a class="reference internal" href="#how-it-works">How it works</a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a></li>
<li><a class="reference internal" href="#mix-setup">Mix setup</a></li>
<li><a class="reference internal" href="#create-a-mix">Create a mix</a></li>
<li><a class="reference internal" href="#maintain-or-modify-mix">Maintain or modify mix</a></li>
</ul>
</li>
<li><a class="reference internal" href="#examples">Examples</a><ul>
<li><a class="reference internal" href="#example-1-mix-set-up">Example 1: Mix set up</a></li>
<li><a class="reference internal" href="#example-2-create-a-simple-mix">Example 2: Create a simple mix</a></li>
<li><a class="reference internal" href="#example-3-create-an-update-for-your-mix">Example 3: Create an update for your mix</a></li>
<li><a class="reference internal" href="#example-4-build-an-image">Example 4: Build an image</a></li>
<li><a class="reference internal" href="#example-5-deploy-updates-to-target">Example 5: Deploy updates to target</a></li>
<li><a class="reference internal" href="#example-6-remove-a-bundle-from-client-system">Example 6: Remove a bundle from client system</a></li>
<li><a class="reference internal" href="#example-7-execute-a-format-bump">Example 7: Execute a format bump</a><ul>
<li><a class="reference internal" href="#basic">Basic</a></li>
<li><a class="reference internal" href="#advanced">Advanced</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#references">References</a><ul>
<li><a class="reference internal" href="#builder-conf">builder.conf</a><ul>
<li><a class="reference internal" href="#format-version">Format version</a></li>
<li><a class="reference internal" href="#format-bump">Format bump</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bundles">Bundles</a><ul>
<li><a class="reference internal" href="#upstream-bundles">Upstream bundles</a></li>
<li><a class="reference internal" href="#local-bundles">Local bundles</a></li>
<li><a class="reference internal" href="#bundle-definition-files">Bundle definition files</a></li>
<li><a class="reference internal" href="#bundle-configuration">Bundle configuration</a></li>
</ul>
</li>
<li><a class="reference internal" href="#set-up-a-nginx-web-server-for-mixer">Set up a nginx web server for mixer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#related-topics">Related topics</a></li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="k8s-migration.html"
title="previous chapter">Kubernetes* migration</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="performance.html"
title="next chapter">Performance</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/guides/clear/mixer.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="performance.html" title="Performance"
>next</a> |</li>
<li class="right" >
<a href="k8s-migration.html" title="Kubernetes* migration"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Guides</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">mixer</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2022 Intel Corporation. All Rights Reserved..
Last updated on Nov 04, 2024.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
</div>
</body>
</html>