coreutils-inst.xml 3.1 KB

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