From 3f3931b0a87f6b5e217b5ffd8bbfcd758045f8c0 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Tue, 7 Feb 2006 19:39:29 +0000 Subject: Indenting chapter 6, part 9 git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7362 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/perl.xml | 686 +++++++++++++++++++++++++------------------- chapter06/pkgmgt.xml | 60 ++-- chapter06/procps.xml | 405 +++++++++++++++----------- chapter06/psmisc.xml | 241 +++++++++------- chapter06/pwdgroup.xml | 128 +++++---- chapter06/readjusting.xml | 135 ++++----- chapter06/readline.xml | 174 ++++++----- chapter06/revisedchroot.xml | 34 ++- chapter06/sed.xml | 115 +++++--- 9 files changed, 1114 insertions(+), 864 deletions(-) (limited to 'chapter06') diff --git a/chapter06/perl.xml b/chapter06/perl.xml index cc2140669..277d831a2 100644 --- a/chapter06/perl.xml +++ b/chapter06/perl.xml @@ -1,338 +1,420 @@ - %general-entities; ]> + -Perl-&perl-version; - + + + Perl-&perl-version; + + + Perl + + + + -<indexterm zone="ch-system-perl"><primary sortas="a-Perl">Perl</primary></indexterm> + <para>The Perl package contains the Practical Extraction and Report + Language.</para> -<sect2 role="package"><title/> -<para>The Perl package contains the Practical Extraction and Report Language.</para> + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> -<segmentedlist> -<segtitle>&buildtime;</segtitle> -<segtitle>&diskspace;</segtitle> -<seglistitem><seg>2.9 SBU</seg><seg>137 MB</seg></seglistitem> -</segmentedlist> + <seglistitem> + <seg>2.9 SBU</seg> + <seg>137 MB</seg> + </seglistitem> + </segmentedlist> -<segmentedlist> -<segtitle>&dependencies;</segtitle> -<seglistitem><seg>Bash, Berkeley DB, Binutils, Coreutils, Diffutils, -Gawk, GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> -</segmentedlist> -</sect2> + <segmentedlist> + <segtitle>&dependencies;</segtitle> -<sect2 role="installation"> -<title>Installation of Perl + + Bash, Berkeley DB, Binutils, Coreutils, Diffutils, Gawk, GCC, + Glibc, Grep, Make, and Sed + + -A security vulnerability exists in Perl's sprintf function. Apply the -following patch to fix it. + + + + Installation of Perl + + A security vulnerability exists in Perl's sprintf function. Apply the + following patch to fix it. patch -Np1 -i ../&perl-sprintf-patch; -The DB_File module that comes with Perl-&perl-version; is incompatible -with Berkeley DB-&db-version; (the testsuite fails if this module gets built). -Apply the following patch in order to update the DB_File module: + The DB_File module that comes with Perl-&perl-version; is incompatible + with Berkeley DB-&db-version; (the testsuite fails if this module gets built). + Apply the following patch in order to update the DB_File module: patch -Np1 -i ../&perl-db_file-patch; -First create a basic /etc/hosts file which will be -referenced in one of Perl's configuration files as well as being used used by -the testsuite if you run that. + First create a basic /etc/hosts file which will be + referenced in one of Perl's configuration files as well as being used used by + the testsuite if you run that. echo "127.0.0.1 localhost $(hostname)" > /etc/hosts -To have full control over the way Perl is set up, run the -interactive Configure script and hand-pick the way -this package is built. If the defaults it auto-detects are suitable, -prepare Perl for compilation with: + To have full control over the way Perl is set up, run the + interactive Configure script and hand-pick the way + this package is built. If the defaults it auto-detects are suitable, + prepare Perl for compilation with: ./configure.gnu --prefix=/usr -Dpager="/usr/bin/less -isR" -The meaning of the configure options: + + The meaning of the configure options: - - --Dpager="/usr/bin/less -isR" -This corrects an error in the way that -perldoc invokes the less program. - - - + + -Dpager="/usr/bin/less -isR" + + This corrects an error in the way that perldoc + invokes the less program. + + -Compile the package: + + + Compile the package: make -Now run the tests, if desired: + Now run the tests, if desired: make test -Install the package: + Install the package: make install - - - -Contents of Perl - - -Installed programs -Installed libraries -a2p, c2ph, dprofpp, enc2xs, -find2perl, h2ph, h2xs, libnetcfg, perl, perl&perl-version; (link to perl), -perlbug, perlcc, perldoc, perlivp, piconv, pl2pm, pod2html, pod2latex, pod2man, -pod2text, pod2usage, podchecker, podselect, psed (link to s2p), pstruct (link -to c2ph), s2p, splain, and xsubpp -Several hundred which cannot all be listed here - - -Short Descriptions - - - - -a2p - -Translates awk to Perl -a2p - - - - -c2ph - -Dumps C structures as generated from cc -g -S -c2ph - - - - -dprofpp - -Displays Perl profile data -dprofpp - - - - -en2cxs - -Builds a Perl extension for the Encode module from either -Unicode Character Mappings or Tcl Encoding Files -en2cxs - - - - -find2perl - -Translates find commands to Perl -find2perl - - - - -h2ph - -Converts .h C header files to -.ph Perl header files -h2ph - - - - -h2xs - -Converts .h C header files to Perl extensions -h2xs - - - - -libnetcfg - -Can be used to configure the libnet -libnetcfg - - - - -perl - -Combines some of the best features of C, sed, -awk and sh into a single swiss-army -language -perl - - - - -perl&perl-version; - -A hard link to perl -perl&perl-version; - - - - - -perlbug - -Used to generate bug reports about Perl, or the modules that come -with it, and mail them -perlbug - - - - -perlcc - -Generates executables from Perl programs -perlcc - - - - -perldoc - -Displays a piece of documentation in pod format that is embedded -in the Perl installation tree or in a Perl script -perldoc - - - - -perlivp - -The Perl Installation Verification Procedure; it can be used to -verify that Perl and its libraries have been installed -correctly -perlivp - - - - -piconv - -A Perl version of the character encoding converter -iconv -piconv - - - - -pl2pm - -A rough tool for converting Perl4 .pl -files to Perl5 .pm modules -pl2pm - - - - -pod2html - -Converts files from pod format to HTML format -pod2html - - - - -pod2latex - -Converts files from pod format to LaTeX format -pod2latex - - - - -pod2man - -Converts pod data to formatted *roff input -pod2man - - - - -pod2text - -Converts pod data to formatted ASCII text -pod2text - - - - -pod2usage - -Prints usage messages from embedded pod docs in files -pod2usage - - - - -podchecker - -Checks the syntax of pod format documentation files -podchecker - - - - -podselect - -Displays selected sections of pod documentation -podselect - - - - -psed - -A Perl version of the stream editor sed -psed - - - - -pstruct - -Dumps C structures as generated from cc -g -S stabs -pstruct - - - - -s2p - -Translates sed scripts to Perl -s2p - - - - -splain - -Is used to force verbose warning diagnostics in Perl -splain - - - - -xsubpp - -Converts Perl XS code into C code -xsubpp - - - - - + + + + Contents of Perl + + + Installed programs + Installed libraries + + + a2p, c2ph, dprofpp, enc2xs, find2perl, h2ph, h2xs, libnetcfg, perl, + perl&perl-version; (link to perl), perlbug, perlcc, perldoc, perlivp, + piconv, pl2pm, pod2html, pod2latex, pod2man, pod2text, pod2usage, + podchecker, podselect, psed (link to s2p), pstruct (link to c2ph), s2p, + splain, and xsubpp + Several hundred which cannot all be listed here + + + + + Short Descriptions + + + + + a2p + + Translates awk to Perl + + a2p + + + + + + c2ph + + Dumps C structures as generated from + cc -g -S + + c2ph + + + + + + dprofpp + + Displays Perl profile data + + dprofpp + + + + + + en2cxs + + Builds a Perl extension for the Encode module from either + Unicode Character Mappings or Tcl Encoding Files + + en2cxs + + + + + + find2perl + + Translates find commands to Perl + + find2perl + + + + + + h2ph + + Converts .h C header + files to .ph Perl header + files + + h2ph + + + + + + h2xs + + Converts .h C header + files to Perl extensions + + h2xs + + + + + + libnetcfg + + Can be used to configure the + libnet + + libnetcfg + + + + + + perl + + Combines some of the best features of C, sed, + awk and sh into a single + swiss-army language + + perl + + + + + + perl&perl-version; + + A hard link to perl + + perl&perl-version; + + + + + + perlbug + + Used to generate bug reports about Perl, or the modules that come + with it, and mail them + + perlbug + + + + + + perlcc + + Generates executables from Perl programs + + perlcc + + + + + + perldoc + + Displays a piece of documentation in pod format that is embedded + in the Perl installation tree or in a Perl script + + perldoc + + + + + + perlivp + + The Perl Installation Verification Procedure; it can be used to + verify that Perl and its libraries have been installed + correctly + + perlivp + + + + + + piconv + + A Perl version of the character encoding converter + iconv + + piconv + + + + + + pl2pm + + A rough tool for converting Perl4 + .pl files to Perl5 + .pm modules + + pl2pm + + + + + + pod2html + + Converts files from pod format to HTML format + + pod2html + + + + + + pod2latex + + Converts files from pod format to LaTeX format + + pod2latex + + + + + + pod2man + + Converts pod data to formatted *roff input + + pod2man + + + + + + pod2text + + Converts pod data to formatted ASCII text + + pod2text + + + + + + pod2usage + + Prints usage messages from embedded pod docs in files + + pod2usage + + + + + + podchecker + + Checks the syntax of pod format documentation files + + podchecker + + + + + + podselect + + Displays selected sections of pod documentation + + podselect + + + + + + psed + + A Perl version of the stream editor sed + + psed + + + + + + pstruct + + Dumps C structures as generated from cc -g -S + stabs + + pstruct + + + + + + s2p + + Translates sed scripts to Perl + + s2p + + + + + + splain + + Is used to force verbose warning diagnostics in Perl + + splain + + + + + + xsubpp + + Converts Perl XS code into C code + + xsubpp + + + + + + + - diff --git a/chapter06/pkgmgt.xml b/chapter06/pkgmgt.xml index e6d9bae3f..76ea123e2 100644 --- a/chapter06/pkgmgt.xml +++ b/chapter06/pkgmgt.xml @@ -1,14 +1,15 @@ %general-entities; ]> - Package Management + Package Management + Package Management is an often requested addition to the LFS Book. A Package Manager allows tracking the installation of files making it easy to remove and upgrade packages. Before you begin to wonder, NO—this section @@ -18,7 +19,8 @@ combination of two or more of these techniques. This section briefly mentions issues that may arise when upgrading packages. - Some reasons why no package manager is mentioned in LFS or BLFS include: + Some reasons why no package manager is mentioned in LFS or BLFS + include: @@ -37,11 +39,13 @@ the Hints subproject and see if one of them fits your need. - As no particular package management technique is mentioned in LFS, - the commands in the remainder of this book must be performed while logged in - as user root and no longer as user - lfs. Also, double check that $LFS is set. - + + As no particular package management technique is mentioned in LFS, + the commands in the remainder of this book must be performed while logged in + as user root and no longer as user + lfs. Also, double check that + $LFS is set. + Upgrade Issues @@ -53,16 +57,14 @@ - If one of the toolchain packages - (Glibc, GCC or - Binutils) needs to be upgraded to a newer - minor version, it is safer to rebuild LFS. Though you - may be able to get by rebuilding all the packages - in their dependency order, we do not recommend it. For example, if - glibc-2.2.x needs to be updated to glibc-2.3.x, it is safer to rebuild. - For micro version updates, a simple reinstallation usually works, but - is not guaranteed. For example, upgrading from glibc-2.3.4 to - glibc-2.3.5 will not usually cause any problems. + If one of the toolchain packages (Glibc, GCC or Binutils) needs + to be upgraded to a newer minor version, it is safer to rebuild LFS. + Though you may be able to get by rebuilding all + the packages in their dependency order, we do not recommend it. For + example, if glibc-2.2.x needs to be updated to glibc-2.3.x, it is safer + to rebuild. For micro version updates, a simple reinstallation usually + works, but is not guaranteed. For example, upgrading from glibc-2.3.4 + to glibc-2.3.5 will not usually cause any problems. @@ -109,6 +111,7 @@ and know what files are installed by each package. Some users also do not need any package management because they plan on rebuilding the entire system when a package is changed. + @@ -129,6 +132,7 @@ INFOPATH and CPPFLAGS need to be expanded to include /usr/pkg/foo. For more than a few packages, this scheme becomes unmanageable. + @@ -168,11 +172,11 @@ make install make make DESTDIR=/usr/pkg/libfoo/1.1 install - Most packages support this approach, but there are some which do - not. For the non-compliant packages, you may either need to manually - install the package, or you may find that it is easier to install some - problematic packages into /opt. - + Most packages support this approach, but there are some which do not. + For the non-compliant packages, you may either need to manually install the + package, or you may find that it is easier to install some problematic + packages into /opt. + @@ -190,6 +194,7 @@ make DESTDIR=/usr/pkg/libfoo/1.1 install the package manager. Also, this scheme can only be used when one package is installed at a time. The logs are not reliable if two packages are being installed on two different consoles. + @@ -205,6 +210,7 @@ make DESTDIR=/usr/pkg/libfoo/1.1 install installation. Therefore, it is advised that one performs some tests to ensure that the package manager does not break anything and logs all the appropriate files. + @@ -214,8 +220,7 @@ make DESTDIR=/usr/pkg/libfoo/1.1 install tree as described in the Symlink style package management. After the installation, a package archive is created using the installed files. This archive is then used to install the package either on the local - machine or can even be used to install the package on other machines. - + machine or can even be used to install the package on other machines. This approach is used by most of the package managers found in the commercial distributions. Examples of package managers that follow this @@ -225,6 +230,7 @@ make DESTDIR=/usr/pkg/libfoo/1.1 install Gentoo's Portage system. A hint describing how to adopt this style of package management for LFS systems is located at . + @@ -236,8 +242,8 @@ make DESTDIR=/usr/pkg/libfoo/1.1 install standard locations. Files belonging to a package are easily identified by checking the user ID. The features and shortcomings of this approach are too complex to describe in this section. For the details please see the - hint at . + hint at . + diff --git a/chapter06/procps.xml b/chapter06/procps.xml index 4973a7955..48a599ad6 100644 --- a/chapter06/procps.xml +++ b/chapter06/procps.xml @@ -1,195 +1,250 @@ - %general-entities; ]> + -Procps-&procps-version; - + + + Procps-&procps-version; + + + Procps + + + + -<indexterm zone="ch-system-procps"><primary sortas="a-Procps">Procps</primary></indexterm> + <para>The Procps package contains programs for monitoring processes.</para> -<sect2 role="package"><title/> -<para>The Procps package contains programs for monitoring processes.</para> + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> -<segmentedlist> -<segtitle>&buildtime;</segtitle> -<segtitle>&diskspace;</segtitle> -<seglistitem><seg>0.1 SBU</seg><seg>2.3 MB</seg></seglistitem> -</segmentedlist> + <seglistitem> + <seg>0.1 SBU</seg> + <seg>2.3 MB</seg> + </seglistitem> + </segmentedlist> -<segmentedlist> -<segtitle>&dependencies;</segtitle> -<seglistitem><seg>Bash, Binutils, Coreutils, GCC, Glibc, -Make, and Ncurses</seg></seglistitem> -</segmentedlist> -</sect2> + <segmentedlist> + <segtitle>&dependencies;</segtitle> -<sect2 role="installation"> -<title>Installation of Procps + + Bash, Binutils, Coreutils, GCC, Glibc, Make, and Ncurses + + -Compile the package: + + + + Installation of Procps + + Compile the package: make -This package does not come with a test suite. + This package does not come with a test suite. -Install the package: + Install the package: make install - - - -Contents of Procps - - -Installed programs -Installed library -free, kill, pgrep, pkill, -pmap, ps, skill, snice, sysctl, tload, top, uptime, vmstat, w, and watch -libproc.so - - -Short Descriptions - - - - -free - -Reports the amount of free and used memory (both physical and -swap memory) in the system -free - - - - -kill - -Sends signals to processes -kill - - - - -pgrep - -Looks up processes based on their name and other attributes -pgrep - - - - -pkill - -Signals processes based on their name and other attributes -pkill - - - - -pmap - -Reports the memory map of the given process -pmap - - - - -ps - -Lists the current running processes -ps - - - - -skill - -Sends signals to processes matching the given criteria -skill - - - - -snice - -Changes the scheduling priority of processes matching the given criteria -snice - - - - -sysctl - -Modifies kernel parameters at run time -sysctl - - - - -tload - -Prints a graph of the current system load average -tload - - - - -top - -Displays a list of the most CPU intensive processes; it provides an -ongoing look at processor activity in real time -top - - - - -uptime - -Reports how long the system has been running, how many users are -logged on, and the system load averages -uptime - - - - -vmstat - -Reports virtual memory statistics, giving information about -processes, memory, paging, block Input/Output (IO), traps, and CPU activity -vmstat - - - - -w - -Shows which users are currently logged on, where, and since when -w - - - - -watch - -Runs a given command repeatedly, displaying the first screen-full of its -output; this allows a user to watch the output change over time -watch - - - - -libproc - -Contains the functions used by most programs in this package -libproc - - - - - + + + + Contents of Procps + + + Installed programs + Installed library + + + free, kill, pgrep, pkill, pmap, ps, skill, snice, sysctl, tload, + top, uptime, vmstat, w, and watch + libproc.so + + + + + Short Descriptions + + + + + free + + Reports the amount of free and used memory (both physical and + swap memory) in the system + + free + + + + + + kill + + Sends signals to processes + + kill + + + + + + pgrep + + Looks up processes based on their name and other attributes + + pgrep + + + + + + pkill + + Signals processes based on their name and other attributes + + pkill + + + + + + pmap + + Reports the memory map of the given process + + pmap + + + + + + ps + + Lists the current running processes + + ps + + + + + + skill + + Sends signals to processes matching the given criteria + + skill + + + + + + snice + + Changes the scheduling priority of processes matching the given + criteria + + snice + + + + + + sysctl + + Modifies kernel parameters at run time + + sysctl + + + + + + tload + + Prints a graph of the current system load average + + tload + + + + + + top + + Displays a list of the most CPU intensive processes; it + provides an ongoing look at processor activity in real time + + top + + + + + + uptime + + Reports how long the system has been running, how many users are + logged on, and the system load averages + + uptime + + + + + + vmstat + + Reports virtual memory statistics, giving information about + processes, memory, paging, block Input/Output (IO), traps, and CPU + activity + + vmstat + + + + + + w + + Shows which users are currently logged on, where, and since + when + + w + + + + + + watch + + Runs a given command repeatedly, displaying the first + screen-full of its output; this allows a user to watch the output + change over time + + watch + + + + + + libproc + + Contains the functions used by most programs in this + package + + libproc + + + + + + + - diff --git a/chapter06/psmisc.xml b/chapter06/psmisc.xml index a8165860b..f8f02f458 100644 --- a/chapter06/psmisc.xml +++ b/chapter06/psmisc.xml @@ -1,134 +1,169 @@ - %general-entities; ]> + -Psmisc-&psmisc-version; - + + + Psmisc-&psmisc-version; + + + Psmisc + + + + -<indexterm zone="ch-system-psmisc"><primary sortas="a-Psmisc">Psmisc</primary></indexterm> + <para>The Psmisc package contains programs for displaying information about + running processes.</para> -<sect2 role="package"><title/> -<para>The Psmisc package contains programs for displaying information about -running processes.</para> + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> -<segmentedlist> -<segtitle>&buildtime;</segtitle> -<segtitle>&diskspace;</segtitle> -<seglistitem><seg>0.1 SBU</seg><seg>1.7 MB</seg></seglistitem> -</segmentedlist> + <seglistitem> + <seg>0.1 SBU</seg> + <seg>1.7 MB</seg> + </seglistitem> + </segmentedlist> -<segmentedlist> -<segtitle>&dependencies;</segtitle> -<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, -GCC, Gettext, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> -</segmentedlist> -</sect2> + <segmentedlist> + <segtitle>&dependencies;</segtitle> -<sect2 role="installation"> -<title>Installation of Psmisc + + Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, + Make, Ncurses, and Sed + + -Prepare Psmisc for compilation: + + + + Installation of Psmisc + + Prepare Psmisc for compilation: ./configure --prefix=/usr --exec-prefix="" -The meaning of the configure options: + + The meaning of the configure options: - - ---exec-prefix="" -This ensures that the Psmisc binaries will install into -/bin instead of /usr/bin. This is the correct location according to -the FHS, because some of the Psmisc binaries are used by the LFS-Bootscripts -package. - - + + --exec-prefix="" + + This ensures that the Psmisc binaries will install into + /bin instead of /usr/bin. This is the correct location + according to the FHS, because some of the Psmisc binaries are used + by the LFS-Bootscripts package. + + -Compile the package: + + + Compile the package: make -This package does not come with a test suite. + This package does not come with a test suite. -Install the package: + Install the package: make install -There is no reason for the pstree and -pstree.x11 programs to reside in /bin. Therefore, move them to /usr/bin: + There is no reason for the pstree and + pstree.x11 programs to reside in /bin. Therefore, move them to /usr/bin: mv -v /bin/pstree* /usr/bin -By default, Psmisc's pidof program is not -installed. This usually is not a problem because it is installed later -in the Sysvinit package, which provides a better -pidof program. If Sysvinit will not be used for a -particular system, complete the installation of Psmisc by creating the -following symlink: + By default, Psmisc's pidof program is not + installed. This usually is not a problem because it is installed later + in the Sysvinit package, which provides a better + pidof program. If Sysvinit will not be used for a + particular system, complete the installation of Psmisc by creating the + following symlink: ln -sv killall /bin/pidof - - - -Contents of Psmisc - - -Installed programs -fuser, killall, pstree, and pstree.x11 (link to pstree) - - -Short Descriptions - - - - -fuser - -Reports the Process IDs (PIDs) of processes that use the given files or file systems -fuser - - - - -killall - -Kills processes by name; it sends a signal to all processes -running any of the given commands -killall - - - - -oldfuser - -Reports the Process IDs (PIDs) of processes that use the given files or file systems -oldfuser - - - - -pstree - -Displays running processes as a tree -pstree - - - - -pstree.x11 - -Same as pstree, except that it waits for confirmation before exiting -pstree.x11 - - - - - + + + + Contents of Psmisc + + + Installed programs + + + fuser, killall, pstree, and pstree.x11 (link to pstree) + + + + + Short Descriptions + + + + + fuser + + Reports the Process IDs (PIDs) of processes that use the given + files or file systems + + fuser + + + + + + killall + + Kills processes by name; it sends a signal to all processes + running any of the given commands + + killall + + + + + + oldfuser + + Reports the Process IDs (PIDs) of processes that use the given + files or file systems + + oldfuser + + + + + + pstree + + Displays running processes as a tree + + pstree + + + + + + pstree.x11 + + Same as pstree, except that it waits for + confirmation before exiting + + pstree.x11 + + + + + + + - diff --git a/chapter06/pwdgroup.xml b/chapter06/pwdgroup.xml index ff561570d..a58edade6 100644 --- a/chapter06/pwdgroup.xml +++ b/chapter06/pwdgroup.xml @@ -1,36 +1,56 @@ - %general-entities; ]> + -Creating the passwd, group, and log Files - + + + Creating the passwd, group, and log Files + + + /etc/passwd + + + + /etc/group + -/etc/passwd -/etc/group -/var/run/utmp -/var/log/btmp -/var/log/lastlog -/var/log/wtmp + + /var/run/utmp + -In order for user root to be able to login -and for the name root to be recognized, there must be relevant -entries in the /etc/passwd and -/etc/group files. + + /var/log/btmp + -Create the /etc/passwd file by running the following -command: + + /var/log/lastlog + + + + /var/log/wtmp + + + In order for user root to be + able to login and for the name root to be recognized, there + must be relevant entries in the /etc/passwd and + /etc/group files. + + Create the /etc/passwd file by running the following + command: cat > /etc/passwd << "EOF" root:x:0:0:root:/root:/bin/bash EOF -The actual password for root (the x -used here is just a placeholder) will be set later. + The actual password for root + (the x used here is just a placeholder) will be set later. -Create the /etc/group file by running the following -command: + Create the /etc/group file by running the following + command: cat > /etc/group << "EOF" root:x:0: @@ -51,49 +71,49 @@ usb:x:14: cdrom:x:15: EOF -The created groups are not part of any standard—they are groups -decided on in part by the requirements of the Udev configuration in this -chapter, and in part by common convention employed by a number of existing Linux -distributions. The Linux Standard Base (LSB, available at ) recommends only that, besides the group -root with a Group ID (GID) of 0, a group bin with -a GID of 1 be present. All other group names and GIDs can be chosen freely by -the system administrator since well-written programs do not depend on GID -numbers, but rather use the group's name. - -To remove the I have no name! prompt, start a new -shell. Since a full Glibc was installed in and the -/etc/passwd and /etc/group -files have been created, user name and group name resolution will now -work. + The created groups are not part of any standard—they are groups + decided on in part by the requirements of the Udev configuration in this + chapter, and in part by common convention employed by a number of existing + Linux distributions. The Linux Standard Base (LSB, available at ) recommends only that, besides the group + root with a Group ID (GID) of 0, + a group bin with a GID of 1 be + present. All other group names and GIDs can be chosen freely by the system + administrator since well-written programs do not depend on GID numbers, but + rather use the group's name. + + To remove the I have no name! prompt, start a new + shell. Since a full Glibc was installed in and the + /etc/passwd and /etc/group + files have been created, user name and group name resolution will now + work. exec /tools/bin/bash --login +h -Note the use of the +h directive. This tells -bash not to use its internal path hashing. Without this -directive, bash would remember the paths to binaries it has -executed. To ensure the use of the newly compiled binaries as soon as they are -installed, the +h directive will be used for the duration -of this chapter. + Note the use of the +h directive. This tells + bash not to use its internal path hashing. Without this + directive, bash would remember the paths to binaries it has + executed. To ensure the use of the newly compiled binaries as soon as they are + installed, the +h directive will be used for the duration + of this chapter. -The login, agetty, and -init programs (and others) use a number of log -files to record information such as who was logged into the system and -when. However, these programs will not write to the log files if they -do not already exist. Initialize the log files and give them -proper permissions: + The login, agetty, and + init programs (and others) use a number of log + files to record information such as who was logged into the system and + when. However, these programs will not write to the log files if they + do not already exist. Initialize the log files and give them + proper permissions: touch /var/run/utmp /var/log/{btmp,lastlog,wtmp} chgrp -v utmp /var/run/utmp /var/log/lastlog chmod -v 664 /var/run/utmp /var/log/lastlog -The /var/run/utmp file records the users -that are currently logged in. The /var/log/wtmp -file records all logins and logouts. The -/var/log/lastlog file records when -each user last logged in. The /var/log/btmp file -records the bad login attempts. + The /var/run/utmp file records the users + that are currently logged in. The /var/log/wtmp + file records all logins and logouts. The + /var/log/lastlog file records when + each user last logged in. The /var/log/btmp file + records the bad login attempts. - diff --git a/chapter06/readjusting.xml b/chapter06/readjusting.xml index 18fc83d4a..e108286f0 100644 --- a/chapter06/readjusting.xml +++ b/chapter06/readjusting.xml @@ -1,113 +1,116 @@ - %general-entities; ]> + -Re-adjusting the Toolchain - - -Now that the final C libraries have been installed, it is time to adjust -the toolchain again. The toolchain will be adjusted so that it will link any -newly compiled program against these new libraries. This is a similar process -used in the Adjusting phase in the beginning of , but with the adjustments reversed. In , the chain was guided from the host's -/{,usr/}lib directories to the new -/tools/lib directory. Now, the chain will -be guided from that same /tools/lib -directory to the LFS /{,usr/}lib -directories. - -First, backup the /tools linker, and -replace it with the adjusted linker we made in chapter 5. We'll also create a -link to its counterpart in /tools/$(gcc -dumpmachine)/bin. + + + Re-adjusting the Toolchain + + Now that the final C libraries have been installed, it is time to adjust + the toolchain again. The toolchain will be adjusted so that it will link any + newly compiled program against these new libraries. This is a similar process + used in the Adjusting phase in the beginning of , but with the adjustments reversed. In , the chain was guided from the host's + /{,usr/}lib directories to the new + /tools/lib directory. Now, the chain will + be guided from that same /tools/lib + directory to the LFS /{,usr/}lib + directories. + + First, backup the /tools linker, + and replace it with the adjusted linker we made in chapter 5. We'll also create + a link to its counterpart in /tools/$(gcc + -dumpmachine)/bin. mv -v /tools/bin/{ld,ld-old} mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old} mv -v /tools/bin/{ld-new,ld} ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld -Next, amend the GCC specs file so that it points to the new -dynamic linker, and so that GCC knows where to find its start files. -A perl command accomplishes this: + Next, amend the GCC specs file so that it points to the new + dynamic linker, and so that GCC knows where to find its start files. + A perl command accomplishes this: gcc -dumpspecs | \ perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \ - -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ - `dirname $(gcc --print-libgcc-file-name)`/specs - - -It is a good idea to visually inspect the specs file to verify the intended -change was actually made. - -If working on a platform where the name of the -dynamic linker is something other than -ld-linux.so.2, substitute -ld-linux.so.2 with the name of the platform's -dynamic linker in the above commands. Refer back to if -necessary. - -It is imperative at this point to stop and ensure that -the basic functions (compiling and linking) of the adjusted toolchain -are working as expected. To do this, perform a sanity -check: + -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ + `dirname $(gcc --print-libgcc-file-name)`/specs + + It is a good idea to visually inspect the specs file to verify the + intended change was actually made. + + + If working on a platform where the name of the dynamic linker is + something other than ld-linux.so.2, + substitute ld-linux.so.2 with the name of the platform's + dynamic linker in the above commands. Refer back to if necessary. + + + + It is imperative at this point to stop and ensure that the basic + functions (compiling and linking) of the adjusted toolchain are working + as expected. To do this, perform a sanity check: echo 'main(){}' > dummy.c cc dummy.c -Wl,--verbose &> dummy.log readelf -l a.out | grep ': /lib' -If everything is working correctly, there should be no errors, -and the output of the last command will be (allowing for -platform-specific differences in dynamic linker name): + If everything is working correctly, there should be no errors, + and the output of the last command will be (allowing for + platform-specific differences in dynamic linker name): [Requesting program interpreter: /lib/ld-linux.so.2] -Note that /lib is now -the prefix of our dynamic linker. + Note that /lib is now + the prefix of our dynamic linker. -Now make sure that we're setup to use the correct start files: + Now make sure that we're setup to use the correct start files: grep "/usr/lib/crt.* " dummy.log -If everything is working correctly, there should be no errors, -and the output of the last command will be: + If everything is working correctly, there should be no errors, + and the output of the last command will be: attempt to open /usr/lib/crt1.o succeeded attempt to open /usr/lib/crti.o succeeded attempt to open /usr/lib/crtn.o succeeded -Next make sure that we're using the correct libc: + Next make sure that we're using the correct libc: grep "/lib/libc.so.6 " dummy.log -If everything is working correctly, there should be no errors, -and the output of the last command will be: + If everything is working correctly, there should be no errors, + and the output of the last command will be: attempt to open /lib/libc.so.6 succeeded -Lastly, make sure GCC is using the correct dynamic linker: + Lastly, make sure GCC is using the correct dynamic linker: grep found dummy.log -If everything is working correctly, there should be no errors, -and the output of the last command will be (allowing for -platform-specific differences in dynamic linker name): + If everything is working correctly, there should be no errors, + and the output of the last command will be (allowing for + platform-specific differences in dynamic linker name): found ld-linux.so.2 at /lib/ld-linux.so.2 -If the output does not appear as shown above or is not received -at all, then something is seriously wrong. Investigate and retrace the -steps to find out where the problem is and correct it. The most likely -reason is that something went wrong with the specs file amendment -above. Any issues will need to be resolved before continuing on with -the process. + If the output does not appear as shown above or is not received + at all, then something is seriously wrong. Investigate and retrace the + steps to find out where the problem is and correct it. The most likely + reason is that something went wrong with the specs file amendment + above. Any issues will need to be resolved before continuing on with + the process. -Once everything is working correctly, clean up the test -files: + Once everything is working correctly, clean up the test + files: -rm -v dummy.c a.out dummy.log +rm -v dummy.c a.out dummy.log + - diff --git a/chapter06/readline.xml b/chapter06/readline.xml index 235f38e8c..f61f934ab 100644 --- a/chapter06/readline.xml +++ b/chapter06/readline.xml @@ -1,111 +1,135 @@ - %general-entities; ]> + -Readline-&readline-version; - + + + Readline-&readline-version; + + + Readline + + + + -<indexterm zone="ch-system-readline"><primary sortas="a-Readline">Readline</primary></indexterm> + <para>The Readline package is a set of libraries that offers command-line + editing and history capabilities.</para> -<sect2 role="package"><title/> -<para>The Readline package is a set of libraries that offers command-line -editing and history capabilities.</para> + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> -<segmentedlist> -<segtitle>&buildtime;</segtitle> -<segtitle>&diskspace;</segtitle> -<seglistitem><seg>0.11 SBU</seg><seg>9.1 MB</seg></seglistitem> -</segmentedlist> + <seglistitem> + <seg>0.11 SBU</seg> + <seg>9.1 MB</seg> + </seglistitem> + </segmentedlist> -<segmentedlist> -<segtitle>&dependencies;</segtitle> -<seglistitem><seg>Binutils, Coreutils, Diffutils, Gawk, -GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> -</segmentedlist> -</sect2> + <segmentedlist> + <segtitle>&dependencies;</segtitle> -<sect2 role="installation"> -<title>Installation of Readline + + Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep, Make, + Ncurses, and Sed + + -Prepare Readline for compilation: + + + + Installation of Readline + + Prepare Readline for compilation: ./configure --prefix=/usr --libdir=/lib -Compile the package: + Compile the package: make SHLIB_LIBS=-lncurses -The meaning of the make option: + + The meaning of the make option: - - -SHLIB_LIBS=-lncurses -This option forces Readline to link against the -libncurses -(really, libncursesw) -library. - - + + SHLIB_LIBS=-lncurses + + This option forces Readline to link against the + libncurses (really, + libncursesw) library. + + -This package does not come with a test suite. + -Install the package: + This package does not come with a test suite. + + Install the package: make install -Give Readline's dynamic libraries more appropriate permissions: + Give Readline's dynamic libraries more appropriate permissions: chmod -v 755 /lib/lib{readline,history}.so* -Now move the static libraries to a more appropriate location: + Now move the static libraries to a more appropriate location: mv -v /lib/lib{readline,history}.a /usr/lib -Next, remove the .so files in -/lib and relink them into /usr/lib. + Next, remove the .so files in + /lib and relink them into /usr/lib. rm -v /lib/lib{readline,history}.so ln -sfv ../../lib/libreadline.so.5 /usr/lib/libreadline.so ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so - - - -Contents of Readline - -Installed libraries -libhistory.[a,so], and libreadline.[a,so] - - -Short Descriptions - - - - -libhistory - -Provides a consistent user interface -for recalling lines of history -libhistory - - - - -libreadline - -Aids in the consistency of user interface -across discrete programs that need to provide a command line -interface -libreadline - - - - - - + + + + Contents of Readline + + + Installed libraries + + + libhistory.[a,so], and libreadline.[a,so] + + + + + Short Descriptions + + + + + libhistory + + Provides a consistent user interface for recalling lines + of history + + libhistory + + + + + + libreadline + + Aids in the consistency of user interface across discrete + programs that need to provide a command line interface + + libreadline + + + + + + + - diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml index 29eeba80a..5954b64be 100644 --- a/chapter06/revisedchroot.xml +++ b/chapter06/revisedchroot.xml @@ -1,30 +1,34 @@ - %general-entities; ]> + -Cleaning Up - + + + Cleaning Up -From now on, when reentering the chroot environment after -exiting, use the following modified chroot command: + From now on, when reentering the chroot environment after + exiting, use the following modified chroot command: chroot "$LFS" /usr/bin/env -i \ HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /bin/bash --login -The reason for this is that the programs in /tools are no longer needed. Since they are no -longer needed you can delete the /tools -directory if so desired. + The reason for this is that the programs in /tools are no longer needed. Since they are no + longer needed you can delete the /tools + directory if so desired. -Removing /tools will also -remove the temporary copies of Tcl, Expect, and DejaGNU which were used for -running the toolchain tests. If you need these programs later on, they will need -to be recompiled and re-installed. The BLFS book has instructions for this (see -). + + Removing /tools will also + remove the temporary copies of Tcl, Expect, and DejaGNU which were used + for running the toolchain tests. If you need these programs later on, + they will need to be recompiled and re-installed. The BLFS book has + instructions for this (see ). + - diff --git a/chapter06/sed.xml b/chapter06/sed.xml index 01c2a6d45..7fd46232a 100644 --- a/chapter06/sed.xml +++ b/chapter06/sed.xml @@ -1,79 +1,100 @@ - %general-entities; ]> + -Sed-&sed-version; - + + + Sed-&sed-version; + + + Sed + + + + -<indexterm zone="ch-system-sed"><primary sortas="a-Sed">Sed</primary></indexterm> + <para>The Sed package contains a stream editor.</para> -<sect2 role="package"><title/> -<para>The Sed package contains a stream editor.</para> + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> -<segmentedlist> -<segtitle>&buildtime;</segtitle> -<segtitle>&diskspace;</segtitle> -<seglistitem><seg>0.2 SBU</seg><seg>8.4 MB</seg></seglistitem> -</segmentedlist> + <seglistitem> + <seg>0.2 SBU</seg> + <seg>8.4 MB</seg> + </seglistitem> + </segmentedlist> -<segmentedlist> -<segtitle>&dependencies;</segtitle> -<seglistitem><seg>Bash, Binutils, Coreutils, -Diffutils, GCC, Gettext, Glibc, Grep, Make, and Texinfo</seg></seglistitem> -</segmentedlist> -</sect2> + <segmentedlist> + <segtitle>&dependencies;</segtitle> -<sect2 role="installation"> -<title>Installation of Sed + + Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, + Grep, Make, and Texinfo + + -By default, Sed installs its HTML documentation in -/usr/share/doc. Alter this to -/usr/share/doc/sed-&sed-version; by -applying the following sed: + + + + Installation of Sed + + By default, Sed installs its HTML documentation in + /usr/share/doc. Alter this to + /usr/share/doc/sed-&sed-version; by + applying the following sed: sed -i 's@/doc@&/sed-&sed-version;@' doc/Makefile.in -Prepare Sed for compilation: + Prepare Sed for compilation: ./configure --prefix=/usr --bindir=/bin -Compile the package: + Compile the package: make -To test the results, issue: -make check. + To test the results, issue: + make check. -Install the package: + Install the package: make install - + + + Contents of Sed -Contents of Sed + + Installed program - -Installed program -sed - + + sed + + -Short Descriptions - - + + Short Descriptions + + - -sed - -Filters and transforms text files in a single pass -sed - - - + + sed + + Filters and transforms text files in a single pass + + sed + + + - + - + + -- cgit v1.2.3-54-g00ecf