- Timestamp:
- 10/01/2022 10:30:12 PM (19 months ago)
- Branches:
- multilib
- Children:
- f3b2f16
- Parents:
- f29824e (diff), 4349661 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- chapter04
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter04/aboutsbus.xml
rf29824e rc093e6b 14 14 it takes to compile and install each package. Because Linux From 15 15 Scratch can be built on many different systems, it is impossible to 16 provide a ccurate time estimates. The biggest package (Glibc) will16 provide absolute time estimates. The biggest package (Glibc) will 17 17 take approximately 20 minutes on the fastest systems, but could take 18 18 up to three days on slower systems! Instead of providing actual times, … … 21 21 22 22 <para>The SBU measure works as follows. The first package to be compiled 23 from this bookis binutils in <xref linkend="chapter-cross-tools"/>. The24 time it takes to compile this package is what w ill be referredto as the25 Standard Build Unit or SBU. All other compile times will be expressed relative26 t o thistime.</para>23 is binutils in <xref linkend="chapter-cross-tools"/>. The 24 time it takes to compile this package is what we will refer to as the 25 Standard Build Unit or SBU. All other compile times will be expressed in 26 terms of this unit of time.</para> 27 27 28 28 <para>For example, consider a package whose compilation time is 4.5 29 SBUs. This means that if asystem took 10 minutes to compile and29 SBUs. This means that if your system took 10 minutes to compile and 30 30 install the first pass of binutils, it will take 31 <emphasis>approximately</emphasis> 45 minutes to build th isexample package.32 Fortunately, most build times are shorter than the one for binutils.</para>31 <emphasis>approximately</emphasis> 45 minutes to build the example package. 32 Fortunately, most build times are shorter than one SBU.</para> 33 33 34 <para> In general,SBUs are not entirely accurate because they depend on many34 <para>SBUs are not entirely accurate because they depend on many 35 35 factors, including the host system's version of GCC. They are provided here 36 36 to give an estimate of how long it might take to install a package, but the … … 46 46 <screen role="nodump"><userinput>export MAKEFLAGS='-j4'</userinput></screen> 47 47 48 <para>or justbuilding with:</para>48 <para>or by building with:</para> 49 49 50 50 <screen role="nodump"><userinput>make -j4</userinput></screen> … … 53 53 book will vary even more than they normally would. In some cases, the make 54 54 step will simply fail. Analyzing the output of the build process will also 55 be more difficult because the lines ofdifferent processes will be56 interleaved. If you run into a problem with a build step, revert backto a55 be more difficult because the lines from different processes will be 56 interleaved. If you run into a problem with a build step, revert to a 57 57 single processor build to properly analyze the error messages.</para> 58 58 </note> -
chapter04/abouttestsuites.xml
rf29824e rc093e6b 28 28 <para>Running the test suites in <xref linkend="chapter-cross-tools"/> 29 29 and <xref linkend="chapter-temporary-tools"/> 30 is impossible, since theprograms are compiled with a cross-compiler,31 so are not supposed to be able torun on the build host.</para>30 is pointless; since the test programs are compiled with a cross-compiler, 31 they probably can't run on the build host.</para> 32 32 </note> 33 33 34 34 <para>A common issue with running the test suites for binutils and GCC 35 is running out of pseudo terminals (PTYs). This can result in a high35 is running out of pseudo terminals (PTYs). This can result in a large 36 36 number of failing tests. This may happen for several reasons, but the 37 37 most likely cause is that the host system does not have the … … 40 40 <ulink url="&lfs-root;lfs/faq.html#no-ptys"/>.</para> 41 41 42 <para>Sometimes package test suites will fail , butfor reasons which the42 <para>Sometimes package test suites will fail for reasons which the 43 43 developers are aware of and have deemed non-critical. Consult the logs located 44 44 at <ulink url="&test-results;"/> to verify whether or not these failures are 45 expected. This site is valid for all test s throughout this book.</para>45 expected. This site is valid for all test suites throughout this book.</para> 46 46 47 47 </sect1> -
chapter04/addinguser.xml
rf29824e rc093e6b 15 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 working environment, create a new user called <systemitem17 working environment, we will create a new user called <systemitem 18 18 class="username">lfs</systemitem> as a member of a new group (also named 19 <systemitem class="groupname">lfs</systemitem>) and use this userduring19 <systemitem class="groupname">lfs</systemitem>) and run commands as &lfs-user; during 20 20 the installation process. As <systemitem class="username">root</systemitem>, 21 21 issue the following commands to add the new user:</para> … … 25 25 26 26 <variablelist> 27 <title>Th e meaning of the command line options:</title>27 <title>This is what the command line options mean:</title> 28 28 29 29 <varlistentry> … … 55 55 <listitem> 56 56 <para>This parameter prevents possible copying of files from a skeleton 57 directory ( default is <filename class="directory">/etc/skel</filename>)57 directory (the default is <filename class="directory">/etc/skel</filename>) 58 58 by changing the input location to the special null device.</para> 59 59 </listitem> … … 69 69 </variablelist> 70 70 71 <para> To log in as <systemitem class="username">lfs</systemitem> (as opposed72 to switching to user <systemitem class="username">lfs</systemitem> when logged73 in as <systemitem class="username">root</systemitem>, which does not require74 the <systemitem class="username">lfs</systemitem> user to have a password),75 give <systemitem class="username">lfs</systemitem> apassword:</para>71 <para>If you want to log in as &lfs-user; or switch to &lfs-user; from a 72 non-&root; user (as opposed to switching to user &lfs-user; 73 when logged in as &root;, which does not require the &lfs-user; user to 74 have a password), you need to set a password of &lfs-user;. Issue the 75 following command as the &root; user to set the password:</para> 76 76 77 77 <screen role="nodump"><userinput>passwd lfs</userinput></screen> 78 78 79 79 <para>Grant <systemitem class="username">lfs</systemitem> full access to 80 all directories under <filename class="directory">$LFS</filename> by making81 <systemitem class="username">lfs</systemitem> the directoryowner:</para>80 all the directories under <filename class="directory">$LFS</filename> by making 81 <systemitem class="username">lfs</systemitem> the owner:</para> 82 82 83 83 <screen><userinput>chown -v lfs $LFS/{usr{,/*},lib,var,etc,bin,sbin,tools} … … 89 89 <screen arch="ml_all" ><userinput>chown -v lfs $LFS/{lib32,libx32}</userinput></screen> 90 90 91 <note><para>In some host systems, the followingcommand does not complete92 properly and suspends the login tothe &lfs-user; user to the background.91 <note><para>In some host systems, the following <command>su</command> command does not complete 92 properly and suspends the login for the &lfs-user; user to the background. 93 93 If the prompt "lfs:~$" does not appear immediately, entering the 94 94 <command>fg</command> command will fix the issue.</para></note> 95 95 96 <para>Next, login as user <systemitem class="username">lfs</systemitem>.97 This can be done via a virtual console, through a display manager, or with98 the followingsubstitute/switch user command:</para>96 <para>Next, start a shell running as user &lfs-user;. This can be done by 97 logging in as &lfs-user; on a virtual console, or with the following 98 substitute/switch user command:</para> 99 99 100 100 <screen role="nodump"><userinput>su - lfs</userinput></screen> … … 102 102 <para>The <quote><parameter>-</parameter></quote> instructs 103 103 <command>su</command> to start a login shell as opposed to a non-login shell. 104 The difference between these two types of shells can be found in detail in104 The difference between these two types of shells is described in detail in 105 105 <filename>bash(1)</filename> and <command>info bash</command>.</para> 106 106 -
chapter04/creatingminlayout.xml
rf29824e rc093e6b 11 11 <title>Creating a limited directory layout in LFS filesystem</title> 12 12 13 <para>The first task performed in the LFS partition is to create a limited 14 directory hierarchy so that programs compiled in <xref 13 <para>In this section, we begin populating the LFS filesystem with the 14 pieces that will constitute the final Linux system. The first step is to 15 create a limited directory hierarchy, so that the programs compiled in <xref 15 16 linkend="chapter-temporary-tools"/> (as well as glibc and libstdc++ in <xref 16 linkend="chapter-cross-tools"/>) maybe installed in their final17 location. This is needed so that those temporary programs be overwritten18 when rebuilding themin <xref linkend="chapter-building-system"/>.</para>17 linkend="chapter-cross-tools"/>) can be installed in their final 18 location. We do this so those temporary programs will be overwritten when 19 the final versions are built in <xref linkend="chapter-building-system"/>.</para> 19 20 20 <para>Create the required directory layout by running the followingas21 <para>Create the required directory layout by issuing the following commands as 21 22 <systemitem class="username">root</systemitem>:</para> 22 23 … … 39 40 40 41 <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled 41 with a cross-compiler (more details in section <xref42 linkend="ch-tools-toolchaintechnotes"/>). In order to separate this43 cross-compiler from the other programs, it will be installed in a special44 directory. Create this directory with:</para>42 with a cross-compiler (more details can be found in section <xref 43 linkend="ch-tools-toolchaintechnotes"/>). This cross-compiler will be installed 44 in a special directory, to separate it from the other programs. Still acting as 45 &root;, create that directory with this command:</para> 45 46 46 47 <screen><userinput>mkdir -pv $LFS/tools</userinput></screen> -
chapter04/introduction.xml
rf29824e rc093e6b 13 13 <para>In this chapter, we will perform a few additional tasks to prepare 14 14 for building the temporary system. We will create a set of directories in 15 <filename class="directory">$LFS</filename> for the installation ofthe16 temporary tools , add an unprivileged user to reduce risk,15 <filename class="directory">$LFS</filename> (in which we will install the 16 temporary tools), add an unprivileged user, 17 17 and create an appropriate build environment for that user. We will also 18 explain the unit of time we use to measure how long LFS packages take to19 build, or <quote>SBUs</quote>, and give some information about package18 explain the units of time (<quote>SBUs</quote>) we use to measure how 19 long it takes to build LFS packages, and provide some information about package 20 20 test suites.</para> 21 21 -
chapter04/settingenviron.xml
rf29824e rc093e6b 20 20 EOF</userinput></screen> 21 21 22 <para>When logged on as user <systemitem class="username">lfs</systemitem>, 23 the initial shell is usually a <emphasis>login</emphasis> shell which reads 22 <para>When logged on as user <systemitem class="username">lfs</systemitem> 23 or switched to the &lfs-user; user using a <command>su</command> command 24 with <quote><parameter>-</parameter></quote> option, 25 the initial shell is a <emphasis>login</emphasis> shell which reads 24 26 the <filename>/etc/profile</filename> of the host (probably containing some 25 27 settings and environment variables) and then <filename>.bash_profile</filename>. … … 33 35 34 36 <para>The new instance of the shell is a <emphasis>non-login</emphasis> 35 shell, which does not read, and execute, the contents of <filename>/etc/profile</filename> or37 shell, which does not read, and execute, the contents of the <filename>/etc/profile</filename> or 36 38 <filename>.bash_profile</filename> files, but rather reads, and executes, the 37 39 <filename>.bashrc</filename> file instead. Create the … … 74 76 <command>bash</command>'s hash function. Hashing is ordinarily a useful 75 77 feature—<command>bash</command> uses a hash table to remember the 76 full path ofexecutable files to avoid searching the <envar>PATH</envar>78 full path to executable files to avoid searching the <envar>PATH</envar> 77 79 time and again to find the same executable. However, the new tools should 78 be used as soon as they are installed. By switching off the hash function,79 the shell will always search the <envar>PATH</envar> whena program is to80 be used as soon as they are installed. Switching off the hash function forces 81 the shell to search the <envar>PATH</envar> whenever a program is to 80 82 be run. As such, the shell will find the newly compiled tools in 81 83 <filename class="directory">$LFS/tools/bin</filename> as soon as they are … … 130 132 <term><parameter>PATH=/usr/bin</parameter></term> 131 133 <listitem> 132 <para>Many modern linux distributions have merged <filename134 <para>Many modern Linux distributions have merged <filename 133 135 class="directory">/bin</filename> and <filename 134 136 class="directory">/usr/bin</filename>. When this is the case, the standard 135 <envar>PATH</envar> variable needs just tobe set to <filename137 <envar>PATH</envar> variable should be set to <filename 136 138 class="directory">/usr/bin/</filename> for the <xref 137 139 linkend="chapter-temporary-tools"/> environment. When this is not the … … 156 158 of <xref linkend="chapter-cross-tools"/> is picked up by the shell 157 159 immediately after its installation. This, combined with turning off hashing, 158 limits the risk that the compiler from the host beused instead of the160 limits the risk that the compiler from the host is used instead of the 159 161 cross-compiler.</para> 160 162 </listitem> … … 210 212 211 213 <para>Finally, to have the environment fully prepared for building the 212 temporary tools, source the just-created user profile:</para> 214 temporary tools, force the <command>bash</command> shell to read 215 the new user profile:</para> 213 216 214 217 <screen><userinput>source ~/.bash_profile</userinput></screen>
Note:
See TracChangeset
for help on using the changeset viewer.