Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > b50d8ee6d7871fcc13c0677a9364ed59 > files > 322

bcfg2-doc-1.3.0-1.fc17.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Gentoo &mdash; Bcfg2 1.3.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/sidebar.js"></script>
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="top" title="Bcfg2 1.3.0 documentation" href="../../index.html" />
    <link rel="up" title="Guides" href="../guides.html" />
    <link rel="next" title="Import existing ssh keys" href="import-existing-ssh-keys.html" />
    <link rel="prev" title="Fedora" href="fedora.html" />
 
<link rel="stylesheet" href="../../_static/bcfg2.css" type=""/>

  </head>
  <body>

<div style="text-align: left; padding: 10px 10px 15px 15px">
<a href="../../index.html"><img src="../../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a>
</div>

    <div class="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="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="import-existing-ssh-keys.html" title="Import existing ssh keys"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="fedora.html" title="Fedora"
             accesskey="P">previous</a> |</li>
	<li><a href="../../index.html">home</a> |&nbsp;</li>
	<!--<li><a href="../../search.html">search</a> |&nbsp;</li>-->
	<li><a href="../../help/index.html">help</a> |&nbsp;</li>
	<li><a href="../../contents.html">documentation </a> &raquo;</li>

          <li><a href="../../contents.html" >Bcfg2 documentation 1.3.0</a> &raquo;</li>
          <li><a href="../index.html" >Appendix</a> &raquo;</li>
          <li><a href="../guides.html" accesskey="U">Guides</a> &raquo;</li> 
      </ul>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="gentoo">
<span id="appendix-guides-gentoo"></span><h1>Gentoo<a class="headerlink" href="#gentoo" title="Permalink to this headline">¶</a></h1>
<p>This document tries to lay out anything Gentoo-specific that you need
to know in order to use Bcfg2. Mostly that has to do with getting it
to cooperate with the various pieces of Portage. Services, all things
POSIX, and just about anything else that Bcfg2 does will work the same
on Gentoo as on any other distribution.  Bcfg2 is new on Gentoo; please
let the list know if you find errors or omissions.</p>
<div class="section" id="installing-bcfg2">
<h2>Installing Bcfg2<a class="headerlink" href="#installing-bcfg2" title="Permalink to this headline">¶</a></h2>
<p>Early in July 2008, Bcfg2 was added to the Gentoo portage tree.</p>
<p>If you don&#8217;t use portage to install Bcfg2, you&#8217;ll want to make sure you
have all the prerequisites installed first. For a server, you&#8217;ll need:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">dev-libs/libgamin[python]</span></tt></li>
<li><tt class="docutils literal"><span class="pre">dev-python/lxml</span></tt></li>
</ul>
<p>Clients will need at least:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">app-portage/gentoolkit</span></tt></li>
</ul>
</div>
<div class="section" id="portage-installs-from-source">
<h2>Portage installs from source<a class="headerlink" href="#portage-installs-from-source" title="Permalink to this headline">¶</a></h2>
<p class="versionadded">
<span class="versionmodified">New in version 1.3.0.</span></p>
<p>By default the client will run with the <tt class="docutils literal"><span class="pre">--gitbinpkgonly</span></tt> option. If
you want your client to install packages from source (rather than
having a binary build host as seen below), you can set the following in
<tt class="docutils literal"><span class="pre">/etc/bcfg2.conf</span></tt>.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">Portage</span><span class="p">]</span>
<span class="n">binpkgonly</span> <span class="o">=</span> <span class="n">false</span>
</pre></div>
</div>
</div>
<div class="section" id="package-repository">
<h2>Package Repository<a class="headerlink" href="#package-repository" title="Permalink to this headline">¶</a></h2>
<p>You’ll need (to make) at least one archive of binary packages. The
Portage driver calls <tt class="docutils literal"><span class="pre">emerge</span></tt> with the <tt class="docutils literal"><span class="pre">--getbinpkgonly</span></tt> option. See
<em class="manpage">make.conf(5)</em> and <em class="manpage">emerge(1)</em> manpages, specifically
the <span class="target" id="index-0"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PORTAGE_BINHOST</span></tt> environment variable.</p>
<div class="section" id="time-saver-quickpkg">
<h3>Time Saver: quickpkg<a class="headerlink" href="#time-saver-quickpkg" title="Permalink to this headline">¶</a></h3>
<p>If you have a standing Gentoo machine that you want to preserve or
propagate, you can generate a complete package archive based on the
present state of the system by using the quickpkg utility. For example:</p>
<div class="highlight-sh"><div class="highlight"><pre><span class="k">for </span>pkg in <span class="sb">`</span>equery -q l<span class="sb">`</span> ; <span class="k">do </span>quickpkg <span class="s2">&quot;=$pkg&quot;</span> ; <span class="k">done</span>
</pre></div>
</div>
<p>...will leave you with a complete archive of all the packages on your
system in <tt class="docutils literal"><span class="pre">/usr/portage/packages/All</span></tt>, which you can then move to your
ftp server.</p>
</div>
<div class="section" id="cataloging-packages-in-your-repository">
<h3>Cataloging Packages In Your Repository<a class="headerlink" href="#cataloging-packages-in-your-repository" title="Permalink to this headline">¶</a></h3>
<p>Once you have a set of packages, you will need to create a catalog for
them in <tt class="docutils literal"><span class="pre">/var/lib/bcfg2/Pkgmgr</span></tt>. Here&#8217;s a template:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;PackageList</span> <span class="na">uri=</span><span class="s">&#39;&#39;</span> <span class="na">type=</span><span class="s">&#39;portage&#39;</span> <span class="na">priority=</span><span class="s">&#39;&#39;</span><span class="nt">&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;&#39;</span> <span class="na">version=</span><span class="s">&#39;&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
<span class="nt">&lt;/PackageList&gt;</span>
</pre></div>
</div>
<p>...and a partially filled-out example, for our local Gentoo/VMware build:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;PackageList</span> <span class="na">uri=</span><span class="s">&#39;ftp://filthy.uchicago.edu/200701-vmware/&#39;</span> <span class="na">type=</span><span class="s">&#39;portage&#39;</span> <span class="na">priority=</span><span class="s">&#39;0&#39;</span><span class="nt">&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;gentoo-200701-vmware&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;app-admin/bcfg2&#39;</span> <span class="na">version=</span><span class="s">&#39;0.9.1_pre1&#39;</span><span class="nt">/&gt;</span>
    [...]
    <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;x11-wm/twm&#39;</span> <span class="na">version=</span><span class="s">&#39;1.0.1&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
<span class="nt">&lt;/PackageList&gt;</span>
</pre></div>
</div>
<p>The <cite>&lt;Group&gt;</cite> name (in our example, &#8220;gentoo-200701-vmware&#8221;) should
be included by any host which will draw its packages from this list. Our
collection of packages for this class of machines is at the listed URI,
and we only have one collection of packages for this batch of machines so
in our case the <cite>priority</cite> doesn’t really matter, we&#8217;ve set it to <cite>0</cite>.</p>
<p>Notice that package name fields are in <cite>CAT/TITLE</cite> format.</p>
<p>Here is a hack which will generate a list of Package lines from
a system&#8217;s database of installed packages, especially useful in
conjunction with the <tt class="docutils literal"><span class="pre">quickpkg</span></tt> example above:</p>
<div class="highlight-sh"><div class="highlight"><pre><span class="c">#!/bin/bash</span>
<span class="k">for </span>pkg in <span class="sb">`</span>equery -q l<span class="sb">`</span> ; <span class="k">do</span>
<span class="k">   </span><span class="nv">title</span><span class="o">=</span><span class="sb">`</span><span class="nb">echo</span> <span class="nv">$pkg</span> | sed -e <span class="s1">&#39;s/\(.*\)-\([0-9].*\)/\1/&#39;</span><span class="sb">`</span>
   <span class="nv">version</span><span class="o">=</span><span class="sb">`</span><span class="nb">echo</span> <span class="nv">$pkg</span> | sed -e <span class="s1">&#39;s/\(.*\)-\([0-9].*\)/\2/&#39;</span><span class="sb">`</span>
   <span class="nb">echo</span> <span class="s2">&quot;    &lt;Package name=&#39;${title}&#39; version=&#39;${version}&#39;/&gt;&quot;</span>
<span class="k">done</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="configuring-client-machines">
<h2>Configuring Client Machines<a class="headerlink" href="#configuring-client-machines" title="Permalink to this headline">¶</a></h2>
<p>Set up <tt class="docutils literal"><span class="pre">/etc/bcfg2.conf</span></tt> the way you would for any other Bcfg2 client.</p>
<p>In <tt class="docutils literal"><span class="pre">make.conf</span></tt>, set <em>PORTAGE_BINHOST</em> to point to the URI of
your package repository. You may want to create versions of
<tt class="docutils literal"><span class="pre">make.conf</span></tt> for each package repository you maintain, with
appropriate <em>PORTAGE_BINHOST</em> URI&#8217;s in each, and associated with
that package archive&#8217;s group under <tt class="docutils literal"><span class="pre">Cfg</span></tt> &#8211; for example, we have
<tt class="docutils literal"><span class="pre">Cfg/etc/make.conf/make.conf.G99_gentoo-200701-vmware</span></tt>. If a client
host switches groups, and the new group needs a different set of packages,
everything should just fall into place.</p>
</div>
<div class="section" id="pitfalls">
<h2>Pitfalls<a class="headerlink" href="#pitfalls" title="Permalink to this headline">¶</a></h2>
<div class="section" id="boot">
<h3>/boot<a class="headerlink" href="#boot" title="Permalink to this headline">¶</a></h3>
<p>Gentoo as well as some other distros recommend leaving <tt class="docutils literal"><span class="pre">/boot</span></tt> unmounted
during normal runtime. This can lead to trouble during verification and
package installation, for example when <tt class="docutils literal"><span class="pre">/boot/grub/grub.conf</span></tt> turns
up missing. The simplest way around this might just be to ensure that
<tt class="docutils literal"><span class="pre">/boot</span></tt> is mounted whenever you run Bcfg2, possibly wrapping Bcfg2
in a script for the purpose. I&#8217;ve also thought about adding <em>Action</em>
clauses to bundles for grub and our kernel packages, which would mount
<tt class="docutils literal"><span class="pre">/boot</span></tt> before the bundle installs and unmount it afterward, but this
doesn&#8217;t get around the problem of those packages flunking verification.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Gentoo</a><ul>
<li><a class="reference internal" href="#installing-bcfg2">Installing Bcfg2</a></li>
<li><a class="reference internal" href="#portage-installs-from-source">Portage installs from source</a></li>
<li><a class="reference internal" href="#package-repository">Package Repository</a><ul>
<li><a class="reference internal" href="#time-saver-quickpkg">Time Saver: quickpkg</a></li>
<li><a class="reference internal" href="#cataloging-packages-in-your-repository">Cataloging Packages In Your Repository</a></li>
</ul>
</li>
<li><a class="reference internal" href="#configuring-client-machines">Configuring Client Machines</a></li>
<li><a class="reference internal" href="#pitfalls">Pitfalls</a><ul>
<li><a class="reference internal" href="#boot">/boot</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="fedora.html"
                        title="previous chapter">Fedora</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="import-existing-ssh-keys.html"
                        title="next chapter">Import existing ssh keys</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/appendix/guides/gentoo.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="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="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="import-existing-ssh-keys.html" title="Import existing ssh keys"
             >next</a> |</li>
        <li class="right" >
          <a href="fedora.html" title="Fedora"
             >previous</a> |</li>
	<li><a href="../../index.html">home</a> |&nbsp;</li>
	<!--<li><a href="../../search.html">search</a> |&nbsp;</li>-->
	<li><a href="../../help/index.html">help</a> |&nbsp;</li>
	<li><a href="../../contents.html">documentation </a> &raquo;</li>

          <li><a href="../../contents.html" >Bcfg2 documentation 1.3.0</a> &raquo;</li>
          <li><a href="../index.html" >Appendix</a> &raquo;</li>
          <li><a href="../guides.html" >Guides</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2013, Narayan Desai.
      Last updated on Mar 20, 2013.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>