- Timestamp:
- 03/31/2021 10:41:39 AM (3 years ago)
- Branches:
- ml-11.0, multilib
- Children:
- 7610848
- Parents:
- 811b5a39
- git-author:
- Thomas Trepl <thomas@…> (06/29/2020 07:55:01 AM)
- git-committer:
- Xℹ Ruoyao <xry111@…> (03/31/2021 10:41:39 AM)
- Location:
- chapter04
- Files:
-
- 1 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter04/aboutsbus.xml
r811b5a39 r6dfcfecc 21 21 22 22 <para>The SBU measure works as follows. The first package to be compiled 23 from this book is Binutils in <xref linkend="chapter-temporary-tools"/>. The23 from this book is binutils in <xref linkend="chapter-cross-tools"/>. The 24 24 time it takes to compile this package is what will be referred to as the 25 25 Standard Build Unit or SBU. All other compile times will be expressed relative … … 28 28 <para>For example, consider a package whose compilation time is 4.5 29 29 SBUs. This means that if a system took 10 minutes to compile and 30 install the first pass of Binutils, it will take30 install the first pass of binutils, it will take 31 31 <emphasis>approximately</emphasis> 45 minutes to build this example package. 32 Fortunately, most build times are shorter than the one for Binutils.</para>32 Fortunately, most build times are shorter than the one for binutils.</para> 33 33 34 34 <para>In general, SBUs are not entirely accurate because they depend on many … … 42 42 make" by either setting an environment variable or telling the 43 43 <command>make</command> program how many processors are available. For 44 instance, a Core2Duo can support twosimultaneous processes with:</para>44 instance, an Intel i5-6500 CPU can support four simultaneous processes with:</para> 45 45 46 <screen role="nodump"><userinput>export MAKEFLAGS='-j 2'</userinput></screen>46 <screen role="nodump"><userinput>export MAKEFLAGS='-j4'</userinput></screen> 47 47 48 48 <para>or just building with:</para> 49 49 50 <screen role="nodump"><userinput>make -j 2</userinput></screen>50 <screen role="nodump"><userinput>make -j4</userinput></screen> 51 51 52 52 <para>When multiple processors are used in this way, the SBU units in the -
chapter04/abouttestsuites.xml
r811b5a39 r6dfcfecc 19 19 20 20 <para>Some test suites are more important than others. For example, 21 the test suites for the core toolchain packages—GCC, Binutils, and22 Glibc—are of the utmost importance due to their central role in a23 properly functioning system. The test suites for GCC and Glibc can21 the test suites for the core toolchain packages—GCC, binutils, and 22 glibc—are of the utmost importance due to their central role in a 23 properly functioning system. The test suites for GCC and glibc can 24 24 take a very long time to complete, especially on slower hardware, but 25 25 are strongly recommended.</para> 26 26 27 27 <note> 28 <para>Experience has shown that there is little to be gained from running 29 the test suites in <xref linkend="chapter-temporary-tools"/>. There can be 30 no escaping the fact that the host system always exerts some influence on 31 the tests in that chapter, often causing inexplicable failures. Because 32 the tools built in <xref linkend="chapter-temporary-tools"/> are temporary 33 and eventually discarded, we do not recommend running the test suites in 34 <xref linkend="chapter-temporary-tools"/> for the average reader. The 35 instructions for running those test suites are provided for the benefit of 36 testers and developers, but they are strictly optional.</para> 28 <para>Running the test suites in <xref linkend="chapter-cross-tools"/> 29 and <xref linkend="chapter-temporary-tools"/> 30 is impossible, since the programs are compiled with a cross-compiler, 31 so are not supposed to be able to run on the build host.</para> 37 32 </note> 38 33 39 <para>A common issue with running the test suites for Binutils and GCC34 <para>A common issue with running the test suites for binutils and GCC 40 35 is running out of pseudo terminals (PTYs). This can result in a high 41 36 number of failing tests. This may happen for several reasons, but the -
chapter04/addinguser.xml
r811b5a39 r6dfcfecc 12 12 13 13 <para>When logged in as user <systemitem class="username">root</systemitem>, 14 making a single mistake can damage or destroy a system. Therefore, we15 recommend building the packages in the next chapteras an unprivileged user.14 making a single mistake can damage or destroy a system. Therefore, 15 the packages in the next two chapters are built as an unprivileged user. 16 16 You could use your own user name, but to make it easier to set up a clean 17 17 working environment, create a new user called <systemitem … … 63 63 <term><parameter>lfs</parameter></term> 64 64 <listitem> 65 <para>This is the actual name for the created group anduser.</para>65 <para>This is the actual name for the created user.</para> 66 66 </listitem> 67 67 </varlistentry> … … 78 78 79 79 <para>Grant <systemitem class="username">lfs</systemitem> full access to 80 <filename class="directory">$LFS/tools</filename> by making80 all directories under <filename class="directory">$LFS</filename> by making 81 81 <systemitem class="username">lfs</systemitem> the directory owner:</para> 82 82 83 <screen><userinput>chown -v lfs $LFS/tools</userinput></screen> 83 <screen><userinput>chown -v lfs $LFS/{usr,lib,var,etc,bin,sbin,tools} 84 case $(uname -m) in 85 x86_64) chown -v lfs $LFS/lib64 ;; 86 esac</userinput></screen> 87 <screen arch="ml_32" ><userinput>chown -v lfs $LFS&lib-m32;</userinput></screen> 88 <screen arch="ml_x32" ><userinput>chown -v lfs $LFS&lib-mx32;</userinput></screen> 89 <screen arch="ml_all" ><userinput>chown -v lfs $LFS/{lib32,libx32}</userinput></screen> 84 90 85 91 <para>If a separate working directory was created as suggested, give … … 96 102 <para>Next, login as user <systemitem class="username">lfs</systemitem>. 97 103 This can be done via a virtual console, through a display manager, or with 98 the following substitute user command:</para>104 the following substitute/switch user command:</para> 99 105 100 106 <screen role="nodump"><userinput>su - lfs</userinput></screen> -
chapter04/chapter04.xml
r811b5a39 r6dfcfecc 14 14 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/> 15 15 <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutlfs.xml"/>--> 16 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creating toolsdir.xml"/>16 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingminlayout.xml"/> 17 17 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="addinguser.xml"/> 18 18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="settingenviron.xml"/> -
chapter04/introduction.xml
r811b5a39 r6dfcfecc 12 12 13 13 <para>In this chapter, we will perform a few additional tasks to prepare 14 for building the temporary system. We will create a directoryin14 for building the temporary system. We will create a set of directories in 15 15 <filename class="directory">$LFS</filename> for the installation of the 16 16 temporary tools, add an unprivileged user to reduce risk, -
chapter04/settingenviron.xml
r811b5a39 r6dfcfecc 44 44 LC_ALL=POSIX 45 45 LFS_TGT=$(uname -m)-lfs-linux-gnu 46 PATH=/tools/bin:/bin:/usr/bin 46 PATH=/usr/bin 47 if [ ! -L /bin ]; then PATH=/bin:$PATH; fi 48 PATH=$LFS/tools/bin:$PATH 47 49 export LFS LC_ALL LFS_TGT PATH</literal> 48 50 EOF</userinput></screen> … … 55 57 LFS_TGT32=i686-lfs-linux-gnu 56 58 LFS_TGTX32=x86_64-lfs-linux-gnux32 57 PATH=/tools/bin:/bin:/usr/bin 59 PATH=/usr/bin 60 if [ ! -L /bin ]; then PATH=/bin:$PATH; fi 61 PATH=$LFS/tools/bin:$PATH 58 62 export LFS LC_ALL LFS_TGT LFS_TGT32 LFS_TGTX32 PATH</literal> 59 63 EOF</userinput></screen> 60 64 61 65 <variablelist> 62 <title>The meaning of the command line options in <filename>.bashrc</filename></title>66 <title>The meaning of the settings in <filename>.bashrc</filename></title> 63 67 64 68 <varlistentry> … … 120 124 121 125 <varlistentry> 122 <term><parameter>PATH=/tools/bin:/bin:/usr/bin</parameter></term> 123 <listitem> 124 <para>By putting <filename class="directory">/tools/bin</filename> ahead of the 125 standard <envar>PATH</envar>, all the programs installed in <xref 126 linkend="chapter-temporary-tools"/> are picked up by the shell immediately after 127 their installation. This, combined with turning off hashing, limits the risk 128 that old programs are used from the host when the same programs are available in 129 the Chapter 5 environment.</para> 126 <term><parameter>PATH=/usr/bin</parameter></term> 127 <listitem> 128 <para>Many modern linux distributions have merged <filename 129 class="directory">/bin</filename> and <filename 130 class="directory">/usr/bin</filename>. When this is the case, the standard 131 <envar>PATH</envar> variable needs just to be set to <filename 132 class="directory">/usr/bin/</filename> for the <xref 133 linkend="chapter-temporary-tools"/> environment. When this is not the 134 case, the following line adds <filename class="directory">/bin</filename> 135 to the path.</para> 136 </listitem> 137 </varlistentry> 138 139 <varlistentry> 140 <term><parameter>if [ ! -L /bin ]; then PATH=/bin:$PATH; fi</parameter></term> 141 <listitem> 142 <para>If <filename class="directory">/bin</filename> is not a symbolic 143 link, then it has to be added to the <envar>PATH</envar> variable.</para> 144 </listitem> 145 </varlistentry> 146 147 <varlistentry> 148 <term><parameter>PATH=$LFS/tools/bin:$PATH</parameter></term> 149 <listitem> 150 <para>By putting <filename class="directory">$LFS/tools/bin</filename> ahead of the 151 standard <envar>PATH</envar>, the cross-compiler installed at the beginning 152 of <xref linkend="chapter-cross-tools"/> is picked up by the shell 153 immediately after its installation. This, combined with turning off hashing, 154 limits the risk that the compiler from the host be used instead of the 155 cross-compiler.</para> 130 156 </listitem> 131 157 </varlistentry> … … 135 161 <listitem> 136 162 <para>While the above commands have set some variables, in order 137 to make them visible within any sub-shells, we export them </para>163 to make them visible within any sub-shells, we export them.</para> 138 164 </listitem> 139 165 </varlistentry> 140 166 141 167 </variablelist> 168 169 <important> 170 171 <para>Several commercial distributions add a non-documented instantiation 172 of <filename>/etc/bash.bashrc</filename> to the initialization of 173 <command>bash</command>. This file has the potential to modify the 174 <systemitem class="username">lfs</systemitem> 175 user's environment in ways that can affect the building of critical LFS 176 packages. To make sure the <systemitem class="username">lfs</systemitem> 177 user's envronment is clean, check for the 178 presence of <filename>/etc/bash.bashrc</filename> and, if present, move it 179 out of the way. As the <systemitem class="username">root</systemitem> 180 user, run:</para> 181 182 <screen role="nodump"><userinput>[ ! -e /etc/bash.bashrc ] || mv -v /etc/bash.bashrc /etc/bash.bashrc.NOUSE</userinput></screen> 183 184 <para>After use of the <systemitem class="username">lfs</systemitem> 185 user is finished at the beginning of <xref 186 linkend="chapter-chroot-temporary-tools"/>, you can restore 187 <filename>/etc/bash.bashrc</filename> (if desired).</para> 188 189 <para>Note that the LFS Bash package we will build in 190 <xref linkend="ch-system-bash"/> is not configured to load or execute 191 <filename>/etc/bash.bashrc</filename>, so this file is useless on a 192 completed LFS system.</para> 193 </important> 142 194 143 195 <para>Finally, to have the environment fully prepared for building the
Note:
See TracChangeset
for help on using the changeset viewer.