<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-busybox" role="wrap">
  <?dbhtml filename="busybox.html"?>

  <title>BusyBox-&busybox-version;</title>

  <indexterm zone="ch-system-busybox">
    <primary sortas="a-BusyBox">BusyBox</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>BusyBox combines tiny versions of many common UNIX utilities into a 
    single small executable. It provides replacements for most of the utilities 
    you usually find in GNU fileutils, shellutils, etc. The utilities in 
    BusyBox generally have fewer options than their full-featured GNU cousins; 
    however, the options that are included provide the expected functionality 
    and behave very much like their GNU counterparts. BusyBox provides
     a fairly complete environment for any small or embedded system.</para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of BusyBox</title>

    <para os="a">First ensure the BusyBox source is completely clean:</para>

<screen os="b"><userinput>make distclean</userinput></screen>

    <para os="c">The following patch is needed for musl-libc:</para>

<screen os="d"><userinput>patch -Np1 -i ../&busybox-musl-patch;</userinput></screen>

    <note os="e"> <para>We tell BusyBox to use the generic defconfig.  For those
        for more adventurous, you can use <command>make menuconfig</command>,
        and create a custom or modified configuration for your build.</para>
    </note>

    <para os="f">The following tells BusyBox to use the default
      configuration:</para>

<screen os="g"><userinput>ARCH="${CLFS_ARCH}" make defconfig</userinput></screen>

    <para os="fa">Disable building both ifplugd and inetd as they both have
      issues building against musl-libc:</para>

<screen os="fb"><userinput>sed -i 's/\(CONFIG_\)\(.*\)\(INETD\)\(.*\)=y/# \1\2\3\4 is not set/g' .config
sed -i 's/\(CONFIG_IFPLUGD\)=y/# \1 is not set/' .config</userinput></screen>

    <para os="h">Compile the package:</para>

<screen os="i"><userinput>ARCH="${CLFS_ARCH}" CROSS_COMPILE="${CLFS_TARGET}-" make</userinput></screen>

    <para os="j">Install the package:</para>

<screen os="k"><userinput>ARCH="${CLFS_ARCH}" CROSS_COMPILE="${CLFS_TARGET}-" make  \
  CONFIG_PREFIX="${CLFS}/targetfs" install</userinput></screen>

    <para os="l">If you're going to build your kernel with modules, you will need
    to make sure <command>depmod.pl</command> is available:</para>

<screen os="m"><userinput>cp examples/depmod.pl ${CLFS}/cross-tools/bin
chmod 755 ${CLFS}/cross-tools/bin/depmod.pl</userinput></screen>

  </sect2>

  <sect2 id="contents-busybox" role="content">
    <title>Contents of BusyBox</title>

    <segmentedlist>
      <segtitle>Installed programs</segtitle>

      <seglistitem>
        <seg>To be Written</seg>
      </seglistitem>
    </segmentedlist>

<!--
    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="bash">
        <term><command>bash</command></term>
        <listitem>
          <para>A widely-used command interpreter; it performs many types of
          expansions and substitutions on a given command line before executing
          it, thus making this interpreter a powerful tool</para>
          <indexterm zone="ch-system-bash bash">
            <primary sortas="b-bash">bash</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="bashbug">
        <term><command>bashbug</command></term>
        <listitem>
          <para>A shell script to help the user compose and mail standard
          formatted bug reports concerning <command>bash</command></para>
          <indexterm zone="ch-system-bash bashbug">
            <primary sortas="b-bashbug">bashbug</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sh">
        <term><command>sh</command></term>
        <listitem>
          <para>A symlink to the <command>bash</command> program; when invoked
          as <command>sh</command>, <command>bash</command> tries to mimic the
          startup behavior of historical versions of <command>sh</command> as
          closely as possible, while conforming to the POSIX standard as
          well</para>
          <indexterm zone="ch-system-bash sh">
            <primary sortas="b-sh">sh</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>
-->
  </sect2>

</sect1>
