1 | <sect2><title> </title><para> </para></sect2>
|
---|
2 |
|
---|
3 | <sect2>
|
---|
4 | <title>Installation of Coreutils</title>
|
---|
5 |
|
---|
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>
|
---|
9 |
|
---|
10 | <para><screen><userinput>patch -Np1 -i ../&coreutils-uname-patch;</userinput></screen></para>
|
---|
11 |
|
---|
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>
|
---|
15 |
|
---|
16 | <para><screen><userinput>patch -Np1 -i ../&coreutils-hostname-patch;</userinput></screen></para>
|
---|
17 |
|
---|
18 | <para>Now prepare Coreutils for compilation:</para>
|
---|
19 |
|
---|
20 | <para><screen><userinput>./configure --prefix=/usr</userinput></screen></para>
|
---|
21 |
|
---|
22 | <para>Compile the package:</para>
|
---|
23 |
|
---|
24 | <para><screen><userinput>make</userinput></screen></para>
|
---|
25 |
|
---|
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 |
|
---|
33 | <para>This package has a test suite available which can perform a number of
|
---|
34 | checks to ensure it built correctly. However, this particular test suite makes
|
---|
35 | some assumptions that aren't quite valid at this early stage of Chapter 6. We
|
---|
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>
|
---|
40 |
|
---|
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>
|
---|
57 |
|
---|
58 | <para>Install the package:</para>
|
---|
59 |
|
---|
60 | <para><screen><userinput>make install</userinput></screen></para>
|
---|
61 |
|
---|
62 | <para>And move some programs to their proper locations:</para>
|
---|
63 |
|
---|
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
|
---|
68 | mv /usr/bin/{touch,true,uname,vdir} /bin
|
---|
69 | mv /usr/bin/chroot /usr/sbin</userinput></screen></para>
|
---|
70 |
|
---|
71 | <para>Finally, create a few necessary symlinks:</para>
|
---|
72 |
|
---|
73 | <para><screen><userinput>ln -s test /bin/[
|
---|
74 | ln -s ../../bin/install /usr/bin</userinput></screen></para>
|
---|
75 |
|
---|
76 | </sect2>
|
---|
77 |
|
---|