From 5b7293ab71a253046b37850efe349b15692ad4fd Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Tue, 9 Mar 2004 19:08:33 +0000 Subject: Removing HOME and --login from the chroot commands. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3285 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/bash.xml | 2 +- chapter06/chapter06.xml | 22 +++++++++++----------- chapter06/coreutils.xml | 15 ++++++--------- chapter06/make.xml | 3 ++- 4 files changed, 20 insertions(+), 22 deletions(-) (limited to 'chapter06') diff --git a/chapter06/bash.xml b/chapter06/bash.xml index f0c2e1b57..aa38ef855 100644 --- a/chapter06/bash.xml +++ b/chapter06/bash.xml @@ -38,7 +38,7 @@ patch: And reload the newly compiled bash program: -exec /bin/bash --login +h +exec /bin/bash +h diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index b8ab3f3a9..da1ae8126 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -129,18 +129,18 @@ the following command to enter the small world that is, at the moment, populated with only the temporary tools: 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 +    /tools/bin/bash +h The -i option given to the env 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 vim and less to operate -properly. If you need other variables present, such as CFLAGS or CXXFLAGS, -this is a good place to set them again. +like less and vim to operate +properly. If you need other variables present, such as CFLAGS, CXXFLAGS or +HOME, this is a good place to set them. 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 /etc/passwd and /etc/group files, user name and group name resolution will now work. -exec /tools/bin/bash --login +h +exec /tools/bin/bash +h Note the use of the +h directive. This tells bash 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 Then reenter it with: 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 +    /tools/bin/bash Now you can safely strip the binaries and libraries: @@ -610,9 +610,9 @@ destroyed. it, you should use the following modified chroot command: 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 +    /bin/bash The reason for this is that, since the programs in /tools are no longer needed, you may want to diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index 1562d0598..24e7733e9 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -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". -To be able to run the full test suite, the su program -needs to be installed. We didn't bother to install this little program in - because it requires root privileges, -so do it now: - -make install-root - -Create a 'table of mounted filesystems' file with: +First create a 'table of mounted filesystems' file with: touch /etc/mtab @@ -70,7 +63,11 @@ are meant to be run as root: Then run the remainder of the tests as the dummy user: -su dummy -c "make RUN_EXPENSIVE_TESTS=yes check" +src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check" + +The above command uses the newly compiled src/su +program, since in we didn't bother to +install it, because installing it requires root privileges. When you're done testing, remove the dummy user and groups: diff --git a/chapter06/make.xml b/chapter06/make.xml index ed3542427..e3d034f30 100644 --- a/chapter06/make.xml +++ b/chapter06/make.xml @@ -24,7 +24,8 @@ make To have the results tested, issue: -make check. +make HOME=/root check. The HOME environment variable +needs to be set to prevent one of the tests from failing. And install the package: -- cgit v1.2.3-54-g00ecf