| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 | <sect1 id="ch-system-coreutils" xreflabel="Coreutils"><title>Installing Coreutils-&coreutils-version;</title><?dbhtml filename="coreutils.html" dir="chapter06"?><para>The Coreutils package contains utilities for showing and setting thebasic system characteristics.</para><screen>&buildtime; &coreutils-time;&diskspace; &coreutils-compsize;</screen>&aa-coreutils-down;&aa-coreutils-dep;<sect2><title> </title><para> </para></sect2><sect2><title>Installation of Coreutils</title><para>Apply the same Posixver patch we used previously:</para><screen><userinput>patch -Np1 -i ../&coreutils-posixver-patch;</userinput></screen><para>Normally the functionality of <command>uname</command> is somewhatbroken, in that the <emphasis>-p</emphasis> switch always returns "unknown".The following patch fixes this behaviour for Intel architectures:</para><screen><userinput>patch -Np1 -i ../&coreutils-uname-patch;</userinput></screen><para>We do not want Coreutils to install its version of the<command>hostname</command> program, because it is inferior to the versionprovided by Net-tools. Prevent its installation by applying a patch:</para><screen><userinput>patch -Np1 -i ../&coreutils-hostname-patch;</userinput></screen><para>Now prepare Coreutils for compilation:</para><screen><userinput>./configure --prefix=/usr</userinput></screen><para>Compile the package:</para><screen><userinput>make</userinput></screen><para>The <command>su</command> program from Coreutils wasn't installed in<xref linkend="chapter-temporary-tools"/> because it needed<emphasis>root</emphasis> privilege to do so. We're going to need it in a fewmoments for the test suite. Therefore we install it now:</para><screen><userinput>make install-root</userinput></screen><para>The test suite of this packagemakes some assumptions with regards to the presence of non-root users andgroups that don't apply this early into the LFS build. We therefore createa dummy system user and two dummy groups to allow the tests to runproperly. Should you choose not to run the test suite, skip down to"Install the package". The following commands will prepare us for the testsuite. Create two dummy groups and a dummy user name:</para><screen><userinput>echo "dummy1:x:1000" >> /etc/groupecho "dummy2:x:1001:dummy" >> /etc/groupecho "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd</userinput></screen><para>Some tests are meant to run as <emphasis>root</emphasis>:</para><screen><userinput>make check-root</userinput></screen><para>The remainder of the tests are run as the <emphasis>dummy</emphasis>user:</para><screen><userinput>su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen><para>Remove the dummy groups and user name:</para><screen><userinput>sed -i.bak '/dummy/d' /etc/passwd /etc/group</userinput></screen><para>Install the package:</para><screen><userinput>make install</userinput></screen><para>And move some programs to their proper locations:</para><screen><userinput>mv /usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} /binmv /usr/bin/{date,echo,false,head,install,ln,ls} /binmv /usr/bin/{mkdir,mknod,mv,pwd,rm,rmdir,sync} /binmv /usr/bin/{sleep,stty,su,test,touch,true,uname} /binmv /usr/bin/chroot /usr/sbin</userinput></screen><para>We'll be using the <filename>kill</filename> program from the Procpspackage (installed as <filename>/bin/kill</filename> later in the chapter).Remove the one installed by Coreutils:</para><screen><userinput>rm /usr/bin/kill</userinput></screen><para>Finally, create a few necessary symlinks:</para><screen><userinput>ln -s test /bin/[ln -s ../../bin/install /usr/bin</userinput></screen></sect2>&aa-coreutils-shortdesc;&aa-coreutils-desc;</sect1>
 |