diff options
Diffstat (limited to 'chapter03/chapter03.xml')
-rw-r--r-- | chapter03/chapter03.xml | 385 |
1 files changed, 288 insertions, 97 deletions
diff --git a/chapter03/chapter03.xml b/chapter03/chapter03.xml index 9da7ccf05..da14e970a 100644 --- a/chapter03/chapter03.xml +++ b/chapter03/chapter03.xml @@ -1,135 +1,326 @@ -<chapter id="chapter-making-space" xreflabel="Chapter 3"> -<title>Preparing a new partition</title> +<chapter id="chapter-getting-materials" xreflabel="Chapter 3"> +<title>The materials: packages and patches</title> <?dbhtml filename="chapter03.html" dir="chapter03"?> -<sect1 id="space-introduction"> +<sect1 id="materials-introduction"> <title>Introduction</title> <?dbhtml filename="introduction.html" dir="chapter03"?> -<para>In this chapter the partition which will host the LFS system is -prepared. We will create the partition itself, make a file system on it, -and mount it.</para> +<para>Below is a list of packages you need to download for building a basic +Linux system. The listed version numbers correspond to versions of the +software that are <emphasis>known</emphasis> to work, and this book is +based upon them. Unless you are an experienced LFS builder, we highly +recommend not to try out newer versions, as the build commands for one +version may not work with a newer version. Also, there is often a good +reason for not using the latest version due to known problems that haven't +been worked around yet.</para> + +<para>All the URLs, when possible, refer to the project's page at +<ulink url="http://www.freshmeat.net/"/>. The Freshmeat +pages will give you easy access to the official download sites as well as +project websites, mailing lists, FAQs, changelogs and more.</para> + +<para>We can't guarantee that these download locations are always available. +In case a download location has changed since this book was published, please +try to google for the package. Should you remain unsuccessful with this, you +can consult the book's errata page at <ulink url="&lfs-root;lfs/print/"/> +or, better yet, try one of the alternative means of downloading listed on +<ulink url="&lfs-root;lfs/packages.html"/>.</para> + +<para>You'll need to store all the downloaded packages and patches somewhere +that is conveniently available throughout the entire build. You'll also need a +working directory in which to unpack the sources and build them. A scheme that +works well is to use <filename>$LFS/sources</filename> as the place to store +the tarballs and patches, <emphasis>and</emphasis> as a working directory. +This way everything you need will be located on the LFS partition and available +during all stages of the building process.</para> + +<para>So you may want to execute, as <emphasis>root</emphasis>, the following +command before starting your download session:</para> + +<screen><userinput>mkdir $LFS/sources</userinput></screen> + +<para>And make this directory writable (and sticky) for your normal user -- as +you won't do the downloading as <emphasis>root</emphasis>, we guess:</para> + +<screen><userinput>chmod a+wt $LFS/sources</userinput></screen> + +<!-- +<para>For your convenience the top of the list contains a link to a file +you can use with the <ulink url="http://wget.sunsite.dk">wget</ulink> +program. Using this file and the <command>wget</command> program will +make it easy to download all the files at once, rather than downloading each +and every individual file manually.</para> +--> </sect1> -<sect1 id="space-creatingpartition"> -<title>Creating a new partition</title> -<?dbhtml filename="creatingpartition.html" dir="chapter03"?> - -<para>In order to build our new Linux system, we will need some space: -an empty disk partition. If you don't have a free partition, and no room -on any of your hard disks to make one, then you could build LFS on the -same partition as the one on which your current distribution is installed. -This procedure is not recommended for your first LFS install, but if you -are short on disk space, and you feel brave, take a look at the hint at -<ulink url="&hints-root;lfs_next_to_existing_systems.txt"/>.</para> - -<para>For a minimal system you will need a partition of around 1.2 GB. -This is enough to store all the source tarballs and compile all the packages. -But if you intend to use the LFS system as your primary Linux system, you -will probably want to install additional software, and will need more space -than this, probably around 2 or 3 GB.</para> - -<para>As we almost never have enough RAM in our box, it is a good idea to -use a small disk partition as swap space -- this space is used by the kernel -to store seldom-used data to make room in memory for more urgent stuff. -The swap partition for your LFS system can be the same one as for your host -system, so you won't have to create another if your host system already uses -a swap partition.</para> - -<para>Start a disk partitioning program such as <command>cfdisk</command> -or <command>fdisk</command> with an argument naming the hard disk upon -which the new partition must be created -- for example -<filename>/dev/hda</filename> for the primary IDE disk. Create a Linux native -partition and a swap partition, if needed. Please refer to the man pages of -<command>cfdisk</command> or <command>fdisk</command> if you don't yet -know how to use the programs.</para> - -<para>Remember the designation of your new partition -- something like -<filename>hda5</filename>. This book will refer to it as the LFS partition. -If you (now) also have a swap partition, remember its designation too. These -names will later be needed for the <filename>/etc/fstab</filename> file.</para> +<sect1 id="materials-packages"> +<title>All the packages</title> +<?dbhtml filename="packages.html" dir="chapter03"?> -</sect1> +<para>Download or otherwise obtain the following packages:</para> +<literallayout> +Autoconf (&autoconf-version;) - &autoconf-size;: +<ulink url="http://freshmeat.net/projects/autoconf/"/> -<sect1 id="space-creatingfilesystem"> -<title>Creating a file system on the new partition</title> -<?dbhtml filename="creatingfilesystem.html" dir="chapter03"?> +Automake (&automake-version;) - &automake-size;: +<ulink url="http://freshmeat.net/projects/automake/"/> -<para>Now that we have a blank partition, we can create a file system on it. -Most widely used in the Linux world is the second extended file system (ext2), -but with the high-capacity hard disks of today the so-called journaling -file systems are becoming increasingly popular. Here we will create an ext2 -file system, but build instructions for other file systems can be found at -<ulink url="&blfs-root;view/stable/postlfs/filesystems.html"/>.</para> +Bash (&bash-version;) - &bash-size;: +<ulink url="http://freshmeat.net/projects/gnubash/"/> -<para>To create an ext2 file system on the LFS partition run the following:</para> +Binutils (&binutils-version;) - &binutils-size;: +<ulink url="http://freshmeat.net/projects/binutils/"/> -<screen><userinput>mke2fs /dev/xxx</userinput></screen> +Bison (&bison-version;) - &bison-size;: +<ulink url="http://freshmeat.net/projects/bison/"/> -<para>Replace <filename>xxx</filename> with the name of the LFS partition -(something like <filename>hda5</filename>).</para> +Bzip2 (&bzip2-version;) - &bzip2-size;: +<ulink url="http://freshmeat.net/projects/bzip2/"/> -<para>If you created a (new) swap partition you need to initialize it as a -swap partition too (also known as formatting, like you did above with -<command>mke2fs</command>) by running:</para> +Coreutils (&coreutils-version;) - &coreutils-size;: +<ulink url="http://freshmeat.net/projects/coreutils/"/> -<screen><userinput>mkswap /dev/yyy</userinput></screen> +DejaGnu (&dejagnu-version;) - &dejagnu-size;: +<ulink url="http://freshmeat.net/projects/dejagnu/"/> -<para>Replace <filename>yyy</filename> with the name of the swap -partition.</para> +Diffutils (&diffutils-version;) - &diffutils-size;: +<ulink url="http://freshmeat.net/projects/diffutils/"/> -</sect1> +E2fsprogs (&e2fsprogs-version;) - &e2fsprogs-size;: +<ulink url="http://freshmeat.net/projects/e2fsprogs/"/> + +Ed (&ed-version;) - &ed-size;: +<ulink url="http://freshmeat.net/projects/ed/"/> + +Expect (&expect-version;) - &expect-size;: +<ulink url="http://freshmeat.net/projects/expect/"/> + +File (&file-version;) - &file-size;: -- <emphasis>(see Note 1 below)</emphasis> +<ulink url="http://freshmeat.net/projects/file/"/> + +Findutils (&findutils-version;) - &findutils-size;: +<ulink url="http://freshmeat.net/projects/findutils/"/> + +Flex (&flex-version;) - &flex-size;: +<ulink url="ftp://ftp.gnu.org/gnu/non-gnu/flex/"/> + +Gawk (&gawk-version;) - &gawk-size;: +<ulink url="http://freshmeat.net/projects/gnuawk/"/> + +GCC-core (&gcc-version;) - &gcc-core-size;: +<ulink url="http://freshmeat.net/projects/gcc/"/> +GCC-g++ (&gcc-version;) - &gcc-gpp-size;: +<ulink url="http://freshmeat.net/projects/gcc/"/> +GCC-testsuite (&gcc-version;) - &gcc-testsuite-size;: +<ulink url="http://freshmeat.net/projects/gcc/"/> + +GCC-2 (&gcc-2953-version;) - &gcc-2953-size;: +<ulink url="http://freshmeat.net/projects/gcc/"/> + +Gettext (&gettext-version;) - &gettext-size;: +<ulink url="http://freshmeat.net/projects/gettext/"/> + +Glibc (&glibc-version;) - &glibc-size;: -- <emphasis>(see Note 2 below)</emphasis> +<ulink url="http://freshmeat.net/projects/glibc/"/> + +Grep (&grep-version;) - &grep-size;: +<ulink url="http://freshmeat.net/projects/grep/"/> + +Groff (&groff-version;) - &groff-size;: +<ulink url="http://freshmeat.net/projects/groff/"/> + +Grub (&grub-version;) - &grub-size;: +<ulink url="ftp://alpha.gnu.org/pub/gnu/grub/"/> + +Gzip (&gzip-version;) - &gzip-size;: +<ulink url="ftp://alpha.gnu.org/gnu/gzip/"/> + +Inetutils (&inetutils-version;) - &inetutils-size;: +<ulink url="http://freshmeat.net/projects/inetutils/"/> + +Kbd (&kbd-version;) - &kbd-size;: +<ulink url="http://freshmeat.net/projects/kbd/"/> + +Less (&less-version;) - &less-size;: +<ulink url="http://freshmeat.net/projects/less/"/> + +LFS-Bootscripts (&bootscripts-version;) - &bootscripts-size;: +<ulink url="&http-down;lfs-bootscripts-&bootscripts-version;.tar.bz2"/> + +Lfs-Utils (&lfs-utils-version;) - &lfs-utils-size;: +<ulink url="&lfs-root;~winkie/downloads/lfs-utils/"/> + +Libtool (&libtool-version;) - &libtool-size;: +<ulink url="http://freshmeat.net/projects/libtool/"/> + +Linux (&kernel-version;) - &kernel-size;: +<ulink url="http://freshmeat.net/projects/linux/"/> + +M4 (&m4-version;) - &m4-size;: +<ulink url="http://freshmeat.net/projects/gnum4/"/> + +Make (&make-version;) - &make-size;: +<ulink url="http://freshmeat.net/projects/gnumake/"/> + +Make_devices (&makedev-version;) - &makedev-size;: +<ulink url="&lfs-root;~alex/make_devices-&makedev-version;.bz2"/> + +Man (&man-version;) - &man-size;: +<ulink url="http://freshmeat.net/projects/man/"/> + +Man-pages (&man-pages-version;) - &man-pages-size;: +<ulink url="http://freshmeat.net/projects/man-pages/"/> + +Modutils (&modutils-version;) - &modutils-size;: +<ulink url="http://freshmeat.net/projects/modutils/"/> +Ncurses (&ncurses-version;) - &ncurses-size;: +<ulink url="http://freshmeat.net/projects/ncurses/"/> -<sect1 id="space-mounting"> -<title>Mounting the new partition</title> -<?dbhtml filename="mounting.html" dir="chapter03"?> +Net-tools (&net-tools-version;) - &net-tools-size;: +<ulink url="http://freshmeat.net/projects/net-tools/"/> -<para>Now that we've created a file system, we want to be able to access -the partition. For that, we need to mount it, and have to choose a mount -point. In this book we assume that the file system is mounted under -<filename>/mnt/lfs</filename>, but it doesn't matter what directory -you choose.</para> +Patch (&patch-version;) - &patch-size;: +<ulink url="http://freshmeat.net/projects/patch/"/> -<para>Choose a mount point and assign it to the LFS environment variable -by running:</para> +Perl (&perl-version;) - &perl-size;: +<ulink url="http://freshmeat.net/projects/perl/"/> -<screen><userinput>export LFS=/mnt/lfs</userinput></screen> +Procinfo (&procinfo-version;) - &procinfo-size;: +<ulink url="http://freshmeat.net/projects/procinfo/"/> -<para>Now create the mount point and mount the LFS file system by running:</para> +Procps (&procps-version;) - &procps-size;: +<ulink url="http://freshmeat.net/projects/procps/"/> -<screen><userinput>mkdir -p $LFS -mount /dev/xxx $LFS</userinput></screen> +Psmisc (&psmisc-version;) - &psmisc-size;: +<ulink url="http://freshmeat.net/projects/psmisc/"/> -<para>Replace <filename>xxx</filename> with the designation of the LFS -partition.</para> +Sed (&sed-version;) - &sed-size;: +<ulink url="http://freshmeat.net/projects/sed/"/> -<para>If you have decided to use multiple partitions for LFS (say one for -<filename>/</filename> and another for <filename>/usr</filename>), mount -them like this:</para> +Shadow (&shadow-version;) - &shadow-size;: +<ulink url="http://freshmeat.net/projects/shadow/"/> -<screen><userinput>mkdir -p $LFS -mount /dev/xxx $LFS -mkdir $LFS/usr -mount /dev/yyy $LFS/usr</userinput></screen> +Sysklogd (&sysklogd-version;) - &sysklogd-size;: +<ulink url="http://freshmeat.net/projects/sysklogd/"/> -<para>Of course, replace <filename>xxx</filename> and <filename>yyy</filename> -with the appropriate partition names.</para> +Sysvinit (&sysvinit-version;) - &sysvinit-size;: +<ulink url="http://freshmeat.net/projects/sysvinit/"/> -<para>You should also ensure that this new partition is not mounted with -permissions that are too restrictive (such as the nosuid, nodev or noatime -options). You can run the <command>mount</command> command without any -parameters to see with what options the LFS partition is mounted. If -you see nosuid, nodev or noatime, you will need to remount it.</para> - -<para>Now that we've made ourselves a place to work in, we're ready to download -the packages.</para> +Tar (&tar-version;) - &tar-size;: +<ulink url="ftp://alpha.gnu.org/gnu/tar/"/> + +Tcl (&tcl-version;) - &tcl-size;: +<ulink url="http://freshmeat.net/projects/tcltk/"/> + +Texinfo (&texinfo-version;) - &texinfo-size;: +<ulink url="http://freshmeat.net/projects/texinfo/"/> + +Util-linux (&util-linux-version;) - &util-linux-size;: +<ulink url="http://freshmeat.net/projects/util-linux/"/> + +Vim (&vim-version;) - &vim-size;: +<ulink url="http://freshmeat.net/projects/vim/"/> + +Zlib (&zlib-version;) - &zlib-size;: +<ulink url="http://freshmeat.net/projects/zlib/"/> + +Total size of these packages: &all-size-mb; +</literallayout> + +<note><para>1) File (&file-version;) may not be available by the time you read +this. The site admins of the master download location are known to occasionally +remove old versions when new ones are released. Please refer to the +<xref linkend="ch-system-file"/> section for an alternate download +location.</para></note> + +<note><para>2) As of this writing, the Glibc maintainers have decided in their +wisdom not to make available new release tarballs for download. The only way to +obtain the current Glibc release from pristine upstream sources is to pull it +from the Glibc CVS repository. The following commands will download the current +release and make a tarball from it:</para> + +<screen><userinput>cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc \ + export -d &glibc-dir; -D "2003-12-02 UTC" libc +tar jcvf &glibc-package; &glibc-dir;</userinput></screen> + +<para>Alternatively, we've made our own tarball available which you can +download courtesy of the generous LFS mirror sites. Please refer to the +<xref linkend="ch-tools-glibc"/> section for the download links.</para></note> </sect1> +<sect1 id="materials-patches"> +<title>Needed patches</title> +<?dbhtml filename="patches.html" dir="chapter03"?> + +<para>Besides all those packages, you'll also need several patches. These +correct tiny mistakes in the packages that should be fixed by the maintainer, +or just make some small modifications to bend things our way. You'll need the +following:</para> + +<literallayout> +Bash Patch - &bash-patch-size;: +<ulink url="&patches-root;&bash-patch;"/> + +Bison Attribute Patch - &bison-patch-size;: +<ulink url="&patches-root;&bison-patch;"/> + +Coreutils Hostname Patch - &coreutils-hostname-patch-size;: +<ulink url="&patches-root;&coreutils-hostname-patch;"/> +Coreutils Posixver Patch - &coreutils-posixver-patch-size;: +<ulink url="&patches-root;&coreutils-posixver-patch;"/> +Coreutils Uname Patch - &coreutils-uname-patch-size;: +<ulink url="&patches-root;&coreutils-uname-patch;"/> + +Ed Mkstemp Patch - &ed-patch-size;: +<ulink url="&patches-root;&ed-patch;"/> + +Expect Spawn Patch - &expect-patch-size;: +<ulink url="&patches-root;&expect-patch;"/> + +GCC No-Fixincludes Patch - &gcc-nofixincludes-patch-size;: +<ulink url="&patches-root;&gcc-nofixincludes-patch;"/> +GCC Specs Patch - &gcc-specs-patch-size;: +<ulink url="&patches-root;&gcc-specs-patch;"/> + +GCC-2 Patch - &gcc-2953-patch-size;: +<ulink url="&patches-root;&gcc-2953-patch;"/> +GCC-2 No-Fixincludes Patch - &gcc-2953-no-fixinc-patch-size;: +<ulink url="&patches-root;&gcc-2953-no-fixinc-patch;"/> +GCC-2 Return-Type Patch - &gcc-2953-returntype-fix-patch-size;: +<ulink url="&patches-root;&gcc-2953-returntype-fix-patch;"/> + +Inetutils No-Server-Man-Pages Patch - &inetutils-no-server-man-pages-patch-size;: +<ulink url="&patches-root;&inetutils-no-server-man-pages-patch;"/> + +Kbd More-Programs Patch - &kbd-patch-size;: +<ulink url="&patches-root;&kbd-patch;"/> + +Man 80-Columns Patch - &man-80cols-patch-size;: +<ulink url="&patches-root;&man-80cols-patch;"/> + +Net-tools Mii-Tool-Gcc33 Patch - &net-tools-mii-patch-size;: +<ulink url="&patches-root;&net-tools-mii-patch;"/> + +Perl Libc Patch - &perl-libc-patch-size;: +<ulink url="&patches-root;&perl-libc-patch;"/> +</literallayout> + +<para>In addition to the above required patches, there exist a number of +optional ones created by the LFS community. Most of these solve slight +problems, or enable some functionality that's not enabled by default. +Feel free to examine the patches database, located at <ulink +url="&lfs-root;patches/"/>, and pick any additional patches you wish to +use.</para> + +</sect1> + </chapter> + |