Index: BOOK/final-system/arm-chapter.xml
===================================================================
--- BOOK/final-system/arm-chapter.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ BOOK/final-system/arm-chapter.xml	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -15,5 +15,5 @@
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/pkgmgt.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/toolchain.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="arm/busybox.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/busybox.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/e2fsprogs.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/iana-etc.xml"/>
Index: OK/final-system/arm/busybox.xml
===================================================================
--- BOOK/final-system/arm/busybox.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ 	(revision )
@@ -1,87 +1,0 @@
-<?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>
-
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-  href="../x86/busybox.xml"
-  xpointer="xpointer(//*[@role='package'])"/>
-
-  <sect2 role="installation">
-    <title>Installation of Busybox</title>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p1'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p2'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p3'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p4'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='a'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='b'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='c'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='d'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='e'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='f'])"/>
-
-<screen os="g"><userinput>make ARCH=arm CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}"</userinput></screen>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='h'])"/>
-
-<screen os="i"><userinput>make ARCH=arm CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}" \
-    CONFIG_PREFIX="${CLFS}" install</userinput></screen>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='h'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='k'])"/>
-
-  </sect2>
-
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-  href="../x86/busybox.xml"
-  xpointer="xpointer(id('contents-busybox'))"/>
-
-</sect1>
Index: BOOK/final-system/common/busybox.xml
===================================================================
--- BOOK/final-system/common/busybox.xml	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
+++ BOOK/final-system/common/busybox.xml	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -0,0 +1,146 @@
+<?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="p1">The following patch contains a number of updates to the
+    &busybox-version; branch by the Busybox developers:</para>
+
+<screen os="p2"><userinput>patch -Np1 -i ../&busybox-branch_update-patch;</userinput></screen>
+
+    <para os="a">Create the default configuration:</para>
+
+<screen os="b"><userinput>make defconfig</userinput></screen>
+
+    <note os="c">
+      <para>Below we are just telling Busybox to use the default configuration of
+      uClibc. For those for more adventureous, you can use make menuconfig, and
+      do a more custom build of your Busybox.</para>
+    </note>
+
+   <para os="d">We will need to edit the configuration file, to make sure everything gets
+   compiled:</para>
+
+<screen os="e"><userinput>BUSYBOX_OPTIONS="CONFIG_DMALLOC CONFIG_BUILD_AT_ONCE CONFIG_BUILD_LIBBUSYBOX
+    CONFIG_FEATURE_SH_IS_NONE CONFIG_LOCALE_SUPPORT CONFIG_TFTP CONFIG_FTPGET
+    CONFIG_FTPPUT CONFIG_IPCALC CONFIG_TFTP CONFIG_HUSH CONFIG_LASH
+    CONFIG_MSH CONFIG_INETD CONFIG_DPKG CONFIG_RPM2CPIO CONFIG_RPM
+    CONFIG_FOLD CONFIG_LOGNAME CONFIG_OD CONFIG_CRONTAB CONFIG_UUDECODE
+    CONFIG_UUENCODE CONFIG_SULOGIN CONFIG_DC CONFIG_DEBUG_YANK_SUSv2
+    CONFIG_DEBUG_INIT CONFIG_DEBUG_CROND_OPTION CONFIG_FEATURE_UDHCP_DEBUG
+    CONFIG_TASKSET CONFIG_CHATTR CONFIG_FSCK CONFIG_LSATTR CONFIG_CHPST
+    CONFIG_SETUIDGID CONFIG_ENVUIDGID CONFIG_ENVDIR CONFIG_SOFTLIMIT
+    CONFIG_FEATURE_2_4_MODULES"
+for config in $BUSYBOX_OPTIONS; do
+    cp .config{,.orig}
+    sed -e "s:${config}=y:${config}=n:" .config.orig &gt; .config
+done
+BUSYBOX_OPTIONS="CONFIG_FEATURE_SH_IS_ASH CONFIG_FEATURE_TRACEROUTE_VERBOSE
+    CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE"
+for config in $BUSYBOX_OPTIONS; do
+    cp .config{,.orig}
+    sed -e "s:# ${config} is not set:${config}=y:" .config.orig &gt; .config
+done</userinput></screen>
+
+    <para os="f">Compile the package:</para>
+
+<screen os="g"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}"</userinput></screen>
+
+    <para os="h">Install the package:</para>
+
+<screen os="i"><userinput>make ARCH=${CLFS_ARCH} CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}" \
+    CONFIG_PREFIX="${CLFS}" install</userinput></screen>
+
+    <para os="j">If your going to build your kernel with modules, you will need to make
+    sure <command>depmod.pl</command> is available:</para>
+
+<screen os="k"><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>
Index: BOOK/final-system/mips-chapter.xml
===================================================================
--- BOOK/final-system/mips-chapter.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ BOOK/final-system/mips-chapter.xml	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -15,5 +15,5 @@
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/pkgmgt.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/toolchain.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips/busybox.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/busybox.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/e2fsprogs.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/iana-etc.xml"/>
Index: OK/final-system/mips/busybox.xml
===================================================================
--- BOOK/final-system/mips/busybox.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ 	(revision )
@@ -1,87 +1,0 @@
-<?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>
-
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-  href="../x86/busybox.xml"
-  xpointer="xpointer(//*[@role='package'])"/>
-
-  <sect2 role="installation">
-    <title>Installation of Busybox</title>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p1'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p2'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p3'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='p4'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='a'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='b'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='c'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='d'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='e'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='f'])"/>
-
-<screen os="g"><userinput>make ARCH=mips CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}"</userinput></screen>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='h'])"/>
-
-<screen os="i"><userinput>make ARCH=mips CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}" \
-    CONFIG_PREFIX="${CLFS}" install</userinput></screen>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='h'])"/>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-    href="../x86/busybox.xml"
-    xpointer="xpointer(//*[@os='k'])"/>
-
-  </sect2>
-
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
-  href="../x86/busybox.xml"
-  xpointer="xpointer(id('contents-busybox'))"/>
-
-</sect1>
Index: BOOK/final-system/wrt-chapter.xml
===================================================================
--- BOOK/final-system/wrt-chapter.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ BOOK/final-system/wrt-chapter.xml	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -15,5 +15,5 @@
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/pkgmgt.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/toolchain.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips/busybox.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/busybox.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/iana-etc.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/zlib.xml"/>
Index: BOOK/final-system/x86-chapter.xml
===================================================================
--- BOOK/final-system/x86-chapter.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ BOOK/final-system/x86-chapter.xml	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -15,5 +15,5 @@
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/pkgmgt.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/toolchain.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="x86/busybox.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/busybox.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/e2fsprogs.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/iana-etc.xml"/>
Index: OK/final-system/x86/busybox.xml
===================================================================
--- BOOK/final-system/x86/busybox.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ 	(revision )
@@ -1,152 +1,0 @@
-<?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="p1">The following patch fixes some issues that are related to the
-    headers we are using:</para>
-
-<screen os="p2"><userinput>patch -Np1 -i ../&busybox-fixes-patch;</userinput></screen>
-
-    <para os="p3">The following patch corrects some includes in
-    <filename>iptunnel.c</filename> to be compatible with the sanatized
-    kernel headers installed earlier:</para>
-
-<screen os="p4"><userinput>patch -Np1 -i ../&busybox-iptunnel_headers-patch;</userinput></screen>
-
-    <para os="a">Create the default configuration:</para>
-
-<screen os="b"><userinput>make defconfig</userinput></screen>
-
-    <note os="c">
-      <para>Below we are just telling Busybox to use the default configuration of
-      uClibc. For those for more adventureous, you can use make menuconfig, and
-      do a more custom build of your Busybox.</para>
-    </note>
-
-   <para os="d">We will need to edit the configuration file, to make sure everything gets
-   compiled:</para>
-
-<screen os="e"><userinput>BUSYBOX_OPTIONS="CONFIG_DMALLOC CONFIG_BUILD_AT_ONCE CONFIG_BUILD_LIBBUSYBOX
-    CONFIG_FEATURE_SH_IS_NONE CONFIG_LOCALE_SUPPORT CONFIG_TFTP CONFIG_FTPGET
-    CONFIG_FTPPUT CONFIG_IPCALC CONFIG_TFTP CONFIG_HUSH CONFIG_LASH
-    CONFIG_MSH CONFIG_INETD CONFIG_DPKG CONFIG_RPM2CPIO CONFIG_RPM
-    CONFIG_FOLD CONFIG_LOGNAME CONFIG_OD CONFIG_CRONTAB CONFIG_UUDECODE
-    CONFIG_UUENCODE CONFIG_SULOGIN CONFIG_DC CONFIG_DEBUG_YANK_SUSv2
-    CONFIG_DEBUG_INIT CONFIG_DEBUG_CROND_OPTION CONFIG_FEATURE_UDHCP_DEBUG
-    CONFIG_TASKSET CONFIG_CHATTR CONFIG_FSCK CONFIG_LSATTR CONFIG_CHPST
-    CONFIG_SETUIDGID CONFIG_ENVUIDGID CONFIG_ENVDIR CONFIG_SOFTLIMIT
-    CONFIG_FEATURE_2_4_MODULES"
-for config in $BUSYBOX_OPTIONS; do
-    cp .config{,.orig}
-    sed -e "s:${config}=y:${config}=n:" .config.orig &gt; .config
-done
-BUSYBOX_OPTIONS="CONFIG_FEATURE_SH_IS_ASH CONFIG_FEATURE_TRACEROUTE_VERBOSE
-    CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE"
-for config in $BUSYBOX_OPTIONS; do
-    cp .config{,.orig}
-    sed -e "s:# ${config} is not set:${config}=y:" .config.orig &gt; .config
-done</userinput></screen>
-
-    <para os="f">Compile the package:</para>
-
-<screen os="g"><userinput>make ARCH=i386 CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}"</userinput></screen>
-
-    <para os="h">Install the package:</para>
-
-<screen os="i"><userinput>make ARCH=i386 CROSS_COMPILE="${CLFS_TARGET}-" CFLAGS="${BUILD}" \
-    CONFIG_PREFIX="${CLFS}" install</userinput></screen>
-
-    <para os="j">If your going to build your kernel with modules, you will need to make
-    sure <command>depmod.pl</command> is available:</para>
-
-<screen os="k"><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>
Index: BOOK/materials/common/patches.xml
===================================================================
--- BOOK/materials/common/patches.xml	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ BOOK/materials/common/patches.xml	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -38,18 +38,9 @@
 
     <varlistentry>
-      <term>Busybox Fixes Patch - <token>&busybox-fixes-patch-size;</token>:</term>
+      <term>Busybox Branch Update Patch - <token>&busybox-branch_update-patch-size;</token>:</term>
       <listitem>
         <para>Download: <ulink
-        url="&patches-root;&busybox-fixes-patch;"/></para>
-        <para>MD5 sum: <literal>&busybox-fixes-patch-md5;</literal></para>
-      </listitem>
-    </varlistentry>
-
-    <varlistentry>
-      <term>Busybox Iptunnel Headers Patch - <token>&busybox-iptunnel_headers-patch-size;</token>:</term>
-      <listitem>
-        <para>Download: <ulink
-        url="&patches-root;&busybox-iptunnel_headers-patch;"/></para>
-        <para>MD5 sum: <literal>&busybox-iptunnel_headers-patch-md5;</literal></para>
+        url="&patches-root;&busybox-branch_update-patch;"/></para>
+        <para>MD5 sum: <literal>&busybox-branch_update-patch-md5;</literal></para>
       </listitem>
     </varlistentry>
Index: BOOK/patches.ent
===================================================================
--- BOOK/patches.ent	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ BOOK/patches.ent	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -13,11 +13,7 @@
 <!ENTITY binutils-posix-patch-size "4 KB">
 
-<!ENTITY busybox-fixes-patch "busybox-&busybox-version;-fixes-1.patch">
-<!ENTITY busybox-fixes-patch-md5 "984f771a81475c234b1fc3f92c672b4d">
-<!ENTITY busybox-fixes-patch-size "16 KB">
-
-<!ENTITY busybox-iptunnel_headers-patch "busybox-&busybox-version;-iptunnel_headers-1.patch">
-<!ENTITY busybox-iptunnel_headers-patch-md5 "f0771cde6810a68c5459683b8c5e69b31">
-<!ENTITY busybox-iptunnel_headers-patch-size "4 KB">
+<!ENTITY busybox-branch_update-patch "busybox-&busybox-version;-branch_update-1.patch">
+<!ENTITY busybox-branch_update-patch-md5 "878f435f7ab3a7bc8dfffaeb7038a6da">
+<!ENTITY busybox-branch_update-patch-size "8 KB">
 
 <!--
Index: tches/busybox-1.12.1-fixes-1.patch
===================================================================
--- patches/busybox-1.12.1-fixes-1.patch	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ 	(revision )
@@ -1,357 +1,0 @@
-Submitted By: Joe Ciccone <jciccone@gmail.com>
-Date: 2008-11-08
-Origin: Busybox FTP
-Initial Package Version: 1.12.1
-Upstream Status: From Upstream
-Descriprion: Apply fixes from upstream
-                 busybox-1.12.1-basename.patch
-                 busybox-1.12.1-grep.patch
-                 busybox-1.12.1-lineedit.patch
-                 busybox-1.12.1-login.patch
-                 busybox-1.12.1-modprobe.patch
-                 busybox-1.12.1-standalone.patch
-                 busybox-1.12.1-vi.patch
-
-diff -Naur busybox-1.12.1.orig/coreutils/basename.c busybox-1.12.1/coreutils/basename.c
---- busybox-1.12.1.orig/coreutils/basename.c	2008-09-28 14:04:18.000000000 -0400
-+++ busybox-1.12.1/coreutils/basename.c	2008-11-08 09:49:16.000000000 -0500
-@@ -48,5 +48,5 @@
- 
- 	/* puts(s) will do, but we can do without stdio this way: */
- 	s[m++] = '\n';
--	return full_write(STDOUT_FILENO, s, m) == (ssize_t)m;
-+	return full_write(STDOUT_FILENO, s, m) != (ssize_t)m;
- }
-diff -Naur busybox-1.12.1.orig/coreutils/env.c busybox-1.12.1/coreutils/env.c
---- busybox-1.12.1.orig/coreutils/env.c	2008-09-28 14:04:18.000000000 -0400
-+++ busybox-1.12.1/coreutils/env.c	2008-11-08 09:49:16.000000000 -0500
-@@ -29,6 +29,8 @@
-  * - use xfunc_error_retval
-  */
- 
-+/* This is a NOEXEC applet. Be very careful! */
-+
- #include "libbb.h"
- 
- #if ENABLE_FEATURE_ENV_LONG_OPTIONS
-@@ -119,5 +121,3 @@
-  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-  * SUCH DAMAGE.
-  */
--
--
-diff -Naur busybox-1.12.1.orig/editors/vi.c busybox-1.12.1/editors/vi.c
---- busybox-1.12.1.orig/editors/vi.c	2008-09-28 14:04:29.000000000 -0400
-+++ busybox-1.12.1/editors/vi.c	2008-11-08 09:49:16.000000000 -0500
-@@ -291,6 +291,8 @@
- #define INIT_G() do { \
- 	SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
- 	last_file_modified = -1; \
-+	/* "" but has space for 2 chars */ \
-+	USE_FEATURE_VI_SEARCH(last_search_pattern = xzalloc(2);) \
- } while (0)
- 
- 
-@@ -2974,7 +2976,7 @@
- 	const char *msg = msg; // for compiler
- 	char c1, *p, *q, *save_dot;
- 	char buf[12];
--	int dir = dir; // for compiler
-+	int dir;
- 	int cnt, i, j;
- 
- //	c1 = c; // quiet the compiler
-@@ -3316,7 +3318,7 @@
- 		q = get_input_line(buf);	// get input line- use "status line"
- 		if (q[0] && !q[1]) {
- 			if (last_search_pattern[0])
--			    last_search_pattern[0] = c;
-+				last_search_pattern[0] = c;
- 			goto dc3; // if no pat re-use old pat
- 		}
- 		if (q[0]) {       // strlen(q) > 1: new pat- save it and find
-@@ -3346,14 +3348,8 @@
- 			do_cmd(c);
- 		}				// repeat cnt
-  dc3:
--		if (last_search_pattern == 0) {
--			msg = "No previous regular expression";
--			goto dc2;
--		}
--		if (last_search_pattern[0] == '/') {
--			dir = FORWARD;	// assume FORWARD search
--			p = dot + 1;
--		}
-+		dir = FORWARD;	// assume FORWARD search
-+		p = dot + 1;
- 		if (last_search_pattern[0] == '?') {
- 			dir = BACK;
- 			p = dot - 1;
-diff -Naur busybox-1.12.1.orig/findutils/grep.c busybox-1.12.1/findutils/grep.c
---- busybox-1.12.1.orig/findutils/grep.c	2008-09-28 14:04:28.000000000 -0400
-+++ busybox-1.12.1/findutils/grep.c	2008-11-08 09:49:16.000000000 -0500
-@@ -363,12 +363,22 @@
- 						 * (unless -v: -Fov doesnt print anything at all) */
- 						if (found)
- 							print_line(gl->pattern, strlen(gl->pattern), linenum, ':');
--					} else {
-+					} else while (1) {
-+						char old = line[gl->matched_range.rm_eo];
- 						line[gl->matched_range.rm_eo] = '\0';
- 						print_line(line + gl->matched_range.rm_so,
- 								gl->matched_range.rm_eo - gl->matched_range.rm_so,
- 								linenum, ':');
--					}
-+						line[gl->matched_range.rm_eo] = old;
-+#if !ENABLE_EXTRA_COMPAT
-+						break;
-+#else
-+						if (re_search(&gl->compiled_regex, line, line_len,
-+								gl->matched_range.rm_eo, line_len - gl->matched_range.rm_eo, 
-+								&gl->matched_range) < 0)
-+							break;
-+#endif
-+					} 
- 				} else {
- 					print_line(line, line_len, linenum, ':');
- 				}
-diff -Naur busybox-1.12.1.orig/include/applets.h busybox-1.12.1/include/applets.h
---- busybox-1.12.1.orig/include/applets.h	2008-09-28 14:04:26.000000000 -0400
-+++ busybox-1.12.1/include/applets.h	2008-11-08 09:49:16.000000000 -0500
-@@ -136,7 +136,7 @@
- USE_ED(APPLET(ed, _BB_DIR_BIN, _BB_SUID_NEVER))
- USE_FEATURE_GREP_EGREP_ALIAS(APPLET_ODDNAME(egrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER, egrep))
- USE_EJECT(APPLET(eject, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
--USE_ENV(APPLET(env, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
-+USE_ENV(APPLET_NOEXEC(env, env, _BB_DIR_USR_BIN, _BB_SUID_NEVER, env))
- USE_ENVDIR(APPLET_ODDNAME(envdir, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envdir))
- USE_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envuidgid))
- USE_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, _BB_DIR_USR_BIN, _BB_SUID_NEVER, ether_wake))
-@@ -171,7 +171,7 @@
- USE_GUNZIP(APPLET(gunzip, _BB_DIR_BIN, _BB_SUID_NEVER))
- USE_GZIP(APPLET(gzip, _BB_DIR_BIN, _BB_SUID_NEVER))
- USE_HALT(APPLET(halt, _BB_DIR_SBIN, _BB_SUID_NEVER))
--USE_HD(APPLET_ODDNAME(hd, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hd))
-+USE_HD(APPLET_NOEXEC(hd, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hd))
- USE_HDPARM(APPLET(hdparm, _BB_DIR_SBIN, _BB_SUID_NEVER))
- USE_HEAD(APPLET(head, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
- USE_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hexdump))
-diff -Naur busybox-1.12.1.orig/libbb/getopt32.c busybox-1.12.1/libbb/getopt32.c
---- busybox-1.12.1.orig/libbb/getopt32.c	2008-09-28 14:04:20.000000000 -0400
-+++ busybox-1.12.1/libbb/getopt32.c	2008-11-08 09:49:16.000000000 -0500
-@@ -515,28 +515,6 @@
- 		}
- 	}
- 
--	/* In case getopt32 was already called:
--	 * reset the libc getopt() function, which keeps internal state.
--	 *
--	 * BSD-derived getopt() functions require that optind be set to 1 in
--	 * order to reset getopt() state.  This used to be generally accepted
--	 * way of resetting getopt().  However, glibc's getopt()
--	 * has additional getopt() state beyond optind, and requires that
--	 * optind be set to zero to reset its state.  So the unfortunate state of
--	 * affairs is that BSD-derived versions of getopt() misbehave if
--	 * optind is set to 0 in order to reset getopt(), and glibc's getopt()
--	 * will core dump if optind is set 1 in order to reset getopt().
--	 *
--	 * More modern versions of BSD require that optreset be set to 1 in
--	 * order to reset getopt().   Sigh.  Standards, anyone?
--	 */
--#ifdef __GLIBC__
--	optind = 0;
--#else /* BSD style */
--	optind = 1;
--	/* optreset = 1; */
--#endif
--	/* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */
- 	pargv = NULL;
- 
- 	/* Note: just "getopt() <= 0" will not work well for
-diff -Naur busybox-1.12.1.orig/libbb/lineedit.c busybox-1.12.1/libbb/lineedit.c
---- busybox-1.12.1.orig/libbb/lineedit.c	2008-09-28 14:04:20.000000000 -0400
-+++ busybox-1.12.1/libbb/lineedit.c	2008-11-08 09:49:16.000000000 -0500
-@@ -1415,7 +1415,8 @@
- 	if ((state->flags & SAVE_HISTORY) && state->hist_file)
- 		load_history(state->hist_file);
- #endif
--	state->cur_history = state->cnt_history;
-+	if (state->flags & DO_HISTORY)
-+		state->cur_history = state->cnt_history;
- 
- 	/* prepare before init handlers */
- 	cmdedit_y = 0;  /* quasireal y, not true if line > xt*yt */
-diff -Naur busybox-1.12.1.orig/libbb/setup_environment.c busybox-1.12.1/libbb/setup_environment.c
---- busybox-1.12.1.orig/libbb/setup_environment.c	2008-09-28 14:04:20.000000000 -0400
-+++ busybox-1.12.1/libbb/setup_environment.c	2008-11-08 09:49:16.000000000 -0500
-@@ -32,16 +32,16 @@
- 
- void FAST_FUNC setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw)
- {
-+	/* Change the current working directory to be the home directory
-+	 * of the user */
-+	if (chdir(pw->pw_dir)) {
-+		xchdir("/");
-+		bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir);
-+	}
-+
- 	if (clear_env) {
- 		const char *term;
- 
--		/* Change the current working directory to be the home directory
--		 * of the user */
--		if (chdir(pw->pw_dir)) {
--			xchdir("/");
--			bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir);
--		}
--
- 		/* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
- 		   Unset all other environment variables.  */
- 		term = getenv("TERM");
-diff -Naur busybox-1.12.1.orig/libbb/vfork_daemon_rexec.c busybox-1.12.1/libbb/vfork_daemon_rexec.c
---- busybox-1.12.1.orig/libbb/vfork_daemon_rexec.c	2008-09-28 14:04:20.000000000 -0400
-+++ busybox-1.12.1/libbb/vfork_daemon_rexec.c	2008-11-08 09:49:16.000000000 -0500
-@@ -125,6 +125,7 @@
- 	int rc, argc;
- 
- 	applet_name = APPLET_NAME(applet_no);
-+
- 	xfunc_error_retval = EXIT_FAILURE;
- 
- 	/* Special flag for xfunc_die(). If xfunc will "die"
-@@ -132,7 +133,30 @@
- 	 * die_sleep and longjmp here instead. */
- 	die_sleep = -1;
- 
--	/* option_mask32 = 0; - not needed */
-+	/* In case getopt() or getopt32() was already called:
-+	 * reset the libc getopt() function, which keeps internal state.
-+	 *
-+	 * BSD-derived getopt() functions require that optind be set to 1 in
-+	 * order to reset getopt() state.  This used to be generally accepted
-+	 * way of resetting getopt().  However, glibc's getopt()
-+	 * has additional getopt() state beyond optind, and requires that
-+	 * optind be set to zero to reset its state.  So the unfortunate state of
-+	 * affairs is that BSD-derived versions of getopt() misbehave if
-+	 * optind is set to 0 in order to reset getopt(), and glibc's getopt()
-+	 * will core dump if optind is set 1 in order to reset getopt().
-+	 *
-+	 * More modern versions of BSD require that optreset be set to 1 in
-+	 * order to reset getopt().  Sigh.  Standards, anyone?
-+	 */
-+#ifdef __GLIBC__
-+	optind = 0;
-+#else /* BSD style */
-+	optind = 1;
-+	/* optreset = 1; */
-+#endif
-+	/* optarg = NULL; opterr = 1; optopt = 63; - do we need this too? */
-+	/* (values above are what they initialized to in glibc and uclibc) */
-+	/* option_mask32 = 0; - not needed, no applet depends on it being 0 */
- 
- 	argc = 1;
- 	while (argv[argc])
-@@ -161,8 +185,16 @@
- 			rc = 0;
- 	}
- 
--	/* Restoring globals */
-+	/* Restoring some globals */
- 	restore_nofork_data(old);
-+
-+	/* Other globals can be simply reset to defaults */
-+#ifdef __GLIBC__
-+	optind = 0;
-+#else /* BSD style */
-+	optind = 1;
-+#endif
-+
- 	return rc & 0xff; /* don't confuse people with "exitcodes" >255 */
- }
- 
-diff -Naur busybox-1.12.1.orig/modutils/modprobe.c busybox-1.12.1/modutils/modprobe.c
---- busybox-1.12.1.orig/modutils/modprobe.c	2008-09-28 14:04:15.000000000 -0400
-+++ busybox-1.12.1/modutils/modprobe.c	2008-11-08 09:49:16.000000000 -0500
-@@ -263,9 +263,9 @@
- 	return TRUE;
- }
- 
--static int include_conf_recursive(struct include_conf_t *conf, const char *filename)
-+static int include_conf_recursive(struct include_conf_t *conf, const char *filename, int flags)
- {
--	return recursive_action(filename, ACTION_RECURSE,
-+	return recursive_action(filename, ACTION_RECURSE | flags,
- 				include_conf_file_act,
- 				include_conf_dir_act,
- 				conf, 1);
-@@ -362,7 +362,7 @@
- 			char *includefile;
- 
- 			includefile = skip_whitespace(line_buffer + 8);
--			include_conf_recursive(conf, includefile);
-+			include_conf_recursive(conf, includefile, 0);
- 		} else if (ENABLE_FEATURE_MODPROBE_BLACKLIST &&
- 				(is_conf_command(line_buffer, "blacklist"))) {
- 			char *mod;
-@@ -559,7 +559,7 @@
- 		if (ENABLE_FEATURE_2_6_MODULES) {
- 			if (include_conf_file(&conf, "/etc/modprobe.conf"))
- 				r = TRUE;
--			if (include_conf_recursive(&conf, "/etc/modprobe.d"))
-+			if (include_conf_recursive(&conf, "/etc/modprobe.d", ACTION_QUIET))
- 				r = TRUE;
- 		}
- 		if (ENABLE_FEATURE_2_4_MODULES && !r)
-diff -Naur busybox-1.12.1.orig/shell/ash.c busybox-1.12.1/shell/ash.c
---- busybox-1.12.1.orig/shell/ash.c	2008-09-28 14:04:18.000000000 -0400
-+++ busybox-1.12.1/shell/ash.c	2008-11-08 09:49:16.000000000 -0500
-@@ -6964,8 +6964,11 @@
- 
- #if ENABLE_FEATURE_SH_STANDALONE
- 	if (applet_no >= 0) {
--		if (APPLET_IS_NOEXEC(applet_no))
-+		if (APPLET_IS_NOEXEC(applet_no)) {
-+			while (*envp)
-+				putenv(*envp++);
- 			run_applet_no_and_exit(applet_no, argv);
-+		}
- 		/* re-exec ourselves with the new arguments */
- 		execve(bb_busybox_exec_path, argv, envp);
- 		/* If they called chroot or otherwise made the binary no longer
-@@ -12014,7 +12017,7 @@
- 	char *name;
- 	const char *p;
- 	char **aptr;
--	int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT;
-+	int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT;
- 
- 	if (nextopt("p") != 'p') {
- 		aptr = argptr;
-diff -Naur busybox-1.12.1.orig/util-linux/getopt.c busybox-1.12.1/util-linux/getopt.c
---- busybox-1.12.1.orig/util-linux/getopt.c	2008-09-28 14:04:30.000000000 -0400
-+++ busybox-1.12.1/util-linux/getopt.c	2008-11-08 09:49:16.000000000 -0500
-@@ -142,7 +142,8 @@
-  * Other settings are found in global variables.
-  */
- #if !ENABLE_GETOPT_LONG
--#define generate_output(argv,argc,optstr,longopts) generate_output(argv,argc,optstr)
-+#define generate_output(argv,argc,optstr,longopts) \
-+	generate_output(argv,argc,optstr)
- #endif
- static int generate_output(char **argv, int argc, const char *optstr, const struct option *longopts)
- {
-@@ -156,14 +157,6 @@
- 	if (quiet_errors) /* No error reporting from getopt(3) */
- 		opterr = 0;
- 
--	/* Reset getopt(3) (see libbb/getopt32.c for long rant) */
--#ifdef __GLIBC__
--	optind = 0;
--#else /* BSD style */
--	optind = 1;
--	/* optreset = 1; */
--#endif
--
- 	while (1) {
- 		opt =
- #if ENABLE_GETOPT_LONG
Index: tches/busybox-1.12.1-iptunnel_headers-1.patch
===================================================================
--- patches/busybox-1.12.1-iptunnel_headers-1.patch	(revision 86679e2ac3d6b9be177df8cb303c3d3c01d82cb4)
+++ 	(revision )
@@ -1,22 +1,0 @@
-Submitted By: Joe Ciccone <jciccone@gmail.com>
-Date: 2008-11-08
-Origin: Joe Ciccone
-Initial Package Version: 1.8.2
-Upstream Status: Unknown
-Descriprion: Make busybox play nice with sanatized kernel headers
-
-diff -Naur busybox-1.12.1.orig/networking/libiproute/iptunnel.c busybox-1.12.1/networking/libiproute/iptunnel.c
---- busybox-1.12.1.orig/networking/libiproute/iptunnel.c	2008-09-28 14:04:10.000000000 -0400
-+++ busybox-1.12.1/networking/libiproute/iptunnel.c	2008-11-08 11:07:07.000000000 -0500
-@@ -14,9 +14,8 @@
-  * Phil Karn <karn@ka9q.ampr.org>	990408:	"pmtudisc" flag
-  */
- 
--#include <netinet/ip.h>
--#include <net/if.h>
--#include <net/if_arp.h>
-+#include <linux/if.h>
-+#include <linux/if_arp.h>
- #include <asm/types.h>
- #ifndef __constant_htons
- #define __constant_htons htons
Index: patches/busybox-1.13.2-branch_update-1.patch
===================================================================
--- patches/busybox-1.13.2-branch_update-1.patch	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
+++ patches/busybox-1.13.2-branch_update-1.patch	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -0,0 +1,183 @@
+Submitted By: Jim Gifford (jim at cross-lfs dot org)
+Date: 01-25-2009
+Initial Package Version: 1.13.2
+Origin: Upstream
+Upstream Status: Applied
+Description: This is a branch update for busybox-1.13.2, and should be
+             rechecked periodically.
+
+diff -Naur busybox-1.13.2.orig/archival/tar.c busybox-1.13.2/archival/tar.c
+--- busybox-1.13.2.orig/archival/tar.c	2008-11-09 09:28:02.000000000 -0800
++++ busybox-1.13.2/archival/tar.c	2009-01-25 12:52:44.955898588 -0800
+@@ -591,8 +591,6 @@
+ 	struct TarBallInfo tbInfo;
+ 
+ 	tbInfo.hlInfoHead = NULL;
+-
+-	fchmod(tar_fd, 0644);
+ 	tbInfo.tarFd = tar_fd;
+ 	tbInfo.verboseFlag = verboseFlag;
+ 
+diff -Naur busybox-1.13.2.orig/modutils/depmod.c busybox-1.13.2/modutils/depmod.c
+--- busybox-1.13.2.orig/modutils/depmod.c	2008-11-09 09:28:03.000000000 -0800
++++ busybox-1.13.2/modutils/depmod.c	2009-01-25 12:52:44.229924290 -0800
+@@ -33,7 +33,7 @@
+ enum {
+ 	ARG_a = (1<<0), /* All modules, ignore mods in argv */
+ 	ARG_A = (1<<1), /* Only emit .ko that are newer than modules.dep file */
+-	ARG_b = (1<<2), /* not /lib/modules/$(uname -r)/ but this base-dir */
++	ARG_b = (1<<2), /* base directory when modules are in staging area */
+ 	ARG_e = (1<<3), /* with -F, print unresolved symbols */
+ 	ARG_F = (1<<4), /* System.map that contains the symbols */
+ 	ARG_n = (1<<5)  /* dry-run, print to stdout only */
+@@ -57,7 +57,7 @@
+ 	*first = info;
+ 
+ 	info->dnext = info->dprev = info;
+-	info->name = xstrdup(fname);
++	info->name = xasprintf("/%s", fname);
+ 	info->modname = filename2modname(fname, NULL);
+ 	for (ptr = image; ptr < image + len - 10; ptr++) {
+ 		if (strncmp(ptr, "depends=", 8) == 0) {
+@@ -123,44 +123,61 @@
+ 	}
+ }
+ 
++static void xfreopen_write(const char *file, FILE *f)
++{
++	if (freopen(file, "w", f) == NULL)
++		bb_perror_msg_and_die("can't open '%s'", file);
++}
++
+ int depmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+ int depmod_main(int argc UNUSED_PARAM, char **argv)
+ {
+ 	module_info *modules = NULL, *m, *dep;
+-	char *moddir_base = (char *)CONFIG_DEFAULT_MODULES_DIR;
++	const char *moddir_base = "/";
++	char *moddir, *version;
++	struct utsname uts;
+ 	int tmp;
+ 
+ 	getopt32(argv, "aAb:eF:n", &moddir_base, NULL);
+ 	argv += optind;
+ 
+ 	/* goto modules location */
++	xchdir(moddir_base);
+ 
+ 	/* If a version is provided, then that kernel version's module directory
+ 	 * is used, rather than the current kernel version (as returned by
+ 	 * "uname -r").  */
+-	xchdir(moddir_base);
+-	if (*argv && (sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3)) {
+-		xchdir(*argv++);
++	if (*argv && sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3) {
++		version = *argv++;
+ 	} else {
+-		struct utsname uts;
+ 		uname(&uts);
+-		xchdir(uts.release);
++		version = uts.release;
+ 	}
+-	/* If no modules are given on the command-line, -a is on per default.  */
+-	option_mask32 |= *argv == NULL;
++	moddir = concat_path_file(&CONFIG_DEFAULT_MODULES_DIR[1], version);
+ 
+ 	/* Scan modules */
+-	moddir_base = xrealloc_getcwd_or_warn(NULL);
+-	do {
+-		recursive_action((option_mask32 & ARG_a) ? moddir_base : *argv,
+-				ACTION_RECURSE, parse_module, NULL,  &modules, 0);
+-	} while (!(option_mask32 & ARG_a) && *(++argv));
++	if (*argv) {
++		char *modfile;
++		struct stat sb;
++		do {
++			modfile = concat_path_file(moddir, *argv);
++			xstat(modfile, &sb);
++			parse_module(modfile, &sb, &modules, 0);
++			free(modfile);
++		} while (*(++argv));
++	} else {
++		recursive_action(moddir, ACTION_RECURSE,
++				 parse_module, NULL, &modules, 0);
++	}
++
++	/* Prepare for writing out the dep files */
++	xchdir(moddir);
+ 	if (ENABLE_FEATURE_CLEAN_UP)
+-		free(moddir_base);
++		free(moddir);
+ 
+ 	/* Generate dependency and alias files */
+ 	if (!(option_mask32 & ARG_n))
+-		freopen(CONFIG_DEFAULT_DEPMOD_FILE, "w", stdout);
++		xfreopen_write(CONFIG_DEFAULT_DEPMOD_FILE, stdout);
+ 	for (m = modules; m != NULL; m = m->next) {
+ 		printf("%s:", m->name);
+ 
+@@ -174,12 +191,12 @@
+ 			dep->dprev->dnext = dep->dnext;
+ 			dep->dnext = dep->dprev = dep;
+ 		}
+-		puts("");
++		bb_putchar('\n');
+ 	}
+ 
+ #if ENABLE_FEATURE_MODUTILS_ALIAS
+ 	if (!(option_mask32 & ARG_n))
+-		freopen("modules.alias", "w", stdout);
++		xfreopen_write("modules.alias", stdout);
+ 	for (m = modules; m != NULL; m = m->next) {
+ 		while (m->aliases) {
+ 			printf("alias %s %s\n",
+@@ -190,7 +207,7 @@
+ #endif
+ #if ENABLE_FEATURE_MODUTILS_SYMBOLS
+ 	if (!(option_mask32 & ARG_n))
+-		freopen("modules.symbols", "w", stdout);
++		xfreopen_write("modules.symbols", stdout);
+ 	for (m = modules; m != NULL; m = m->next) {
+ 		while (m->symbols) {
+ 			printf("alias symbol:%s %s\n",
+diff -Naur busybox-1.13.2.orig/testsuite/mdev.tests busybox-1.13.2/testsuite/mdev.tests
+--- busybox-1.13.2.orig/testsuite/mdev.tests	2008-11-09 09:28:19.000000000 -0800
++++ busybox-1.13.2/testsuite/mdev.tests	2009-01-25 12:52:44.443204916 -0800
+@@ -111,6 +111,22 @@
+ 
+ # continuing to use directory structure from prev test
+ rm -rf mdev.testdir/dev/*
++echo "sda 0:0 644 =block/ @echo @echo TEST" >mdev.testdir/etc/mdev.conf
++testing "mdev move and command" \
++	"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
++	ls -lnR mdev.testdir/dev | $FILTER_LS2" \
++"\
++@echo TEST
++mdev.testdir/dev:
++drwxr-xr-x 2 0 0 block
++
++mdev.testdir/dev/block:
++brw-r--r-- 1 0 0 sda
++" \
++	"" ""
++
++# continuing to use directory structure from prev test
++rm -rf mdev.testdir/dev/*
+ echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf
+ testing "mdev #maj,min and no explicit uid" \
+ 	"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
+diff -Naur busybox-1.13.2.orig/util-linux/mdev.c busybox-1.13.2/util-linux/mdev.c
+--- busybox-1.13.2.orig/util-linux/mdev.c	2008-11-09 09:28:22.000000000 -0800
++++ busybox-1.13.2/util-linux/mdev.c	2009-01-25 12:52:44.443204916 -0800
+@@ -179,8 +179,9 @@
+ 			unsigned i, n;
+ #endif
+ 			char *a = val;
+-			s = strchr(val, ' ');
+-			val = (s && s[1]) ? s+1 : NULL;
++			s = strchrnul(val, ' ');
++			val = (s[0] && s[1]) ? s+1 : NULL;
++			s[0] = '\0';
+ #if ENABLE_FEATURE_MDEV_RENAME_REGEXP
+ 			/* substitute %1..9 with off[1..9], if any */
+ 			n = 0;
Index: scripts/patch/busybox-patch.sh
===================================================================
--- scripts/patch/busybox-patch.sh	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
+++ scripts/patch/busybox-patch.sh	(revision 0e9e8899f1f8e5442ea7164cd71c8ce38159ead1)
@@ -0,0 +1,79 @@
+#!/bin/bash
+# Create a Busybox Patch
+
+# Get Version #
+#
+VERSION=$1
+
+# Check Input
+#
+if [ "${VERSION}" = "" ]; then
+  echo "$0 - Busybox_Version"
+  echo "This will Create a Patch for Busybox Busybox_Version"
+  exit 255
+fi
+
+# Get Patch Names
+#
+cd /usr/src
+wget http://busybox.net/downloads/fixes-${VERSION}/ --no-remove-listing
+FILES=$(cat index.html | grep patch | grep patch | cut -f3 -d'<' | cut -f2 -d'>')
+rm -f .listing
+rm -f index.html
+
+# Download Busybox Source
+#
+if ! [ -e busybox-${VERSION}.tar.bz2 ]; then
+  wget http://busybox.net/downloads/busybox-${VERSION}.tar.bz2
+fi
+
+# Cleanup Directory
+#
+rm -rf busybox-${VERSION} busybox-${VERSION}.orig
+tar xvf busybox-${VERSION}.tar.bz2
+cp -ar busybox-${VERSION} busybox-${VERSION}.orig
+cd busybox-${VERSION}
+CURRENTDIR=$(pwd -P)
+
+# Download and Apply Patches
+#
+mkdir /tmp/busybox-${VERSION}
+for file in ${FILES}; do
+  cd /tmp/busybox-${VERSION}
+  echo "Getting Patch ${file}..."
+  wget --quiet http://busybox.net/downloads/fixes-${VERSION}/${file}
+  cd ${CURRENTDIR}
+  patch --dry-run -s -f -Np1 -i /tmp/busybox-${VERSION}/${file}
+  if [ "$?" = "0" ]; then
+    echo "Apply Patch ${file}..."
+    patch -Np1 -i /tmp/busybox-${VERSION}/${file}
+  fi
+done
+
+# Cleanup Directory
+#
+for dir in $(find * -type d); do
+  cd /usr/src/busybox-${VERSION}/${dir}
+  for file in $(find . -name '*~'); do
+    rm -f ${file}
+  done
+  for file in $(find . -name '*.orig'); do
+    rm -f ${file}
+  done
+done
+cd /usr/src/busybox-${VERSION}
+rm -f *~ *.orig
+
+# Create Patch
+#
+cd /usr/src
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > busybox-${VERSION}-branch_update-x.patch
+echo "Date: `date +%m-%d-%Y`" >> busybox-${VERSION}-branch_update-x.patch
+echo "Initial Package Version: ${VERSION}" >> busybox-${VERSION}-branch_update-x.patch
+echo "Origin: Upstream" >> busybox-${VERSION}-branch_update-x.patch
+echo "Upstream Status: Applied" >> busybox-${VERSION}-branch_update-x.patch
+echo "Description: This is a branch update for busybox-${VERSION}, and should be" >> busybox-${VERSION}-branch_update-x.patch
+echo "             rechecked periodically." >> busybox-${VERSION}-branch_update-x.patch
+echo "" >> busybox-${VERSION}-branch_update-x.patch
+diff -Naur busybox-${VERSION}.orig busybox-${VERSION} >> busybox-${VERSION}-branch_update-x.patch
+echo "Created /usr/src/busybox-${VERSION}-branch_update-x.patch."
