From cd0c92d633ca0277a961a76d67ae8c094593d123 Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Sun, 22 Feb 2004 19:05:53 +0000 Subject: Adding a touch of mtab before the running of Coreutils test suite. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3257 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/coreutils.xml | 40 ++++++++++++++++++++++------------------ chapter06/e2fsprogs.xml | 7 +++++-- chapter06/shadow.xml | 2 +- 3 files changed, 28 insertions(+), 21 deletions(-) (limited to 'chapter06') diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index 4c5bdf129..1562d0598 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -40,35 +40,39 @@ provided by Net-tools. Prevent its installation by applying a patch: make -The su program from Coreutils wasn't installed in - because it needed -root privilege to do so. We're going to need it in a few -moments for the test suite. Therefore we install it now: +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". + +To be able to run the full test suite, the su program +needs to be installed. We didn't bother to install this little program in + because it requires root privileges, +so do it now: make install-root -The test suite of this package -makes some assumptions with regards to the presence of non-root users and -groups that don't apply this early into the LFS build. We therefore create -a dummy system user and two dummy groups 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: +Create a 'table of mounted filesystems' file with: + +touch /etc/mtab + +And 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 +echo "dummy1:x:1000" >> /etc/group +echo "dummy2:x:1001:dummy" >> /etc/group +echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd -Some tests are meant to run as root: +Now you're all set to run the test suite. First run the few tests that +are meant to be run as root: make check-root -The remainder of the tests are run as the dummy +Then run the remainder of the tests as the dummy user: su dummy -c "make RUN_EXPENSIVE_TESTS=yes check" -Remove the dummy groups and user name: +When you're done testing, remove the dummy user and groups: sed -i.bak '/dummy/d' /etc/passwd /etc/group @@ -90,7 +94,7 @@ Remove the one installed by Coreutils: rm /usr/bin/kill -Finally, create a few necessary symlinks: +Finally, create two symlinks to be FHS-compliant: ln -s test /bin/[ ln -s ../../bin/install /usr/bin diff --git a/chapter06/e2fsprogs.xml b/chapter06/e2fsprogs.xml index 81af66eff..89badb958 100644 --- a/chapter06/e2fsprogs.xml +++ b/chapter06/e2fsprogs.xml @@ -49,8 +49,11 @@ of. make -To have the results tested, issue: -make check. +If you wish to have the results tested, first make sure an mtab file +exists with touch /etc/mtab to prevent some sixty tests +from failing, and (if it doesn't already exist) fake the presence of an old +pager with ln -s /tools/bin/cat /bin/more to prevent one +test from failing, then issue: make check. Install most of the package: diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml index 377dbae04..714393c2a 100644 --- a/chapter06/shadow.xml +++ b/chapter06/shadow.xml @@ -34,7 +34,7 @@ properly: Work around a problem that prevents Shadow's internationalization from working: -echo '#define HAVE_SETLOCALE 1' >> config.h +echo '#define HAVE_SETLOCALE 1' >> config.h Compile the package: -- cgit v1.2.3-54-g00ecf