diff options
author | Gerard Beekmans <gerard@linuxfromscratch.org> | 2001-01-24 00:31:17 +0000 |
---|---|---|
committer | Gerard Beekmans <gerard@linuxfromscratch.org> | 2001-01-24 00:31:17 +0000 |
commit | 6370fa6cff0ec2a8ac8d50d1595ec9500f6631c9 (patch) | |
tree | b17c8cb0a839b76f4a7db0f771953caa11c3a04e /chapter05 | |
parent | 5c930fe6eb43d23cfa0de2451d9a905a8505f981 (diff) |
Initial commit - LFS 2.4.4 files
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@14 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter05')
46 files changed, 1134 insertions, 0 deletions
diff --git a/chapter05/bash-static-exp.sgml b/chapter05/bash-static-exp.sgml new file mode 100644 index 000000000..8d627237e --- /dev/null +++ b/chapter05/bash-static-exp.sgml @@ -0,0 +1,55 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>--enable-static-link:</userinput> This configure +option causes Bash to be linked statically +</para> + +<para> +<userinput>--prefix=$LFS/usr:</userinput> This configure option installs +all of Bash's files under the $LFS/usr directory, which becomes the /usr +directory after you chroot into $LFS or when you reboot the system into LFS. +</para> + +<para> +<userinput>--bindir=$LFS/bin:</userinput> This installs the executable +files in $LFS/bin. We do this because we want bash to be in /bin, not in +/usr/bin. One reason being: your /usr partition might be on a seperate +partition which has to be mounted at some point. Before that partition is +mounted you need and will want to have bash available (it will be hard to +execute the boot scripts without a shell for instance). +</para> + +<para> +<userinput>--disable-nls:</userinput> This disables the build of NLS +(National Language Support). It's only a waste of time for now as Bash +will be reinstalled in the next chapter. +</para> + +<para> +<userinput>--with-curses:</userinput> This causes Bash to be linked +against the curses library instead of the default termcap library which +is becoming obsolete. +</para> + +<para> +<userinput>ln -s bash sh:</userinput> This command creates the sh +symlink that points to bash. Most scripts run themselves via 'sh'; sh +being a symlink to the default system shell. Because programs and +scripts don't know what shell you use by default (could be bash, ksh, +korn, tch, csh and others) they use the common symlink sh which, if the +system is properly setup, always points to the system's default shell. +</para> + +<para> +The <userinput>&&</userinput>'s at the end of every line cause +the next command only to be executed when the previous command exists +with a return value of 0 indicating success. In case you copy&paste +all of these commands on the shell you want to be ensured that if +./configure fails, make isn't being executed and likewise if make fails +that make install isn't being executed, and so forth. +</para> + +</sect2> + diff --git a/chapter05/bash-static-inst.sgml b/chapter05/bash-static-inst.sgml new file mode 100644 index 000000000..8c9115709 --- /dev/null +++ b/chapter05/bash-static-inst.sgml @@ -0,0 +1,42 @@ +<sect2> +<title>Installation of Bash</title> + +<para> +Install Bash by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>./configure --enable-static-link --prefix=$LFS/usr \</userinput> + <userinput> --bindir=$LFS/bin --disable-nls + --with-curses &&</userinput> + <userinput>make &&</userinput> + <userinput>make install &&</userinput> + <userinput>cd $LFS/bin &&</userinput> + <userinput>ln -s bash sh</userinput> + +</literallayout></blockquote> + +<para> +If you get errors when compiling bash that tell you about not being able to +find <quote>-lcurses</quote> run these two commands to create the +missing symlink (so far we have not enountered one distribution that has +this libncurses symlink setup properly, except for LFS systems where it +is setup properly): +</para> + +<blockquote><literallayout> + + <userinput>cd /usr/lib &&</userinput> + <userinput>ln -s libncurses.a libcurses.a</userinput> + +</literallayout></blockquote> + +<para> +Note: Normally the libncurses.a file resides in the /usr/lib directory +but it might reside in /lib (like it does on LFS systems). So check to +make sure whether you should run the ln command in /usr/lib or in /lib +</para> + +</sect2> + diff --git a/chapter05/bash-static.sgml b/chapter05/bash-static.sgml new file mode 100644 index 000000000..a6b668eb0 --- /dev/null +++ b/chapter05/bash-static.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-bash"> +<title>Installing Bash</title> + +&c5-pp-bash-inst; +&c5-pp-bash-exp; +&aa-bash-desc; + +</sect1> + diff --git a/chapter05/binutils-static-exp.sgml b/chapter05/binutils-static-exp.sgml new file mode 100644 index 000000000..71370de2a --- /dev/null +++ b/chapter05/binutils-static-exp.sgml @@ -0,0 +1,28 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>make -e:</userinput> The -e paramater tells make that +environment variables take precedence over variables defined in the +Makefile file(s). This is needed in order to successfully link binutils +statically. +</para> + +<para> +<userinput>LDFLAGS=-all-static:</userinput> Setting the variable LDFLAGS +to the value -all-static causes binutils to be linked statically. +</para> + +<para> +<userinput>tooldir=$LFS/usr:</userinput> Normally the tooldir (the +directory where the executables from binutils end up in) is set to +$(exec_prefix)/$(target_alias) which expands into, for example, +/usr/i686-pc-linux-gnu. Since we only build for our own system we don't +need this target specific directory in $LFS/usr. You would use that +setup if you use your system to cross-compile (for example you would +compile a package on your Intel machine that generates code that can be +executed on Apple PowerPC machines). +</para> + +</sect2> + diff --git a/chapter05/binutils-static-inst.sgml b/chapter05/binutils-static-inst.sgml new file mode 100644 index 000000000..f08640f42 --- /dev/null +++ b/chapter05/binutils-static-inst.sgml @@ -0,0 +1,19 @@ +<sect2> +<title>Installation of Binutils</title> + +<para> +Install Binutils by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>./configure --prefix=$LFS/usr --disable-nls + &&</userinput> + <userinput>make -e LDFLAGS=-all-static tooldir=$LFS/usr + &&</userinput> + <userinput>make -e tooldir=$LFS/usr install</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/binutils-static.sgml b/chapter05/binutils-static.sgml new file mode 100644 index 000000000..fd13dfd20 --- /dev/null +++ b/chapter05/binutils-static.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-binutils"> +<title>Installing Binutils</title> + +&c5-pp-binutils-inst; +&c5-pp-binutils-exp; +&aa-binutils-desc; + +</sect1> + diff --git a/chapter05/bzip2-static-exp.sgml b/chapter05/bzip2-static-exp.sgml new file mode 100644 index 000000000..788de4298 --- /dev/null +++ b/chapter05/bzip2-static-exp.sgml @@ -0,0 +1,33 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>sed: </userinput> The sed command here searches for the +string "$(CC) $(CFLAGS) -o" and replaced it by "$(CC) $(CFLAGS) +$(LDFLAGS) -o" in the Makefile file. We make that modification so it +will be easier to link bzip2 statically. +</para> + +<para> +<userinput>...Makefile | make -f -:</userinput> Makefile +is the last parameter of the sed command which indicates the file to +search and replace in. sed normally sends the modified file to stdout +(standard output) which will be your console. With the construction we +use, sed's output will be piped to the make program. Normally when make +is started it tries to find a number of files like Makefile. But we have +modified the Makefile file so we don't want make to use it. The "-f -" +parameter tells make to read it's input from another file, or from stdin +(standard input) which the dash (-) implies. This is one way to do it. +Another way would be to have sed write the output to a different file +and tell make with the -f parameter to read that alternate file. +</para> + +<para> +<userinput>LDFLAGS=-static:</userinput> This is the second way we use to +link a package statically. This is also the most common way. As you'll +notice, the -all-static value is only used with the binutils package and +won't be used throughout the rest of this book. +</para> + +</sect2> + diff --git a/chapter05/bzip2-static-inst.sgml b/chapter05/bzip2-static-inst.sgml new file mode 100644 index 000000000..277ee2f5e --- /dev/null +++ b/chapter05/bzip2-static-inst.sgml @@ -0,0 +1,22 @@ +<sect2> +<title>Installation of Bzip2</title> + +<para> +Install Bzip2 by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>sed \</userinput> + <userinput> s/"\$(CC) \$(CFLAGS) -o"/"\$(CC) \$(CFLAGS) + \$(LDFLAGS) -o"/ \</userinput> + <userinput> Makefile | make -f - + LDFLAGS=-static &&</userinput> + <userinput>make PREFIX=$LFS/usr install &&</userinput> + <userinput>cd $LFS/usr/bin &&</userinput> + <userinput>mv bzcat bunzip2 bzip2 bzip2recover $LFS/bin</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/bzip2-static.sgml b/chapter05/bzip2-static.sgml new file mode 100644 index 000000000..1cf203aed --- /dev/null +++ b/chapter05/bzip2-static.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-bzip2"> +<title>Installing Bzip2</title> + +&c5-pp-bzip2-inst; +&c5-pp-bzip2-exp; +&aa-bzip2-desc; + +</sect1> + diff --git a/chapter05/chapter5.sgml b/chapter05/chapter5.sgml new file mode 100644 index 000000000..a5e82ebc6 --- /dev/null +++ b/chapter05/chapter5.sgml @@ -0,0 +1,26 @@ +<chapter id="chapter05"> +<title>Preparing the LFS system</title> + +&c5-introduction; + +&c5-pp-bash; +&c5-pp-binutils; +&c5-pp-bzip2; +&c5-pp-diffutils; +&c5-pp-fileutils; +&c5-pp-gcc-local; +&c5-pp-gcc; +&c5-pp-kernel; +&c5-pp-glibc; +&c5-pp-grep; +&c5-pp-gzip; +&c5-pp-make; +&c5-pp-sed; +&c5-pp-shellutils; +&c5-pp-tar; +&c5-pp-textutils; +&c5-pp-pwdgroup; +&c5-pp-proc; + +</chapter> + diff --git a/chapter05/diffutils-static-exp.sgml b/chapter05/diffutils-static-exp.sgml new file mode 100644 index 000000000..5c8261459 --- /dev/null +++ b/chapter05/diffutils-static-exp.sgml @@ -0,0 +1,16 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>CPPFLAGS=-Dre_max_failures=re_max_failures2:</userinput> The +CPPFLAGS variable is a variable that's read by the cpp program (C +PreProcessor). The value of this variable tells the preprocessor to +replace every instance of re_max_failures it finds by re_max_failures2 +before handing the souce file to the compiler itself for compilation. This +package has problems linking statically on certain platforms (depending +on the Glibc version used on that system) and this construction fixes +that problem. +</para> + +</sect2> + diff --git a/chapter05/diffutils-static-inst.sgml b/chapter05/diffutils-static-inst.sgml new file mode 100644 index 000000000..60874c3f9 --- /dev/null +++ b/chapter05/diffutils-static-inst.sgml @@ -0,0 +1,21 @@ +<sect2> +<title>Installation of Diffutils</title> + +<para> +Install Diffutils by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>export CPPFLAGS=-Dre_max_failures=re_max_failures2 + &&</userinput> + <userinput>./configure --prefix=$LFS/usr --disable-nls + &&</userinput> + <userinput>unset CPPFLAGS &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/diffutils-static.sgml b/chapter05/diffutils-static.sgml new file mode 100644 index 000000000..c56846bf4 --- /dev/null +++ b/chapter05/diffutils-static.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-diffutils"> +<title>Installing Diffutils</title> + +&c5-pp-diffutils-inst; +&c5-pp-diffutils-exp; +&aa-diffutils-desc; + +</sect1> + diff --git a/chapter05/fileutils-static-exp.sgml b/chapter05/fileutils-static-exp.sgml new file mode 100644 index 000000000..c4cc59b1a --- /dev/null +++ b/chapter05/fileutils-static-exp.sgml @@ -0,0 +1,12 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>--libexecdir=$LFS/bin:</userinput> This configure option will +set the program executable directory to $LFS/bin. This is normally set +to /usr/libexec, but nothing is placed in it. Changing it just prevents +that directory from being created. +</para> + +</sect2> + diff --git a/chapter05/fileutils-static-inst.sgml b/chapter05/fileutils-static-inst.sgml new file mode 100644 index 000000000..f3e3553d6 --- /dev/null +++ b/chapter05/fileutils-static-inst.sgml @@ -0,0 +1,21 @@ +<sect2> +<title>Installation of Fileutils</title> + +<para> +Install Fileutils by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>./configure --disable-nls \</userinput> + <userinput>--prefix=$LFS/usr --libexecdir=$LFS/bin + --bindir=$LFS/bin &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install &&</userinput> + <userinput>cd $LFS/usr/bin &&</userinput> + <userinput>ln -s ../../bin/install install</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/fileutils-static.sgml b/chapter05/fileutils-static.sgml new file mode 100644 index 000000000..6ca75bf0b --- /dev/null +++ b/chapter05/fileutils-static.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-fileutils"> +<title>Installing Fileutils</title> + +&c5-pp-fileutils-inst; +&c5-pp-fileutils-exp; +&aa-fileutils-desc; + +</sect1> + diff --git a/chapter05/gcc-local-exp.sgml b/chapter05/gcc-local-exp.sgml new file mode 100644 index 000000000..0de2e3737 --- /dev/null +++ b/chapter05/gcc-local-exp.sgml @@ -0,0 +1,31 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>--with-local-prefix:</userinput> GCC installs a number of +files in /usr/local even when --prefix is set to something else. We +don't want that to happen in this case so that's why we use the +--with-local-prefix option to change that path. +</para> + +<para> +<userinput>--with-gxx-include-dir:</userinput> GCC installs the C++ +header files in /usr/include/g++ by default. Again, in this case we +don't want that to happen, we want this GCC version to be installed +completely under /usr/local/gcc2952. +</para> + +<para> +<userinput>make bootstrap:</userinput> Compile GCC by bootstrapping it. +Here that means the compiler will be built three times in total. First +it is compiled with your system's default compiler (which will usually +be a gcc or egcs compiler). This is stage 1 compiler. Then GCC will re-compile +itself but instead of using your system's compiler it will use itself to +compile itself again. This is the stage 2 compiler. Then it will compile +itself a second time with the stage 2 compiler and compares the second +and the third build to see if they are identical. If so, the +compilation was a success. +</para> + +</sect2> + diff --git a/chapter05/gcc-local-inst.sgml b/chapter05/gcc-local-inst.sgml new file mode 100644 index 000000000..c98ab6e0f --- /dev/null +++ b/chapter05/gcc-local-inst.sgml @@ -0,0 +1,56 @@ +<sect2> +<title>Installation of GCC on the normal system if necessary</title> + +<para> +In order to compile Glibc-2.1.3 later on you need to have gcc-2.95.2 +installed. Although any GCC version above 2.8 would do, 2.95.2 is the +highly +recommended version to use. egcs-2.91.x is also known to work. If you +don't have gcc-2.95.x or egcs-2.91.x you need to install gcc-2.95.2 on +your normal sytem before you can compile Glibc later in this chapter. +</para> + +<para> +To find out which compiler version your systems has, run the +following command: +</para> + +<blockquote><literallayout> + + <userinput>gcc --version</userinput> + +</literallayout></blockquote> + +<para> +If you normal Linux system does not have gcc-2.95.x or egcs-2.91.x +installed you need to install it now. We won't replace the current +compiler on your system, but instead we will install gcc in a separate +directory (/usr/local/gcc2952). This way no binaries or header files will be +replaced. +</para> + +<para> +After you unpacked the gcc-2.95.2 archive don't enter the newly created +gcc-2.95.2 directory but stay in the $LFS/usr/src directory. Install GCC by +running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>mkdir $LFS/usr/src/gcc-build &&</userinput> + <userinput>cd $LFS/usr/src/gcc-build &&</userinput> + <userinput>../gcc-2.95.2/configure \</userinput> + <userinput> --prefix=/usr/local/gcc2952 \</userinput> + <userinput> --with-local-prefix=/usr/local/gcc2952 + \</userinput> + <userinput> + --with-gxx-include-dir=/usr/local/gcc2952/include/g++ \</userinput> + <userinput> --enable-shared --enable-languages=c,c++ + &&</userinput> + <userinput>make bootstrap &&</userinput> + <userinput>make install</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/gcc-local.sgml b/chapter05/gcc-local.sgml new file mode 100644 index 000000000..91b02f55a --- /dev/null +++ b/chapter05/gcc-local.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-gcclocal"> +<title>Installing GCC on the normal system if necessary</title> + +&c5-pp-gcc-local-inst; +&c5-pp-gcc-local-exp; +&aa-gcc-desc; + +</sect1> + diff --git a/chapter05/gcc-static-exp.sgml b/chapter05/gcc-static-exp.sgml new file mode 100644 index 000000000..62639d914 --- /dev/null +++ b/chapter05/gcc-static-exp.sgml @@ -0,0 +1,24 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>--enable-languages=c,c++:</userinput> This only builds the C +and C++ compilers and not the other available compilers as they are, on +the average, not often used. If you do need those other compilers don't +use the --enable-languages parameter. +</para> + +<para> +<userinput>ln -s ../usr/lib/gcc-lib/*/2.95.2/cpp cpp:</userinput> This +creates the $LFS/lib/cpp symlink. Some packages explicitely try to find +cpp in /lib. +</para> + +<para> +<userinput>ln -s ../usr/lib/gcc-lib/*/2.95.2/cpp cpp:</userinput> This +creates the $LFS/usr/lib/cpp symlink as there are packages that expect +cpp to be in /usr/lib. +</para> + +</sect2> + diff --git a/chapter05/gcc-static-inst.sgml b/chapter05/gcc-static-inst.sgml new file mode 100644 index 000000000..fce53546a --- /dev/null +++ b/chapter05/gcc-static-inst.sgml @@ -0,0 +1,36 @@ +<sect2> +<title>Installation of GCC on the LFS system</title> + +<para> +After you unpacked the gcc-2.95.2 archive don't enter the newly created +gcc-2.95.2 directory but stay in the $LFS/usr/src directory. Install GCC by +running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>mkdir $LFS/usr/src/gcc-build &&</userinput> + <userinput>cd $LFS/usr/src/gcc-build &&</userinput> + <userinput>../gcc-2.95.2/configure --prefix=/usr \</userinput> + <userinput> --with-gxx-include-dir=/usr/include/g++ + \</userinput> + <userinput> --enable-languages=c,c++ --disable-nls + &&</userinput> + <userinput>make -e LDFLAGS=-static bootstrap &&</userinput> + <userinput>make prefix=$LFS/usr local_prefix=$LFS/usr/local + \</userinput> + <userinput> gxx_include_dir=$LFS/usr/include/g++ + install &&</userinput> + <userinput>cd $LFS/lib &&</userinput> + <userinput>ln -s ../usr/lib/gcc-lib/*/2.95.2/cpp cpp + &&</userinput> + <userinput>cd $LFS/usr/lib &&</userinput> + <userinput>ln -s gcc-lib/*/2.95.2/cpp cpp + &&</userinput> + <userinput>cd $LFS/usr/bin &&</userinput> + <userinput>ln -s gcc cc</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/gcc-static.sgml b/chapter05/gcc-static.sgml new file mode 100644 index 000000000..813257ca0 --- /dev/null +++ b/chapter05/gcc-static.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-gcc"> +<title>Installing GCC on the LFS system</title> + +&c5-pp-gcc-inst; +&c5-pp-gcc-exp; +&aa-gcc-desc; + +</sect1> + diff --git a/chapter05/glibc-exp.sgml b/chapter05/glibc-exp.sgml new file mode 100644 index 000000000..b325b739d --- /dev/null +++ b/chapter05/glibc-exp.sgml @@ -0,0 +1,29 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>patch -Np1 -i ../glibc-2.1.3.patch:</userinput> This applies +a patch that fixes a minor bug in Glibc. Glibc defines a few variables +names with illegal characters in the name. Bash-2.03 and older don't +complain about that but Bash-2.04 does and won't compile Glibc properly. +</para> + +<para> +<userinput>--enable-add-ons:</userinput> This enabled the add-ons that +we install with Glibc: linuxthreads and crypt. +</para> + +<para> +<userinput>--with-headers=$LFS/usr/include:</userinput> This makes Glibc +use the kernel header files on our LFS system and not the kernel header +files from your starting distribution which may be out-of-date or +modified. +</para> + +<para> +<userinput>make install_root=$LFS:</userinput> This is the Glibc way to +specify the equivalent of --prefix=. +</para> + +</sect2> + diff --git a/chapter05/glibc-inst.sgml b/chapter05/glibc-inst.sgml new file mode 100644 index 000000000..122f37ac2 --- /dev/null +++ b/chapter05/glibc-inst.sgml @@ -0,0 +1,111 @@ +<sect2> +<title>Installation of Glibc</title> + +<para> +Unpack the glibc-crypt and glibc-linuxthreads in the glibc-2.1.3 +directory, not in $LFS/usr/src. Don't enter the created directories. Just +unpack them and leave it with that. +</para> + +<para> +A few default parameters of Glibc need to be changed, such as the +directory where the shared libraries are supposed to be installed in and +the directory that contains the system configuration files. For this +purpose you need to create the <filename class="directory"> +$LFS/usr/src/glibc-build</filename> directory and cd into that directory +with: +</para> + +<blockquote><literallayout> + + <userinput>mkdir $LFS/usr/src/glibc-build &&</userinput> + <userinput>cd $LFS/usr/src/glibc-build</userinput> + +</literallayout></blockquote> + +<para> +In that directory you create a new file <filename>configparms</filename> +by running the following: +</para> + +<literallayout> + +<userinput>cat > configparms << "EOF"</userinput> +# Begin configparms + +slibdir=/lib +sysconfdir=/etc + +# End configparms +<userinput>EOF</userinput> + +</literallayout> + +<para> +Before we actually install Glibc you need to unpack the Glibc patch +file. +</para> + +<para> +Please note that the configure script of Glibc may complain about +certain files in the /usr/include directory being too old and will be +replaced, or that some symlink is not supposed to be there anymore (like +the /usr/include/scsi symlink that's present on older Linux systems). If +it asks you to move a symlink like scsi out of the way, please do so. If +it says it will replace old files by the newer Glibc files you can +ignore that. Glibc does not know that it will end up on $LFS when the +configure script is run. +</para> + +<para> +If your system had already a suitable GCC version installed, change to the +<filename class="directory">$LFS/usr/src/glibc-build</filename> +directory and install Glibc by running the following +commands: +</para> + +<blockquote><literallayout> + + <userinput>cd ../glibc-2.1.3 &&</userinput> + <userinput>patch -Np1 -i ../glibc-2.1.3.patch &&</userinput> + <userinput>cd $LFS/usr/src/glibc-build &&</userinput> + <userinput>../glibc-2.1.3/configure \</userinput> + <userinput> --prefix=/usr --enable-add-ons + \</userinput> + <userinput> --with-headers=$LFS/usr/include + \</userinput> + <userinput> --libexecdir=/usr/bin && + </userinput> + <userinput>make &&</userinput> + <userinput>make install_root=$LFS install &&</userinput> + <userinput>make install_root=$LFS localedata/install-locales</userinput> + +</literallayout></blockquote> + +<para> +If your system didn't have a suitable GCC version installed, change to the +<filename class="directory">$LFS/usr/src/glibc-build</filename> +directory and install Glibc using the gcc-2.95.2 you just installed by +running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>cd ../glibc-2.1.3 &&</userinput> + <userinput>patch -Np1 -i ../glibc-2.1.3.patch &&</userinput> + <userinput>cd $LFS/usr/src/glibc-build &&</userinput> + <userinput>CC=/usr/local/gcc2952/bin/gcc \</userinput> + <userinput> ../glibc-2.1.3/configure --prefix=/usr + --enable-add-ons \</userinput> + <userinput> --with-headers=$LFS/usr/include \ + </userinput> + <userinput> --libexecdir=/usr/bin && + </userinput> + <userinput>make &&</userinput> + <userinput>make install_root=$LFS install &&</userinput> + <userinput>make install_root=$LFS localedata/install-locales</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/glibc-nss.sgml b/chapter05/glibc-nss.sgml new file mode 100644 index 000000000..a281e60c9 --- /dev/null +++ b/chapter05/glibc-nss.sgml @@ -0,0 +1,38 @@ +<sect2> +<title>Copying old NSS library files</title> + +<para> +If your normal Linux system runs glibc-2.0, you need to copy the NSS +library files to the LFS partition. Certain statically linked programs +still depend on the NSS library, especially programs that need to lookup +usernames,userid's and groupid's. You can check which C library version +your normal Linux system uses by running: +</para> + +<blockquote><literallayout> + + <userinput>strings /lib/libc* | grep "release version"</userinput> + +</literallayout></blockquote> + +<para> +The output of that command should tell you something like this: +</para> + +<blockquote><literallayout> + GNU C Library stable release version 2.1.3, by Roland McGrath et al. +</literallayout></blockquote> + +<para> +If you have Glibc-2.0.x installed on your starting distribution, copy +the NSS library files by running: +</para> + +<blockquote><literallayout> + + <userinput>cp -av /lib/libnss* $LFS/lib</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/glibc.sgml b/chapter05/glibc.sgml new file mode 100644 index 000000000..5c03144a9 --- /dev/null +++ b/chapter05/glibc.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-glibc"> +<title>Installing Glibc</title> + +&c5-pp-glibc-inst; +&c5-pp-glibc-nss; +&c5-pp-glibc-exp; +&aa-glibc-desc; + +</sect1> diff --git a/chapter05/grep-static-inst.sgml b/chapter05/grep-static-inst.sgml new file mode 100644 index 000000000..ecf2051ee --- /dev/null +++ b/chapter05/grep-static-inst.sgml @@ -0,0 +1,21 @@ +<sect2> +<title>Installation of Grep</title> + +<para> +Install Grep by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>export CPPFLAGS=-Dre_max_failures=re_max_failures2 + &&</userinput> + <userinput>./configure --prefix=$LFS/usr --disable-nls + &&</userinput> + <userinput>unset CPPFLAGS &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/grep-static.sgml b/chapter05/grep-static.sgml new file mode 100644 index 000000000..5887148af --- /dev/null +++ b/chapter05/grep-static.sgml @@ -0,0 +1,8 @@ +<sect1 id="ch05-grep"> +<title>Installing Grep</title> + +&c5-pp-grep-inst; +&aa-grep-desc; + +</sect1> + diff --git a/chapter05/gzip-static-inst.sgml b/chapter05/gzip-static-inst.sgml new file mode 100644 index 000000000..0b9c58409 --- /dev/null +++ b/chapter05/gzip-static-inst.sgml @@ -0,0 +1,22 @@ +<sect2> +<title>Installation of Gzip</title> + +<para> +Before you install Gzip you have to unpack the gzip patch file. +</para> + +<blockquote><literallayout> + + <userinput>patch -Np1 -i ../gzip-1.2.4a.patch &&</userinput> + <userinput>./configure --prefix=$LFS/usr --disable-nls + &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install &&</userinput> + <userinput>cp $LFS/usr/bin/gunzip $LFS/usr/bin/gzip + $LFS/bin &&</userinput> + <userinput>rm $LFS/usr/bin/gunzip $LFS/usr/bin/gzip</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/gzip-static.sgml b/chapter05/gzip-static.sgml new file mode 100644 index 000000000..0737c6728 --- /dev/null +++ b/chapter05/gzip-static.sgml @@ -0,0 +1,8 @@ +<sect1 id="ch05-gzip"> +<title>Installing Gzip</title> + +&c5-pp-gzip-inst; +&aa-gzip-desc; + +</sect1> + diff --git a/chapter05/introduction.sgml b/chapter05/introduction.sgml new file mode 100644 index 000000000..881a7e9ed --- /dev/null +++ b/chapter05/introduction.sgml @@ -0,0 +1,55 @@ +<sect1 id="ch05-introduction"> +<title>Introduction</title> + +<para> +In the following chapters we will install all the software that belongs to +a basic Linux system. After you're done with this chapter you have a +fully working Linux system. The remaining chapters deal with setting up +networking, creating the boot scripts and adding an entry to lilo.conf so +that you can boot your LFS system. +</para> + +<para> +The software in this chapter will be linked statically. These programs +will be re-installed in the next chapter and linked dynamically. The +reason for the static version first is that there is a chance that our +normal Linux system and your LFS system aren't using the same C +Library versions. If the programs in the first part are linked against +an older C library version, those programs might not work well on the +LFS system. +</para> + +<para> +The key to learn what makes Linux tick is to know exactly what packages +are used for and why you or the system needs them. Descriptions +of the package content are provided after the Installation subsection of each +package and in Appendix A as well. +</para> + +<para> +We're about to start with installing the first set of packages. These +packages will be, as previously explained, linked statically. +</para> + +<para> +During the installation of various packages you will most likely see +compiler warnings scrolling by on your screen. These are normal and can +be safely ignored. They are just that, warnings (mostly about improper +use of the C or C++ syntax, but not illegal use. It's just that often C +standards changed and packages still use the old standard which is not a +problem). +</para> + +<para> +Before we start, make sure you have the LFS environment variable setup +if you plan on using it, by running the following command: +</para> + +<blockquote><literallayout> + + <userinput>echo $LFS</userinput> + +</literallayout></blockquote> + +</sect1> + diff --git a/chapter05/kernel-exp.sgml b/chapter05/kernel-exp.sgml new file mode 100644 index 000000000..1ff6f17ee --- /dev/null +++ b/chapter05/kernel-exp.sgml @@ -0,0 +1,35 @@ +<sect2> +<title>Command explanations</title> + +<para> +<userinput>yes "" | make config:</userinput> This runs make config and +answers "Y" to every question the config script asks the user. We're not +configuring the real kernel here, we just need to have some sort of +configure file created so that we can run make dep next that will create +a few files in $LFS/usr/src/linux/include/linux like version.h among +others that we will need to compilg Glibc and other packages later in +chroot. +</para> + +<para> +<userinput>make dep:</userinput> make dep checks dependencies and sets +up the dependencies file. We don't really care about the dependency +checks, but what we do care about is that make dep creates those +aforementioned files in $LFS/usr/src/linux/include/linux we will be +needing later on. +</para> + +<para> +<userinput>ln -s ../src/linux/include/linux linux</userinput> and +<userinput>ln -s ../src/linux/include/asm asm:</userinput> These +commands create the linux and asm symlinks in the $LFS/usr/include +directory that point to the proper directories in the Linux source tree. +Packages that need kernel headers include them with lines like #include +<linux/errno.h>. These paths are relative to the /usr/include +directory so the /usr/include/linux link points to the directory +containing the Linux kernel header files. The same goes for the asm +symlink. +</para> + +</sect2> + diff --git a/chapter05/kernel-inst.sgml b/chapter05/kernel-inst.sgml new file mode 100644 index 000000000..0d36fa1af --- /dev/null +++ b/chapter05/kernel-inst.sgml @@ -0,0 +1,49 @@ +<sect2> +<title>Installation of Linux Kernel</title> + +<para> +We won't be compiling a new kernel image yet. We'll do that after we +have finished the installation of the basic system software in this +chapter. But because certain software need the kernel header files, we're +going to unpack the kernel archive now and set it up so that we can +compile package that need the kernel. +</para> + +<para> +Create the kernel configuration file by running the following command: +</para> + +<blockquote><literallayout> + + <userinput>yes "" | make config</userinput> + +</literallayout></blockquote> + +<para> +Ignore the warning <emphasis>Broken pipe</emphasis> you might see at the +end. Now run the following commands to set up all the dependencies correctly: +</para> + +<blockquote><literallayout> + + <userinput>make dep</userinput> + +</literallayout></blockquote> + +<para> +Now that that's done, we need to create the <filename class="symlink"> +$LFS/usr/include/linux</filename> and the <filename class="symlink"> +$LFS/usr/include/asm</filename> symlinks. Create them by running the +following commands: +</para> + +<blockquote><literallayout> + + <userinput>cd $LFS/usr/include &&</userinput> + <userinput>ln -s ../src/linux/include/linux linux &&</userinput> + <userinput>ln -s ../src/linux/include/asm asm</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/kernel.sgml b/chapter05/kernel.sgml new file mode 100644 index 000000000..be1bf3b45 --- /dev/null +++ b/chapter05/kernel.sgml @@ -0,0 +1,9 @@ +<sect1 id="ch05-kernel"> +<title>Installing Linux Kernel</title> + +&c5-pp-kernel-inst; +&c5-pp-kernel-exp; +&aa-kernel-desc; + +</sect1> + diff --git a/chapter05/make-static-inst.sgml b/chapter05/make-static-inst.sgml new file mode 100644 index 000000000..74fee7dea --- /dev/null +++ b/chapter05/make-static-inst.sgml @@ -0,0 +1,18 @@ +<sect2> +<title>Installation of Make</title> + +<para> +Install Make by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>./configure --prefix=$LFS/usr + --disable-nls &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/make-static.sgml b/chapter05/make-static.sgml new file mode 100644 index 000000000..9380ad1c5 --- /dev/null +++ b/chapter05/make-static.sgml @@ -0,0 +1,8 @@ +<sect1 id="ch05-make"> +<title>Installing Make</title> + +&c5-pp-make-inst; +&aa-make-desc; + +</sect1> + diff --git a/chapter05/proc.sgml b/chapter05/proc.sgml new file mode 100644 index 000000000..044ccd6c6 --- /dev/null +++ b/chapter05/proc.sgml @@ -0,0 +1,23 @@ +<sect1 id="ch05-proc"> +<title>Mounting $LFS/proc file system</title> + +<para> +In order for certain programs to function properly the proc file system +must be mounted and available from within the chroot'ed environment as +well. It's not a problem to mount the proc file system twice +or even more than that, since it's a virtual file system maintained by +the kernel itself. +</para> + +<para> +Mount the proc file system under $LFS/proc by running the following command: +</para> + +<blockquote><literallayout> + + <userinput>mount proc $LFS/proc -t proc</userinput> + +</literallayout></blockquote> + +</sect1> + diff --git a/chapter05/pwdgroup.sgml b/chapter05/pwdgroup.sgml new file mode 100644 index 000000000..db7343aa6 --- /dev/null +++ b/chapter05/pwdgroup.sgml @@ -0,0 +1,53 @@ +<sect1 id="ch05-pwdgroup"> +<title>Creating passwd and group files</title> + +<para> +In order for user and group root to be recognized and to be able to logon +it needs an entry in the /etc/passwd and /etc/group file. Besides the +group root a couple of other groups are recommended and needed by +packages. The groups with their GID's below aren't part of any standard. +The LSB only recommends besides a group root a group bin to be present +with GID 1. Other group names and GID's can be chosen by yourself. Well +written packages don't depend on GID numbers but just use the group +name, it doesn't matter all that much what GID a group has. Since there +aren't any standards for groups I won't follow any conventions used by +Debian, RedHat and others. The groups added here are the groups the +MAKEDEV script (the script that creates the device files in the /dev +directory) mentions. +</para> + +<para> +Create a new file <filename>$LFS/etc/passwd</filename> by running the +following command: +</para> + +<blockquote><literallayout> + + <userinput>echo "root:x:0:0:root:/root:/bin/bash" > + $LFS/etc/passwd</userinput> + +</literallayout></blockquote> + +<para> +Create a new file <filename>$LFS/etc/group</filename> by running the +following: +</para> + +<literallayout> + +<userinput>cat > $LFS/etc/group << "EOF"</userinput> + root:x:0: + bin:x:1: + sys:x:2: + kmem:x:3: + tty:x:4: + uucp:x:5: + daemon:x:6: + floppy:x:7: + disk:x:8: +<userinput>EOF</userinput> + +</literallayout> + +</sect1> + diff --git a/chapter05/sed-static-inst.sgml b/chapter05/sed-static-inst.sgml new file mode 100644 index 000000000..701fbcf1b --- /dev/null +++ b/chapter05/sed-static-inst.sgml @@ -0,0 +1,21 @@ +<sect2> +<title>Installation of Sed</title> + +<para> +Install Sed by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>export CPPFLAGS=-Dre_max_failures=re_max_failures2 + &&</userinput> + <userinput>./configure --prefix=$LFS/usr + --disable-nls --bindir=$LFS/bin &&</userinput> + <userinput>unset CPPFLAGS &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/sed-static.sgml b/chapter05/sed-static.sgml new file mode 100644 index 000000000..91cfdb6b9 --- /dev/null +++ b/chapter05/sed-static.sgml @@ -0,0 +1,8 @@ +<sect1 id="ch05-sed"> +<title>Installing Sed</title> + +&c5-pp-sed-inst; +&aa-sed-desc; + +</sect1> + diff --git a/chapter05/shellutils-static-inst.sgml b/chapter05/shellutils-static-inst.sgml new file mode 100644 index 000000000..5c65eefc7 --- /dev/null +++ b/chapter05/shellutils-static-inst.sgml @@ -0,0 +1,21 @@ +<sect2> +<title>Installation of Sh-utils</title> + +<para> +Install Shellutils by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>./configure --prefix=$LFS/usr + --disable-nls &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install &&</userinput> + <userinput>cd $LFS/usr/bin &&</userinput> + <userinput>mv date echo false pwd stty $LFS/bin &&</userinput> + <userinput>mv su true uname hostname $LFS/bin</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/shellutils-static.sgml b/chapter05/shellutils-static.sgml new file mode 100644 index 000000000..59b371b04 --- /dev/null +++ b/chapter05/shellutils-static.sgml @@ -0,0 +1,8 @@ +<sect1 id="ch05-shutils"> +<title>Installing Shellutils</title> + +&c5-pp-shellutils-inst; +&aa-shellutils-desc; + +</sect1> + diff --git a/chapter05/tar-static-inst.sgml b/chapter05/tar-static-inst.sgml new file mode 100644 index 000000000..4a811c8cf --- /dev/null +++ b/chapter05/tar-static-inst.sgml @@ -0,0 +1,40 @@ +<sect2> +<title>Installation of Tar</title> + +<para> +If you want to be able to directly use bzip2 files with tar, use the tar +patch avaiable from the LFS FTP site. This patch will add the -y option +to tar which works the same as the -z option to tar (which you can use +for gzip files). +</para> + +<para> +Apply the patch by running the following command: +</para> + +<blockquote><literallayout> + + <userinput>cd src &&</userinput> + <userinput>patch -i ../../gnutarpatch.txt &&</userinput> + <userinput>cd ..</userinput> + +</literallayout></blockquote> + +<para> +Install Tar by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>./configure --prefix=$LFS/usr + --disable-nls \</userinput> + <userinput> --libexecdir=$LFS/usr/bin && + </userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make prefix=$LFS/usr install &&</userinput> + <userinput>mv $LFS/usr/bin/tar $LFS/bin</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/tar-static.sgml b/chapter05/tar-static.sgml new file mode 100644 index 000000000..17ca6b885 --- /dev/null +++ b/chapter05/tar-static.sgml @@ -0,0 +1,8 @@ +<sect1 id="ch05-tar"> +<title>Installing Tar</title> + +&c5-pp-tar-inst; +&aa-tar-desc; + +</sect1> + diff --git a/chapter05/textutils-static-inst.sgml b/chapter05/textutils-static-inst.sgml new file mode 100644 index 000000000..2fe91620c --- /dev/null +++ b/chapter05/textutils-static-inst.sgml @@ -0,0 +1,19 @@ +<sect2> +<title>Installation of Textutils</title> + +<para> +Install Textutils by running the following commands: +</para> + +<blockquote><literallayout> + + <userinput>./configure --prefix=$LFS/usr + --disable-nls &&</userinput> + <userinput>make LDFLAGS=-static &&</userinput> + <userinput>make install &&</userinput> + <userinput>mv $LFS/usr/bin/cat $LFS/bin</userinput> + +</literallayout></blockquote> + +</sect2> + diff --git a/chapter05/textutils-static.sgml b/chapter05/textutils-static.sgml new file mode 100644 index 000000000..2870918e9 --- /dev/null +++ b/chapter05/textutils-static.sgml @@ -0,0 +1,8 @@ +<sect1 id="ch05-textutils"> +<title>Installing Textutils</title> + +&c5-pp-textutils-inst; +&aa-textutils-desc; + +</sect1> + |