The Util-linux package contains miscellaneous utility programs. Among them are utilities for handling file systems, consoles, partitions, and messages.
The FHS recommends using the /var/lib/hwclock directory instead of the usual /etc directory as the location for the adjtime file. To make the hwclock program FHS-compliant, run the following:
cp hwclock/hwclock.c{,.orig}
sed 's@etc/adjtime@var/lib/hwclock/adjtime@g' \
hwclock/hwclock.c.orig > hwclock/hwclock.c
mkdir -pv ${CLFS}/var/lib/hwclock
Util-linux fails to compile against newer versions of Linux kernel headers. The following patch properly fixes this issue:
patch -Np1 -i ../util-linux-2.12r-cramfs-1.patch
The following patch fixes build issues the changes to the Linux 2.6.18 headers:
patch -Np1 -i ../util-linux-2.12r-syscall_fixes-1.patch
The following patch fixes swapon.c - it tries to find the variable R_OK, but the header that has R_OK is not included:
patch -Np1 -i ../util-linux-2.12r-missing_header-1.patch
Due to a change in headers some util-linux will not build. This patch will change the utilization of llseek to lseek. This change is in the new release of util-linux:
patch -Np1 -i ../util-linux-2.12r-missing_lseek-1.patch
The following sed prevents the installed files from being owned by root
cp MCONFIG{,.orig}
sed -e "s/-o root//" MCONFIG.orig > MCONFIG
Prepare Util-linux for compilation:
./configure
Compile the package:
make HAVE_KILL=yes HAVE_SLN=yes \ CPUOPT="" ARCH="" CPU=""
The meaning of the make parameters:
This prevents the kill program (already installed by Procps) from being built and installed again.
This prevents the sln program (a statically linked version of ln already installed by Glibc) from being built and installed again.
This disables any compiler optimizations by CPU type.
This disables the detection of the architecture.
This disables the detection of the CPU.
Install the package and move the logger binary to /bin as it is needed by the CLFS-Bootscripts package:
make HAVE_KILL=yes HAVE_SLN=yes \
CPUOPT="" ARCH="" CPU="" USE_TTY_GROUP=no DESTDIR=${CLFS} install
mv -v ${CLFS}/usr/bin/logger ${CLFS}/bin