mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-03-06 06:14:47 +00:00
Removing HOME and --login from the chroot commands.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3285 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
c6b5ddb7a6
commit
5b7293ab71
@ -36,6 +36,12 @@ first a summary, then a detailed log.</para>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
|
||||
<listitem><para>March 9th, 2004 [alex]: Chapter 6 - Removed HOME and --login
|
||||
from the chroot commands.</para></listitem>
|
||||
|
||||
<listitem><para>March 6th, 2004 [alex]: Rotated the contents of chapters 2, 3
|
||||
and 4.</para></listitem>
|
||||
|
||||
<listitem><para>February 27th, 2004 [jeremy]: Upgraded to
|
||||
Procps-3.2.0.</para></listitem>
|
||||
|
||||
|
@ -38,7 +38,7 @@ patch:</para>
|
||||
|
||||
<para>And reload the newly compiled <command>bash</command> program:</para>
|
||||
|
||||
<screen><userinput>exec /bin/bash --login +h</userinput></screen>
|
||||
<screen><userinput>exec /bin/bash +h</userinput></screen>
|
||||
|
||||
</sect2>
|
||||
|
||||
|
@ -129,18 +129,18 @@ the following command to enter the small world that is, at the moment,
|
||||
populated with only the temporary tools:</para>
|
||||
|
||||
<screen><userinput>chroot $LFS /tools/bin/env -i \
|
||||
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
||||
TERM=$TERM PS1='\u:\w\$ ' \
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
|
||||
/tools/bin/bash --login +h</userinput></screen>
|
||||
/tools/bin/bash +h</userinput></screen>
|
||||
|
||||
<para>The <emphasis>-i</emphasis> option given to the
|
||||
<command>env</command> command will clear all variables of the chroot
|
||||
environment. After that, only the HOME, TERM, PS1 and PATH variables are
|
||||
environment. After that, only the TERM, PS1 and PATH variables are
|
||||
set again. The TERM=$TERM construct will set the TERM variable inside chroot
|
||||
to the same value as outside chroot; this variable is needed for programs
|
||||
like <command>vim</command> and <command>less</command> to operate
|
||||
properly. If you need other variables present, such as CFLAGS or CXXFLAGS,
|
||||
this is a good place to set them again.</para>
|
||||
like <command>less</command> and <command>vim</command> to operate
|
||||
properly. If you need other variables present, such as CFLAGS, CXXFLAGS or
|
||||
HOME, this is a good place to set them.</para>
|
||||
|
||||
<para>From this point on there's no need to use the LFS variable anymore,
|
||||
because everything you do will be restricted to the LFS file system -- since
|
||||
@ -328,7 +328,7 @@ and have just created the <filename>/etc/passwd</filename> and
|
||||
<filename>/etc/group</filename> files, user name and group name resolution
|
||||
will now work.</para>
|
||||
|
||||
<screen><userinput>exec /tools/bin/bash --login +h</userinput></screen>
|
||||
<screen><userinput>exec /tools/bin/bash +h</userinput></screen>
|
||||
|
||||
<para>Note the use of the <emphasis>+h</emphasis> directive. This tells
|
||||
<command>bash</command> not to use its internal path hashing. Without this
|
||||
@ -580,9 +580,9 @@ If you're not sure whether you entered chroot with the command given in
|
||||
<para>Then reenter it with:</para>
|
||||
|
||||
<screen><userinput>chroot $LFS /tools/bin/env -i \
|
||||
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
||||
TERM=$TERM PS1='\u:\w\$ ' \
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
|
||||
/tools/bin/bash --login</userinput></screen>
|
||||
/tools/bin/bash</userinput></screen>
|
||||
|
||||
<para>Now you can safely strip the binaries and libraries:</para>
|
||||
|
||||
@ -610,9 +610,9 @@ destroyed.</para>
|
||||
it, you should use the following modified chroot command:</para>
|
||||
|
||||
<screen><userinput>chroot $LFS /usr/bin/env -i \
|
||||
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
||||
TERM=$TERM PS1='\u:\w\$ ' \
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
|
||||
/bin/bash --login</userinput></screen>
|
||||
/bin/bash</userinput></screen>
|
||||
|
||||
<para>The reason for this is that, since the programs in <filename
|
||||
class="directory">/tools</filename> are no longer needed, you may want to
|
||||
|
@ -45,14 +45,7 @@ of files and users that aren't valid yet this early in the LFS build. We will
|
||||
therefore have to set up a few things before being able to run the tests. If
|
||||
you choose not to run these tests, skip down to "Install the package".</para>
|
||||
|
||||
<para>To be able to run the full test suite, the <command>su</command> program
|
||||
needs to be installed. We didn't bother to install this little program in
|
||||
<xref linkend="chapter-temporary-tools"/> because it requires root privileges,
|
||||
so do it now:</para>
|
||||
|
||||
<screen><userinput>make install-root</userinput></screen>
|
||||
|
||||
<para>Create a 'table of mounted filesystems' file with:</para>
|
||||
<para>First create a 'table of mounted filesystems' file with:</para>
|
||||
|
||||
<screen><userinput>touch /etc/mtab</userinput></screen>
|
||||
|
||||
@ -70,7 +63,11 @@ are meant to be run as <emphasis>root</emphasis>:</para>
|
||||
<para>Then run the remainder of the tests as the <emphasis>dummy</emphasis>
|
||||
user:</para>
|
||||
|
||||
<screen><userinput>su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>
|
||||
<screen><userinput>src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>
|
||||
|
||||
<para>The above command uses the newly compiled <command>src/su</command>
|
||||
program, since in <xref linkend="chapter-temporary-tools"/> we didn't bother to
|
||||
install it, because installing it requires root privileges.</para>
|
||||
|
||||
<para>When you're done testing, remove the dummy user and groups:</para>
|
||||
|
||||
|
@ -24,7 +24,8 @@
|
||||
<screen><userinput>make</userinput></screen>
|
||||
|
||||
<para>To have the results tested, issue:
|
||||
<userinput>make check</userinput>.</para>
|
||||
<userinput>make HOME=/root check</userinput>. The HOME environment variable
|
||||
needs to be set to prevent one of the tests from failing.</para>
|
||||
|
||||
<para>And install the package:</para>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user