diff options
author | Zack Winkles <winkie@linuxfromscratch.org> | 2004-05-03 21:28:58 +0000 |
---|---|---|
committer | Zack Winkles <winkie@linuxfromscratch.org> | 2004-05-03 21:28:58 +0000 |
commit | 9dfc02ff38f26117daffe7d8b822ebb64a3fed04 (patch) | |
tree | c3ea0521973ac75238f6ab5f674d5b4fc4032df8 /chapter06 | |
parent | 411ceb86b8150183a447f89b4789395bf16fddf0 (diff) |
Current BE-LFS (but w/ GCC 3.3.3) merged -> 6.0 branch
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3445 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06')
34 files changed, 372 insertions, 764 deletions
diff --git a/chapter06/bash.xml b/chapter06/bash.xml index af2acf4b5..8ce43a01e 100644 --- a/chapter06/bash.xml +++ b/chapter06/bash.xml @@ -18,7 +18,6 @@ Required disk space: 27 MB</screen> GCC, Glibc, Grep, Make, Ncurses, Sed.</para> - <sect2> <title>Installation of Bash</title> @@ -30,7 +29,8 @@ patch:</para> <para>Now prepare Bash for compilation:</para> -<screen><userinput>./configure --prefix=/usr --bindir=/bin</userinput></screen> +<screen><userinput>./configure --prefix=/usr --bindir=/bin \ + --without-bash-malloc</userinput></screen> <para>Compile the package:</para> diff --git a/chapter06/binutils.xml b/chapter06/binutils.xml index 589f61f29..9edbb24f2 100644 --- a/chapter06/binutils.xml +++ b/chapter06/binutils.xml @@ -34,9 +34,7 @@ everything is set up correctly by performing a simple test:</para> <para>Your chroot environment is not set up for proper PTY operation. In this case there is no point in running the test suites for Binutils and GCC until you -are able to resolve the issue. Please refer back to <xref linkend="ch-system-proc"/> -and the <xref linkend="ch-system-MAKEDEV"/> section and perform the recommended steps -to fix the problem.</para> +are able to resolve the issue.</para> <para>This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). @@ -72,7 +70,7 @@ circumstances.</para></important> <para>Test the results:</para> -<screen><userinput>make check</userinput></screen> +<screen><userinput>make -k check</userinput></screen> <para>The test suite notes from <xref linkend="ch-tools-binutils-pass2"/> are still very much appropriate here. Be sure to refer back there should you have any diff --git a/chapter06/bison.xml b/chapter06/bison.xml index 4202899d1..64ed98ec5 100644 --- a/chapter06/bison.xml +++ b/chapter06/bison.xml @@ -22,12 +22,7 @@ GCC, Gettext, Glibc, Grep, M4, Make, Sed.</para> <sect2> <title>Installation of Bison</title> -<para>First fix a minor compilation problem that Bison has with some packages, -the patch is back-ported from CVS:</para> - -<screen><userinput>patch -Np1 -i ../bison-&bison-version;-attribute.patch</userinput></screen> - -<para>Now prepare Bison for compilation:</para> +<para>Prepare Bison for compilation:</para> <screen><userinput>./configure --prefix=/usr</userinput></screen> diff --git a/chapter06/bzip2.xml b/chapter06/bzip2.xml index e6034e228..d52cde737 100644 --- a/chapter06/bzip2.xml +++ b/chapter06/bzip2.xml @@ -55,7 +55,6 @@ necessary symbolic links, and clean up:</para> cp -a libbz2.so* /lib ln -s ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so rm /usr/bin/{bunzip2,bzcat,bzip2} -mv /usr/bin/{bzip2recover,bzless,bzmore} /bin ln -s bzip2 /bin/bunzip2 ln -s bzip2 /bin/bzcat</userinput></screen> diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index 0de12cb7a..e6425e402 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -8,192 +8,65 @@ <title>Installing basic system software</title> <?dbhtml filename="chapter06.html"?> - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/> - - -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="proc.xml"/> - - +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kernfs.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chroot.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="changingowner.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingdirs.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="createfiles.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pwdgroup.xml"/> - - -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="makedev.xml"/> - - -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kernel-headers.xml"/> - - +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="devices.xml"/> +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/> - - - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/> - - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="zlib.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mktemp.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iana-etc.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="vim.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="m4.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bison.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="less.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sed.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="net-tools.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inetutils.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="perl.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="texinfo.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="autoconf.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="automake.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="file.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libtool.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/> - - -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ed.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kbd.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="e2fsprogs.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grep.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/> - - -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="modutils.xml"/> - - +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="module-init-tools.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patch.xml"/> - - -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="procinfo.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="procps.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="psmisc.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="shadow.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysvinit.xml"/> - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tar.xml"/> - - +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/> - - -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-2953.xml"/> - - - - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutdebug.xml"/> - <sect1 id="ch-system-strippingagain"> <title>Stripping again</title> <?dbhtml filename="strippingagain.html"?> @@ -239,7 +112,6 @@ destroyed.</para> </sect1> - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/> </chapter> diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index 8ac6c756e..7adb4ee60 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -57,11 +57,7 @@ so do it now:</para> <screen><userinput>make install-root</userinput></screen> -<para>Create a 'table of mounted filesystems' file with:</para> - -<screen><userinput>touch /etc/mtab</userinput></screen> - -<para>And create two dummy groups and a dummy user name:</para> +<para>Create two dummy groups and a dummy user name:</para> <screen><userinput>echo "dummy1:x:1000" >> /etc/group echo "dummy2:x:1001:dummy" >> /etc/group @@ -70,7 +66,7 @@ echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd</userinput></screen> <para>Now you're all set to run the test suite. First run the few tests that are meant to be run as <emphasis>root</emphasis>:</para> -<screen><userinput>export NON_ROOT_USERNAME=dummy; make check-root</userinput></screen> +<screen><userinput>make NON_ROOT_USERNAME=dummy make check-root</userinput></screen> <para>Then run the remainder of the tests as the <emphasis>dummy</emphasis> user:</para> @@ -79,7 +75,7 @@ user:</para> <para>When you're done testing, remove the dummy user and groups:</para> -<screen><userinput>sed -i.bak '/dummy/d' /etc/passwd /etc/group</userinput></screen> +<screen><userinput>sed -i '/dummy/d' /etc/passwd /etc/group</userinput></screen> <para>Install the package:</para> @@ -87,7 +83,7 @@ user:</para> <para>And move some programs to their proper locations:</para> -<screen><userinput>mv /usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} /bin +<screen><userinput>mv /usr/bin/{[,basename,cat,chgrp,chmod,chown,cp,dd,df} /bin mv /usr/bin/{date,echo,false,head,install,ln,ls} /bin mv /usr/bin/{mkdir,mknod,mv,pwd,rm,rmdir,sync} /bin mv /usr/bin/{sleep,stty,su,test,touch,true,uname} /bin @@ -99,10 +95,9 @@ Remove the one installed by Coreutils:</para> <screen><userinput>rm /usr/bin/kill</userinput></screen> -<para>Finally, create two symlinks to be FHS-compliant:</para> +<para>Finally, create a symlink to be FHS-compliant:</para> -<screen><userinput>ln -s test /bin/[ -ln -s ../../bin/install /usr/bin</userinput></screen> +<screen><userinput>ln -s ../../bin/install /usr/bin</userinput></screen> </sect2> diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml index 4faf42e66..b85264a47 100644 --- a/chapter06/creatingdirs.xml +++ b/chapter06/creatingdirs.xml @@ -11,7 +11,7 @@ a directory tree. Issuing the following commands will create a more or less standard tree:</para> -<screen><userinput>mkdir -p /{bin,boot,dev/{pts,shm},etc/opt,home,lib,mnt,proc} +<screen><userinput>mkdir -p /{bin,boot,dev,etc/opt,home,lib,mnt} mkdir -p /{root,sbin,srv,tmp,usr/local,var,opt} mkdir -p /media/{floppy,cdrom} mkdir /usr/{bin,include,lib,sbin,share,src} @@ -25,7 +25,7 @@ mkdir /usr/local/share/{doc,info,locale,man} mkdir /usr/local/share/{misc,terminfo,zoneinfo} mkdir /usr/local/share/man/man{1,2,3,4,5,6,7,8} mkdir /var/{lock,log,mail,run,spool} -mkdir -p /var/{tmp,opt,cache,lib/misc,local} +mkdir -p /var/{tmp,opt,cache,lib/{misc,locate},local} mkdir /opt/{bin,doc,include,info} mkdir -p /opt/{lib,man/man{1,2,3,4,5,6,7,8}}</userinput></screen> diff --git a/chapter06/devices.xml b/chapter06/devices.xml new file mode 100644 index 000000000..e6b1a8c57 --- /dev/null +++ b/chapter06/devices.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> +<sect1 id="ch-system-devices" xreflabel="devices"> +<title>Populating /dev with device nodes</title> +<?dbhtml filename="devices.html"?> + +<indexterm zone="ch-system-devices"><primary sortas="a-Devices">Devices</primary></indexterm> + +<sect2> +<title>Creating initial device nodes</title> + +<para>When the kernel boots the system, it requires the presence of a few device +nodes, in particular the console and null devices:</para> + +<screen><userinput>mknod -m 600 /dev/console c 5 1 +mknod -m 666 /dev/null c 1 3</userinput></screen> +</sect2> + +<sect2> +<title>Mounting ramfs and populating /dev</title> + +<para>The ideal way to populate /dev is to mount a ramfs onto /dev (like tmpfs, but it +cannot be swapped) and create the devices on there during each bootup. Since we haven't +booted the system, we have to do what the bootscripts would otherwise do for us, and +populate /dev ourselves. Begin by mounting /dev:</para> + +<screen><userinput>mount -n -t ramfs none /dev</userinput></screen> + +<para>Now use the provided udevstart utility to create the initial devices based on +all the information in /sys:</para> + +<screen><userinput>/tools/sbin/udevstart</userinput></screen> + +<para>There are some symlinks and directories required by LFS that are not created by +Udev, so we create those ourselves here:</para> + +<screen><userinput>ln -s /proc/self/fd /dev/fd +ln -s /proc/self/fd/0 /dev/stdin +ln -s /proc/self/fd/1 /dev/stdout +ln -s /proc/self/fd/2 /dev/stderr +ln -s /proc/kcore /dev/core +mkdir /dev/pts +mkdir /dev/shm</userinput></screen> + +<para>Finally, mount the proper virtual (kernel) file systems on the directories we just +created:</para> + +<screen><userinput>mount -t devpts -o gid=4,mode=620 none /dev/pts +mount -t tmpfs none /dev/shm</userinput></screen> +</sect2> + + +</sect1> diff --git a/chapter06/e2fsprogs.xml b/chapter06/e2fsprogs.xml index 4ca8f4b50..56828e140 100644 --- a/chapter06/e2fsprogs.xml +++ b/chapter06/e2fsprogs.xml @@ -23,16 +23,10 @@ Diffutils, Gawk, GCC, Gettext, Glibc, Grep, Make, Sed, Texinfo.</para> <sect2> <title>Installation of E2fsprogs</title> -<para>It is recommended to build E2fsprogs outside of the -source tree:</para> - -<screen><userinput>mkdir ../e2fsprogs-build -cd ../e2fsprogs-build</userinput></screen> - <para>Prepare E2fsprogs for compilation:</para> -<screen><userinput>../e2fsprogs-&e2fsprogs-version;/configure --prefix=/usr --with-root-prefix="" \ - --enable-elf-shlibs</userinput></screen> +<screen><userinput>./configure --prefix=/usr --with-root-prefix="" \ + --enable-elf-shlibs --disable-evms</userinput></screen> <para>The meaning of the configure options:</para> @@ -55,11 +49,8 @@ the shared libraries which some programs in this package use.</para></listitem> <screen><userinput>make</userinput></screen> -<para>If you to test the results, first make sure an mtab file -exists with <userinput>touch /etc/mtab</userinput> to prevent some sixty tests -from failing, and (if it doesn't already exist) fake the presence of an old -pager with <userinput>ln -s /tools/bin/cat /bin/more</userinput> to prevent one -test from failing, then issue: <userinput>make check</userinput>.</para> +<para>To test the results, issue: +<userinput>make check</userinput>.</para> <para>Install most of the package:</para> diff --git a/chapter06/ed.xml b/chapter06/ed.xml deleted file mode 100644 index 7858144c9..000000000 --- a/chapter06/ed.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> -<sect1 id="ch-system-ed" xreflabel="Ed"> -<title>Ed-&ed-version;</title> -<?dbhtml filename="ed.html"?> - -<indexterm zone="ch-system-ed"><primary sortas="a-Ed">Ed</primary></indexterm> - -<para>The Ed package contains a spartan line editor.</para> - -<screen>&buildtime; 0.1 SBU -&diskspace; 3.1 MB</screen> - -<para>Ed installation depends on: Bash, Binutils, Coreutils, Diffutils, GCC, -Glibc, Grep, Make, Sed.</para> - - - -<sect2> -<title>Installation of Ed</title> - -<note><para>Ed isn't something which many people use. It's installed here -because it can be used by the patch program if you encounter an ed-based patch -file. This happens rarely because diff-based patches are preferred these -days.</para></note> - -<para>Ed normally uses the <emphasis>mktemp</emphasis> function to create -temporary files in <filename class="directory">/tmp</filename>, but this -function contains a vulnerability (see the section on Temporary Files in <ulink -url="http://en.tldp.org/HOWTO/Secure-Programs-HOWTO/avoid-race.html"/>). Apply -the following patch to make Ed use <emphasis>mkstemp</emphasis> instead, a -secure way to create temporary files:</para> - -<screen><userinput>patch -Np1 -i ../ed-&ed-version;-mkstemp.patch</userinput></screen> - -<para>Now prepare Ed for compilation:</para> - -<screen><userinput>./configure --prefix=/usr --exec-prefix=""</userinput></screen> - -<para>The meaning of the configure option:</para> - -<itemizedlist> -<listitem><para><userinput>--exec-prefix=""</userinput>: This forces the -programs to be installed into the <filename>/bin</filename> directory. Having -the programs available there is useful in the event of the -<filename>/usr</filename> partition being unavailable.</para></listitem> -</itemizedlist> - -<para>Compile the package:</para> - -<screen><userinput>make</userinput></screen> - -<para>To test the results, issue: -<userinput>make check</userinput>.</para> - -<para>Install the package:</para> - -<screen><userinput>make install</userinput></screen> - -</sect2> - - -<sect2 id="contents-ed"><title>Contents of Ed</title> - -<para><emphasis>Installed programs</emphasis>: ed and red (link to ed)</para> - -</sect2> - - -<sect2><title>Short descriptions</title> - -<indexterm zone="ch-system-ed ed"><primary sortas="b-ed">ed</primary></indexterm> -<para id="ed"><command>ed</command> is a line-oriented text editor. It can be used -to create, display, modify and otherwise manipulate text files.</para> - -<indexterm zone="ch-system-ed red"><primary sortas="b-red">red</primary></indexterm> -<para id="red"><command>red</command> is a restricted ed -- it can only edit files -in the current directory and cannot execute shell commands.</para> - -</sect2> - - - -</sect1> diff --git a/chapter06/findutils.xml b/chapter06/findutils.xml index a6f2aa3d5..82000777c 100644 --- a/chapter06/findutils.xml +++ b/chapter06/findutils.xml @@ -28,10 +28,10 @@ Diffutils, GCC, Gettext, Glibc, Grep, Make, Sed.</para> <para>Prepare Findutils for compilation:</para> <screen><userinput>./configure --prefix=/usr --libexecdir=/usr/lib/locate \ - --localstatedir=/var/lib/misc</userinput></screen> + --localstatedir=/var/lib/locate</userinput></screen> <para>The localstatedir directive above changes the location of the locate -database to be in /var/lib/misc, which is FHS-compliant.</para> +database to be in /var/lib/locate, which is FHS-compliant.</para> <para>Compile the package:</para> diff --git a/chapter06/flex.xml b/chapter06/flex.xml index 4210a6fc8..34f0fbc1e 100644 --- a/chapter06/flex.xml +++ b/chapter06/flex.xml @@ -23,7 +23,17 @@ GCC, Gettext, Glibc, Grep, M4, Make, Sed.</para> <sect2> <title>Installation of Flex</title> -<para>Prepare Flex for compilation:</para> +<para>Flex contains several known bugs. Fix these with the following patch:</para> + +<screen><userinput>patch -Np1 -i ../flex-&flex-version;-debian-fixes-2.patch</userinput></screen> + +<para>The GNU autotools detects that the Flex source code has been modified by the patch, +and tries to update the man pages to include those changes, but this breaks on many +systems, and the default pages are fine, so make sure they don't get renegerated:</para> + +<screen><userinput>touch doc/*.1</userinput></screen> + +<para>Now prepare Flex for compilation:</para> <screen><userinput>./configure --prefix=/usr</userinput></screen> @@ -32,7 +42,7 @@ GCC, Gettext, Glibc, Grep, M4, Make, Sed.</para> <screen><userinput>make</userinput></screen> <para>To test the results, issue: -<userinput>make bigcheck</userinput>.</para> +<userinput>make check</userinput>.</para> <para>Now install the package:</para> diff --git a/chapter06/gcc-2953.xml b/chapter06/gcc-2953.xml deleted file mode 100644 index b337d127e..000000000 --- a/chapter06/gcc-2953.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> -<sect1 id="ch-system-gcc-2953"> -<title>GCC-&gcc-2953-version;</title> -<?dbhtml filename="gcc-2953.html"?> - -<indexterm zone="ch-system-gcc-2953"><primary sortas="a-GCC-2953">GCC-2953</primary></indexterm> - -<screen>&buildtime; 1.5 SBU -&buildtime; 130 MB</screen> - -<sect2> -<title>Installation of GCC</title> - -<para>This package is known to behave badly when you have changed its -default optimization flags (including the -march and -mcpu options). -Therefore, if you have defined any environment variables that override -default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting -or modifying them when building GCC.</para> - -<para>This is an older release of GCC which we are going to install for the -purpose of compiling the Linux kernel in <xref linkend="chapter-bootable"/>. -This version is recommended by the kernel developers when you need absolute -stability. Later versions of GCC have not received as much testing for Linux -kernel compilation. Using a later version is likely to work, however, we -recommend adhering to the kernel developer's advice and using the version here -to compile your kernel.</para> - -<note><para>We don't install the C++ compiler or libraries here. However, there -may be reasons why you would want to install them. More information can be found -at <ulink url="&blfs-root;view/stable/general/gcc2.html"/>.</para></note> - -<para>We'll install this older release of GCC into the non-standard prefix of -<filename class="directory">/opt</filename> so as to avoid interfering with -the system GCC already installed in <filename class="directory">/usr</filename> - .</para> - -<para>Apply the patches and make a small adjustment:</para> - -<screen><userinput>patch -Np1 -i ../gcc-&gcc-2953-version;-2.patch -patch -Np1 -i ../gcc-&gcc-2953-version;-no-fixinc.patch -patch -Np1 -i ../gcc-&gcc-2953-version;-returntype-fix.patch -echo timestamp > gcc/cstamp-h.in</userinput></screen> - -<para>The GCC documentation recommends building GCC outside of the source -directory in a dedicated build directory:</para> - -<screen><userinput>mkdir ../gcc-2-build -cd ../gcc-2-build</userinput></screen> - -<para>Compile and install the compiler:</para> - -<screen><userinput>../gcc-&gcc-2953-version;/configure --prefix=/opt/gcc-&gcc-2953-version; \ - --enable-shared --enable-languages=c \ - --enable-threads=posix -make bootstrap -make install</userinput></screen> - -</sect2> - -</sect1> diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml index cc6b5d79e..eb168cb61 100644 --- a/chapter06/gcc.xml +++ b/chapter06/gcc.xml @@ -55,9 +55,9 @@ cd ../gcc-build</userinput></screen> <para>Now prepare GCC for compilation:</para> <screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \ - --enable-shared --enable-threads=posix \ - --enable-__cxa_atexit --enable-clocale=gnu \ - --enable-languages=c,c++</userinput></screen> + --libexecdir=/usr/lib --enable-shared --enable-threads=posix \ + --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ +</userinput></screen> <para>Compile the package:</para> diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml index 59ecff6f9..9296458e5 100644 --- a/chapter06/glibc.xml +++ b/chapter06/glibc.xml @@ -42,28 +42,20 @@ cd ../glibc-build</userinput></screen> <para>Now prepare Glibc for compilation:</para> -<screen><userinput>../glibc-&glibc-version;-20031202/configure --prefix=/usr \ - --disable-profile --enable-add-ons=linuxthreads \ - --libexecdir=/usr/lib --with-headers=/usr/include \ - --without-cvs</userinput></screen> +<screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr \ + --disable-profile --enable-add-ons=nptl --with-tls \ + --libexecdir=/tmp/pt_chown --without-cvs \ + --with-headers=/tools/glibc-kernheaders</userinput></screen> <para>The meaning of the new configure options:</para> <itemizedlist> -<listitem><para><userinput>--libexecdir=/usr/lib</userinput>: This changes the -location of the <filename>pt_chown</filename> program from its default of +<listitem><para><userinput>--libexecdir=/tmp/pt_chown</userinput>: This changes +the location of the <filename>pt_chown</filename> program from its default of <filename class="directory">/usr/libexec</filename> to -<filename class="directory">/usr/lib</filename>. The use of -<emphasis>libexec</emphasis> is considered not to be FHS-compliant because the -FHS doesn't even mention it.</para></listitem> - -<listitem><para><userinput>--with-headers=/usr/include</userinput>: This -ensures that the kernel headers in <filename>/usr/include</filename> are used -for this build. If you don't pass this switch then the headers from -<filename>/tools/include</filename> are used which of course is not ideal -(although they should be identical). Using this switch has the advantage -that you will be informed immediately should you have forgotten to install the -kernel headers into <filename>/usr/include</filename>.</para></listitem> +<filename class="directory">/tmp/pt_chown</filename>. This program isn't required +on modern systems, so we install it in a place from which we will delete it +later.</para></listitem> </itemizedlist> <para>Compile the package:</para> @@ -119,13 +111,14 @@ localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro localedef -i it_IT -f ISO-8859-1 it_IT localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen> -<para>Finally, build the linuxthreads man pages:</para> +<para>Finally, build the linuxthreads man pages, which are a great reference +on the threading API (applicable to NPTL as well):</para> -<screen><userinput>make -C ../glibc-&glibc-version;-20031202/linuxthreads/man</userinput></screen> +<screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man</userinput></screen> <para>And install these pages:</para> -<screen><userinput>make -C ../glibc-&glibc-version;-20031202/linuxthreads/man install</userinput></screen> +<screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man install</userinput></screen> </sect2> diff --git a/chapter06/grub.xml b/chapter06/grub.xml index a7c7ff1bc..3abecc041 100644 --- a/chapter06/grub.xml +++ b/chapter06/grub.xml @@ -32,10 +32,19 @@ Grub.</para> <screen><userinput>./configure --prefix=/usr</userinput></screen> -<para>Compile the package:</para> +<para>A few of the files comprising Grub have issues with optimizations done +by GCC 3.4. Compile these few files with known-good optimizations:</para> + +<screen><userinput>make -C stage2 STAGE2_CFLAGS=-O2 \ + pre_stage2_exec-builtins.o pre_stage2_exec-serial.o</userinput></screen> + +<para>Now compile the rest of the package:</para> <screen><userinput>make</userinput></screen> +<para>To test the results, issue: +<userinput>make check</userinput>.</para> + <para>Now install it:</para> <screen><userinput>make install diff --git a/chapter06/inetutils.xml b/chapter06/inetutils.xml index 9d944d340..6ef16b16f 100644 --- a/chapter06/inetutils.xml +++ b/chapter06/inetutils.xml @@ -22,6 +22,11 @@ Diffutils, GCC, Glibc, Grep, Make, Ncurses, Sed.</para> <sect2> <title>Installation of Inetutils</title> +<para>Inetutils has issues with the Linux 2.6 kernel series - fix these isues +by applying the following patch:</para> + +<screen><userinput>patch -Np1 -i ../inetutils-&inetutils-version;-kernel-2.6-1.patch</userinput></screen> + <para>We are not going to install all the programs that come with Inetutils. However, the Inetutils build system will insist on installing all the man pages anyway. The following patch will correct this situation:</para> diff --git a/chapter06/kbd.xml b/chapter06/kbd.xml index 4c37aade6..0f644bfb5 100644 --- a/chapter06/kbd.xml +++ b/chapter06/kbd.xml @@ -22,13 +22,7 @@ Diffutils, Flex, GCC, Gettext, Glibc, Grep, Gzip, M4, Make, Sed.</para> <sect2> <title>Installation of Kbd</title> -<para>By default some of Kbd's utilities (<command>setlogcons</command>, -<command>setvesablank</command> and <command>getunimap</command>) are -not installed. First enable the compilation of these utilities:</para> - -<screen><userinput>patch -Np1 -i ../kbd-&kbd-version;-more-programs-1.patch</userinput></screen> - -<para>Now prepare Kbd for compilation:</para> +<para>Prepare Kbd for compilation:</para> <screen><userinput>./configure</userinput></screen> @@ -73,7 +67,7 @@ source (you will have to repeat this command whenever you unpack a new kernel):</para> <screen><userinput>loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz > \ - /usr/src/linux-2.4.25/drivers/char/defkeymap.c</userinput></screen> + /usr/src/linux-&linux-version;/drivers/char/defkeymap.c</userinput></screen> </sect2> diff --git a/chapter06/kernel-headers.xml b/chapter06/kernel-headers.xml deleted file mode 100644 index 1a51b1a31..000000000 --- a/chapter06/kernel-headers.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> -<sect1 id="ch-system-kernel-headers"> -<title>Linux-&linux-version; headers</title> -<?dbhtml filename="kernelheaders.html"?> - -<indexterm zone="ch-system-kernel-headers"> -<primary sortas="a-Linux">Linux</primary> -<secondary>system, headers</secondary></indexterm> - -<screen>&buildtime; 0.1 SBU -&diskspace; 186 MB</screen> - - -<sect2> -<title>Installation of the kernel headers</title> - -<para>We won't be compiling a new kernel yet -- we'll do that when we have -finished the installation of all the packages. But the libraries installed in -the next section need to refer to the kernel header files in order to know how -to interface with the kernel. Instead of unpacking the kernel sources again, -making the version file and the symlinks and so on, we will simply copy the -headers from the temporary tools directory in one swoop:</para> - -<screen><userinput>cp -a /tools/include/{asm,asm-generic,linux} /usr/include</userinput></screen> - -<para>A few kernel header files refer to the <filename>autoconf.h</filename> -header file. Since we have not yet configured the kernel, we need to create -this file ourselves in order to avoid a compilation failure of Sysklogd. -Create an empty <filename>autoconf.h</filename> file with:</para> - -<screen><userinput>touch /usr/include/linux/autoconf.h</userinput></screen> - -</sect2> - - -<sect2> -<title>Why we copy the kernel headers</title> - -<para>In the past it was common practice to symlink the -<filename class="directory">/usr/include/{linux,asm}</filename> directories -to <filename class="directory">/usr/src/linux/include/{linux,asm}</filename>. -This was a <emphasis>bad</emphasis> practice, as the following extract from a -post by Linus Torvalds to the Linux Kernel Mailing List points out:</para> - -<screen>I would suggest that people who compile new kernels should: - - - not have a single symbolic link in sight (except the one that the - kernel build itself sets up, namely the <quote>linux/include/asm</quote> - symlink that is only used for the internal kernel compile itself) - -And yes, this is what I do. My /usr/src/linux still has the old 2.2.13 -header files, even though I haven't run a 2.2.13 kernel in a _loong_ -time. But those headers were what Glibc was compiled against, so those -headers are what matches the library object files. - -And this is actually what has been the suggested environment for at -least the last five years. I don't know why the symlink business keeps -on living on, like a bad zombie. Pretty much every distribution still -has that broken symlink, and people still remember that the linux -sources should go into <quote>/usr/src/linux</quote> even though that hasn't -been true in a _loong_ time.</screen> - -<para>The essential part is where Linus states that the header files should be -<emphasis>the ones which Glibc was compiled against</emphasis>. These are -the headers that should be used when you later compile other packages, as they -are the ones that match the object-code library files. By copying the headers, -we ensure that they remain available if later you upgrade your kernel.</para> - -<para>Note, by the way, that it is perfectly all right to have the kernel sources -in <filename class="directory">/usr/src/linux</filename>, as long as you don't -have the <filename class="directory">/usr/include/{linux,asm}</filename> -symlinks.</para> - -</sect2> - -</sect1> diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml new file mode 100644 index 000000000..9b3473303 --- /dev/null +++ b/chapter06/kernfs.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> +<sect1 id="ch-system-kernfs"> +<title>Mounting virtual kernel file systems</title> +<?dbhtml filename="kernfs.html"?> + +<para>Various file systems exported by the kernel don't exist at all on your +hard drive, but are used to communicate things to and from the kernel itself.</para> + +<para>Begin by creating directories onto which the file systems will be mounted:</para> + +<screen><userinput>mkdir -p $LFS/{proc,sys}</userinput></screen> + +<para>Now mount the file systems:</para> + +<screen><userinput>mount -t proc proc $LFS/proc +mount -t sysfs sysfs $LFS/sys</userinput></screen> + +<para>Remember that if for any reason you stop working on your BE-LFS, and start +again later, it's important to check that these file systems are mounted again +before entering the chroot environment, otherwise problems could occur.</para> + +<para>Shortly, we'll be mounting a few more file systems from within the chroot +environment. To keep the host up-to-date, we'll do a <quote>fake mount</quote> +for each of these now:</para> + +<screen><userinput>mount -f -t ramfs ramfs $LFS/dev +mount -f -t tmpfs tmpfs $LFS/dev/shm +mount -f -t devpts -o gid=4,mode=620 devpts $LFS/dev/pts</userinput></screen> + +</sect1> diff --git a/chapter06/linux-libc-headers.xml b/chapter06/linux-libc-headers.xml new file mode 100644 index 000000000..03cf0ecaa --- /dev/null +++ b/chapter06/linux-libc-headers.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> +<sect1 id="ch-system-linux-libc-headers"> +<title>Linux-Libc-Headers-&linux-libc-headers-version;</title> +<?dbhtml filename="linux-libc-headers.html"?> + +<indexterm zone="ch-system-linux-libc-headers"> +<primary sortas="a-Linux-Libc-Headers">Linux-Libc-Headers</primary> +<secondary>system, headers</secondary></indexterm> + +<screen>&buildtime; 0.1 SBU +&diskspace; 22 MB</screen> + + +<sect2> +<title>Installation of Linux-Libc-Headers</title> + +<para>For years it has been common practice to use so-called <quote>raw</quote> +kernel headers (straight from a kernel tarball) in /usr/include, but over the +last few years, the kernel developers have taken a strong stance that such +things should not be done. Thus was born the linux-libc-headers project, +designed to maintain an API stable version of the Linux headers.</para> + +<para>Install the header files:</para> + +<screen><userinput>cp -R include/asm-i386 /usr/include/asm +cp -R include/linux /usr/include</userinput></screen> + +<para>Assure that all the headers are owned by root:</para> + +<screen><userinput>chown -R root:root /usr/include/{asm,linux}</userinput></screen> + +<para>And make sure all the users can read the headers:</para> + +<screen><userinput>find /usr/include/{asm,linux} -type d -exec chmod 755 {} \; +find /usr/include/{asm,linux} -type f -exec chmod 644 {} \;</userinput></screen> + +</sect2> + +</sect1> diff --git a/chapter06/makedev.xml b/chapter06/makedev.xml deleted file mode 100644 index 6d6e08edb..000000000 --- a/chapter06/makedev.xml +++ /dev/null @@ -1,105 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> -<sect1 id="ch-system-MAKEDEV" xreflabel="Make_devices"> -<title>Creating devices with Make_devices-&makedev-version;</title> -<?dbhtml filename="makedevices.html"?> - -<indexterm zone="ch-system-MAKEDEV"><primary sortas="a-Make_devices">Make_devices</primary></indexterm> - -<para>The Make_devices package contains a script for creating device -nodes.</para> - -<screen>&buildtime; 1 SBU -&diskspace; 160 KB</screen> - -<para>For its installation Make_devices depends on: Bash, Bzip2, -Coreutils.</para> - - - -<sect2> -<title>Making devices</title> - -<para>Note that unpacking the -<filename>make_devices-&makedev-version;.bz2</filename> file doesn't -create a directory for you to <command>cd</command> into, as the file -contains only a shell script.</para> - -<para>Install the <filename>make_devices</filename> script:</para> - -<screen><userinput>bzcat make_devices-&makedev-version;.bz2 > /dev/make_devices -chmod 754 /dev/make_devices</userinput></screen> - -<para>Device nodes are special files: things that can generate or receive data. -They usually correspond to physical pieces of hardware. Device nodes can be -created by issuing commands of the form: <command>mknod -m mode name type major -minor</command>. In such a command, <emphasis>mode</emphasis> is the usual -octal read/write/execute permissions triplet, and <emphasis>name</emphasis> is -the name of the device file to be created. It may seem surprising, but the -device name is actually arbitrary, except that most programs rely on devices -such as <filename>/dev/null</filename> having their usual names. The remaining -three parameters tell the kernel what device the node -actually refers to. The <emphasis>type</emphasis> is a letter, either b or c, -indicating whether the device is accessed in blocks (such as a hard disk) or -character by character (such as the console). And <emphasis>major</emphasis> -and <emphasis>minor</emphasis> are numbers, together forming a code that -identifies the device to the kernel. A list of the currently assigned device -numbers for Linux can be found in the file <filename>devices.txt</filename> in -the <filename class="directory">Documentation</filename> subdirectory of the -kernel sources.</para> - -<para>Note that the same major/minor combination is usually assigned to both a -block and a character device. These are, however, completely unrelated devices -that cannot be interchanged. A device is identified by the type/major/minor -triple, not just the major/minor pair, so when creating a device node it is -important to choose the correct <emphasis>type</emphasis> of device.</para> - -<para>Because looking up the type/major/minor triples and using -<command>mknod</command> manually is tedious and error-prone, the -<filename>make_devices</filename> script has been created. It contains a whole -series of <command>mknod</command> commands, one for each device, complete with -recommended name, permissions and group assignment. It has been set up so that -only a minimal set of commonly used devices is enabled and the other lines are -commented out. You should open <filename>make_devices</filename> in an editor -and customize it to your needs. This takes some time, but is very simple. When -you are satisfied, run the script to create the device files:</para> - -<screen><userinput>cd /dev -./make_devices</userinput></screen> - -<para>If you had success with mounting the devpts file system earlier in -<xref linkend="ch-system-proc"/>, you can continue with the next section. If you were -unable to mount devpts, you will have to create a few static ptyXX and ttyXX -device nodes instead. To do this, open <filename>make_devices</filename> in -your editor, go to the section <quote>Pseudo-TTY masters</quote> and enable a -few ptyXX devices -- a handful are enough to enable the test suites to run, but -if you plan to run a kernel without devpts support you will probably need many -more (every xterm, ssh connection, telnet connection, and the like, uses one of -these pseudo terminals). In the immediately following section <quote>Pseudo-TTY -slaves</quote>, enable the corresponding ttyXX devices. When you are done, rerun -<command>./make_devices</command> from inside <filename>/dev</filename> to -have it create the new devices.</para> - -</sect2> - - -<sect2 id="contents-makedev"><title>Contents of Make_devices</title> - -<para><emphasis>Installed script</emphasis>: make_devices</para> - -</sect2> - -<sect2><title>Short description</title> - -<indexterm zone="ch-system-MAKEDEV make_devices"><primary sortas="d-make_devices">make_devices</primary></indexterm> -<para id="make_devices"><command>make_devices</command> is a script for creating a basic set of -static device nodes, usually residing in the <filename class="directory">/dev</filename> directory.</para> - -</sect2> - - - -</sect1> diff --git a/chapter06/module-init-tools.xml b/chapter06/module-init-tools.xml new file mode 100644 index 000000000..a98fe2773 --- /dev/null +++ b/chapter06/module-init-tools.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> +<sect1 id="ch-system-module-init-tools" xreflabel="Module-Init-Tools"> +<title>Module-Init-Tools-&module-init-tools-version;</title> +<?dbhtml filename="module-init-tools.html"?> + +<indexterm zone="ch-system-module-init-tools"><primary sortas="a-Module-Init-Tools">Module-Init-Tools</primary></indexterm> + +<para>The Module-Init-Tools package contains programs for handling kernel +modules in Linux kernels greater than or equal to version 2.5.47.</para> + +<screen>&buildtime; 0.1 SBU +&buildtime; 650 KB</screen> + +<para>Module-Init-Tools installation depends on: Bash, Binutils, Bison, +Coreutils, Diffutils, Flex, GCC, Glibc, Grep, M4, Make, Sed.</para> + + +<sect2> +<title>Installation of Module-Init-Tools</title> + +<para>Prepare Module-Init-Tools for compilation:</para> + +<screen><userinput>./configure --prefix="" --enable-zlib</userinput></screen> + +<para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + +<para>To test the results, issue: +<userinput>make check</userinput>.</para> + +<para>Install it:</para> + +<screen><userinput>make install</userinput></screen> + +</sect2> + + +<sect2 id="contents-module-init-tools"><title>Contents of Module-Init-Tools</title> + +<para><emphasis>Installed programs</emphasis>: depmod, genksyms, insmod, +insmod_ksymoops_clean, kallsyms (link to insmod), kernelversion, ksyms +(link to insmod), lsmod (link to insmod), modinfo, modprobe (link to insmod) +and rmmod (link to insmod)</para> + +</sect2> + + +<sect2><title>Short descriptions</title> + +<indexterm zone="ch-system-module-init-tools depmod"><primary sortas="b-depmod">depmod</primary></indexterm> +<para id="depmod"><command>depmod</command> creates a dependency file, based on the +symbols it finds in the existing set of modules. This dependency file is used +by modprobe to automatically load the required modules.</para> + +<indexterm zone="ch-system-module-init-tools genksyms"><primary sortas="b-genksyms">genksyms</primary></indexterm> +<para id="genksyms"><command>genksyms</command> generates symbol version information.</para> + +<indexterm zone="ch-system-module-init-tools insmod"><primary sortas="b-insmod">insmod</primary></indexterm> +<para id="insmod"><command>insmod</command> installs a loadable module in the running kernel.</para> + +<indexterm zone="ch-system-module-init-tools insmod_ksymoops_clean"><primary sortas="b-insmod_ksymoops_clean">insmod_ksymoops_clean</primary></indexterm> +<para id="insmod_ksymoops_clean"><command>insmod_ksymoops_clean</command> deletes saved ksyms and +modules not accessed for two days.</para> + +<indexterm zone="ch-system-module-init-tools kallsyms"><primary sortas="b-kallsyms">kallsyms</primary></indexterm> +<para id="kallsyms"><command>kallsyms</command> extracts all kernel symbols for debugging.</para> + +<indexterm zone="ch-system-module-init-tools kernelversion"><primary sortas="b-kernelversion">kernelversion</primary></indexterm> +<para id="kernelversion"><command>kernelversion</command> reports the major version of the +running kernel.</para> + +<indexterm zone="ch-system-module-init-tools ksyms"><primary sortas="b-ksyms">ksyms</primary></indexterm> +<para id="ksyms"><command>ksyms</command> displays exported kernel symbols.</para> + +<indexterm zone="ch-system-module-init-tools lsmod"><primary sortas="b-lsmod">lsmod</primary></indexterm> +<para id="lsmod"><command>lsmod</command> shows which modules are loaded.</para> + +<indexterm zone="ch-system-module-init-tools modinfo"><primary sortas="b-modinfo">modinfo</primary></indexterm> +<para id="modinfo"><command>modinfo</command> examines an object file associated with +a kernel module and displays any information that it can glean.</para> + +<indexterm zone="ch-system-module-init-tools modprobe"><primary sortas="b-modprobe">modprobe</primary></indexterm> +<para id="modprobe"><command>modprobe</command> uses a dependency file, created by +depmod, to automatically load the relevant modules.</para> + +<indexterm zone="ch-system-module-init-tools rmmod"><primary sortas="b-rmmod">rmmod</primary></indexterm> +<para id="rmmod"><command>rmmod</command> unloads modules from the running kernel.</para> + +</sect2> + + + +</sect1> diff --git a/chapter06/modutils.xml b/chapter06/modutils.xml deleted file mode 100644 index 829dc4739..000000000 --- a/chapter06/modutils.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> -<sect1 id="ch-system-modutils" xreflabel="Modutils"> -<title>Modutils-&modutils-version;</title> -<?dbhtml filename="modutils.html"?> - -<indexterm zone="ch-system-modutils"><primary sortas="a-Modutils">Modutils</primary></indexterm> - -<para>The Modutils package contains programs for handling kernel modules.</para> - -<screen>&buildtime; 0.1 SBU -&buildtime; 2.9 MB</screen> - -<para>Modutils installation depends on: Bash, Binutils, Bison, Coreutils, -Diffutils, Flex, GCC, Glibc, Grep, M4, Make, Sed.</para> - - - -<sect2> -<title>Installation of Modutils</title> - -<para>Prepare Modutils for compilation:</para> - -<screen><userinput>./configure</userinput></screen> - -<para>Compile the package:</para> - -<screen><userinput>make</userinput></screen> - -<para>Install it:</para> - -<screen><userinput>make install</userinput></screen> - -</sect2> - - -<sect2 id="contents-modutils"><title>Contents of Modutils</title> - -<para><emphasis>Installed programs</emphasis>: depmod, genksyms, insmod, -insmod_ksymoops_clean, kallsyms (link to insmod), kernelversion, ksyms -(link to insmod), lsmod (link to insmod), modinfo, modprobe (link to insmod) -and rmmod (link to insmod)</para> - -</sect2> - - -<sect2><title>Short descriptions</title> - -<indexterm zone="ch-system-modutils depmod"><primary sortas="b-depmod">depmod</primary></indexterm> -<para id="depmod"><command>depmod</command> creates a dependency file, based on the -symbols it finds in the existing set of modules. This dependency file is used -by modprobe to automatically load the required modules.</para> - -<indexterm zone="ch-system-modutils genksyms"><primary sortas="b-genksyms">genksyms</primary></indexterm> -<para id="genksyms"><command>genksyms</command> generates symbol version information.</para> - -<indexterm zone="ch-system-modutils insmod"><primary sortas="b-insmod">insmod</primary></indexterm> -<para id="insmod"><command>insmod</command> installs a loadable module in the running kernel.</para> - -<indexterm zone="ch-system-modutils insmod_ksymoops_clean"><primary sortas="b-insmod_ksymoops_clean">insmod_ksymoops_clean</primary></indexterm> -<para id="insmod_ksymoops_clean"><command>insmod_ksymoops_clean</command> deletes saved ksyms and -modules not accessed for two days.</para> - -<indexterm zone="ch-system-modutils kallsyms"><primary sortas="b-kallsyms">kallsyms</primary></indexterm> -<para id="kallsyms"><command>kallsyms</command> extracts all kernel symbols for debugging.</para> - -<indexterm zone="ch-system-modutils kernelversion"><primary sortas="b-kernelversion">kernelversion</primary></indexterm> -<para id="kernelversion"><command>kernelversion</command> reports the major version of the -running kernel.</para> - -<indexterm zone="ch-system-modutils ksyms"><primary sortas="b-ksyms">ksyms</primary></indexterm> -<para id="ksyms"><command>ksyms</command> displays exported kernel symbols.</para> - -<indexterm zone="ch-system-modutils lsmod"><primary sortas="b-lsmod">lsmod</primary></indexterm> -<para id="lsmod"><command>lsmod</command> shows which modules are loaded.</para> - -<indexterm zone="ch-system-modutils modinfo"><primary sortas="b-modinfo">modinfo</primary></indexterm> -<para id="modinfo"><command>modinfo</command> examines an object file associated with -a kernel module and displays any information that it can glean.</para> - -<indexterm zone="ch-system-modutils modprobe"><primary sortas="b-modprobe">modprobe</primary></indexterm> -<para id="modprobe"><command>modprobe</command> uses a dependency file, created by -depmod, to automatically load the relevant modules.</para> - -<indexterm zone="ch-system-modutils rmmod"><primary sortas="b-rmmod">rmmod</primary></indexterm> -<para id="rmmod"><command>rmmod</command> unloads modules from the running kernel.</para> - -</sect2> - - - -</sect1> diff --git a/chapter06/net-tools.xml b/chapter06/net-tools.xml index 9eaa24b3c..d63b2f4b4 100644 --- a/chapter06/net-tools.xml +++ b/chapter06/net-tools.xml @@ -37,6 +37,11 @@ but it's up to the kernel to make the protocols available.</para> <screen><userinput>patch -Np1 -i ../net-tools-&net-tools-version;-miitool-gcc33-1.patch</userinput></screen> +<para>Net-tools has issues with the Linux 2.6 kernel series - fix these issues +by applying the following patch:</para> + +<screen><userinput>patch -Np1 -i ../net-tools-&net-tools-version;-kernel-2.6-1.patch</userinput></screen> + <para>Now prepare Net-tools for compilation (if you intend to accept the defaults, you can skip all the questions by running <userinput>yes "" | make config</userinput> instead):</para> diff --git a/chapter06/proc.xml b/chapter06/proc.xml deleted file mode 100644 index 919abf6a8..000000000 --- a/chapter06/proc.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> -<sect1 id="ch-system-proc"> -<title>Mounting the proc and devpts file systems</title> -<?dbhtml filename="proc.html"?> - -<para>In order for certain programs to function properly, the -<emphasis>proc</emphasis> and <emphasis>devpts</emphasis> file systems must be -available within the chroot environment. The proc file system is the process -information pseudo file system through which the kernel provides information -about the status of the system. And the devpts file system is nowadays the most -common way pseudo terminals (PTYs) are implemented. Since kernel version 2.4, a -file system can be mounted as many times and in as many places as you like, -thus it's not a problem that these file systems are already mounted on your -host system, especially so because they are virtual file systems.</para> - -<para>First become <emphasis>root</emphasis>, as only <emphasis>root</emphasis> -can mount file systems in unusual places. Then check again that the LFS -environment variable is set correctly by running <userinput>echo -$LFS</userinput> and making sure it shows the path to your LFS partition's -mount point, which is <filename class="directory">/mnt/lfs</filename> if you -followed our example.</para> - -<para>Now make the mount points for these filesystems:</para> - -<screen><userinput>mkdir -p $LFS/{proc,dev/pts}</userinput></screen> - -<para>Mount the <emphasis>proc</emphasis> file system with:</para> - -<screen><userinput>mount proc $LFS/proc -t proc</userinput></screen> - -<para>And mount the <emphasis>devpts</emphasis> file system with:</para> - -<screen><userinput>mount devpts $LFS/dev/pts -t devpts</userinput></screen> - -<para>This last command might fail with an error like:</para> - -<blockquote><screen>filesystem devpts not supported by kernel</screen></blockquote> - -<para>The most likely cause for this is that your host system's kernel was -compiled without support for the devpts file system (you can check which file -systems your kernel supports with <command>cat /proc/filesystems</command>, -for example). A few PTYs are needed to be able to run the suites for Binutils -and GCC later on. If your kernel does not support devpts, do not worry, there -is another way to get them working inside the chroot environment. We'll cover -this shortly in the <xref linkend="ch-system-MAKEDEV"/> section.</para> - -<para>Remember that if for any reason you stop working on your LFS, and start -again later, it's important to check that these file systems are mounted again -before entering the chroot environment, otherwise problems could occur.</para> - -</sect1> diff --git a/chapter06/procinfo.xml b/chapter06/procinfo.xml deleted file mode 100644 index 41249115b..000000000 --- a/chapter06/procinfo.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> -<sect1 id="ch-system-procinfo" xreflabel="Procinfo"> -<title>Procinfo-&procinfo-version;</title> -<?dbhtml filename="procinfo.html"?> - -<indexterm zone="ch-system-procinfo"><primary sortas="a-Procinfo">Procinfo</primary></indexterm> - -<para>The Procinfo package contains programs for displaying system information.</para> - -<screen>&buildtime; 0.1 SBU -&diskspace; 0.2 MB</screen> - -<para>Procinfo installation depends on: Binutils, GCC, Glibc, Make, Ncurses.</para> - - - -<sect2> -<title>Installation of Procinfo</title> - -<para>Compile Procinfo:</para> - -<screen><userinput>make LDLIBS=-lncurses</userinput></screen> - -<para>The meaning of the make parameter:</para> -<itemizedlist> -<listitem><para><userinput>LDLIBS=-lncurses</userinput>: This tells Procinfo -to use the <filename>libncurses</filename> library instead of the -long-obsolete <filename>libtermcap</filename>.</para></listitem> -</itemizedlist> - -<para>Install the package:</para> - -<screen><userinput>make install</userinput></screen> - -</sect2> - - -<sect2 id="contents-procinfo"><title>Contents of Procinfo</title> - -<para><emphasis>Installed programs</emphasis>: lsdev, procinfo and -socklist</para> - -</sect2> - - -<sect2><title>Short descriptions</title> - -<indexterm zone="ch-system-procinfo lsdev"><primary sortas="b-lsdev">lsdev</primary></indexterm> -<para id="lsdev"><command>lsdev</command> lists the devices present in your system, -and which IRQs (Interrupt ReQuest) and IO ports they use.</para> - -<indexterm zone="ch-system-procinfo procinfo"><primary sortas="b-procinfo">procinfo</primary></indexterm> -<para id="procinfo"><command>procinfo</command> displays an overview of some of the information -present in the virtual proc file system.</para> - -<indexterm zone="ch-system-procinfo socklist"><primary sortas="b-socklist">socklist</primary></indexterm> -<para id="socklist"><command>socklist</command> lists the open sockets, reporting their -type, port number, and other specifics.</para> - -</sect2> - - - -</sect1> diff --git a/chapter06/psmisc.xml b/chapter06/psmisc.xml index 2378d60ff..b69f91ea1 100644 --- a/chapter06/psmisc.xml +++ b/chapter06/psmisc.xml @@ -25,12 +25,12 @@ GCC, Gettext, Glibc, Grep, Make, Ncurses, Sed.</para> <para>Prepare Psmisc for compilation:</para> -<screen><userinput>./configure --prefix=/usr --exec-prefix=/</userinput></screen> +<screen><userinput>./configure --prefix=/usr --exec-prefix=""</userinput></screen> <para>The meaning of the configure option:</para> <itemizedlist> -<listitem><para><userinput>--exec-prefix=/</userinput>: This causes the +<listitem><para><userinput>--exec-prefix=""</userinput>: This causes the binaries to be installed in <filename>/bin</filename> instead of <filename>/usr/bin</filename>. As the Psmisc programs are often used in bootscripts, they should be available also when the <filename>/usr</filename> diff --git a/chapter06/pwdgroup.xml b/chapter06/pwdgroup.xml index a515de425..83c3bd283 100644 --- a/chapter06/pwdgroup.xml +++ b/chapter06/pwdgroup.xml @@ -45,10 +45,11 @@ disk:x:8: lp:x:9: dialout:x:10: audio:x:11: +video:x:12: <userinput>EOF</userinput></screen> <para>The created groups aren't part of any standard -- they are some of the -groups that the <command>make_devices</command> script in the next section +groups that the Udev configuration we will be using in the next section uses. The LSB (<ulink url="http://www.linuxbase.org/">Linux Standard Base</ulink>) recommends only that, beside the group <quote>root</quote> with a GID of 0, a group <quote>bin</quote> with a GID of 1 be present. All other group diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml index 76ea1f075..cba368d08 100644 --- a/chapter06/shadow.xml +++ b/chapter06/shadow.xml @@ -43,6 +43,11 @@ working:</para> <screen><userinput>echo '#define HAVE_SETLOCALE 1' >> config.h</userinput></screen> +<para>Shadow incorrectly declares the malloc() function, causing compilation +failure. Fix this:</para> + +<screen><userinput>sed -i '/extern char/d' libmisc/xmalloc.c</userinput></screen> + <para>Compile the package:</para> <screen><userinput>make</userinput></screen> diff --git a/chapter06/sysklogd.xml b/chapter06/sysklogd.xml index 1d85acec1..c9eac3bdf 100644 --- a/chapter06/sysklogd.xml +++ b/chapter06/sysklogd.xml @@ -18,10 +18,14 @@ as those given by the kernel when unusual things happen.</para> <para>Sysklogd installation depends on: Binutils, Coreutils, GCC, Glibc, Make.</para> - <sect2> <title>Installation of Sysklogd</title> +<para>Sysklogd has issues with the Linux 2.6 kernel series - fix these isues +by applying the following patch:</para> + +<screen><userinput>patch -Np1 -i ../sysklogd-&sysklogd-version;-kernel_header.patch</userinput></screen> + <para>Compile Sysklogd:</para> <screen><userinput>make</userinput></screen> diff --git a/chapter06/udev.xml b/chapter06/udev.xml new file mode 100644 index 000000000..aba37b85f --- /dev/null +++ b/chapter06/udev.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> +<sect1 id="ch-system-udev"> +<title>Udev-&udev-version;</title> +<?dbhtml filename="udev.html"?> + +<indexterm zone="ch-system-udev"> +<primary sortas="a-Udev">Udev</primary> +<secondary>system</secondary></indexterm> + +<screen>&buildtime; 0.2 SBU +&diskspace; 5.2 MB</screen> + + +<sect2> +<title>Installation of Udev</title> + +<para>By default, the permissions udev assigns to nodes are all uniform, +being owned by user root, group root, and only accessible to root. As you +can easily imagine, this isn't ideal. Give it a much better configuration +by applying the following patch:</para> + +<screen><userinput>patch -Np1 -i ../udev-&udev-version;-config-1.patch +</userinput></screen> + +<para>Now compile Udev:</para> + +<screen><userinput>make udevdir=/dev</userinput></screen> + +<para>And install finally install it:</para> + +<screen><userinput>make udevdir=/dev install</userinput></screen> + +<para>And since we aren't going to be using the udev daemon, but instead the +udev binary itself, we correct it's hotplug configuration:</para> + +<screen><userinput>ln -sf /sbin/udev /etc/hotplug.d/default/udev.hotplug</userinput></screen> + +</sect2> + + +<sect2 id="contents-udev"><title>Contents of Udev</title> +<para>Who knows?</para> +</sect2> + + +</sect1> diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml index 38aa75a84..b0d5ca805 100644 --- a/chapter06/util-linux.xml +++ b/chapter06/util-linux.xml @@ -39,6 +39,11 @@ mkdir -p /var/lib/hwclock</userinput></screen> <sect2> <title>Installation of Util-linux</title> +<para>Util-linux has issues with the Linux 2.6 kernel series - fix these isues +by applying the following patch:</para> + +<screen><userinput>patch -Np1 -i ../util-linux-&util-linux-version;-kernel-dj-2.6-1.patch</userinput></screen> + <para>Prepare Util-linux for compilation:</para> <screen><userinput>./configure</userinput></screen> diff --git a/chapter06/vim.xml b/chapter06/vim.xml index a11a4dca9..366716f0d 100644 --- a/chapter06/vim.xml +++ b/chapter06/vim.xml @@ -45,7 +45,7 @@ echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h</userinput>< <screen><userinput>make</userinput></screen> <para>To test the results, you can issue: -<userinput>make check</userinput>. However, this test suite outputs a lot of +<userinput>make test</userinput>. However, this test suite outputs a lot of seemingly garbage characters to the screen, and this can wreak havoc with the settings of the current terminal. Therefore the running of the test suite here is strictly optional.</para> |