2004-01-27 22:29:49 +00:00
|
|
|
<sect1 id="ch-system-coreutils" xreflabel="Coreutils">
|
2003-05-02 19:20:20 +01:00
|
|
|
<title>Installing Coreutils-&coreutils-version;</title>
|
|
|
|
<?dbhtml filename="coreutils.html" dir="chapter06"?>
|
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
<para>The Coreutils package contains utilities for showing and setting the
|
|
|
|
basic system characteristics.</para>
|
|
|
|
|
2004-01-27 22:27:44 +00:00
|
|
|
<screen>&buildtime; &coreutils-time;
|
|
|
|
&diskspace; &coreutils-compsize;</screen>
|
2003-09-02 23:04:32 +01:00
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
&aa-coreutils-down;
|
2003-11-15 16:07:18 +00:00
|
|
|
&aa-coreutils-dep;
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<sect2><title> </title><para> </para></sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Installation of Coreutils</title>
|
|
|
|
|
2004-02-04 22:22:26 +00:00
|
|
|
<para>Apply the same Posixver patch we used previously:</para>
|
2004-01-20 05:59:05 +00:00
|
|
|
|
|
|
|
<screen><userinput>patch -Np1 -i ../&coreutils-posixver-patch;</userinput></screen>
|
|
|
|
|
2004-02-01 21:49:10 +00:00
|
|
|
<para>Normally the functionality of <command>uname</command> is somewhat
|
|
|
|
broken, in that the <emphasis>-p</emphasis> switch always returns "unknown".
|
2003-11-01 22:31:50 +00:00
|
|
|
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
|
2004-02-01 21:49:10 +00:00
|
|
|
<command>hostname</command> program, because it is inferior to the version
|
2003-11-01 22:31:50 +00:00
|
|
|
provided 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>
|
|
|
|
|
2004-02-22 19:05:53 +00:00
|
|
|
<para>The test suite of Coreutils makes several assumptions about the presence
|
|
|
|
of files and users that aren't valid yet this early in the LFS build. We will
|
|
|
|
therefore have to set up a few things before being able to run the tests. If
|
|
|
|
you choose not to run these tests, skip down to "Install the package".</para>
|
|
|
|
|
2004-03-09 19:08:33 +00:00
|
|
|
<para>First create a 'table of mounted filesystems' file with:</para>
|
2004-02-22 19:05:53 +00:00
|
|
|
|
|
|
|
<screen><userinput>touch /etc/mtab</userinput></screen>
|
|
|
|
|
|
|
|
<para>And create two dummy groups and a dummy user name:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2004-02-22 19:05:53 +00:00
|
|
|
<screen><userinput>echo "dummy1:x:1000" >> /etc/group
|
|
|
|
echo "dummy2:x:1001:dummy" >> /etc/group
|
|
|
|
echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2004-02-22 19:05:53 +00:00
|
|
|
<para>Now you're all set to run the test suite. First run the few tests that
|
|
|
|
are meant to be run as <emphasis>root</emphasis>:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<screen><userinput>make check-root</userinput></screen>
|
|
|
|
|
2004-02-22 19:05:53 +00:00
|
|
|
<para>Then run the remainder of the tests as the <emphasis>dummy</emphasis>
|
2003-11-01 22:31:50 +00:00
|
|
|
user:</para>
|
|
|
|
|
2004-03-09 19:08:33 +00:00
|
|
|
<screen><userinput>src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>
|
|
|
|
|
|
|
|
<para>The above command uses the newly compiled <command>src/su</command>
|
|
|
|
program, since in <xref linkend="chapter-temporary-tools"/> we didn't bother to
|
|
|
|
install it, because installing it requires root privileges.</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2004-02-22 19:05:53 +00:00
|
|
|
<para>When you're done testing, remove the dummy user and groups:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<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} /bin
|
2003-11-15 00:45:58 +00:00
|
|
|
mv /usr/bin/{date,echo,false,head,install,ln,ls} /bin
|
|
|
|
mv /usr/bin/{mkdir,mknod,mv,pwd,rm,rmdir,sync} /bin
|
|
|
|
mv /usr/bin/{sleep,stty,su,test,touch,true,uname} /bin
|
2003-11-01 22:31:50 +00:00
|
|
|
mv /usr/bin/chroot /usr/sbin</userinput></screen>
|
|
|
|
|
2003-11-14 22:54:43 +00:00
|
|
|
<para>We'll be using the <filename>kill</filename> program from the Procps
|
|
|
|
package (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>
|
|
|
|
|
2004-02-22 19:05:53 +00:00
|
|
|
<para>Finally, create two symlinks to be FHS-compliant:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<screen><userinput>ln -s test /bin/[
|
|
|
|
ln -s ../../bin/install /usr/bin</userinput></screen>
|
|
|
|
|
|
|
|
</sect2>
|
2003-05-02 19:20:20 +01:00
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
&aa-coreutils-shortdesc;
|
|
|
|
&aa-coreutils-desc;
|
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
</sect1>
|
|
|
|
|