diff options
author | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2020-05-29 08:06:18 +0000 |
---|---|---|
committer | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2020-05-29 08:06:18 +0000 |
commit | 7406bece6f21f8edefd3b78480ba30cc704fb233 (patch) | |
tree | 3a2165a204e973477cca4e1342995226d3ace4e0 /chapter06 | |
parent | 51c960dfdf415e0a793d99ccc6e5e80f41649504 (diff) |
Add an unprivileged user, tester, at the
beginning of Chapter 6 for running some tests. This
user is then removed at the end of the chapter.
Update to zstd-1.4.5. Fixes
Update to util-linux-2.35.2. Fixes
Update to bison-3.6.2. Fixes
Update to linux-5.6.15. Fixes
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11864 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06')
-rw-r--r-- | chapter06/bash.xml | 16 | ||||
-rw-r--r-- | chapter06/coreutils.xml | 16 | ||||
-rw-r--r-- | chapter06/createfiles.xml | 6 | ||||
-rw-r--r-- | chapter06/gcc.xml | 6 | ||||
-rw-r--r-- | chapter06/revisedchroot.xml | 4 | ||||
-rw-r--r-- | chapter06/util-linux.xml | 4 | ||||
-rw-r--r-- | chapter06/vim.xml | 8 |
7 files changed, 34 insertions, 26 deletions
diff --git a/chapter06/bash.xml b/chapter06/bash.xml index 0c7f7f062..03a3e0614 100644 --- a/chapter06/bash.xml +++ b/chapter06/bash.xml @@ -73,23 +73,21 @@ <para>Skip down to <quote>Install the package</quote> if not running the test suite.</para> - <para>To prepare the tests, ensure that the <systemitem class="username">nobody</systemitem> user can write to the sources tree:</para> + <para>To prepare the tests, ensure that the <systemitem class="username">tester</systemitem> user can write to the sources tree:</para> -<screen><userinput remap="test">chown -Rv nobody .</userinput></screen> +<screen><userinput remap="test">chown -Rv tester .</userinput></screen> <para>Now, run the tests as the <systemitem - class="username">nobody</systemitem> user:</para> - -<screen><userinput remap="test">su nobody -s /bin/bash << EOF -PATH=$PATH HOME=/home make tests -EOF</userinput></screen> + class="username">tester</systemitem> user:</para> +<screen><userinput remap="test">su tester -c "PATH=$PATH make tests"</userinput></screen> +<!-- <para>The <command>su</command> command above is slightly different from other places in the book. The reason is that the <option>-c</option> option runs the command without a controlling terminal, while the bash test suite needs one.</para> - - <para>Nevertheless, the <systemitem class="username">nobody</systemitem> +--> + <para>The <systemitem class="username">tester</systemitem> user does not have enough permissions for all the tests to pass. This shows up in some <quote>diff</quote> output in four test results.</para> diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index 50907ae11..e3ab4a679 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -108,35 +108,35 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ <para>Now the test suite is ready to be run. First, run the tests that are meant to be run as user <systemitem class="username">root</systemitem>:</para> -<screen><userinput remap="test">make NON_ROOT_USERNAME=nobody check-root</userinput></screen> +<screen><userinput remap="test">make NON_ROOT_USERNAME=tester check-root</userinput></screen> <para>We're going to run the remainder of the tests as the - <systemitem class="username">nobody</systemitem> user. Certain tests, + <systemitem class="username">tester</systemitem> user. Certain tests, however, require that the user be a member of more than one group. So that these tests are not skipped we'll add a temporary group and make the - user <systemitem class="username">nobody</systemitem> a part of it:</para> + user <systemitem class="username">tester</systemitem> a part of it:</para> -<screen><userinput remap="test">echo "dummy:x:1000:nobody" >> /etc/group</userinput></screen> +<screen><userinput remap="test">echo "tester:x:1000:nogroup" >> /etc/group</userinput></screen> <para>Fix some of the permissions so that the non-root user can compile and run the tests:</para> -<screen><userinput remap="test">chown -Rv nobody . </userinput></screen> +<screen><userinput remap="test">chown -Rv tester . </userinput></screen> <para>Now run the tests. Make sure the PATH in the <userinput>su</userinput> environment includes /tools/bin.</para> -<screen><userinput remap="test">su nobody -s /bin/bash -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen> +<screen><userinput remap="test">su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen> <!-- <para>The test program test-getlogin is known to fail in a partially built system environment like the chroot environment here, but passes if run at the end of this chapter. The test program tty.sh is also known to fail.</para> ---> + <para>Remove the temporary group:</para> <screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen> - +--> <para>Install the package:</para> <screen><userinput remap="install">make install</userinput></screen> diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml index 8cb6175cb..8e7b78410 100644 --- a/chapter06/createfiles.xml +++ b/chapter06/createfiles.xml @@ -342,6 +342,12 @@ EOF</userinput></screen> administrator since well-written programs do not depend on GID numbers, but rather use the group's name.</para> + <para>Some tests later in the chapter need a regular user. We add this + user here and delete this account at the end of the chapter.</para> + +<screen><userinput>echo "tester:x:101:101::/tmp:/bin/bash" >> /etc/passwd +echo "tester:x:101:dummy" >> /etc/group</userinput></screen> + <para>To remove the <quote>I have no name!</quote> prompt, start a new shell. Since a full Glibc was installed in <xref linkend="chapter-temporary-tools"/> and the diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml index 550ee44fe..2c41fee2e 100644 --- a/chapter06/gcc.xml +++ b/chapter06/gcc.xml @@ -115,8 +115,8 @@ cd build</userinput></screen> <para>Test the results as a non-privileged user, but do not stop at errors:</para> -<screen><userinput remap="test">chown -Rv nobody . -su nobody -s /bin/bash -c "PATH=$PATH make -k check"</userinput></screen> +<screen><userinput remap="test">chown -Rv tester . +su tester -c "PATH=$PATH make -k check"</userinput></screen> <para>To receive a summary of the test suite results, run:</para> @@ -156,7 +156,7 @@ su nobody -s /bin/bash -c "PATH=$PATH make -k check"</userinput></screen> rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/&gcc-version;/include-fixed/bits/</userinput></screen> <para>The GCC build directory is owned by <systemitem class="username"> - nobody</systemitem> now and the ownership of the installed header + tester</systemitem> now and the ownership of the installed header directory (and its content) will be incorrect. Change the ownership to <systemitem class="username">root</systemitem> user and group:</para> diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml index eb40fb7ce..c39084882 100644 --- a/chapter06/revisedchroot.xml +++ b/chapter06/revisedchroot.xml @@ -70,4 +70,8 @@ rm -f /usr/lib/libz.a</userinput></screen> url="&blfs-book;/introduction/la-files.html">BLFS section "About Libtool Archive (.la) files"</ulink>.</para> + <para>Finally, remove the temporary 'tester' usr account created at the + beginning of this chapter.</para> + +<screen><userinput>sed -i '/tester/d' /etc/passwd /etc/group</userinput></screen> </sect1> diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml index 6a6a5bcc5..036f5db82 100644 --- a/chapter06/util-linux.xml +++ b/chapter06/util-linux.xml @@ -115,8 +115,8 @@ rm -vf /usr/lib/pkgconfig/{blkid,fdisk,mount,uuid}.pc</userinput></screen> <screen role="nodump"><userinput>bash tests/run.sh --srcdir=$PWD --builddir=$PWD</userinput></screen> </warning> -<screen><userinput remap="test">chown -Rv nobody . -su nobody -s /bin/bash -c "PATH=$PATH make -k check"</userinput></screen> +<screen><userinput remap="test">chown -Rv tester . +su tester -c "make -k check"</userinput></screen> <para>Install the package:</para> diff --git a/chapter06/vim.xml b/chapter06/vim.xml index 2f91d5c33..263122bd7 100644 --- a/chapter06/vim.xml +++ b/chapter06/vim.xml @@ -67,15 +67,15 @@ <screen><userinput remap="make">make</userinput></screen> <para>To prepare the tests, ensure that the - <systemitem class="username">nobody</systemitem> user can write + <systemitem class="username">tester</systemitem> user can write to the sources tree:</para> -<screen><userinput remap="test">chown -Rv nobody .</userinput></screen> +<screen><userinput remap="test">chown -Rv tester .</userinput></screen> <para>Now run the tests as the <systemitem - class="username">nobody</systemitem> user:</para> + class="username">tester</systemitem> user:</para> -<screen><userinput remap="test">su nobody -s /bin/bash -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log</userinput></screen> +<screen><userinput remap="test">su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log</userinput></screen> <!--<screen><userinput remap="test">LANG=en_US.UTF-8 make -j1 test &> vim-test.log</userinput></screen>--> |