Changeset c6b5ddb for chapter03


Ignore:
Timestamp:
03/07/2004 12:09:31 PM (20 years ago)
Author:
Alex Gronenwoud <alex@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.0, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, v5_1, v5_1_1, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
5b7293a
Parents:
4f4b4e84
Message:

Shifting chapter contents, and moving preparational sections of chapter 5 to a separate chapter.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3284 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter03/chapter03.xml

    r4f4b4e84 rc6b5ddb  
    1 <chapter id="chapter-making-space" xreflabel="Chapter 3">
    2 <title>Preparing a new partition</title>
     1<chapter id="chapter-getting-materials" xreflabel="Chapter 3">
     2<title>The materials: packages and patches</title>
    33<?dbhtml filename="chapter03.html" dir="chapter03"?>
    44
    55
    6 <sect1 id="space-introduction">
     6<sect1 id="materials-introduction">
    77<title>Introduction</title>
    88<?dbhtml filename="introduction.html" dir="chapter03"?>
    99
    10 <para>In this chapter the partition which will host the LFS system is
    11 prepared. We will create the partition itself, make a file system on it,
    12 and mount it.</para>
     10<para>Below is a list of packages you need to download for building a basic
     11Linux system. The listed version numbers correspond to versions of the
     12software that are <emphasis>known</emphasis> to work, and this book is
     13based upon them. Unless you are an experienced LFS builder, we highly
     14recommend not to try out newer versions, as the build commands for one
     15version may not work with a newer version. Also, there is often a good
     16reason for not using the latest version due to known problems that haven't
     17been worked around yet.</para>
     18
     19<para>All the URLs, when possible, refer to the project's page at
     20<ulink url="http://www.freshmeat.net/"/>. The Freshmeat
     21pages will give you easy access to the official download sites as well as
     22project websites, mailing lists, FAQs, changelogs and more.</para>
     23
     24<para>We can't guarantee that these download locations are always available.
     25In case a download location has changed since this book was published, please
     26try to google for the package. Should you remain unsuccessful with this, you
     27can consult the book's errata page at <ulink url="&lfs-root;lfs/print/"/>
     28or, better yet, try one of the alternative means of downloading listed on
     29<ulink url="&lfs-root;lfs/packages.html"/>.</para>
     30
     31<para>You'll need to store all the downloaded packages and patches somewhere
     32that is conveniently available throughout the entire build. You'll also need a
     33working directory in which to unpack the sources and build them. A scheme that
     34works well is to use <filename>$LFS/sources</filename> as the place to store
     35the tarballs and patches, <emphasis>and</emphasis> as a working directory.
     36This way everything you need will be located on the LFS partition and available
     37during all stages of the building process.</para>
     38
     39<para>So you may want to execute, as <emphasis>root</emphasis>, the following
     40command before starting your download session:</para>
     41
     42<screen><userinput>mkdir $LFS/sources</userinput></screen>
     43
     44<para>And make this directory writable (and sticky) for your normal user -- as
     45you won't do the downloading as <emphasis>root</emphasis>, we guess:</para>
     46
     47<screen><userinput>chmod a+wt $LFS/sources</userinput></screen>
     48
     49<!--
     50<para>For your convenience the top of the list contains a link to a file
     51you can use with the <ulink url="http://wget.sunsite.dk">wget</ulink>
     52program. Using this file and the <command>wget</command> program will
     53make it easy to download all the files at once, rather than downloading each
     54and every individual file manually.</para>
     55-->
    1356
    1457</sect1>
    1558
    1659
    17 <sect1 id="space-creatingpartition">
    18 <title>Creating a new partition</title>
    19 <?dbhtml filename="creatingpartition.html" dir="chapter03"?>
    20 
    21 <para>In order to build our new Linux system, we will need some space:
    22 an empty disk partition. If you don't have a free partition, and no room
    23 on any of your hard disks to make one, then you could build LFS on the
    24 same partition as the one on which your current distribution is installed.
    25 This procedure is not recommended for your first LFS install, but if you
    26 are short on disk space, and you feel brave, take a look at the hint at
    27 <ulink url="&hints-root;lfs_next_to_existing_systems.txt"/>.</para>
    28 
    29 <para>For a minimal system you will need a partition of around 1.2 GB.
    30 This is enough to store all the source tarballs and compile all the packages.
    31 But if you intend to use the LFS system as your primary Linux system, you
    32 will probably want to install additional software, and will need more space
    33 than this, probably around 2 or 3 GB.</para>
    34 
    35 <para>As we almost never have enough RAM in our box, it is a good idea to
    36 use a small disk partition as swap space -- this space is used by the kernel
    37 to store seldom-used data to make room in memory for more urgent stuff.
    38 The swap partition for your LFS system can be the same one as for your host
    39 system, so you won't have to create another if your host system already uses
    40 a swap partition.</para>
    41 
    42 <para>Start a disk partitioning program such as <command>cfdisk</command>
    43 or <command>fdisk</command> with an argument naming the hard disk upon
    44 which the new partition must be created -- for example
    45 <filename>/dev/hda</filename> for the primary IDE disk. Create a Linux native
    46 partition and a swap partition, if needed. Please refer to the man pages of
    47 <command>cfdisk</command> or <command>fdisk</command> if you don't yet
    48 know how to use the programs.</para>
    49 
    50 <para>Remember the designation of your new partition -- something like
    51 <filename>hda5</filename>. This book will refer to it as the LFS partition.
    52 If you (now) also have a swap partition, remember its designation too. These
    53 names will later be needed for the <filename>/etc/fstab</filename> file.</para>
     60<sect1 id="materials-packages">
     61<title>All the packages</title>
     62<?dbhtml filename="packages.html" dir="chapter03"?>
     63
     64<para>Download or otherwise obtain the following packages:</para>
     65
     66<literallayout>
     67Autoconf (&autoconf-version;) - &autoconf-size;:
     68<ulink url="http://freshmeat.net/projects/autoconf/"/>
     69
     70Automake (&automake-version;) - &automake-size;:
     71<ulink url="http://freshmeat.net/projects/automake/"/>
     72
     73Bash (&bash-version;) - &bash-size;:
     74<ulink url="http://freshmeat.net/projects/gnubash/"/>
     75
     76Binutils (&binutils-version;) - &binutils-size;:
     77<ulink url="http://freshmeat.net/projects/binutils/"/>
     78
     79Bison (&bison-version;) - &bison-size;:
     80<ulink url="http://freshmeat.net/projects/bison/"/>
     81
     82Bzip2 (&bzip2-version;) - &bzip2-size;:
     83<ulink url="http://freshmeat.net/projects/bzip2/"/>
     84
     85Coreutils (&coreutils-version;) - &coreutils-size;:
     86<ulink url="http://freshmeat.net/projects/coreutils/"/>
     87
     88DejaGnu (&dejagnu-version;) - &dejagnu-size;:
     89<ulink url="http://freshmeat.net/projects/dejagnu/"/>
     90
     91Diffutils (&diffutils-version;) - &diffutils-size;:
     92<ulink url="http://freshmeat.net/projects/diffutils/"/>
     93
     94E2fsprogs (&e2fsprogs-version;) - &e2fsprogs-size;:
     95<ulink url="http://freshmeat.net/projects/e2fsprogs/"/>
     96
     97Ed (&ed-version;) - &ed-size;:
     98<ulink url="http://freshmeat.net/projects/ed/"/>
     99
     100Expect (&expect-version;) - &expect-size;:
     101<ulink url="http://freshmeat.net/projects/expect/"/>
     102
     103File (&file-version;) - &file-size;: -- <emphasis>(see Note 1 below)</emphasis>
     104<ulink url="http://freshmeat.net/projects/file/"/>
     105
     106Findutils (&findutils-version;) - &findutils-size;:
     107<ulink url="http://freshmeat.net/projects/findutils/"/>
     108
     109Flex (&flex-version;) - &flex-size;:
     110<ulink url="ftp://ftp.gnu.org/gnu/non-gnu/flex/"/>
     111
     112Gawk (&gawk-version;) - &gawk-size;:
     113<ulink url="http://freshmeat.net/projects/gnuawk/"/>
     114
     115GCC-core (&gcc-version;) - &gcc-core-size;:
     116<ulink url="http://freshmeat.net/projects/gcc/"/>
     117GCC-g++ (&gcc-version;) - &gcc-gpp-size;:
     118<ulink url="http://freshmeat.net/projects/gcc/"/>
     119GCC-testsuite (&gcc-version;) - &gcc-testsuite-size;:
     120<ulink url="http://freshmeat.net/projects/gcc/"/>
     121
     122GCC-2 (&gcc-2953-version;) - &gcc-2953-size;:
     123<ulink url="http://freshmeat.net/projects/gcc/"/>
     124
     125Gettext (&gettext-version;) - &gettext-size;:
     126<ulink url="http://freshmeat.net/projects/gettext/"/>
     127
     128Glibc (&glibc-version;) - &glibc-size;: -- <emphasis>(see Note 2 below)</emphasis>
     129<ulink url="http://freshmeat.net/projects/glibc/"/>
     130
     131Grep (&grep-version;) - &grep-size;:
     132<ulink url="http://freshmeat.net/projects/grep/"/>
     133
     134Groff (&groff-version;) - &groff-size;:
     135<ulink url="http://freshmeat.net/projects/groff/"/>
     136
     137Grub (&grub-version;) - &grub-size;:
     138<ulink url="ftp://alpha.gnu.org/pub/gnu/grub/"/>
     139
     140Gzip (&gzip-version;) - &gzip-size;:
     141<ulink url="ftp://alpha.gnu.org/gnu/gzip/"/>
     142
     143Inetutils (&inetutils-version;) - &inetutils-size;:
     144<ulink url="http://freshmeat.net/projects/inetutils/"/>
     145
     146Kbd (&kbd-version;) - &kbd-size;:
     147<ulink url="http://freshmeat.net/projects/kbd/"/>
     148
     149Less (&less-version;) - &less-size;:
     150<ulink url="http://freshmeat.net/projects/less/"/>
     151
     152LFS-Bootscripts (&bootscripts-version;) - &bootscripts-size;:
     153<ulink url="&http-down;lfs-bootscripts-&bootscripts-version;.tar.bz2"/>
     154
     155Lfs-Utils (&lfs-utils-version;) - &lfs-utils-size;:
     156<ulink url="&lfs-root;~winkie/downloads/lfs-utils/"/>
     157
     158Libtool (&libtool-version;) - &libtool-size;:
     159<ulink url="http://freshmeat.net/projects/libtool/"/>
     160
     161Linux (&kernel-version;) - &kernel-size;:
     162<ulink url="http://freshmeat.net/projects/linux/"/>
     163
     164M4 (&m4-version;) - &m4-size;:
     165<ulink url="http://freshmeat.net/projects/gnum4/"/>
     166
     167Make (&make-version;) - &make-size;:
     168<ulink url="http://freshmeat.net/projects/gnumake/"/>
     169
     170Make_devices (&makedev-version;) - &makedev-size;:
     171<ulink url="&lfs-root;~alex/make_devices-&makedev-version;.bz2"/>
     172
     173Man (&man-version;) - &man-size;:
     174<ulink url="http://freshmeat.net/projects/man/"/>
     175
     176Man-pages (&man-pages-version;) - &man-pages-size;:
     177<ulink url="http://freshmeat.net/projects/man-pages/"/>
     178
     179Modutils (&modutils-version;) - &modutils-size;:
     180<ulink url="http://freshmeat.net/projects/modutils/"/>
     181
     182Ncurses (&ncurses-version;) - &ncurses-size;:
     183<ulink url="http://freshmeat.net/projects/ncurses/"/>
     184
     185Net-tools (&net-tools-version;) - &net-tools-size;:
     186<ulink url="http://freshmeat.net/projects/net-tools/"/>
     187
     188Patch (&patch-version;) - &patch-size;:
     189<ulink url="http://freshmeat.net/projects/patch/"/>
     190
     191Perl (&perl-version;) - &perl-size;:
     192<ulink url="http://freshmeat.net/projects/perl/"/>
     193
     194Procinfo (&procinfo-version;) - &procinfo-size;:
     195<ulink url="http://freshmeat.net/projects/procinfo/"/>
     196
     197Procps (&procps-version;) - &procps-size;:
     198<ulink url="http://freshmeat.net/projects/procps/"/>
     199
     200Psmisc (&psmisc-version;) - &psmisc-size;:
     201<ulink url="http://freshmeat.net/projects/psmisc/"/>
     202
     203Sed (&sed-version;) - &sed-size;:
     204<ulink url="http://freshmeat.net/projects/sed/"/>
     205
     206Shadow (&shadow-version;) - &shadow-size;:
     207<ulink url="http://freshmeat.net/projects/shadow/"/>
     208
     209Sysklogd (&sysklogd-version;) - &sysklogd-size;:
     210<ulink url="http://freshmeat.net/projects/sysklogd/"/>
     211
     212Sysvinit (&sysvinit-version;) - &sysvinit-size;:
     213<ulink url="http://freshmeat.net/projects/sysvinit/"/>
     214
     215Tar (&tar-version;) - &tar-size;:
     216<ulink url="ftp://alpha.gnu.org/gnu/tar/"/>
     217
     218Tcl (&tcl-version;) - &tcl-size;:
     219<ulink url="http://freshmeat.net/projects/tcltk/"/>
     220
     221Texinfo (&texinfo-version;) - &texinfo-size;:
     222<ulink url="http://freshmeat.net/projects/texinfo/"/>
     223
     224Util-linux (&util-linux-version;) - &util-linux-size;:
     225<ulink url="http://freshmeat.net/projects/util-linux/"/>
     226
     227Vim (&vim-version;) - &vim-size;:
     228<ulink url="http://freshmeat.net/projects/vim/"/>
     229
     230Zlib (&zlib-version;) - &zlib-size;:
     231<ulink url="http://freshmeat.net/projects/zlib/"/>
     232
     233Total size of these packages: &all-size-mb;
     234</literallayout>
     235
     236<note><para>1) File (&file-version;) may not be available by the time you read
     237this. The site admins of the master download location are known to occasionally
     238remove old versions when new ones are released. Please refer to the
     239<xref linkend="ch-system-file"/> section for an alternate download
     240location.</para></note>
     241
     242<note><para>2) As of this writing, the Glibc maintainers have decided in their
     243wisdom not to make available new release tarballs for download. The only way to
     244obtain the current Glibc release from pristine upstream sources is to pull it
     245from the Glibc CVS repository. The following commands will download the current
     246release and make a tarball from it:</para>
     247
     248<screen><userinput>cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc \
     249&nbsp;&nbsp;&nbsp;&nbsp;export -d &glibc-dir; -D "2003-12-02 UTC" libc
     250tar jcvf &glibc-package; &glibc-dir;</userinput></screen>
     251
     252<para>Alternatively, we've made our own tarball available which you can
     253download courtesy of the generous LFS mirror sites. Please refer to the
     254<xref linkend="ch-tools-glibc"/> section for the download links.</para></note>
    54255
    55256</sect1>
    56257
    57258
    58 <sect1 id="space-creatingfilesystem">
    59 <title>Creating a file system on the new partition</title>
    60 <?dbhtml filename="creatingfilesystem.html" dir="chapter03"?>
    61 
    62 <para>Now that we have a blank partition, we can create a file system on it.
    63 Most widely used in the Linux world is the second extended file system (ext2),
    64 but with the high-capacity hard disks of today the so-called journaling
    65 file systems are becoming increasingly popular. Here we will create an ext2
    66 file system, but build instructions for other file systems can be found at
    67 <ulink url="&blfs-root;view/stable/postlfs/filesystems.html"/>.</para>
    68 
    69 <para>To create an ext2 file system on the LFS partition run the following:</para>
    70 
    71 <screen><userinput>mke2fs /dev/xxx</userinput></screen>
    72 
    73 <para>Replace <filename>xxx</filename> with the name of the LFS partition
    74 (something like <filename>hda5</filename>).</para>
    75 
    76 <para>If you created a (new) swap partition you need to initialize it as a
    77 swap partition too (also known as formatting, like you did above with
    78 <command>mke2fs</command>) by running:</para>
    79 
    80 <screen><userinput>mkswap /dev/yyy</userinput></screen>
    81 
    82 <para>Replace <filename>yyy</filename> with the name of the swap
    83 partition.</para>
     259<sect1 id="materials-patches">
     260<title>Needed patches</title>
     261<?dbhtml filename="patches.html" dir="chapter03"?>
     262
     263<para>Besides all those packages, you'll also need several patches. These
     264correct tiny mistakes in the packages that should be fixed by the maintainer,
     265or just make some small modifications to bend things our way. You'll need the
     266following:</para>
     267
     268<literallayout>
     269Bash Patch - &bash-patch-size;:
     270<ulink url="&patches-root;&bash-patch;"/>
     271
     272Bison Attribute Patch - &bison-patch-size;:
     273<ulink url="&patches-root;&bison-patch;"/>
     274
     275Coreutils Hostname Patch - &coreutils-hostname-patch-size;:
     276<ulink url="&patches-root;&coreutils-hostname-patch;"/>
     277Coreutils Posixver Patch - &coreutils-posixver-patch-size;:
     278<ulink url="&patches-root;&coreutils-posixver-patch;"/>
     279Coreutils Uname Patch - &coreutils-uname-patch-size;:
     280<ulink url="&patches-root;&coreutils-uname-patch;"/>
     281
     282Ed Mkstemp Patch - &ed-patch-size;:
     283<ulink url="&patches-root;&ed-patch;"/>
     284
     285Expect Spawn Patch - &expect-patch-size;:
     286<ulink url="&patches-root;&expect-patch;"/>
     287
     288GCC No-Fixincludes Patch - &gcc-nofixincludes-patch-size;:
     289<ulink url="&patches-root;&gcc-nofixincludes-patch;"/>
     290GCC Specs Patch - &gcc-specs-patch-size;:
     291<ulink url="&patches-root;&gcc-specs-patch;"/>
     292
     293GCC-2 Patch - &gcc-2953-patch-size;:
     294<ulink url="&patches-root;&gcc-2953-patch;"/>
     295GCC-2 No-Fixincludes Patch - &gcc-2953-no-fixinc-patch-size;:
     296<ulink url="&patches-root;&gcc-2953-no-fixinc-patch;"/>
     297GCC-2 Return-Type Patch - &gcc-2953-returntype-fix-patch-size;:
     298<ulink url="&patches-root;&gcc-2953-returntype-fix-patch;"/>
     299
     300Inetutils No-Server-Man-Pages Patch - &inetutils-no-server-man-pages-patch-size;:
     301<ulink url="&patches-root;&inetutils-no-server-man-pages-patch;"/>
     302
     303Kbd More-Programs Patch - &kbd-patch-size;:
     304<ulink url="&patches-root;&kbd-patch;"/>
     305
     306Man 80-Columns Patch - &man-80cols-patch-size;:
     307<ulink url="&patches-root;&man-80cols-patch;"/>
     308
     309Net-tools Mii-Tool-Gcc33 Patch - &net-tools-mii-patch-size;:
     310<ulink url="&patches-root;&net-tools-mii-patch;"/>
     311
     312Perl Libc Patch - &perl-libc-patch-size;:
     313<ulink url="&patches-root;&perl-libc-patch;"/>
     314</literallayout>
     315
     316<para>In addition to the above required patches, there exist a number of
     317optional ones created by the LFS community. Most of these solve slight
     318problems, or enable some functionality that's not enabled by default.
     319Feel free to examine the patches database, located at <ulink
     320url="&lfs-root;patches/"/>, and pick any additional patches you wish to
     321use.</para>
    84322
    85323</sect1>
    86324
    87 
    88 <sect1 id="space-mounting">
    89 <title>Mounting the new partition</title>
    90 <?dbhtml filename="mounting.html" dir="chapter03"?>
    91 
    92 <para>Now that we've created a file system, we want to be able to access
    93 the partition. For that, we need to mount it, and have to choose a mount
    94 point. In this book we assume that the file system is mounted under
    95 <filename>/mnt/lfs</filename>, but it doesn't matter what directory
    96 you choose.</para>
    97 
    98 <para>Choose a mount point and assign it to the LFS environment variable
    99 by running:</para>
    100 
    101 <screen><userinput>export LFS=/mnt/lfs</userinput></screen>
    102 
    103 <para>Now create the mount point and mount the LFS file system by running:</para>
    104 
    105 <screen><userinput>mkdir -p $LFS
    106 mount /dev/xxx $LFS</userinput></screen>
    107 
    108 <para>Replace <filename>xxx</filename> with the designation of the LFS
    109 partition.</para>
    110 
    111 <para>If you have decided to use multiple partitions for LFS (say one for
    112 <filename>/</filename> and another for <filename>/usr</filename>), mount
    113 them like this:</para>
    114 
    115 <screen><userinput>mkdir -p $LFS
    116 mount /dev/xxx $LFS
    117 mkdir $LFS/usr
    118 mount /dev/yyy $LFS/usr</userinput></screen>
    119 
    120 <para>Of course, replace <filename>xxx</filename> and <filename>yyy</filename>
    121 with the appropriate partition names.</para>
    122 
    123 <para>You should also ensure that this new partition is not mounted with
    124 permissions that are too restrictive (such as the nosuid, nodev or noatime
    125 options). You can run the <command>mount</command> command without any
    126 parameters to see with what options the LFS partition is mounted. If
    127 you see nosuid, nodev or noatime, you will need to remount it.</para>
    128  
    129 <para>Now that we've made ourselves a place to work in, we're ready to download
    130 the packages.</para>
    131 
    132 </sect1>
    133 
    134 
    135325</chapter>
     326
Note: See TracChangeset for help on using the changeset viewer.