[bc82645e] | 1 | <sect2><title> </title><para> </para></sect2>
|
---|
| 2 |
|
---|
| 3 | <sect2>
|
---|
| 4 | <title>Installation of Coreutils</title>
|
---|
| 5 |
|
---|
[4114088] | 6 | <para>Normally the functionality of <userinput>uname</userinput> is somewhat
|
---|
| 7 | broken, in that the <userinput>-p</userinput> switch always returns "unknown".
|
---|
| 8 | The following patch fixes this behaviour for Intel architectures:</para>
|
---|
[9720145] | 9 |
|
---|
[7acb4c3] | 10 | <para><screen><userinput>patch -Np1 -i ../&coreutils-uname-patch;</userinput></screen></para>
|
---|
[b175687] | 11 |
|
---|
[89fcc34] | 12 | <para>We do not want Coreutils to install its version of the
|
---|
| 13 | <userinput>hostname</userinput> program, because it is inferior to the version
|
---|
| 14 | provided by Net-tools. Prevent its installation by applying a patch:</para>
|
---|
[b175687] | 15 |
|
---|
[7acb4c3] | 16 | <para><screen><userinput>patch -Np1 -i ../&coreutils-hostname-patch;</userinput></screen></para>
|
---|
[9720145] | 17 |
|
---|
[89fcc34] | 18 | <para>Now prepare Coreutils for compilation:</para>
|
---|
[9720145] | 19 |
|
---|
| 20 | <para><screen><userinput>./configure --prefix=/usr</userinput></screen></para>
|
---|
| 21 |
|
---|
[89fcc34] | 22 | <para>Compile the package:</para>
|
---|
[9720145] | 23 |
|
---|
| 24 | <para><screen><userinput>make</userinput></screen></para>
|
---|
| 25 |
|
---|
[f861982] | 26 | <para>The <userinput>su</userinput> program from Coreutils wasn't installed in
|
---|
| 27 | Chapter 5 because it needed <emphasis>root</emphasis> privilege to do so. We're
|
---|
| 28 | going to need it in a few moments for the test suite. Therefore we work around
|
---|
| 29 | the problem by installing it now:</para>
|
---|
| 30 |
|
---|
| 31 | <para><screen><userinput>make install-root</userinput></screen></para>
|
---|
| 32 |
|
---|
[39dbad2] | 33 | <para>This package has a test suite available which can perform a number of
|
---|
[e005067] | 34 | checks to ensure it built correctly. However, this particular test suite makes
|
---|
[defc168] | 35 | some assumptions that aren't quite valid at this early stage of Chapter 6. We
|
---|
[e005067] | 36 | therefore make a few adjustments to allow the tests to run properly. Should you
|
---|
| 37 | choose not to run the test suite, skip down to "Install the package". The
|
---|
| 38 | following commands will prepare us for the test suite. Create two dummy groups
|
---|
| 39 | and a dummy user name:</para>
|
---|
[89fcc34] | 40 |
|
---|
[e005067] | 41 | <para><screen><userinput>echo "dummy1:x:1000" >> /etc/group
|
---|
| 42 | echo "dummy2:x:1001:dummy" >> /etc/group
|
---|
| 43 | echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd</userinput></screen></para>
|
---|
| 44 |
|
---|
| 45 | <para>Some tests are meant to run as <emphasis>root</emphasis>:</para>
|
---|
| 46 |
|
---|
| 47 | <para><screen><userinput>make check-root</userinput></screen></para>
|
---|
| 48 |
|
---|
| 49 | <para>The remainder of the tests are run as the <emphasis>dummy</emphasis>
|
---|
| 50 | user:</para>
|
---|
| 51 |
|
---|
| 52 | <para><screen><userinput>su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen></para>
|
---|
| 53 |
|
---|
| 54 | <para>Remove the dummy groups and user name:</para>
|
---|
| 55 |
|
---|
| 56 | <para><screen><userinput>sed -i.bak '/dummy/d' /etc/passwd /etc/group</userinput></screen></para>
|
---|
[4a7a683] | 57 |
|
---|
[9720145] | 58 | <para>Install the package:</para>
|
---|
| 59 |
|
---|
| 60 | <para><screen><userinput>make install</userinput></screen></para>
|
---|
| 61 |
|
---|
[89fcc34] | 62 | <para>And move some programs to their proper locations:</para>
|
---|
[9720145] | 63 |
|
---|
[4a7a683] | 64 | <para><screen><userinput>mv /usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} /bin
|
---|
| 65 | mv /usr/bin/{dir,dircolors,du,date,echo,false,head} /bin
|
---|
| 66 | mv /usr/bin/{install,ln,ls,mkdir,mkfifo,mknod,mv,pwd} /bin
|
---|
| 67 | mv /usr/bin/{rm,rmdir,shred,sync,sleep,stty,su,test} /bin
|
---|
[bc82645e] | 68 | mv /usr/bin/{touch,true,uname,vdir} /bin
|
---|
[9720145] | 69 | mv /usr/bin/chroot /usr/sbin</userinput></screen></para>
|
---|
| 70 |
|
---|
[aa69c5d] | 71 | <para>Finally, create a few necessary symlinks:</para>
|
---|
[bc82645e] | 72 |
|
---|
[9720145] | 73 | <para><screen><userinput>ln -s test /bin/[
|
---|
| 74 | ln -s ../../bin/install /usr/bin</userinput></screen></para>
|
---|
[bc82645e] | 75 |
|
---|
| 76 | </sect2>
|
---|
| 77 |
|
---|