The Findutils package contains programs to find files. These programs are provided to recursively search through a directory tree and to create, maintain, and search a database (often faster than the recursive find, but unreliable if the database has not been recently updated).
Prepare Findutils for compilation:
./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
--prefix=/usr --libexecdir=/usr/lib/locate \
--localstatedir=/var/lib/locate
The meaning of the configure options:
This option changes the location of the locate database to be in /var/lib/locate, which is FHS-compliant.
Compile the package:
make
Install the package:
make DESTDIR=${CLFS} install
The find program is used by some of the scripts in the CLFS-Bootscripts package. As /usr may not be available during the early stages of booting, the find binary need to be on the root partition:
mv -v ${CLFS}/usr/bin/find ${CLFS}/bin
The updatedb script needs to be modified to point to the new location for find:
cp ${CLFS}/usr/bin/updatedb{,.orig}
sed 's@find:=${BINDIR}@find:=/bin@' ${CLFS}/usr/bin/updatedb.orig > ${CLFS}/usr/bin/updatedb
rm ${CLFS}/usr/bin/updatedb.orig