summaryrefslogtreecommitdiffstats
path: root/tmp/lfs-html.xml
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2014-11-27 16:29:31 -0600
committerWilliam Harrington <kb0iic@berzerkula.org>2014-11-27 16:29:31 -0600
commit7df987a652b93d55dd8eca363706d3bacc469b55 (patch)
tree17f84ce0fee76a3a0476b714eae09486ab2470e6 /tmp/lfs-html.xml
Initial commit message for lfs live howto.HEADmaster
Diffstat (limited to 'tmp/lfs-html.xml')
-rw-r--r--tmp/lfs-html.xml1209
1 files changed, 1209 insertions, 0 deletions
diff --git a/tmp/lfs-html.xml b/tmp/lfs-html.xml
new file mode 100644
index 0000000..94b08a3
--- /dev/null
+++ b/tmp/lfs-html.xml
@@ -0,0 +1,1209 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- This document was created with Syntext Serna Free. -->
+<book>
+ <bookinfo>
+ <title>LFS live howto</title>
+ <subtitle>Version 0.3</subtitle>
+ <authorgroup>
+ <author>
+ <firstname>JP</firstname>
+ <surname>Hauradou</surname>
+ </author>
+ <author>
+ <firstname>Jonathan</firstname>
+ <surname>Norman</surname>
+ </author>
+ <author>
+ <firstname>Sander</firstname>
+ <surname>van Ginkel</surname>
+ </author>
+ </authorgroup>
+ <copyright id="copyright">
+ <year>2011</year>
+ <holder>JP Hauradou</holder>
+ </copyright>
+ <legalnotice>
+ <para>Copyright (c) 2011, JP Hauradou</para>
+ <para> LinuxFromScratch is Copyright (c) 1999-2011, Gerard Beekmans</para>
+ <para>All rights reserved.</para>
+ <para>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ <quote>AS IS</quote> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+ BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</para>
+ <para>Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled "GNU
+ Free Documentation License"</para>
+ </legalnotice>
+ </bookinfo>
+<!--<preface id="preface">
+ <title>Preface</title>
+<para>to do</para>
+</preface>--> <part id="part1">
+ <title>Introduction</title>
+ <chapter>
+ <title>Before we start</title>
+ <sect1 id="intro-why">
+ <?dbhtml filename="why.html"?>
+
+ <title>Why this howto ?</title>
+
+ <para>After building LFS and a lot of packages from BLFS (Desktop, ...), I wondered if I could just copy my system on a dvd or a usb key, so that I could run my usual apps on some other computer.
+ </para>
+ <para>I found some useful documentation on the web, and decided to write this little hint. See <xref linkend="links"/>.
+ </para>
+
+</sect1>
+ </chapter>
+<!--
+ <?dbhtml filename="part1.html"?>
+ <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="why.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="prerequisites.xml"/>
+
+Why this article ? --> </part>
+ <part id="part2">
+ <title>Needed packages</title>
+ <chapter id="chapter1">
+ <title>packages</title>
+ <!-- This document was created with Syntext Serna Free. --><sect1 id="squashfs" xreflabel="squashfs 4.2">
+<?dbhtml filename="squashfs.html"?> <title>Squashfs 4.2</title>
+ <note><para>This chapter is mandatory for building the livecd. The livekey doesn't need it as we will show later</para></note>
+ <para/>
+ <sect2 role="package">
+ <title>Introduction to Squashfs</title>
+ <para>The <application moreinfo="none">Squashfs</application> package contains a highly compressed read-only filesystem for Linux.</para>
+ <itemizedlist spacing="compact">
+ <listitem>
+ <para>Download (HTTP): <ulink url="http://downloads.sourceforge.net/squashfs/squashfs4.2.tar.gz"/></para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2 role="installation">
+ <title>Installing squashfs-tools</title>
+ <para>Assuming you are in the squashfs 4.2 source directory, install Squashfs by running the following
+ commands:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cd squashfs-tools &amp;&amp; make</userinput></screen>
+ <para>Then, as user root, run the following:
+ </para>
+ <screen format="linespecific"><userinput moreinfo="none">cp -v unsquashfs mksquashfs /usr/bin </userinput></screen>
+ </sect2>
+</sect1>
+ <sect1 id="git" xreflabel="git 1.7.7">
+<?dbhtml filename="git.html"?> <title>GIT</title>
+ <note><para>This chapter is mandatory for building the livecd.</para></note>
+ <para/>
+ <sect2 role="package">
+ <title>Introduction to GIT</title>
+ <para>GIT is a version control system, mainly used by the linux kernel maintainers, but other developers use it as well as the developers of AUFS</para>
+ <para>To download AUFS in the next chapter we need to be able to checkout the AUFS branch. So we need to install GIT first</para>
+ <itemizedlist spacing="compact">
+ <listitem>
+ <para>Download (HTTP): <ulink url="http://git-core.googlecode.com/files/git-1.7.7.tar.gz"/></para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2>
+ <title>Install GIT</title>
+ <screen format="linespecific"><userinput moreinfo="none">./configure --prefix=/usr
+make</userinput></screen>
+ <para>Now install GIT as root:</para>
+ <screen format="linespecific"><userinput moreinfo="none">make install</userinput></screen>
+ </sect2>
+</sect1>
+ <!-- This document was created with Syntext Serna Free. --><sect1 id="aufs" xreflabel="aufs">
+<?dbhtml filename="aufs.html"?> <title>aufs</title>
+ <note><para>This chapter is mandatory for building the livecd. The livekey doesn't need it as we will show later</para></note>
+ <para/>
+ <sect2 role="package">
+ <title>Introduction to aufs</title>
+ <para>AUFS (Another Union File System) is as the name states, an union filesystem service. It allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system. Contents of directories which have the same path within the merged branches will be seen together in a single merged directory, within the new, virtual filesystem. </para>
+ <para>Versioning of AUFS is parallel to the kernel version. For kernel 2.x you'll need AUFS2 and for the new kernel 3.x you'll need AUFS3.</para>
+ <para>As stated in the previous chapter, we need to checkout AUFS from GIT.</para>
+ </sect2>
+ <sect2>
+ <title>Checking out AUFS</title>
+ <para>Assuming we are using kernel 3.0.4:</para>
+ <screen format="linespecific"><userinput moreinfo="none">git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git aufs3-standalone.git
+cd aufs3-standalone.git
+git checkout origin/aufs3.0</userinput></screen>
+<para/>
+ </sect2>
+ <sect2>
+ <title>Copying the sources</title>
+ <screen format="linespecific"><userinput moreinfo="none">cp -r fs &lt;location of kernel source&gt;
+cp -r include &lt;location of kernel source&gt;
+cp config.mk &lt;location of kernel source&gt;</userinput></screen>
+<para/>
+ </sect2>
+ <sect2>
+ <title>Patching the kernel</title>
+ <para>Now, cd to your kernel source top level directory and run the following command:</para>
+ <screen format="linespecific"><userinput moreinfo="none">patch -Np1 -i &lt;location of patch&gt;/aufs3-base.patch
+patch -Np1 -i &lt;location of patch&gt;/aufs3-kbuild.patch
+patch -Np1 -i &lt;location of patch&gt;/aufs3-standalone.patch</userinput></screen>
+ <para/>
+ </sect2>
+</sect1>
+ <sect1 id="busybox" xreflabel="busybox 1.19.2">
+<?dbhtml filename="busybox.html"?> <title>busybox 1.19.2</title>
+ <note><para>This chapter is mandatory for both the livecd and the livekey. Busybox is used in the initrd which will be discussed later in the book.</para></note>
+ <para/>
+ <sect2 role="package">
+ <title>Introduction to busybox</title>
+ <para>Busybox is a utility that combines many common utilities in one. Although the functions provided by busybox would have limited options, in compare with the original utility, it would be often sufficient to do simple tasks. In this way you can save crucial space, like in a small initial ramdisk.</para>
+ <para>Busybox can be build staticly easily so we don't have to care about the shared libraries.</para>
+ <itemizedlist spacing="compact">
+ <listitem>
+ <para>Download (HTTP): <ulink url="http://www.busybox.net/downloads/busybox-1.19.2.tar.bz2"/></para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2>
+ <title>Building busybox</title>
+ <para>In the root of the sourcedir:</para>
+ <screen format="linespecific"><userinput moreinfo="none">make mrproper
+make allnoconfig </userinput></screen>
+ <para>"make mrproper" will cleanup the sourcedir, previous config files etc. will be removed.</para>
+ <para>"make allnoconfig" will make a simple config file with all options disabled.</para>
+ <para/>
+ <para>Modify the config, so that we enable only the necessary functions. Note that this can be done by "make menuconfig" but for the sake of simplicity we modify the config with sed.</para>
+ <screen format="linespecific"><userinput moreinfo="none">sed -e 's/# CONFIG_FEATURE_INSTALLER is not set/CONFIG_FEATURE_INSTALLER=y/' -i .config
+sed -e 's/# CONFIG_INSTALL_NO_USR is not set/CONFIG_INSTALL_NO_USR=y/' -i .config
+sed -e 's/# CONFIG_LONG_OPTS is not set/CONFIG_LONG_OPTS=y/' -i .config
+sed -e 's/# CONFIG_STATIC is not set/CONFIG_STATIC=y/' -i .config
+sed -e 's/# CONFIG_LFS is not set/CONFIG_LFS=y/' -i .config
+sed -e 's/# CONFIG_CAT is not set/CONFIG_CAT=y/' -i .config
+sed -e 's/# CONFIG_TEST is not set/CONFIG_TEST=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_TEST_64 is not set/CONFIG_FEATURE_TEST_64=y/' -i .config
+sed -e 's/# CONFIG_CUT is not set/CONFIG_CUT=y/' -i .config
+sed -e 's/# CONFIG_ECHO is not set/CONFIG_ECHO=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_FANCY_ECHO is not set/CONFIG_FEATURE_FANCY_ECHO=y/' -i .config
+sed -e 's/# CONFIG_SLEEP is not set/CONFIG_SLEEP=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_FANCY_SLEEP is not set/CONFIG_FEATURE_FANCY_SLEEP=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_FLOAT_SLEEP is not set/CONFIG_FEATURE_FLOAT_SLEEP=y/' -i .config
+sed -e 's/# CONFIG_USLEEP is not set/CONFIG_USLEEP=y/' -i .config
+sed -e 's/# CONFIG_MODINFO is not set/CONFIG_MODINFO=y/' -i .config
+sed -e 's/# CONFIG_INSMOD is not set/CONFIG_INSMOD=y/' -i .config
+sed -e 's/# CONFIG_RMMOD is not set/CONFIG_RMMOD=y/' -i .config
+sed -e 's/# CONFIG_LSMOD is not set/CONFIG_LSMOD=y/' -i .config
+sed -e 's/# CONFIG_MODPROBE is not set/CONFIG_MODPROBE=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set/CONFIG_FEATURE_MODPROBE_BLACKLIST=y/' -i .config
+sed -e 's/# CONFIG_DEPMOD is not set/CONFIG_DEPMOD=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set/CONFIG_FEATURE_INSMOD_TRY_MMAP=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set/CONFIG_FEATURE_CHECK_TAINTED_MODULE=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MODUTILS_ALIAS is not set/CONFIG_FEATURE_MODUTILS_ALIAS=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set/CONFIG_FEATURE_MODUTILS_SYMBOLS=y/' -i .config
+sed -e 's/CONFIG_DEFAULT_MODULES_DIR=""/CONFIG_DEFAULT_MODULES_DIR="\/lib\/modules"/' -i .config
+sed -e 's/CONFIG_DEFAULT_DEPMOD_FILE=""/CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"/' -i .config
+sed -e 's/# CONFIG_FINDFS is not set/CONFIG_FINDFS=y/' -i .config
+sed -e 's/# CONFIG_MOUNT is not set/CONFIG_MOUNT=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MOUNT_FAKE is not set/CONFIG_FEATURE_MOUNT_FAKE=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MOUNT_LABEL is not set/CONFIG_FEATURE_MOUNT_LABEL=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MOUNT_FLAGS is not set/CONFIG_FEATURE_MOUNT_FLAGS=y/' -i .config
+sed -e 's/# CONFIG_SWITCH_ROOT is not set/CONFIG_SWITCH_ROOT=y/' -i .config
+sed -e 's/# CONFIG_UMOUNT is not set/CONFIG_UMOUNT=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_UMOUNT_ALL is not set/CONFIG_FEATURE_UMOUNT_ALL=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MOUNT_LOOP is not set/CONFIG_FEATURE_MOUNT_LOOP=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set/CONFIG_FEATURE_MOUNT_LOOP_CREATE=y/' -i .config
+sed -e 's/# CONFIG_VOLUMEID is not set/CONFIG_VOLUMEID=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_EXT is not set/CONFIG_FEATURE_VOLUMEID_EXT=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set/CONFIG_FEATURE_VOLUMEID_ISO9660=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_UDF is not set/CONFIG_FEATURE_VOLUMEID_UDF=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_ROMFS is not set/CONFIG_FEATURE_VOLUMEID_ROMFS=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_SYSV is not set/CONFIG_FEATURE_VOLUMEID_SYSV=y/' -i .config
+sed -e 's/# CONFIG_ASH is not set/CONFIG_ASH=y/' -i .config
+sed -e 's/# CONFIG_ASH_BASH_COMPAT is not set/CONFIG_ASH_BASH_COMPAT=y/' -i .config
+sed -e 's/# CONFIG_ASH_JOB_CONTROL is not set/CONFIG_ASH_JOB_CONTROL=y/' -i .config
+sed -e 's/# CONFIG_ASH_ALIAS is not set/CONFIG_ASH_ALIAS=y/' -i .config
+sed -e 's/# CONFIG_ASH_GETOPTS is not set/CONFIG_ASH_GETOPTS=y/' -i .config
+sed -e 's/# CONFIG_ASH_BUILTIN_ECHO is not set/CONFIG_ASH_BUILTIN_ECHO=y/' -i .config
+sed -e 's/# CONFIG_ASH_BUILTIN_PRINTF is not set/CONFIG_ASH_BUILTIN_PRINTF=y/' -i .config
+sed -e 's/# CONFIG_ASH_BUILTIN_TEST is not set/CONFIG_ASH_BUILTIN_TEST=y/' -i .config
+sed -e 's/# CONFIG_ASH_CMDCMD is not set/CONFIG_ASH_CMDCMD=y/' -i .config
+sed -e 's/# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set/CONFIG_ASH_OPTIMIZE_FOR_SIZE=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_SH_IS_ASH is not set/CONFIG_FEATURE_SH_IS_ASH=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_BASH_IS_ASH is not set/CONFIG_FEATURE_BASH_IS_ASH=y/' -i .config
+sed -e 's/CONFIG_FEATURE_SH_IS_NONE=y/# CONFIG_FEATURE_SH_IS_NONE is not set/' -i .config
+sed -e 's/CONFIG_FEATURE_BASH_IS_NONE=y/# CONFIG_FEATURE_BASH_IS_NONE is not set/' -i .config </userinput></screen>
+ <para>Build the executable:</para>
+ <screen format="linespecific"><userinput moreinfo="none">make </userinput></screen>
+ <para>Now we have a static build busybox. Keep it for later use.</para>
+ </sect2>
+</sect1>
+ </chapter>
+ </part>
+ <part id="part3">
+ <title>Reconfiguring the Linux Kernel</title>
+ <chapter>
+ <title>Essential step</title>
+ <sect1 id="essential">
+ <?dbhtml filename="essential.html"?>
+
+ <title>Reconfiguring the Kernel</title>
+ <note><para>This chapter is mandatory for building the livecd. The livekey only need an new kernel if you haven't enabled support for USB,EXT2/EXT3,SCSI and initial ramdisk</para></note>
+ <para>After having patched your kernel sources with aufs, you will have to configure your kernel to enable the new features.</para>
+ <para>Use your favorite configuration tool, like <quote>make menuconfig</quote>.</para>
+ <important>
+ <para>As you will use your actual LFS system and maybe make a few changes in it, you should now backup your present kernel config, located in /boot/config-&lt;kernel-version&gt;.</para>
+ </important>
+ <para>Enable <quote>Initial RAM filesystem and RAM disk (initramfs/initrd) support</quote> in <quote>General setup</quote>.</para>
+ <para>If you want your live system to boot on most architectures, you will have to enable Block layer SG support v4 (in menuconfig-&gt;Enable the block layer).</para>
+ <para>In <quote>Processor type and features</quote>, select <quote>386</quote> as <quote>Processor family</quote></para>
+ <para>You will have to enable loopback device support and ramdisk support in <quote>Device Drivers-&gt;Block devices</quote></para>
+ <para>If you plan to build a live usb key, you will have to say yes to <quote>USB support</quote> and to <quote>Support for Host-side USB</quote>, as well as <quote>UHCI HCD support</quote>, <quote>OHCI HCD support</quote> and <quote>EHCI HCD (USB 2.0) support</quote>. Say yes (y) to <quote>USB Mass Storage support</quote> also.</para>
+ <para>You will also need <quote>SCSI device support: SCSI disk support</quote>.</para>
+ <para/>
+ <para>If you plan to build a live cd or dvd, make sure you build the following modules direct into the kernel (* not m) :</para>
+ <para>*<quote>SCSI device support-&gt;SCSI CDROM support</quote></para>
+ <para>*<quote>SCSI generic support</quote></para>
+ <para>*<quote>ISO 9660 CDROM file system support</quote> in CD-ROM/DVD Filesystems</para>
+ <para>*<quote>PATA support.</quote></para>
+ <para/>
+ <para>Last, but not least, enable AUFS and SquashFS, in <quote>File systems-&gt;Miscellaneous filesystems</quote>
+ </para>
+ <para>After configuration, just build and install your kernel.
+ </para>
+</sect1>
+ </chapter>
+ </part>
+ <part id="part4">
+ <title>Preparing the build</title>
+ <chapter>
+ <title>initrd</title>
+ <!-- This document was created with Syntext Serna Free. --><sect1 id="initrd">
+<?dbhtml filename="initrd.html"?> <title> Building the initramfs image</title>
+<note><para>This chapter is mandatory for both the livecd and the livekey.</para></note>
+ <para>To boot our live system, we will need an initramfs image, which will contain a couple of utilities and kernel modules, necessary to find our rootfs and mount it.
+ </para>
+ <para>Create a directory structure:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mkdir -p initramfs/{bin,sbin,dev/{pts,shm},etc,proc,sys,rtmnt,lib}</userinput></screen>
+ <para>Copy busybox which we created in the chapter <xref linkend="busybox"/> to the bin directory</para>
+ <screen format="linespecific"><userinput moreinfo="none">cp &lt;path-to-busybox-builddir&gt;/busybox initramfs/bin </userinput></screen>
+ <para>Busybox can install symlinks for the desired utilities itself, however this can be done until the init script is running. So for some utilities that we need before this stage, we need to create the symlinks our selfs.</para>
+ <para><screen format="linespecific"><userinput moreinfo="none">ln -s /bin/busybox initramfs/bin/ash
+ln -s /bin/busybox initramfs/bin/mount </userinput></screen></para>
+ <para>We need access to some devicenodes before udev starts:</para>
+ <para><screen format="linespecific"><userinput moreinfo="none">mknod initramfs/dev/null c 1 3
+mknod initramfs/dev/tty c 5 0
+mknod initramfs/dev/console c 5 1 </userinput></screen></para>
+ <para>Add the necessary kernel modules:</para>
+ <para><screen format="linespecific"><userinput moreinfo="none">for filename in sd_mod usbcore ehci-hcd usb-storage usb-libusual uhci-hcd ext3 mbcache jbd
+do
+ find /lib/modules/`uname -r` -name "$filename"* -exec cp -r --parents {} initramfs \;
+done</userinput></screen></para>
+ <para>This will search for the given modules, and copy them to the initramfs</para>
+ <para>Now we need to create the initscript:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cat &gt; initramfs/init &lt;&lt; "EOF"
+#!/bin/ash
+
+PATH=/bin:/sbin
+
+# Mount proc and sysfs
+
+mount -t proc none /proc
+mount -t sysfs none /sys
+mount -t devtmpfs none /dev
+
+# Unpack the busybox
+
+/bin/busybox --install -s
+
+# Add modules
+
+if [ -z $(ls /lib/modules/) ]; then
+
+ depmod -a
+
+ modprobe sd_mod
+ modprobe usbcore
+ modprobe ehci-hcd
+ modprobe usb-storage
+ modprobe ext3
+
+fi
+
+# Check the command line
+
+initfile="/sbin/init"
+root=""
+
+# Check the parameterlist for rootdelay
+
+for arg in $(cat /proc/cmdline); do
+ case $arg in
+
+ rootdelay=*)
+ dt=$(echo $arg | cut -d= -f2)
+ sleep $dt
+ ;;
+ esac
+done
+
+# Check the parameterlist for UUID= and LABEL=
+
+for arg in $(cat /proc/cmdline); do
+ case $arg in
+
+ root=*)
+ option=$(echo $arg | cut -d= -f2)
+
+ if [ $option == "LABEL" ] ; then
+ root=$(findfs LABEL=$(echo $arg | cut -d= -f3))
+ fi
+
+ if [ $option == "UUID" ] ; then
+ root=$(findfs UUID=$(echo $arg | cut -d= -f3))
+ fi
+
+ ;;
+
+ init=*)
+ initfile=$(echo "$@" | cut -d "=" -f 2 )
+
+ ;;
+
+ esac
+done
+
+if [ $root != "" ] ; then
+
+ mount "${root}" /rtmnt
+
+ if [[ -x "/rtmnt/${initfile}" ]] ; then
+
+ umount /dev
+ umount /sys
+ umount /proc
+
+ exec switch_root /rtmnt "${initfile}"
+ fi
+fi
+
+# We shouldn't come here
+
+exec ash
+EOF
+chmod 0755 initramfs/init</userinput></screen>
+ <para>Pack our stuff:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cd initramfs
+find ./ | cpio -H newc -o &gt; ../initrd
+cd ..
+gzip initrd</userinput></screen>
+<para>Keep our created initrd.gz for later use.</para>
+</sect1>
+ </chapter>
+ <chapter>
+ <title>Preparing install</title>
+ <!-- This document was created with Syntext Serna Free. --><sect1 id="about_usb">
+<?dbhtml filename="about_media.html"?> <title>Creating a linux Filesystem</title>
+ <note><para>The commands in the remainder of this book must be performed while logged in as user root</para></note>
+ <para>The rest of this chapter assumes you already installed needed packages. If it's not the case, you should go to <xref linkend="squashfs"/>
+ You should also have configured your kernel properly, as described in <xref linkend="essential"/>
+ </para>
+ <para>Now it's time to assemble our live system.</para>
+ <para>First let's define the name of our system, this name will be given to our media: cd/dvd/usbkey/usbdrive.</para>
+ <para>The cd/dvd choice will be further mentioned as the ISO live system, the usbkey, usbdrive or usbstick will be mentioned as the usb live system</para>
+ <para>export the name of our system:</para>
+ <screen format="linespecific"><userinput moreinfo="none">export LFSLIVE=lfslive</userinput></screen>
+ <para>create and export the mount point:</para>
+ <screen format="linespecific"><userinput moreinfo="none">export LFSMOUNT=/mnt/LFS
+mkdir -pv $LFSMOUNT</userinput></screen>
+ <para>If you plan to create an ISO live system, create some space to store the complete system plus some extra space. App. 1,5 times the size of the system will do,
+after you reserved some space, create a link to the folder:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mount --bind &lt;path to LFSspace&gt; $LFSMOUNT</userinput></screen>
+ <para>Or if you use a dedicated partition mount it:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mount /dev/&lt;device&gt; $LFSMOUNT</userinput></screen>
+ <para>you can now continue with <xref linkend="building_iso"/></para>
+ <para/>
+ <para>For use of the usb live system, it's time to create some free space on it and create partitions, just like we do in the LFS book;
+Make an ext2 or ext3 file system on it and a small swap partition.</para>
+ <para>First, open the key with your favorite partitioning program, eg. cfdisk or fdisk or some other, and remove any partition already existing on it.
+Then, create one primary partition on the usb stick.</para>
+ <para>You will then have to create ext2/ext3 filesystem on the partition you created, using:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mke2fs -j -L $LFSLIVE /dev/&lt;sd?1&gt;</userinput></screen>
+ <para>Where sd?1 is the flash drive partition for the livekey</para>
+ <para>And mount it:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mount /dev/&lt;device&gt; $LFSMOUNT</userinput></screen>
+ <para>Now that the filesystem has been set up on the usb-media, go to <xref linkend="building_usb"/></para>
+</sect1>
+ </chapter>
+ </part>
+ <part id="part5">
+ <title>the USB live system</title>
+ <chapter>
+ <title>Building the USB live system</title>
+ <sect1 id="building_usb">
+ <?dbhtml filename="building.html"?>
+ <title>Building the USB live system</title>
+ <para>Creating the USB live system is quite easy. Either install your LFS/BLS system on the USB media, if you used a package manager, or copy your system to the USB media:</para>
+ <para>Because you're propably running the wanted system now, let's repeat a little part of the LFS book; create the directory structure</para>
+ <screen format="linespecific"><userinput moreinfo="none">mkdir -pv -m 755 $LFSMOUNT/{bin,boot,dev/{pts,shm},etc,home,include,lib,media,mnt,opt,proc,run,sbin,share,srv,sys,usr}
+mkdir -pv -m 755 $LFSMOUNT/var/{opt,cache,lib/{misc,locate},local,log,mail,spool}
+install -dv -m 0750 $LFSMOUNT/root
+install -dv -m 1777 $LFSMOUNT/tmp $LFSMOUNT/var/tmp
+ln -s /run $LFSMOUNT/var/run
+ln -s /run/lock $LFSMOUNT/var/lock</userinput></screen>
+ <para>Udev populates /dev so copying /dev is not necessary. However create some basic device nodes:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mknod -m 600 $LFSMOUNT/dev/console c 5 1
+mknod -m 666 $LFSMOUNT/dev/null c 1 3
+mknod $LFSMOUNT/dev/ram0 b 1 0 </userinput></screen>
+ <para>Now copy the system:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cp -av /bin /boot /etc /include /lib /opt /sbin /share /srv /usr $LFSMOUNT</userinput></screen>
+ <para>Modify mtab and fstab in etc</para>
+ <screen format="linespecific"><userinput moreinfo="none">echo "" &gt; $LFSMOUNT/etc/mtab
+echo "# Begin /etc/fstab" &gt; $LFSMOUNT/etc/fstab
+echo &gt;&gt; $LFSMOUNT/etc/fstab
+echo "# file system mount-point type options dump fsck" &gt;&gt; $LFSMOUNT/etc/fstab
+echo "# order" &gt;&gt; $LFSMOUNT/etc/fstab
+echo &gt;&gt; $LFSMOUNT/etc/fstab
+echo "LABEL=$LFSLIVE / ext3 defaults 1 1" &gt;&gt; $LFSMOUNT/etc/fstab
+echo "proc /proc proc defaults 0 0" &gt;&gt; $LFSMOUNT/etc/fstab
+echo "sysfs /sys sysfs defaults 0 0" &gt;&gt; $LFSMOUNT/etc/fstab
+echo "devpts /dev/pts devpts gid=4,mode=620 0 0" &gt;&gt; $LFSMOUNT/etc/fstab
+echo "tmpfs /run tmpfs defaults 0 0" &gt;&gt; $LFSMOUNT/etc/fstab
+echo &gt;&gt; $LFSMOUNT/etc/fstab
+echo "# End /etc/fstab" &gt;&gt; $LFSMOUNT/etc/fstab
+</userinput></screen>
+
+ <para>Copy our previous created initrd.gz to /boot of the media.</para>
+ <screen format="linespecific"><userinput moreinfo="none">cp &lt;PATH-TO-INITRD&gt;/initrd.gz $LFSMOUNT/boot</userinput></screen>
+ <para/>
+</sect1>
+ </chapter>
+ <chapter>
+ <title>Making the USB live system bootable</title>
+ <sect1>
+ <?dbhtml filename="bootable_usb.html"?>
+ <title>Making the USB live system bootable</title>
+ <para>This chapter assume you use grub2 for your LFS.</para>
+ <para>Install the GRUB files into /boot/grub, assuming you are installing LFS on sda[x]:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mount --bind /dev $LFSMOUNT/dev
+mount --bind /sys $LFSMOUNT/sys
+mount --bind /proc $LFSMOUNT/proc
+chroot $LFSMOUNT
+grub-install /dev/sda
+exit
+umount $LFSMOUNT/proc
+umount $LFSMOUNT/sys
+umount $LFSMOUNT/dev</userinput></screen>
+ <para>Issue the following to create the file grub.cfg:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cd $LFSMOUNT
+echo 'menuentry "LFS" {' &gt; boot/grub/grub.cfg
+echo " search -n -l $LFSLIVE -s" &gt;&gt; boot/grub/grub.cfg
+echo " linux /boot/lfskernel root=LABEL=$LFSLIVE quiet rootdelay=10" &gt;&gt; boot/grub/grub.cfg
+echo " initrd /boot/initrd.gz" &gt;&gt; boot/grub/grub.cfg
+echo "}" &gt;&gt; boot/grub/grub.cfg
+</userinput></screen>
+ <para>Rename kernel, according to menu.lst:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mv -v boot/lfskernel-&lt;version&gt; boot/lfskernel</userinput></screen>
+ <para>Where &lt;version&gt; is your kernel version</para>
+ <para>Enjoy the livekey !</para>
+</sect1>
+ </chapter>
+ </part>
+ <part id="part6">
+ <title>the ISO live system</title>
+ <chapter>
+ <title>Building the ISO live system</title>
+ <sect1 id="building_iso">
+ <?dbhtml filename="building_iso.html"?>
+ <title>Building the ISO live system</title>
+ <para>As we want to put a whole system on little space, we will squash some directories to have some more free space on the cd or dvd.
+ </para>
+ <para>
+ Before squashing, we have some work to do
+ </para>
+ <para>Issue the following: </para>
+ <screen format="linespecific"><userinput moreinfo="none">cd $LFSMOUNT</userinput></screen>
+ <para>As the system won't be writable, we have to provide a directory that will be mounted on tmpfs and will, therefore, be writable to ensure a successful boot.</para>
+ <screen format="linespecific"><userinput moreinfo="none">mkdir -v ro rw dev</userinput></screen>
+ <para>Make sure you have support for loopback device in your kernel:</para>
+ <screen format="linespecific"><userinput moreinfo="none">ls -l /dev | grep loop</userinput></screen>
+ <para>You should see a few /dev/loopX, where X is a number from 0 to 7. If this is not the case, and the loopback is supported as a kernel module, try to modprobe the module and retry again:</para>
+<screen format="linespecific"><userinput moreinfo="none">modprobe loop
+ls -l /dev | grep loop</userinput></screen>
+
+ <para>Create some essential files in the dev directory</para>
+ <screen format="linespecific"><userinput moreinfo="none">mknod -m 600 dev/console c 5 1
+mknod -m 666 dev/null c 1 3
+cp -av /dev/loop[0-7] dev/
+mknod dev/ram0 b 1 0</userinput></screen>
+ <para>Copy the /etc directory</para>
+ <screen format="linespecific"><userinput moreinfo="none">cp -av /etc .</userinput></screen>
+ <para>Modify some files in it</para>
+ <screen format="linespecific"><userinput moreinfo="none">echo "" &gt; etc/mtab
+cat &gt; etc/fstab &lt;&lt; "EOF"
+# Begin /etc/fstab
+
+# file system mount-point type options dump fsck
+# order
+
+proc /proc proc defaults 0 0
+sysfs /sys sysfs defaults 0 0
+devpts /dev/pts devpts gid=4,mode=620 0 0
+tmpfs /run tmpfs defaults 0 0
+usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0
+
+# End /etc/fstab
+EOF</userinput></screen>
+ <para>While booting, we will have to copy some directories in shared memory, and mount a root filesystem on it. This has to be done in the first bootscript.</para>
+ <sect2>
+ <title>Creating bootscript</title>
+ <para>issue the following to create a new bootscript:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cd etc/rc.d/init.d
+cat &gt; mountrootfs &lt;&lt; "EOF"
+#!/bin/sh
+
+# Set up variables
+
+dir_rw=/rw
+dir_ro=/ro
+
+# Source functions
+
+source /etc/rc.d/init.d/functions
+
+case "$1" in
+ start)
+
+# Mount temporary files on $dir_rw
+
+ echo "Mounting tmpfs on $dir_rw..."
+ mount -t tmpfs tmpfs $dir_rw
+ evaluate_retval
+ sleep 1
+
+# Create essential dirs in dir_rw
+
+ mkdir $dir_rw/{dev,etc,home,media,mnt}
+ mkdir $dir_rw/{opt,root,srv,tmp,usr,var}
+
+# If you have some other dirs in $LFSMOUNT/ like sources
+# Add them to that list, eg: mkdir -v $dir_rw/sources
+
+mount -n -t squashfs root.sqsh ro -o loop
+mount -n -t aufs -o dirs=$dir_rw/etc=rw:$dir_ro/etc=ro aufs etc
+mount -n -t aufs -o dirs=$dir_rw/usr=rw:$dir_ro/usr=ro aufs usr
+mount -n -t aufs -o dirs=$dir_rw/tmp=rw:$dir_ro/tmp=ro aufs tmp
+mount -n -t aufs -o dirs=$dir_rw/var=rw:$dir_ro/var=ro aufs var
+mount -n -t aufs -o dirs=$dir_rw/dev=rw:$dir_ro/dev=ro aufs dev
+mount -n -t aufs -o dirs=$dir_rw/home=rw:$dir_ro/home=ro aufs home
+mount -n -t aufs -o dirs=$dir_rw/media=rw:$dir_ro/media=ro aufs media
+mount -n -t aufs -o dirs=$dir_rw/mnt=rw:$dir_ro/mnt=ro aufs mnt
+mount -n -t aufs -o dirs=$dir_rw/opt=rw:$dir_ro/opt=ro aufs opt
+mount -n -t aufs -o dirs=$dir_rw/root=rw:$dir_ro/root=ro aufs root
+mount -n -t aufs -o dirs=$dir_rw/srv=rw:$dir_ro/srv=ro aufs srv
+chmod 1777 /tmp
+
+ ;;
+ *)
+ echo "Usage: $0 {start}"
+ exit 1
+ ;;
+esac
+EOF
+chmod 0754 mountrootfs</userinput></screen>
+ <para>Inspect the contents of etc/rc.d/rcS.d</para>
+ <screen format="linespecific"><userinput moreinfo="none">ls -l ../rcS.d</userinput></screen>
+ <para>You should see a list beginning with S00mountvirtfs, S02consolelog, ...</para><para>Now, issue:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cd ../rcS.d
+mv -v S00mountvirtfs S01mountvirtfs
+ln -sv ../init.d/mountrootfs S00mountrootfs
+</userinput></screen>
+ <para>The live system can not be checked with fsck so remove these bootscripts</para>
+ <screen format="linespecific"><userinput moreinfo="none">rm S30checkfs
+rm S40mountfs
+rm S45cleanfs
+</userinput></screen>
+</sect2>
+<sect2>
+ <title>About the var directory</title>
+ <para>As we are just copying our system, we will need the var directory while booting. We have to remove pid and sockets file from it.</para>
+ <screen format="linespecific"><userinput moreinfo="none">cd $LFSMOUNT
+cp -av /var .
+cd var
+rm log/*.log
+for FILE in `find . -type f -name '*pid'`
+ do rm $FILE
+done
+for FILE in `find . -type s`
+ do rm $FILE
+done
+rm -rf tmp/*
+cd $LFSMOUNT</userinput></screen>
+</sect2>
+<sect2>
+ <title>Squashing directories</title>
+ <para>Create tmp, root and other directories, then squash all. When squashing, you might not want to add some file or directory. Add files to the -e option of mksquashfs if you wish.</para>
+ <screen format="linespecific"><userinput moreinfo="none">mkdir -pv home media mnt opt proc root run srv sys tmp usr ro/{dev,etc,home,media,mnt,opt,root,srv,tmp,usr,var}
+mksquashfs dev etc /home /media mnt /opt /root /srv tmp /usr var root.sqsh -keep-as-directory -info
+rm -r var/*
+</userinput></screen>
+ <para>Copy dirs that won't be squashed:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cp -av /bin /boot /lib /sbin .</userinput></screen>
+ <para>Copy our previous created initrd.gz to /boot of the media.</para>
+ <screen format="linespecific"><userinput moreinfo="none">cp &lt;PATH-TO-INITRD&gt;/initrd.gz $LFSMOUNT/boot</userinput></screen>
+ <para/>
+</sect2>
+</sect1>
+ </chapter>
+ <chapter>
+ <title>Making the ISO live system bootable</title>
+ <sect1>
+ <?dbhtml filename="bootable_iso.html"?>
+ <title>Making the ISO live system bootable</title>
+ <para>This chapter assume you use grub2 for your LFS. Issue the following to modify the file grub.cfg:</para>
+ <screen format="linespecific"><userinput moreinfo="none">cd $LFSMOUNT
+echo 'menuentry "LFS" {' &gt; boot/grub/grub.cfg
+echo " search -n -l $LFSLIVE -s" &gt;&gt; boot/grub/grub.cfg
+echo " linux /boot/lfskernel root=LABEL=$LFSLIVE quiet" &gt;&gt; boot/grub/grub.cfg
+echo " initrd /boot/initrd.gz" &gt;&gt; boot/grub/grub.cfg
+echo "}" &gt;&gt; boot/grub/grub.cfg
+</userinput></screen>
+ <para>Rename kernel, according to menu.lst:</para>
+ <screen format="linespecific"><userinput moreinfo="none">mv -v boot/lfskernel-&lt;version&gt; boot/lfskernel</userinput></screen>
+ <para>Where &lt;version&gt; is your kernel version</para>
+ <para>Create our ISO::</para>
+ <screen format="linespecific"><userinput moreinfo="none">export ISODIR=&lt;path to the dir where you want to store your ISO&gt;
+cd $LFSMOUNT
+grub-mkrescue -o $ISODIR/livecd.iso -V $LFSLIVE $LFSMOUNT &amp;&amp;
+unset ISODIR</userinput></screen>
+ <para> Now, you can burn your image on a cd or dvd, and enjoy the livecd !</para>
+</sect1>
+ </chapter>
+ </part>
+ <part id="part7">
+ <title>References</title>
+ <chapter>
+ <title>Bibliography</title>
+ <sect1 id="links">
+ <?dbhtml filename="links.html"?>
+ <title> Some useful links on the web </title>
+ <para>
+ <ulink url="http://www.culmination.org/Mike/2.6-udev-nptl-bootcd.txt"/>
+ </para>
+ <para>
+ <ulink url="http://tldp.org/HOWTO/SquashFS-HOWTO/"/>
+ </para>
+</sect1>
+ </chapter>
+ </part>
+ <part id="licence">
+ <title>License</title>
+ <chapter>
+ <title>GNU Free Documentation License</title>
+ <sect1>
+ <?dbhtml filename="license.html"?>
+ <title>GNU Free Documentation License</title>
+<para>
+ Copyright (C) 2000, 2001, 2002 Free Software Foundation,
+ <abbrev>Inc.</abbrev> 51 Franklin <abbrev>St</abbrev>, Fifth Floor,
+ Boston, <abbrev>MA</abbrev> 02110-1301 <abbrev role="initialism">USA</abbrev>. Everyone is permitted to copy and
+ distribute verbatim copies of this license document, but changing it is
+ not allowed.
+ </para>
+ <bridgehead id="Preamble" renderas="sect1">
+ 0. PREAMBLE
+ </bridgehead>
+ <para>
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to assure
+ everyone the effective freedom to copy and redistribute it, with or
+ without modifying it, either commercially or noncommercially.
+ Secondarily, this License preserves for the author and publisher a way to
+ get credit for their work, while not being considered responsible for
+ modifications made by others.
+ </para>
+ <para>
+ This License is a kind of "copyleft", which means that derivative works of
+ the document must themselves be free in the same sense. It complements
+ the GNU General Public License, which is a copyleft license designed for
+ free software.
+ </para>
+ <para>
+ We have designed this License in order to use it for manuals for free
+ software, because free software needs free documentation: a free program
+ should come with manuals providing the same freedoms that the software
+ does. But this License is not limited to software manuals; it can be used
+ for any textual work, regardless of subject matter or whether it is
+ published as a printed book. We recommend this License principally for
+ works whose purpose is instruction or reference.</para>
+ <bridgehead id="Definitions" renderas="sect1">
+ 1. APPLICABILITY AND DEFINITIONS
+ </bridgehead>
+ <para>
+ This License applies to any manual or other work, in any medium, that
+ contains a notice placed by the copyright holder saying it can be
+ distributed under the terms of this License. Such a notice grants a
+ world-wide, royalty-free license, unlimited in duration, to use that work
+ under the conditions stated herein. The "Document", below, refers to any
+ such manual or work. Any member of the public is a licensee, and is
+ addressed as "you". You accept the license if you copy, modify or
+ distribute the work in a way requiring permission under copyright
+ law.
+ </para>
+ <para>
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with modifications
+ and/or translated into another language.
+ </para>
+ <para>
+ A "Secondary Section" is a named appendix or a front-matter section of the
+ Document that deals exclusively with the relationship of the publishers or
+ authors of the Document to the Document's overall subject (or to related
+ matters) and contains nothing that could fall directly within that overall
+ subject. (Thus, if the Document is in part a textbook of mathematics, a
+ Secondary Section may not explain any mathematics.) The relationship
+ could be a matter of historical connection with the subject or with
+ related matters, or of legal, commercial, philosophical, ethical or
+ political position regarding them.
+ </para>
+ <para>
+ The "Invariant Sections" are certain Secondary Sections whose titles are
+ designated, as being those of Invariant Sections, in the notice that says
+ that the Document is released under this License. If a section does not
+ fit the above definition of Secondary then it is not allowed to be
+ designated as Invariant. The Document may contain zero Invariant
+ Sections. If the Document does not identify any Invariant Sections then
+ there are none.
+ </para>
+ <para>
+ The "Cover Texts" are certain short passages of text that are listed, as
+ Front-Cover Texts or Back-Cover Texts, in the notice that says that the
+ Document is released under this License. A Front-Cover Text may be at
+ most 5 words, and a Back-Cover Text may be at most 25 words.
+ </para>
+ <para>
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the general
+ public, that is suitable for revising the document straightforwardly with
+ generic text editors or (for images composed of pixels) generic paint
+ programs or (for drawings) some widely available drawing editor, and that
+ is suitable for input to text formatters or for automatic translation to a
+ variety of formats suitable for input to text formatters. A copy made in
+ an otherwise Transparent file format whose markup, or absence of markup,
+ has been arranged to thwart or discourage subsequent modification by
+ readers is not Transparent. An image format is not Transparent if used
+ for any substantial amount of text. A copy that is not "Transparent" is
+ called "Opaque".
+ </para>
+ <para>
+ Examples of suitable formats for Transparent copies include plain ASCII
+ without markup, Texinfo input format, LaTeX input format, SGML or XML
+ using a publicly available DTD, and standard-conforming simple HTML,
+ PostScript or PDF designed for human modification. Examples of
+ transparent image formats include PNG, XCF and JPG. Opaque formats
+ include proprietary formats that can be read and edited only by
+ proprietary word processors, SGML or XML for which the DTD and/or
+ processing tools are not generally available, and the machine-generated
+ HTML, PostScript or PDF produced by some word processors for output
+ purposes only.
+ </para>
+ <para>
+ The "Title Page" means, for a printed book, the title page itself, plus
+ such following pages as are needed to hold, legibly, the material this
+ License requires to appear in the title page. For works in formats which
+ do not have any title page as such, "Title Page" means the text near the
+ most prominent appearance of the work's title, preceding the beginning of
+ the body of the text.
+ </para>
+ <para>
+ A section "Entitled XYZ" means a named subunit of the Document whose title
+ either is precisely XYZ or contains XYZ in parentheses following text that
+ translates XYZ in another language. (Here XYZ stands for a specific
+ section name mentioned below, such as "Acknowledgements", "Dedications",
+ "Endorsements", or "History".) To "Preserve the Title" of such a section
+ when you modify the Document means that it remains a section "Entitled
+ XYZ" according to this definition.
+ </para>
+ <para>
+ The Document may include Warranty Disclaimers next to the notice which
+ states that this License applies to the Document. These Warranty
+ Disclaimers are considered to be included by reference in this License,
+ but only as regards disclaiming warranties: any other implication that
+ these Warranty Disclaimers may have is void and has no effect on the
+ meaning of this License.
+ </para>
+ <bridgehead id="VerbatimCopying" renderas="sect1">
+ 2. VERBATIM COPYING
+ </bridgehead>
+ <para>
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the copyright
+ notices, and the license notice saying this License applies to the
+ Document are reproduced in all copies, and that you add no other
+ conditions whatsoever to those of this License. You may not use technical
+ measures to obstruct or control the reading or further copying of the
+ copies you make or distribute. However, you may accept compensation in
+ exchange for copies. If you distribute a large enough number of copies
+ you must also follow the conditions in section 3.
+ </para>
+ <para>
+ You may also lend copies, under the same conditions stated above, and you
+ may publicly display copies.
+ </para>
+ <bridgehead id="QuantityCopying" renderas="sect1">
+ 3. COPYING IN QUANTITY
+ </bridgehead>
+ <para>
+ If you publish printed copies (or copies in media that commonly have
+ printed covers) of the Document, numbering more than 100, and the
+ Document's license notice requires Cover Texts, you must enclose the
+ copies in covers that carry, clearly and legibly, all these Cover Texts:
+ Front-Cover Texts on the front cover, and Back-Cover Texts on the back
+ cover. Both covers must also clearly and legibly identify you as the
+ publisher of these copies. The front cover must present the full title
+ with all words of the title equally prominent and visible. You may add
+ other material on the covers in addition. Copying with changes limited to
+ the covers, as long as they preserve the title of the Document and satisfy
+ these conditions, can be treated as verbatim copying in other
+ respects.
+ </para>
+ <para>
+ If the required texts for either cover are too voluminous to fit legibly,
+ you should put the first ones listed (as many as fit reasonably) on the
+ actual cover, and continue the rest onto adjacent pages.
+ </para>
+ <para>
+ If you publish or distribute Opaque copies of the Document numbering more
+ than 100, you must either include a machine-readable Transparent copy
+ along with each Opaque copy, or state in or with each Opaque copy a
+ computer-network location from which the general network-using public has
+ access to download using public-standard network protocols a complete
+ Transparent copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you begin
+ distribution of Opaque copies in quantity, to ensure that this Transparent
+ copy will remain thus accessible at the stated location until at least one
+ year after the last time you distribute an Opaque copy (directly or
+ through your agents or retailers) of that edition to the public.
+ </para>
+ <para>
+ It is requested, but not required, that you contact the authors of the
+ Document well before redistributing any large number of copies, to give
+ them a chance to provide you with an updated version of the
+ Document.
+ </para>
+ <bridgehead id="Modifications" renderas="sect1">
+ 4. MODIFICATIONS
+ </bridgehead>
+ <para>
+ You may copy and distribute a Modified Version of the Document under the
+ conditions of sections 2 and 3 above, provided that you release the
+ Modified Version under precisely this License, with the Modified Version
+ filling the role of the Document, thus licensing distribution and
+ modification of the Modified Version to whoever possesses a copy of it.
+ In addition, you must do these things in the Modified Version:
+ </para>
+ <orderedlist numeration="upperalpha" inheritnum="ignore" continuation="restarts">
+ <listitem>
+ <simpara>
+ Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions (which
+ should, if there were any, be listed in the History section of the
+ Document). You may use the same title as a previous version if the
+ original publisher of that version gives permission.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ State on the Title page the name of the publisher of the Modified
+ Version, as the publisher.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Preserve all the copyright notices of the Document.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Add an appropriate copyright notice for your modifications adjacent to
+ the other copyright notices.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Include an unaltered copy of this License.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise the
+ network locations given in the Document for previous versions it was
+ based on. These may be placed in the "History" section. You may omit
+ a network location for a work that was published at least four years
+ before the Document itself, or if the original publisher of the
+ version it refers to gives permission.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ For any section Entitled "Acknowledgements" or "Dedications", Preserve
+ the Title of the section, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements and/or
+ dedications given therein.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Preserve all the Invariant Sections of the Document, unaltered in
+ their text and in their titles. Section numbers or the equivalent are
+ not considered part of the section titles.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Delete any section Entitled "Endorsements". Such a section may not be
+ included in the Modified Version.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Do not retitle any existing section to be Entitled "Endorsements" or
+ to conflict in title with any Invariant Section.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Preserve any Warranty Disclaimers.
+ </simpara>
+ </listitem>
+ </orderedlist>
+ <para>
+ If the Modified Version includes new front-matter sections or appendices
+ that qualify as Secondary Sections and contain no material copied from the
+ Document, you may at your option designate some or all of these sections
+ as invariant. To do this, add their titles to the list of Invariant
+ Sections in the Modified Version's license notice. These titles must be
+ distinct from any other section titles.
+ </para>
+ <para>
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various parties--for
+ example, statements of peer review or that the text has been approved by
+ an organization as the authoritative definition of a standard.
+ </para>
+ <para>
+ You may add a passage of up to five words as a Front-Cover Text, and a
+ passage of up to 25 words as a Back-Cover Text, to the end of the list of
+ Cover Texts in the Modified Version. Only one passage of Front-Cover Text
+ and one of Back-Cover Text may be added by (or through arrangements made
+ by) any one entity. If the Document already includes a cover text for the
+ same cover, previously added by you or by arrangement made by the same
+ entity you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous publisher
+ that added the old one.
+ </para>
+ <para>
+ The author(s) and publisher(s) of the Document do not by this License give
+ permission to use their names for publicity for or to assert or imply
+ endorsement of any Modified Version.
+ </para>
+ <bridgehead id="Combining" renderas="sect1">
+ 5. COMBINING DOCUMENTS
+ </bridgehead>
+ <para>
+ You may combine the Document with other documents released under this
+ License, under the terms defined in section 4 above for modified versions,
+ provided that you include in the combination all of the Invariant Sections
+ of all of the original documents, unmodified, and list them all as
+ Invariant Sections of your combined work in its license notice, and that
+ you preserve all their Warranty Disclaimers.
+ </para>
+ <para>
+ The combined work need only contain one copy of this License, and multiple
+ identical Invariant Sections may be replaced with a single copy. If there
+ are multiple Invariant Sections with the same name but different contents,
+ make the title of each such section unique by adding at the end of it, in
+ parentheses, the name of the original author or publisher of that section
+ if known, or else a unique number. Make the same adjustment to the
+ section titles in the list of Invariant Sections in the license notice of
+ the combined work.
+ </para>
+ <para>
+ In the combination, you must combine any sections Entitled "History" in
+ the various original documents, forming one section Entitled "History";
+ likewise combine any sections Entitled "Acknowledgements", and any
+ sections Entitled "Dedications". You must delete all sections Entitled
+ "Endorsements".
+ </para>
+ <bridgehead id="Collections" renderas="sect1">
+ 6. COLLECTIONS OF DOCUMENTS
+ </bridgehead>
+ <para>
+ You may make a collection consisting of the Document and other documents
+ released under this License, and replace the individual copies of this
+ License in the various documents with a single copy that is included in
+ the collection, provided that you follow the rules of this License for
+ verbatim copying of each of the documents in all other respects.
+ </para>
+ <para>
+ You may extract a single document from such a collection, and distribute
+ it individually under this License, provided you insert a copy of this
+ License into the extracted document, and follow this License in all other
+ respects regarding verbatim copying of that document.
+ </para>
+ <bridgehead id="Aggregation" renderas="sect1">
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+ </bridgehead>
+ <para>
+ A compilation of the Document or its derivatives with other separate and
+ independent documents or works, in or on a volume of a storage or
+ distribution medium, is called an "aggregate" if the copyright resulting
+ from the compilation is not used to limit the legal rights of the
+ compilation's users beyond what the individual works permit. When the
+ Document is included in an aggregate, this License does not apply to the
+ other works in the aggregate which are not themselves derivative works of
+ the Document.
+ </para>
+ <para>
+ If the Cover Text requirement of section 3 is applicable to these copies
+ of the Document, then if the Document is less than one half of the entire
+ aggregate, the Document's Cover Texts may be placed on covers that bracket
+ the Document within the aggregate, or the electronic equivalent of covers
+ if the Document is in electronic form. Otherwise they must appear on
+ printed covers that bracket the whole aggregate.
+ </para>
+ <bridgehead id="Translation" renderas="sect1">
+ 8. TRANSLATION
+ </bridgehead>
+ <para>
+ Translation is considered a kind of modification, so you may distribute
+ translations of the Document under the terms of section 4. Replacing
+ Invariant Sections with translations requires special permission from
+ their copyright holders, but you may include translations of some or all
+ Invariant Sections in addition to the original versions of these Invariant
+ Sections. You may include a translation of this License, and all the
+ license notices in the Document, and any Warranty Disclaimers, provided
+ that you also include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of this
+ License or a notice or disclaimer, the original version will prevail.
+ </para>
+ <para>
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to Preserve its
+ Title (section 1) will typically require changing the actual title.
+ </para>
+ <bridgehead id="Termination" renderas="sect1">
+ 9. TERMINATION
+ </bridgehead>
+ <para>
+ You may not copy, modify, sublicense, or distribute the Document except as
+ expressly provided for under this License. Any other attempt to copy,
+ modify, sublicense or distribute the Document is void, and will
+ automatically terminate your rights under this License. However, parties
+ who have received copies, or rights, from you under this License will not
+ have their licenses terminated so long as such parties remain in full
+ compliance.
+ </para>
+ <bridgehead id="FutureRevisions" renderas="sect1">
+ 10. FUTURE REVISIONS OF THIS LICENSE
+ </bridgehead>
+ <para>
+ The Free Software Foundation may publish new, revised versions of the GNU
+ Free Documentation License from time to time. Such new versions will be
+ similar in spirit to the present version, but may differ in detail to
+ address new problems or concerns. See <ulink url="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</ulink>.
+ </para>
+ <para>
+ Each version of the License is given a distinguishing version number. If
+ the Document specifies that a particular numbered version of this License
+ "or any later version" applies to it, you have the option of following the
+ terms and conditions either of that specified version or of any later
+ version that has been published (not as a draft) by the Free Software
+ Foundation. If the Document does not specify a version number of this
+ License, you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+ </para>
+ <bridgehead id="HowToUse" renderas="sect1">
+ ADDENDUM: How to use this License for your documents
+ </bridgehead>
+ <para>
+ To use this License in a document you have written, include a copy of the
+ License in the document and put the following copyright and license
+ notices just after the title page:
+ </para>
+ <blockquote>
+ <para>
+ Copyright (C) YEAR YOUR NAME.
+ </para>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2 or
+ any later version published by the Free Software Foundation; with no
+ Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
+ copy of the license is included in the section entitled "GNU Free
+ Documentation License".
+ </para>
+ </blockquote>
+ <para>
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+ replace the "with...Texts." line with this:
+ </para>
+ <blockquote>
+ <para>
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ </para>
+ </blockquote>
+ <para>
+ If you have Invariant Sections without Cover Texts, or some other
+ combination of the three, merge those two alternatives to suit the
+ situation.
+ </para>
+ <para>
+ If your document contains nontrivial examples of program code, we
+ recommend releasing these examples in parallel under your choice of free
+ software license, such as the GNU General Public License, to permit their
+ use in free software.
+ </para>
+</sect1>
+ </chapter>
+ </part>
+ <index/>
+</book>