- Timestamp:
- 05/29/2020 08:06:18 AM (4 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 5f24c50
- Parents:
- 51c960d
- Location:
- chapter06
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/bash.xml
r51c960d r7406bec 74 74 package</quote> if not running the test suite.</para> 75 75 76 <para>To prepare the tests, ensure that the <systemitem class="username"> nobody</systemitem> user can write to the sources tree:</para>76 <para>To prepare the tests, ensure that the <systemitem class="username">tester</systemitem> user can write to the sources tree:</para> 77 77 78 <screen><userinput remap="test">chown -Rv nobody.</userinput></screen>78 <screen><userinput remap="test">chown -Rv tester .</userinput></screen> 79 79 80 80 <para>Now, run the tests as the <systemitem 81 class="username"> nobody</systemitem> user:</para>81 class="username">tester</systemitem> user:</para> 82 82 83 <screen><userinput remap="test">su nobody -s /bin/bash << EOF 84 PATH=$PATH HOME=/home make tests 85 EOF</userinput></screen> 86 83 <screen><userinput remap="test">su tester -c "PATH=$PATH make tests"</userinput></screen> 84 <!-- 87 85 <para>The <command>su</command> command above is slightly different from 88 86 other places in the book. The 89 87 reason is that the <option>-c</option> option runs the command without 90 88 a controlling terminal, while the bash test suite needs one.</para> 91 92 <para> Nevertheless, the <systemitem class="username">nobody</systemitem>89 --> 90 <para>The <systemitem class="username">tester</systemitem> 93 91 user does not have enough permissions for all the tests to pass. This shows 94 92 up in some <quote>diff</quote> output in four test results.</para> -
chapter06/coreutils.xml
r51c960d r7406bec 109 109 meant to be run as user <systemitem class="username">root</systemitem>:</para> 110 110 111 <screen><userinput remap="test">make NON_ROOT_USERNAME= nobodycheck-root</userinput></screen>111 <screen><userinput remap="test">make NON_ROOT_USERNAME=tester check-root</userinput></screen> 112 112 113 113 <para>We're going to run the remainder of the tests as the 114 <systemitem class="username"> nobody</systemitem> user. Certain tests,114 <systemitem class="username">tester</systemitem> user. Certain tests, 115 115 however, require that the user be a member of more than one group. So that 116 116 these tests are not skipped we'll add a temporary group and make the 117 user <systemitem class="username"> nobody</systemitem> a part of it:</para>118 119 <screen><userinput remap="test">echo " dummy:x:1000:nobody" >> /etc/group</userinput></screen>117 user <systemitem class="username">tester</systemitem> a part of it:</para> 118 119 <screen><userinput remap="test">echo "tester:x:1000:nogroup" >> /etc/group</userinput></screen> 120 120 121 121 <para>Fix some of the permissions so that the non-root user can compile and 122 122 run the tests:</para> 123 123 124 <screen><userinput remap="test">chown -Rv nobody. </userinput></screen>124 <screen><userinput remap="test">chown -Rv tester . </userinput></screen> 125 125 126 126 <para>Now run the tests. Make sure the PATH in the <userinput>su</userinput> 127 127 environment includes /tools/bin.</para> 128 128 129 <screen><userinput remap="test">su nobody -s /bin/bash-c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>129 <screen><userinput remap="test">su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen> 130 130 <!-- 131 131 <para>The test program test-getlogin is known to fail in a … … 133 133 passes if run at the end of this chapter. The test program tty.sh is 134 134 also known to fail.</para> 135 136 <para>Remove the temporary group:</para> 137 138 <screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen> 135 139 --> 136 <para>Remove the temporary group:</para>137 138 <screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen>139 140 140 <para>Install the package:</para> 141 141 -
chapter06/createfiles.xml
r51c960d r7406bec 343 343 rather use the group's name.</para> 344 344 345 <para>Some tests later in the chapter need a regular user. We add this 346 user here and delete this account at the end of the chapter.</para> 347 348 <screen><userinput>echo "tester:x:101:101::/tmp:/bin/bash" >> /etc/passwd 349 echo "tester:x:101:dummy" >> /etc/group</userinput></screen> 350 345 351 <para>To remove the <quote>I have no name!</quote> prompt, start a new 346 352 shell. Since a full Glibc was installed in <xref -
chapter06/gcc.xml
r51c960d r7406bec 116 116 <para>Test the results as a non-privileged user, but do not stop at errors:</para> 117 117 118 <screen><userinput remap="test">chown -Rv nobody.119 su nobody -s /bin/bash-c "PATH=$PATH make -k check"</userinput></screen>118 <screen><userinput remap="test">chown -Rv tester . 119 su tester -c "PATH=$PATH make -k check"</userinput></screen> 120 120 121 121 <para>To receive a summary of the test suite results, run:</para> … … 157 157 158 158 <para>The GCC build directory is owned by <systemitem class="username"> 159 nobody</systemitem> now and the ownership of the installed header159 tester</systemitem> now and the ownership of the installed header 160 160 directory (and its content) will be incorrect. Change the ownership to 161 161 <systemitem class="username">root</systemitem> user and group:</para> -
chapter06/revisedchroot.xml
r51c960d r7406bec 71 71 Archive (.la) files"</ulink>.</para> 72 72 73 <para>Finally, remove the temporary 'tester' usr account created at the 74 beginning of this chapter.</para> 75 76 <screen><userinput>sed -i '/tester/d' /etc/passwd /etc/group</userinput></screen> 73 77 </sect1> -
chapter06/util-linux.xml
r51c960d r7406bec 116 116 </warning> 117 117 118 <screen><userinput remap="test">chown -Rv nobody.119 su nobody -s /bin/bash -c "PATH=$PATHmake -k check"</userinput></screen>118 <screen><userinput remap="test">chown -Rv tester . 119 su tester -c "make -k check"</userinput></screen> 120 120 121 121 <para>Install the package:</para> -
chapter06/vim.xml
r51c960d r7406bec 68 68 69 69 <para>To prepare the tests, ensure that the 70 <systemitem class="username"> nobody</systemitem> user can write70 <systemitem class="username">tester</systemitem> user can write 71 71 to the sources tree:</para> 72 72 73 <screen><userinput remap="test">chown -Rv nobody.</userinput></screen>73 <screen><userinput remap="test">chown -Rv tester .</userinput></screen> 74 74 75 75 <para>Now run the tests as the <systemitem 76 class="username"> nobody</systemitem> user:</para>77 78 <screen><userinput remap="test">su nobody -s /bin/bash-c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log</userinput></screen>76 class="username">tester</systemitem> user:</para> 77 78 <screen><userinput remap="test">su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log</userinput></screen> 79 79 80 80 <!--<screen><userinput remap="test">LANG=en_US.UTF-8 make -j1 test &> vim-test.log</userinput></screen>-->
Note:
See TracChangeset
for help on using the changeset viewer.