[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 |
|
---|
[b175687] | 10 | <para><screen><userinput>patch -Np1 -i ../coreutils-&coreutils-uname-patch-version;.patch</userinput></screen></para>
|
---|
| 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 |
|
---|
| 16 | <para><screen><userinput>patch -Np1 -i ../coreutils-&coreutils-hostname-patch-version;.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 |
|
---|
[39dbad2] | 26 | <para>This package has a test suite available which can perform a number of
|
---|
[e005067] | 27 | checks to ensure it built correctly. However, this particular test suite makes
|
---|
| 28 | some assumptions that aren't quite vaild at this early stage of Chapter 6. We
|
---|
| 29 | therefore make a few adjustments to allow the tests to run properly. Should you
|
---|
| 30 | choose not to run the test suite, skip down to "Install the package". The
|
---|
| 31 | following commands will prepare us for the test suite. Create two dummy groups
|
---|
| 32 | and a dummy user name:</para>
|
---|
[89fcc34] | 33 |
|
---|
[e005067] | 34 | <para><screen><userinput>echo "dummy1:x:1000" >> /etc/group
|
---|
| 35 | echo "dummy2:x:1001:dummy" >> /etc/group
|
---|
| 36 | echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd</userinput></screen></para>
|
---|
| 37 |
|
---|
| 38 | <para>Fix a small permissions problem:</para>
|
---|
| 39 |
|
---|
| 40 | <para><screen><userinput>chown dummy tests/cut</userinput></screen></para>
|
---|
| 41 |
|
---|
| 42 | <para>The <userinput>su</userinput> program from Coreutils wasn't installed in
|
---|
| 43 | Chapter 5 because it needed <emphasis>root</emphasis> privilege to install. We
|
---|
| 44 | work around this problem by installing it now:</para>
|
---|
| 45 |
|
---|
| 46 | <para><screen><userinput>make install-root</userinput></screen></para>
|
---|
| 47 |
|
---|
| 48 | <para>Some tests are meant to run as <emphasis>root</emphasis>:</para>
|
---|
| 49 |
|
---|
| 50 | <para><screen><userinput>make check-root</userinput></screen></para>
|
---|
| 51 |
|
---|
| 52 | <para>The remainder of the tests are run as the <emphasis>dummy</emphasis>
|
---|
| 53 | user:</para>
|
---|
| 54 |
|
---|
| 55 | <para><screen><userinput>su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen></para>
|
---|
| 56 |
|
---|
| 57 | <para>Remove the dummy groups and user name:</para>
|
---|
| 58 |
|
---|
| 59 | <para><screen><userinput>sed -i.bak '/dummy/d' /etc/passwd /etc/group</userinput></screen></para>
|
---|
[4a7a683] | 60 |
|
---|
[9720145] | 61 | <para>Install the package:</para>
|
---|
| 62 |
|
---|
| 63 | <para><screen><userinput>make install</userinput></screen></para>
|
---|
| 64 |
|
---|
[89fcc34] | 65 | <para>And move some programs to their proper locations:</para>
|
---|
[9720145] | 66 |
|
---|
[4a7a683] | 67 | <para><screen><userinput>mv /usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} /bin
|
---|
| 68 | mv /usr/bin/{dir,dircolors,du,date,echo,false,head} /bin
|
---|
| 69 | mv /usr/bin/{install,ln,ls,mkdir,mkfifo,mknod,mv,pwd} /bin
|
---|
| 70 | mv /usr/bin/{rm,rmdir,shred,sync,sleep,stty,su,test} /bin
|
---|
[bc82645e] | 71 | mv /usr/bin/{touch,true,uname,vdir} /bin
|
---|
[9720145] | 72 | mv /usr/bin/chroot /usr/sbin</userinput></screen></para>
|
---|
| 73 |
|
---|
[aa69c5d] | 74 | <para>Finally, create a few necessary symlinks:</para>
|
---|
[bc82645e] | 75 |
|
---|
[9720145] | 76 | <para><screen><userinput>ln -s test /bin/[
|
---|
| 77 | ln -s ../../bin/install /usr/bin</userinput></screen></para>
|
---|
[bc82645e] | 78 |
|
---|
| 79 | </sect2>
|
---|
| 80 |
|
---|