Installation of Coreutils
Normally the functionality of uname is somewhat
broken, in that the -p switch always returns "unknown".
The following patch fixes this behaviour for Intel architectures:
patch -Np1 -i ../coreutils-&coreutils-uname-patch-version;.patch
We do not want Coreutils to install its version of the
hostname program, because it is inferior to the version
provided by Net-tools. Prevent its installation by applying a patch:
patch -Np1 -i ../coreutils-&coreutils-hostname-patch-version;.patch
Now prepare Coreutils for compilation:
./configure --prefix=/usr
Compile the package:
make
This package has a test suite available which can perform a number of
checks to ensure it built correctly. However, this particular test suite makes
some assumptions that aren't quite valid at this early stage of Chapter 6. We
therefore make a few adjustments to allow the tests to run properly. Should you
choose not to run the test suite, skip down to "Install the package". The
following commands will prepare us for the test suite. Create two dummy groups
and a dummy user name:
echo "dummy1:x:1000" >> /etc/group
echo "dummy2:x:1001:dummy" >> /etc/group
echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd
The su program from Coreutils wasn't installed in
Chapter 5 because it needed root privilege to install. We
work around this problem by installing it now:
make install-root
Some tests are meant to run as root:
make check-root
The remainder of the tests are run as the dummy
user:
su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"
Remove the dummy groups and user name:
sed -i.bak '/dummy/d' /etc/passwd /etc/group
Install the package:
make install
And move some programs to their proper locations:
mv /usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} /bin
mv /usr/bin/{dir,dircolors,du,date,echo,false,head} /bin
mv /usr/bin/{install,ln,ls,mkdir,mkfifo,mknod,mv,pwd} /bin
mv /usr/bin/{rm,rmdir,shred,sync,sleep,stty,su,test} /bin
mv /usr/bin/{touch,true,uname,vdir} /bin
mv /usr/bin/chroot /usr/sbin
Finally, create a few necessary symlinks:
ln -s test /bin/[
ln -s ../../bin/install /usr/bin