1 | <chapter id="chapter06" xreflabel="Chapter 6">
|
---|
2 | <title>Installing basic system software</title>
|
---|
3 | <?dbhtml filename="chapter06.html" dir="chapter06"?>
|
---|
4 |
|
---|
5 |
|
---|
6 | <sect1 id="ch06-introduction">
|
---|
7 | <title>Introduction</title>
|
---|
8 | <?dbhtml filename="introduction.html" dir="chapter06"?>
|
---|
9 |
|
---|
10 | <para>In this chapter we enter the building site, and start
|
---|
11 | constructing our LFS system in earnest. That is, we chroot into
|
---|
12 | our temporary mini Linux system, create some auxiliary things,
|
---|
13 | and then start installing all the packages, one by one.</para>
|
---|
14 |
|
---|
15 | <para>The installation of all this software is pretty straightforward,
|
---|
16 | and you will probably think it would be much shorter to give here
|
---|
17 | the generic installation instructions and explain in full only the
|
---|
18 | installation of those packages that require an alternate method.
|
---|
19 | Although we agree with that, we nevertheless choose to give the
|
---|
20 | full instructions for each and every package, simply to minimize
|
---|
21 | the possibilities for mistakes.</para>
|
---|
22 |
|
---|
23 | <para>The key to learning what makes a Linux system work is to know
|
---|
24 | what each package is used for and why the user (or the system) needs it.
|
---|
25 | For this purpose for every installed package a summary of its content is
|
---|
26 | given followed by concise descriptions of each program and library it
|
---|
27 | installed.</para>
|
---|
28 |
|
---|
29 | <para>If you plan to use compiler optimizations in this chapter, take a look at
|
---|
30 | the optimization hint at <ulink url="&hints-root;optimization.txt"/>. Compiler
|
---|
31 | optimizations can make a program run slightly faster, but they may also cause
|
---|
32 | compilation difficulties and even problems when running the program. If a
|
---|
33 | package refuses to compile when using optimization, try to compile it without
|
---|
34 | optimization and see if the problem goes away. Even if the package does compile
|
---|
35 | when using optimization, there is the risk it may have been compiled incorrectly
|
---|
36 | due to complex interactions between the code and build tools. In short, the
|
---|
37 | small potential gains achieved in using compiler optimization are generally
|
---|
38 | outweighed by the risk. First time builders of LFS are encouraged to build
|
---|
39 | without custom optimizations. Your system will still be very fast and very
|
---|
40 | stable at the same time.</para>
|
---|
41 |
|
---|
42 | <para>The order in which packages are installed in this chapter has
|
---|
43 | to be strictly followed, to ensure that no program gets a path referring
|
---|
44 | to <filename class="directory">/tools</filename> hard-wired into it.
|
---|
45 | For the same reason, <emphasis>do not </emphasis> compile packages
|
---|
46 | in parallel. Compiling in parallel may save you some time (especially on
|
---|
47 | dual-CPU machines), but it could result in a program containing a
|
---|
48 | hard-wired path to <filename class="directory">/tools</filename>,
|
---|
49 | which will cause the program to stop working when that directory
|
---|
50 | is removed.</para>
|
---|
51 |
|
---|
52 | </sect1>
|
---|
53 |
|
---|
54 |
|
---|
55 | <sect1 id="ch06-chroot">
|
---|
56 | <title>Entering the chroot environment</title>
|
---|
57 | <?dbhtml filename="chroot.html" dir="chapter06"?>
|
---|
58 |
|
---|
59 | <para>It is time to enter the chroot environment in order to begin installing
|
---|
60 | the packages we need. Before you can chroot, however, you need to become
|
---|
61 | <emphasis>root</emphasis>, since only <emphasis>root</emphasis>
|
---|
62 | can execute the <userinput>chroot</userinput> command.</para>
|
---|
63 |
|
---|
64 | <para>Just like earlier, ensure the LFS environment variable is set up properly
|
---|
65 | by running <userinput>echo $LFS</userinput> and ensuring it shows the path to
|
---|
66 | your LFS partition's mount point, which is
|
---|
67 | <filename class="directory">/mnt/lfs</filename> if you followed our
|
---|
68 | example.</para>
|
---|
69 |
|
---|
70 | <para>Become <emphasis>root</emphasis> and run the following command
|
---|
71 | to enter the chroot environment:</para>
|
---|
72 |
|
---|
73 | <screen><userinput>chroot $LFS /tools/bin/env -i \
|
---|
74 | HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
---|
75 | PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
|
---|
76 | /tools/bin/bash --login +h</userinput></screen>
|
---|
77 |
|
---|
78 | <para>The <userinput>-i</userinput> option given to the
|
---|
79 | <userinput>env</userinput> command will clear all variables of the chroot
|
---|
80 | environment. After that, only the HOME, TERM, PS1 and PATH variables are
|
---|
81 | set again. The TERM=$TERM construct will set the TERM variable inside chroot
|
---|
82 | to the same value as outside chroot; this variable is needed for programs
|
---|
83 | like <userinput>vim</userinput> and <userinput>less</userinput> to operate
|
---|
84 | properly. If you need other variables present, such as CFLAGS or CXXFLAGS,
|
---|
85 | this is a good place to set them again.</para>
|
---|
86 |
|
---|
87 | <para>From this point on there's no need to use the LFS variable anymore,
|
---|
88 | because everything you do will be restricted to the LFS file system -- since
|
---|
89 | what the shell thinks is <filename class="directory">/</filename> is actually
|
---|
90 | the value of <filename class="directory">$LFS</filename>, which was passed to
|
---|
91 | the chroot command.</para>
|
---|
92 |
|
---|
93 | <para>Notice that <filename class="directory">/tools/bin</filename> comes
|
---|
94 | last in the PATH. This means that a temporary tool will not be used any more
|
---|
95 | as soon as its final version is installed. Well, at least when the shell
|
---|
96 | doesn't remember the locations of executed binaries -- for this reason hashing
|
---|
97 | is switched off by passing the <userinput>+h</userinput> option to
|
---|
98 | <userinput>bash</userinput>.</para>
|
---|
99 |
|
---|
100 | <para>You have to make sure all the commands in the rest of this chapter and
|
---|
101 | in the following chapters are run from within the chroot environment.
|
---|
102 | If you ever leave this environment for any reason (rebooting for example),
|
---|
103 | you must remember to again enter chroot and mount the proc and devpts
|
---|
104 | filesystems (discussed later) before continuing with the installations.</para>
|
---|
105 |
|
---|
106 | <para>Note that the bash prompt will say "I have no name!" This is
|
---|
107 | normal, as the <filename>/etc/passwd</filename> file has not been
|
---|
108 | created yet.</para>
|
---|
109 |
|
---|
110 | </sect1>
|
---|
111 |
|
---|
112 |
|
---|
113 | <sect1 id="ch06-changingowner">
|
---|
114 | <title>Changing ownership</title>
|
---|
115 | <?dbhtml filename="changingowner.html" dir="chapter06"?>
|
---|
116 |
|
---|
117 | <para>Right now the <filename class="directory">/tools</filename> directory
|
---|
118 | is owned by the user <emphasis>lfs</emphasis>, a user that exists only on your
|
---|
119 | host system. Although you will probably want to delete the
|
---|
120 | <filename class="directory">/tools</filename> directory once you have
|
---|
121 | finished your LFS system, you may want to keep it around, for example to
|
---|
122 | build more LFS systems. But if you keep the
|
---|
123 | <filename class="directory">/tools</filename> directory as it is, you end up
|
---|
124 | with files owned by a user ID without a corresponding account. This is
|
---|
125 | dangerous because a user account created later on could get this same user ID
|
---|
126 | and would suddenly own the <filename class="directory">/tools</filename>
|
---|
127 | directory and all the files therein, thus exposing these files to possible
|
---|
128 | malicious manipulation.</para>
|
---|
129 |
|
---|
130 | <para>To avoid this issue, you could add the <emphasis>lfs</emphasis> user to
|
---|
131 | your new LFS system later on when creating the <filename>/etc/passwd</filename>
|
---|
132 | file, taking care to assign it the same user and group IDs as on your host
|
---|
133 | system. Alternatively, you can (and the book assumes you do) assign the
|
---|
134 | contents of the <filename class="directory">/tools</filename> directory to
|
---|
135 | user <emphasis>root</emphasis> by running the following command:</para>
|
---|
136 |
|
---|
137 | <screen><userinput>chown -R 0:0 /tools</userinput></screen>
|
---|
138 |
|
---|
139 | <para>The command uses "0:0" instead of "root:root", because
|
---|
140 | <userinput>chown</userinput> is unable to resolve the name "root" until the
|
---|
141 | password file has been created.</para>
|
---|
142 |
|
---|
143 | </sect1>
|
---|
144 |
|
---|
145 |
|
---|
146 | <sect1 id="ch06-creatingdirs">
|
---|
147 | <title>Creating directories</title>
|
---|
148 | <?dbhtml filename="creatingdirs.html" dir="chapter06"?>
|
---|
149 |
|
---|
150 | <para>Let's now create some structure in our LFS file system. Let's create
|
---|
151 | a directory tree. Issuing the following commands will create a more or less
|
---|
152 | standard tree:</para>
|
---|
153 |
|
---|
154 | <screen><userinput>mkdir -p /{bin,boot,dev/{pts,shm},etc/opt,home,lib,mnt,proc}
|
---|
155 | mkdir -p /{root,sbin,tmp,usr/local,var,opt}
|
---|
156 | for dirname in /usr /usr/local
|
---|
157 | do
|
---|
158 | mkdir $dirname/{bin,etc,include,lib,sbin,share,src}
|
---|
159 | ln -s share/{man,doc,info} $dirname
|
---|
160 | mkdir $dirname/share/{doc,info,locale,man}
|
---|
161 | mkdir $dirname/share/{misc,terminfo,zoneinfo}
|
---|
162 | mkdir $dirname/share/man/man{1,2,3,4,5,6,7,8}
|
---|
163 | done
|
---|
164 | mkdir /var/{lock,log,mail,run,spool}
|
---|
165 | mkdir -p /var/{tmp,opt,cache,lib/misc,local}
|
---|
166 | mkdir /opt/{bin,doc,include,info}
|
---|
167 | mkdir -p /opt/{lib,man/man{1,2,3,4,5,6,7,8}}</userinput></screen>
|
---|
168 |
|
---|
169 | <para>Directories are, by default, created with permission mode 755, but this
|
---|
170 | isn't desirable for all directories. We will make two changes: one to the home
|
---|
171 | directory of <emphasis>root</emphasis>, and another to the directories for
|
---|
172 | temporary files.</para>
|
---|
173 |
|
---|
174 | <screen><userinput>chmod 0750 /root
|
---|
175 | chmod 1777 /tmp /var/tmp</userinput></screen>
|
---|
176 |
|
---|
177 | <para>The first mode change ensures that not just anybody can enter the
|
---|
178 | <filename class="directory">/root</filename> directory -- the same
|
---|
179 | as a normal user would do with his or her home directory.
|
---|
180 | The second mode change makes sure that any user can write to the
|
---|
181 | <filename class="directory">/tmp</filename> and
|
---|
182 | <filename class="directory">/var/tmp</filename> directories, but
|
---|
183 | cannot remove other users' files from them. The latter is prohibited
|
---|
184 | by the so-called "sticky bit" -- the highest bit in the 1777 bit mask.</para>
|
---|
185 |
|
---|
186 | <sect2>
|
---|
187 | <title>FHS compliance note</title>
|
---|
188 |
|
---|
189 | <para>We have based our directory tree on the FHS standard (available at
|
---|
190 | <ulink url="http://www.pathname.com/fhs/"/>). Besides the above created
|
---|
191 | tree this standard stipulates the existence of
|
---|
192 | <filename class="directory">/usr/local/games</filename> and
|
---|
193 | <filename class="directory">/usr/share/games</filename>, but we don't
|
---|
194 | much like these for a base system. However, feel free to make your system
|
---|
195 | FHS-compliant. As to the structure of the
|
---|
196 | <filename class="directory">/usr/local/share</filename> subdirectory, the FHS
|
---|
197 | isn't precise, so we created here the directories that we think are needed.</para>
|
---|
198 |
|
---|
199 | </sect2>
|
---|
200 |
|
---|
201 | </sect1>
|
---|
202 |
|
---|
203 |
|
---|
204 | &c6-mountproc;
|
---|
205 |
|
---|
206 |
|
---|
207 | <sect1 id="ch06-createfiles">
|
---|
208 | <title>Creating essential symlinks</title>
|
---|
209 | <?dbhtml filename="createfiles.html" dir="chapter06"?>
|
---|
210 |
|
---|
211 | <para>Some programs hard-wire paths to programs which don't exist yet. In
|
---|
212 | order to satisfy these programs, we create a number of symbolic links which
|
---|
213 | will be replaced by real files throughout the course of this chapter when
|
---|
214 | we're installing all the software.</para>
|
---|
215 |
|
---|
216 | <screen><userinput>ln -s /tools/bin/{bash,cat,pwd,stty} /bin
|
---|
217 | ln -s /tools/bin/perl /usr/bin
|
---|
218 | ln -s /tools/lib/libgcc_s.so.1 /usr/lib
|
---|
219 | ln -s bash /bin/sh</userinput></screen>
|
---|
220 |
|
---|
221 | </sect1>
|
---|
222 |
|
---|
223 |
|
---|
224 | <sect1 id="ch06-pwdgroup">
|
---|
225 | <title>Creating the passwd and group files</title>
|
---|
226 | <?dbhtml filename="pwdgroup.html" dir="chapter06"?>
|
---|
227 |
|
---|
228 | <para>In order for <emphasis>root</emphasis> to be able to login and for the
|
---|
229 | name "root" to be recognized, there need to be relevant entries in the
|
---|
230 | <filename>/etc/passwd</filename> and <filename>/etc/group</filename> files.</para>
|
---|
231 |
|
---|
232 | <para>Create the <filename>/etc/passwd</filename> file by running the following
|
---|
233 | command:</para>
|
---|
234 |
|
---|
235 | <screen><userinput>cat > /etc/passwd << "EOF"</userinput>
|
---|
236 | root:x:0:0:root:/root:/bin/bash
|
---|
237 | <userinput>EOF</userinput></screen>
|
---|
238 |
|
---|
239 | <para>The actual password for <emphasis>root</emphasis> (the "x" here is just a
|
---|
240 | placeholder) will be set later.</para>
|
---|
241 |
|
---|
242 | <para>Create the <filename>/etc/group</filename> file by running the following
|
---|
243 | command:</para>
|
---|
244 |
|
---|
245 | <screen><userinput>cat > /etc/group << "EOF"</userinput>
|
---|
246 | root:x:0:
|
---|
247 | bin:x:1:
|
---|
248 | sys:x:2:
|
---|
249 | kmem:x:3:
|
---|
250 | tty:x:4:
|
---|
251 | tape:x:5:
|
---|
252 | daemon:x:6:
|
---|
253 | floppy:x:7:
|
---|
254 | disk:x:8:
|
---|
255 | lp:x:9:
|
---|
256 | dialout:x:10:
|
---|
257 | audio:x:11:
|
---|
258 | <userinput>EOF</userinput></screen>
|
---|
259 |
|
---|
260 | <para>The created groups aren't part of any standard -- they are the groups
|
---|
261 | that the MAKEDEV script in the next section uses. Besides the group "root", the
|
---|
262 | LSB (<ulink url="http://www.linuxbase.org"/>) recommends only a group "bin",
|
---|
263 | with a GID of 1, be present. All other group names and GIDs can be chosen
|
---|
264 | freely by the user, as well-written packages don't depend on GID numbers but
|
---|
265 | use the group's name.</para>
|
---|
266 |
|
---|
267 | <para>Lastly, we re-login to the chroot environment. User name and group name
|
---|
268 | resolution will start working immediately after the
|
---|
269 | <filename>/etc/passwd</filename> and <filename>/etc/group</filename> files are
|
---|
270 | created, because we installed a full Glibc in Chapter 5. This will get rid of
|
---|
271 | the <quote>I have no name!</quote> prompt.</para>
|
---|
272 |
|
---|
273 | <screen><userinput>exec /tools/bin/bash --login +h</userinput></screen>
|
---|
274 |
|
---|
275 | <para>Note the use of the <userinput>+h</userinput> directive. This tells
|
---|
276 | <userinput>bash</userinput> not to use its internal path hashing. Without this
|
---|
277 | directive, <userinput>bash</userinput> would remember the paths to binaries it
|
---|
278 | has executed. Since we want to use our newly compiled binaries as soon as
|
---|
279 | they are installed, we turn off this function for the duration of this
|
---|
280 | chapter.</para>
|
---|
281 |
|
---|
282 | </sect1>
|
---|
283 |
|
---|
284 |
|
---|
285 | &c6-makedev;
|
---|
286 | &c6-kernel;
|
---|
287 | &c6-manpages;
|
---|
288 | &c6-glibc;
|
---|
289 |
|
---|
290 |
|
---|
291 | <sect1 id="ch06-adjustingtoolchain">
|
---|
292 | <title>Re-adjusting the toolchain</title>
|
---|
293 | <?dbhtml filename="adjustingtoolchain.html" dir="chapter06"?>
|
---|
294 |
|
---|
295 | <para>Now that the new C libraries have been installed, it's time to re-adjust
|
---|
296 | our toolchain. We'll adjust it so that it will link any newly compiled program
|
---|
297 | against the new C libraries. Basically, this is the reverse of what we did
|
---|
298 | in the "locking in" stage in the beginning of the previous chapter.</para>
|
---|
299 |
|
---|
300 | <para>The first thing to do is to adjust the linker. For this we retained the
|
---|
301 | source and build directories from the second pass over Binutils. Install the
|
---|
302 | adjusted linker by running the following from within the
|
---|
303 | <filename class="directory">binutils-build</filename> directory:</para>
|
---|
304 |
|
---|
305 | <screen><userinput>make -C ld INSTALL=/tools/bin/install install</userinput></screen>
|
---|
306 |
|
---|
307 | <note><para>If you somehow missed the earlier warning to retain the Binutils
|
---|
308 | source and build directories from the second pass in Chapter 5 or otherwise
|
---|
309 | accidentally deleted them or just don't have access to them, don't worry, all is
|
---|
310 | not lost. Just ignore the above command. The result will be that the next
|
---|
311 | package, Binutils, will link against the Glibc libraries in
|
---|
312 | <filename class="directory">/tools</filename> rather than
|
---|
313 | <filename class="directory">/usr</filename>. This is not ideal, however, our
|
---|
314 | testing has shown that the resulting Binutils program binaries should be
|
---|
315 | identical.</para></note>
|
---|
316 |
|
---|
317 | <para>From now on every compiled program will link <emphasis>only</emphasis>
|
---|
318 | against the libraries in <filename>/usr/lib</filename> and
|
---|
319 | <filename>/lib</filename>. The extra
|
---|
320 | <userinput>INSTALL=/tools/bin/install</userinput> is needed because the Makefile
|
---|
321 | created during the second pass still contains the reference to
|
---|
322 | <filename>/usr/bin/install</filename>, which we obviously haven't installed yet.
|
---|
323 | Some host distributions contain a <filename class="symlink">ginstall</filename>
|
---|
324 | symbolic link which takes precedence in the Makefile and thus can cause a
|
---|
325 | problem here. The above command takes care of this also.</para>
|
---|
326 |
|
---|
327 | <para>You can now remove the Binutils source and build directories.</para>
|
---|
328 |
|
---|
329 | <para>The next thing to do is to amend our GCC specs file so that it points
|
---|
330 | to the new dynamic linker. Just like earlier on, we use a sed to accomplish
|
---|
331 | this:</para>
|
---|
332 |
|
---|
333 | <!-- Ampersands are needed to allow cut and paste -->
|
---|
334 |
|
---|
335 | <screen><userinput>SPECFILE=/tools/lib/gcc-lib/*/*/specs &&
|
---|
336 | sed -e 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g' \
|
---|
337 | $SPECFILE > newspecfile &&
|
---|
338 | mv -f newspecfile $SPECFILE &&
|
---|
339 | unset SPECFILE</userinput></screen>
|
---|
340 |
|
---|
341 | <para>Again, cutting and pasting the above is recommended. And just like
|
---|
342 | before, it is a good idea to check the specs file to ensure the intended
|
---|
343 | changes were actually made.</para>
|
---|
344 |
|
---|
345 | <important><para>If you are working on a platform where the name of the dynamic
|
---|
346 | linker is something other than <filename>ld-linux.so.2</filename>, you
|
---|
347 | <emphasis>must</emphasis> substitute <filename>ld-linux.so.2</filename> with the
|
---|
348 | name of your platform's dynamic linker in the above commands. Refer back to
|
---|
349 | <xref linkend="ch05-toolchaintechnotes"/> if necessary.</para></important>
|
---|
350 |
|
---|
351 | <!-- HACK - Force some whitespace to appease tidy -->
|
---|
352 | <literallayout></literallayout>
|
---|
353 |
|
---|
354 | <caution><para>It is imperative at this point to stop and ensure that the
|
---|
355 | basic functions (compiling and linking) of the adjusted toolchain are working
|
---|
356 | as expected. For this we are going to perform a simple sanity check:</para>
|
---|
357 |
|
---|
358 | <screen><userinput>echo 'main(){}' > dummy.c
|
---|
359 | gcc dummy.c
|
---|
360 | readelf -l a.out | grep ': /lib'</userinput></screen>
|
---|
361 |
|
---|
362 | <para>If everything is working correctly, there should be no errors, and the
|
---|
363 | output of the last command will be:</para>
|
---|
364 |
|
---|
365 | <blockquote><screen>[Requesting program interpreter: /lib/ld-linux.so.2]</screen></blockquote>
|
---|
366 |
|
---|
367 | <para>If you did not receive the output as shown above, or received no output at
|
---|
368 | all, then something is seriously wrong. You will need to investigate and retrace
|
---|
369 | your steps to find out where the problem is and correct it. There is no point in
|
---|
370 | continuing until this is done. Most likely something went wrong with the specs
|
---|
371 | file amendment above. Note especially that <filename>/lib</filename> now appears
|
---|
372 | as the prefix of our dynamic linker. Of course, if you are working on a platform
|
---|
373 | where the name of the dynamic linker is something other than
|
---|
374 | <filename>ld-linux.so.2</filename>, then the output will be slightly
|
---|
375 | different.</para>
|
---|
376 |
|
---|
377 | <para>Once you are satisfied that all is well, clean up the test files:</para>
|
---|
378 |
|
---|
379 | <screen><userinput>rm dummy.c a.out</userinput></screen>
|
---|
380 | </caution>
|
---|
381 |
|
---|
382 | <!-- HACK - Force some whitespace to appease tidy -->
|
---|
383 | <literallayout></literallayout>
|
---|
384 |
|
---|
385 | </sect1>
|
---|
386 |
|
---|
387 |
|
---|
388 | &c6-binutils;
|
---|
389 | &c6-gcc;
|
---|
390 |
|
---|
391 | &c6-coreutils;
|
---|
392 | &c6-zlib;
|
---|
393 | &c6-lfs-utils;
|
---|
394 | &c6-findutils;
|
---|
395 | &c6-gawk;
|
---|
396 | &c6-ncurses;
|
---|
397 | &c6-vim;
|
---|
398 | &c6-m4;
|
---|
399 | &c6-bison;
|
---|
400 | &c6-less;
|
---|
401 | &c6-groff;
|
---|
402 | &c6-sed;
|
---|
403 | &c6-flex;
|
---|
404 | &c6-gettext;
|
---|
405 | &c6-nettools;
|
---|
406 | &c6-inetutils;
|
---|
407 | &c6-perl;
|
---|
408 | &c6-texinfo;
|
---|
409 | &c6-autoconf;
|
---|
410 | &c6-automake;
|
---|
411 | &c6-bash;
|
---|
412 | &c6-file;
|
---|
413 | &c6-libtool;
|
---|
414 | &c6-bzip2;
|
---|
415 | &c6-diffutils;
|
---|
416 | &c6-ed;
|
---|
417 | &c6-kbd;
|
---|
418 | &c6-e2fsprogs;
|
---|
419 | &c6-grep;
|
---|
420 | &c6-grub;
|
---|
421 | &c6-gzip;
|
---|
422 | &c6-man;
|
---|
423 | &c6-make;
|
---|
424 | &c6-modutils;
|
---|
425 | &c6-patch;
|
---|
426 | &c6-procinfo;
|
---|
427 | &c6-procps;
|
---|
428 | &c6-psmisc;
|
---|
429 | &c6-shadowpwd;
|
---|
430 | &c6-sysklogd;
|
---|
431 | &c6-sysvinit;
|
---|
432 | &c6-tar;
|
---|
433 | &c6-utillinux;
|
---|
434 | &c6-gcc-2953;
|
---|
435 |
|
---|
436 |
|
---|
437 | <sect1 id="ch06-revisedchroot">
|
---|
438 | <title>Revised chroot command</title>
|
---|
439 | <?dbhtml filename="revisedchroot.html" dir="chapter06"?>
|
---|
440 |
|
---|
441 | <para>From now on when you exit the chroot environment and wish to re-enter
|
---|
442 | it, you should run the following modified chroot command:</para>
|
---|
443 |
|
---|
444 | <screen><userinput>chroot $LFS /usr/bin/env -i \
|
---|
445 | HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
---|
446 | PATH=/bin:/usr/bin:/sbin:/usr/sbin \
|
---|
447 | /bin/bash --login</userinput></screen>
|
---|
448 |
|
---|
449 | <para>The reason being there is no longer any need to use programs from the
|
---|
450 | <filename class="directory">/tools</filename> directory. However, we don't
|
---|
451 | want to remove the <filename class="directory">/tools</filename> directory
|
---|
452 | just yet. There is still some use for it towards the end of the book.</para>
|
---|
453 |
|
---|
454 | </sect1>
|
---|
455 |
|
---|
456 |
|
---|
457 | &c6-bootscripts;
|
---|
458 | &c6-aboutdebug;
|
---|
459 |
|
---|
460 | </chapter>
|
---|
461 |
|
---|