coreutils-inst.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. <screen><userinput>patch -Np1 -i ../&coreutils-uname-patch;</userinput></screen>
  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. <screen><userinput>patch -Np1 -i ../&coreutils-hostname-patch;</userinput></screen>
  12. <para>Now prepare Coreutils for compilation:</para>
  13. <screen><userinput>./configure --prefix=/usr</userinput></screen>
  14. <para>Compile the package:</para>
  15. <screen><userinput>make</userinput></screen>
  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. <screen><userinput>make install-root</userinput></screen>
  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
  23. makes some assumptions with regards to the presence of non-root users and
  24. groups that don't apply this early into the LFS build. We therefore create
  25. a dummy system user and two dummy groups to allow the tests to run
  26. properly. Should you choose not to run the test suite, skip down to
  27. "Install the package". The following commands will prepare us for the test
  28. suite. Create two dummy groups and a dummy user name:</para>
  29. <screen><userinput>echo "dummy1:x:1000" >> /etc/group
  30. echo "dummy2:x:1001:dummy" >> /etc/group
  31. echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd</userinput></screen>
  32. <para>Some tests are meant to run as <emphasis>root</emphasis>:</para>
  33. <screen><userinput>make check-root</userinput></screen>
  34. <para>The remainder of the tests are run as the <emphasis>dummy</emphasis>
  35. user:</para>
  36. <screen><userinput>su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>
  37. <para>Remove the dummy groups and user name:</para>
  38. <screen><userinput>sed -i.bak '/dummy/d' /etc/passwd /etc/group</userinput></screen>
  39. <para>Install the package:</para>
  40. <screen><userinput>make install</userinput></screen>
  41. <para>And move some programs to their proper locations:</para>
  42. <screen><userinput>mv /usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} /bin
  43. mv /usr/bin/{dir,dircolors,du,date,echo,false,head} /bin
  44. mv /usr/bin/{install,ln,ls,mkdir,mkfifo,mknod,mv,pwd} /bin
  45. mv /usr/bin/{rm,rmdir,shred,sync,sleep,stty,su,test} /bin
  46. mv /usr/bin/{touch,true,uname,vdir} /bin
  47. mv /usr/bin/chroot /usr/sbin</userinput></screen>
  48. <para>Finally, create a few necessary symlinks:</para>
  49. <screen><userinput>ln -s test /bin/[
  50. ln -s ../../bin/install /usr/bin</userinput></screen>
  51. </sect2>