Changeset 3c928f1
- Timestamp:
- 06/13/2004 12:58:23 PM (20 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.0, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- e63529b
- Parents:
- 7db6ac5
- Location:
- chapter06
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/aboutdebug.xml
r7db6ac5 r3c928f1 9 9 10 10 <para>Most programs and libraries are, by default, compiled with debugging 11 symbols included (with <command>gcc</command>'s < emphasis>-g</emphasis>11 symbols included (with <command>gcc</command>'s <parameter>-g</parameter> 12 12 option). This means that, when debugging a program or library that was compiled 13 13 with debugging information included, the debugger can give you not only memory … … 26 26 without debugging symbols: 480 KB</para></listitem> 27 27 28 <listitem><para>Glibc and GCC files (/lib and /usr/lib) 28 <listitem><para>Glibc and GCC files (<filename class="directory">/lib</filename> 29 and <filename class="directory">/usr/lib</filename>) 29 30 with debugging symbols: 87 MB</para></listitem> 30 31 -
chapter06/automake.xml
r7db6ac5 r3c928f1 185 185 <listitem> 186 186 <indexterm zone="ch-system-automake ylwrap"><primary sortas="b-ylwrap">ylwrap</primary></indexterm> 187 <para>is a wrapper for lex and yacc.</para>187 <para>is a wrapper for <command>lex</command> and <command>yacc</command>.</para> 188 188 </listitem> 189 189 </varlistentry> -
chapter06/bash.xml
r7db6ac5 r3c928f1 55 55 <screen><userinput>exec /bin/bash --login +h</userinput></screen> 56 56 57 <para>Note that the parameters used make it an interactive login instance 58 (so /etc/profile is read, if it exists, and the first found 59 ~/.bash_profile, ~/.bash_login or and ~/.profile) and continue to 57 <note><para>The parameters used make it an interactive login instance 58 (so <filename>/etc/profile</filename> is read, if it exists, and the first found 59 <filename>~/.bash_profile</filename>, <filename>~/.bash_login</filename> or 60 and <filename>~/.profile</filename>) and continue to 60 61 disable hashing so that new programs are found as they become 61 available.</para> 62 available.</para></note> 62 63 63 64 </sect2> … … 88 89 <indexterm zone="ch-system-bash bashbug"><primary sortas="b-bashbug">bashbug</primary></indexterm> 89 90 <para>is a shell script to help the user 90 compose and mail bug reports concerning bashin a standard format.</para>91 compose and mail bug reports concerning <command>bash</command> in a standard format.</para> 91 92 </listitem> 92 93 </varlistentry> … … 97 98 <indexterm zone="ch-system-bash sh"><primary sortas="b-sh">sh</primary></indexterm> 98 99 <para>is a symlink to the bash program. When invoked 99 as sh, bash tries to mimic the startup behavior of historical versions of sh as 100 as <command>sh</command>, <command>bash</command> tries to mimic the 101 startup behavior of historical versions of <command>sh</command> as 100 102 closely as possible, while conforming to the POSIX standard as well.</para> 101 103 </listitem> -
chapter06/binutils.xml
r7db6ac5 r3c928f1 38 38 <para>If you receive the message:</para> 39 39 40 < blockquote><screen>The system has no more ptys. Ask your system administrator to create more.</screen></blockquote>40 <screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen> 41 41 42 42 <para>Your chroot environment is not set up for proper PTY operation. In this … … 45 45 46 46 <para>This package is known to behave badly when you have changed its 47 default optimization flags (including the -march and -mcpuoptions).47 default optimization flags (including the <parameter>-march</parameter> and <parameter>-mcpu</parameter> options). 48 48 Therefore, if you have defined any environment variables that override 49 49 default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting … … 66 66 <para>Normally, the <emphasis>tooldir</emphasis> (the directory where the 67 67 executables end up) is set to $(exec_prefix)/$(target_alias), which expands 68 into, for example, <filename >/usr/i686-pc-linux-gnu</filename>. Since we only68 into, for example, <filename class="directory">/usr/i686-pc-linux-gnu</filename>. Since we only 69 69 build for our own system, we don't need this target specific directory in 70 <filename >/usr</filename>. That setup would be used if the system was used to70 <filename class="directory">/usr</filename>. That setup would be used if the system was used to 71 71 cross-compile (for example compiling a package on an Intel machine that 72 72 generates code that can be executed on PowerPC machines).</para> … … 88 88 <screen><userinput>make tooldir=/usr install</userinput></screen> 89 89 90 <para>Install the < emphasis>libiberty</emphasis> header file that is needed by90 <para>Install the <filename class="headerfile">libiberty</filename> header file that is needed by 91 91 some packages:</para> 92 92 … … 134 134 <listitem> 135 135 <indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm> 136 <para>is an assembler. It assembles the output of gccinto object files.</para>136 <para>is an assembler. It assembles the output of <command>gcc</command> into object files.</para> 137 137 </listitem> 138 138 </varlistentry> -
chapter06/bison.xml
r7db6ac5 r3c928f1 62 62 <indexterm zone="ch-system-bison bison"><primary sortas="b-bison">bison</primary></indexterm> 63 63 <para>generates, from a series of rules, a program 64 for analyzing the structure of text files. Bison is a replacement for yacc64 for analyzing the structure of text files. <command>bison</command> is a replacement for <command>yacc</command> 65 65 (Yet Another Compiler Compiler).</para> 66 66 </listitem> … … 71 71 <listitem> 72 72 <indexterm zone="ch-system-bison yacc"><primary sortas="b-yacc">yacc</primary></indexterm> 73 <para>is a wrapper for bison, meant for programs 74 that still call yacc instead of bison. It calls bison with the -y option.</para> 73 <para>is a wrapper for <command>bison</command>, meant for programs 74 that still call <command>yacc</command> instead of <command>bison</command>. 75 It calls <command>bison</command> with the <parameter>-y</parameter> option.</para> 75 76 </listitem> 76 77 </varlistentry> -
chapter06/bzip2.xml
r7db6ac5 r3c928f1 36 36 make clean</userinput></screen> 37 37 38 <para>The < emphasis>-f</emphasis> flag will cause Bzip2 to be built38 <para>The <parameter>-f</parameter> flag will cause Bzip2 to be built 39 39 using a different <filename>Makefile</filename> file, in this case the 40 40 <filename>Makefile-libbz2_so</filename> file, which creates a dynamic 41 <filename >libbz2.so</filename> library and links the Bzip2 utilities41 <filename class="libraryfile">libbz2.so</filename> library and links the Bzip2 utilities 42 42 against it.</para> 43 43 … … 101 101 <listitem> 102 102 <indexterm zone="ch-system-bzip2 bzcmp"><primary sortas="b-bzcmp">bzcmp</primary></indexterm> 103 <para>runs cmpon bzipped files.</para>103 <para>runs <command>cmp</command> on bzipped files.</para> 104 104 </listitem> 105 105 </varlistentry> … … 109 109 <listitem> 110 110 <indexterm zone="ch-system-bzip2 bzdiff"><primary sortas="b-bzdiff">bzdiff</primary></indexterm> 111 <para>runs diffon bzipped files.</para>111 <para>runs <command>diff</command> on bzipped files.</para> 112 112 </listitem> 113 113 </varlistentry> … … 117 117 <listitem> 118 118 <indexterm zone="ch-system-bzip2 bzgrep"><primary sortas="b-bzgrep">bzgrep</primary></indexterm> 119 <para>and friends run grepon bzipped files.</para>119 <para>and friends run <command>grep</command> on bzipped files.</para> 120 120 </listitem> 121 121 </varlistentry> … … 136 136 <listitem> 137 137 <indexterm zone="ch-system-bzip2 bzip2recover"><primary sortas="b-bzip2recover">bzip2recover</primary></indexterm> 138 <para>tries to recover data from damaged bzip 2files.</para>138 <para>tries to recover data from damaged bzipped files.</para> 139 139 </listitem> 140 140 </varlistentry> … … 144 144 <listitem> 145 145 <indexterm zone="ch-system-bzip2 bzless"><primary sortas="b-bzless">bzless</primary></indexterm> 146 <para>runs lesson bzipped files.</para>146 <para>runs <command>less</command> on bzipped files.</para> 147 147 </listitem> 148 148 </varlistentry> … … 152 152 <listitem> 153 153 <indexterm zone="ch-system-bzip2 bzmore"><primary sortas="b-bzmore">bzmore</primary></indexterm> 154 <para>runs moreon bzipped files.</para>154 <para>runs <command>more</command> on bzipped files.</para> 155 155 </listitem> 156 156 </varlistentry> -
chapter06/changingowner.xml
r7db6ac5 r3c928f1 30 30 <screen><userinput>chown -R 0:0 /tools</userinput></screen> 31 31 32 <para>The command uses < quote>0:0</quote> instead of <quote>root:root</quote>,32 <para>The command uses <parameter>0:0</parameter> instead of <parameter>root:root</parameter>, 33 33 because <userinput>chown</userinput> is unable to resolve the name 34 34 <quote>root</quote> until the password file has been created.</para> -
chapter06/chapter06.xml
r7db6ac5 r3c928f1 69 69 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/> 70 70 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutdebug.xml"/> 71 72 <sect1 id="ch-system-strippingagain"> 73 <title>Stripping again</title> 74 <?dbhtml filename="strippingagain.html"?> 75 76 <para>If you are not a programmer and don't plan to do any debugging on your 77 system software, you can shrink your system by about 200 MB by removing the 78 debugging symbols from binaries and libraries. This causes no inconvenience 79 other than not being able to debug the software fully any more.</para> 80 81 <para>Most people who use the command mentioned below don't experience any 82 problems. But it is easy to make a typo and render your new system unusable, so 83 before running the strip command it is probably a good idea to make a backup of 84 the current situation.</para> 85 86 <para>If you are going to perform the stripping, special care is needed to 87 ensure you're not running any of the binaries that are about to be stripped. 88 If you're not sure whether you entered chroot with the command given in 89 <xref linkend="ch-system-chroot"/>, then first exit from chroot:</para> 90 91 <screen><userinput>logout</userinput></screen> 92 93 <para>Then reenter it with:</para> 94 95 <screen><userinput>chroot $LFS /tools/bin/env -i \ 96 HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ 97 PATH=/bin:/usr/bin:/sbin:/usr/sbin \ 98 /tools/bin/bash --login</userinput></screen> 99 100 <para>Now you can safely strip the binaries and libraries:</para> 101 102 <screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \ 103 -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen> 104 105 <para>A large number of files will be reported as having their file format not 106 recognized. These warnings can be safely ignored, they just mean that those 107 files are scripts instead of binaries, no harm is done.</para> 108 109 <para>If you are really tight on disk space, you may want to use 110 <emphasis>--strip-all</emphasis> on the binaries in 111 <filename>/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do 112 <emphasis>not</emphasis> use this option on libraries: they would be 113 destroyed.</para> 114 115 </sect1> 116 71 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="strippingagain.xml"/> 117 72 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/> 118 73 -
chapter06/chroot.xml
r7db6ac5 r3c928f1 18 18 /tools/bin/bash --login +h</userinput></screen> 19 19 20 <para>The < emphasis>-i</emphasis> option given to the20 <para>The <parameter>-i</parameter> option given to the 21 21 <command>env</command> command will clear all variables of the chroot 22 22 environment. After that, only the HOME, TERM, PS1 and PATH variables are 23 set again. The TERM=$TERMconstruct will set the TERM variable inside chroot23 set again. The <parameter>TERM=$TERM</parameter> construct will set the TERM variable inside chroot 24 24 to the same value as outside chroot; this variable is needed for programs 25 25 like <command>vim</command> and <command>less</command> to operate … … 37 37 as soon as its final version is installed. Well, at least when the shell 38 38 doesn't remember the locations of executed binaries -- for this reason hashing 39 is switched off by passing the < emphasis>+h</emphasis> option to39 is switched off by passing the <parameter>+h</parameter> option to 40 40 <command>bash</command>.</para> 41 41 … … 43 43 in the following chapters are run from within the chroot environment. 44 44 If you ever leave this environment for any reason (rebooting for example), 45 you must remember to first mount the proc and devpts file systems (discussed 45 you must remember to first mount the <systemitem class="filesystem">proc</systemitem> 46 and <systemitem class="filesystem">devpts</systemitem> file systems (discussed 46 47 in the previous section) <emphasis>and</emphasis> enter chroot again before 47 48 continuing with the installations.</para> 48 49 49 <para>Note that the bash prompt will say <quote>I have no name!</quote> This is 50 <para>Note that the <command>bash</command> prompt will say 51 <computeroutput>I have no name!</computeroutput> This is 50 52 normal, as the <filename>/etc/passwd</filename> file has not been created yet. 51 53 </para> -
chapter06/coreutils.xml
r7db6ac5 r3c928f1 31 31 32 32 <para>Normally the functionality of <command>uname</command> is somewhat 33 broken, in that the < emphasis>-p</emphasis> switch always returns34 < quote>unknown</quote>. The following patch fixes this behavior for Intel33 broken, in that the <parameter>-p</parameter> switch always returns 34 <computeroutput>unknown</computeroutput>. The following patch fixes this behavior for Intel 35 35 architectures:</para> 36 36 … … 161 161 <indexterm zone="ch-system-coreutils chroot"><primary sortas="b-chroot">chroot</primary></indexterm> 162 162 <para>runs a given command with the specified directory as the 163 <filename >/</filename> directory. The given command can be an interactive shell.163 <filename class="directory">/</filename> directory. The given command can be an interactive shell. 164 164 On most systems only <emphasis>root</emphasis> can do this.</para> 165 165 </listitem> … … 242 242 <listitem> 243 243 <indexterm zone="ch-system-coreutils dir"><primary sortas="b-dir">dir</primary></indexterm> 244 <para>is the same as ls.</para>244 <para>is the same as <command>ls</command>.</para> 245 245 </listitem> 246 246 </varlistentry> … … 251 251 <indexterm zone="ch-system-coreutils dircolors"><primary sortas="b-dircolors">dircolors</primary></indexterm> 252 252 <para>outputs commands to set the LS_COLOR 253 environment variable, to change the color scheme used by ls.</para>253 environment variable, to change the color scheme used by <command>ls</command>.</para> 254 254 </listitem> 255 255 </varlistentry> … … 449 449 <listitem> 450 450 <indexterm zone="ch-system-coreutils mkfifo"><primary sortas="b-mkfifo">mkfifo</primary></indexterm> 451 <para>creates FIFOs (First-In, First-Out, a "named pipe" in UNIX parlance) with451 <para>creates FIFOs (First-In, First-Out, a <quote>named pipe</quote> in UNIX parlance) with 452 452 the given names.</para> 453 453 </listitem> … … 809 809 <listitem> 810 810 <indexterm zone="ch-system-coreutils vdir"><primary sortas="b-vdir">vdir</primary></indexterm> 811 <para>is the same as ls -l.</para>811 <para>is the same as <command>ls -l</command>.</para> 812 812 </listitem> 813 813 </varlistentry> … … 842 842 <listitem> 843 843 <indexterm zone="ch-system-coreutils yes"><primary sortas="b-yes">yes</primary></indexterm> 844 <para>outputs 'y'or a given string repeatedly, until killed.</para>844 <para>outputs <quote>y</quote> or a given string repeatedly, until killed.</para> 845 845 </listitem> 846 846 </varlistentry> -
chapter06/devices.xml
r7db6ac5 r3c928f1 8 8 <?dbhtml filename="devices.html"?> 9 9 10 <indexterm zone="ch-system-devices"><primary sortas=" a-Devices">Devices</primary></indexterm>10 <indexterm zone="ch-system-devices"><primary sortas="e-Devices">Devices</primary></indexterm> 11 11 12 12 <sect2> … … 14 14 15 15 <para>When the kernel boots the system, it requires the presence of a few device 16 nodes, in particular the console and null devices:</para> 16 nodes, in particular the <filename class="devicefile">console</filename> and 17 <filename class="devicefile">null</filename> devices:</para> 17 18 18 19 <screen><userinput>mknod -m 600 /dev/console c 5 1 … … 23 24 <title>Mounting ramfs and populating /dev</title> 24 25 25 <para>The ideal way to populate /dev is to mount a ramfs onto /dev (like tmpfs, but it 26 <para>The ideal way to populate <filename class="directory">/dev</filename> is 27 to mount a <systemitem class="filesystem">ramfs</systemitem> onto <filename class="directory">/dev </filename> 28 like <systemitem class="filesystem">tmpfs</systemitem>, but it 26 29 cannot be swapped) and create the devices on there during each bootup. Since we haven't 27 30 booted the system, we have to do what the bootscripts would otherwise do for us, and 28 populate /dev ourselves. Begin by mounting /dev:</para>31 populate <filename class="directory">/dev</filename> ourselves. Begin by mounting <filename class="directory">/dev</filename>:</para> 29 32 30 33 <screen><userinput>mount -n -t ramfs none /dev</userinput></screen> 31 34 32 35 <para>Now use the provided udevstart utility to create the initial devices based on 33 all the information in /sys:</para>36 all the information in <filename class="directory">/sys</filename>:</para> 34 37 35 38 <screen><userinput>/tools/sbin/udevstart</userinput></screen>
Note:
See TracChangeset
for help on using the changeset viewer.