Skip to the content.

12. System Utilities


This chapter contains mainly hardware utilities. It also contains some applications used by other applications in the book for installation or configuration purposes.

12.1 AccountsService-22.08.8


Introduction to AccountsService

The AccountsService package provides a set of D-Bus interfaces for querying and manipulating user account information and an implementation of those interfaces based on the usermod(8), useradd(8) and userdel(8) commands.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

AccountsService Dependencies

Required

Polkit-122

gobject-introspection-1.74.0 and Systemd-252

Optional

GTK-Doc-1.33.2 and xmlto-0.0.28

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/accountsservice

Installation of AccountsService

Install AccountsService by running the following commands:

mkdir build &&
cd build &&

meson --prefix=/usr       \
      --buildtype=release \
      -Dadmin_group=adm   \
      .. &&
ninja

This package does not come with a test suite.

Now, as the root user:

ninja install

Command Explanations

--buildtype=release: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

-Dadmin_group=adm: This switch sets the group for administrator accounts.

-Ddocbook=true: This switch enables building the D-Bus interface API documentation.

Configuring AccountsService

To allow users in the adm group to be listed as Administrators, execute the following commands as the root user:

cat > /etc/polkit-1/rules.d/40-adm.rules << "EOF"
polkit.addAdminRule(function(action, subject) {
   return ["unix-group:adm"];
   });
EOF

Systemd Unit

To start the accounts-daemon daemon at boot, enable the previously installed systemd unit by running the following command as the root user:

systemctl enable accounts-daemon

Contents

Installed Programs: accounts-daemon (in /usr/libexec)

Installed Libraries: libaccountsservice.so

Installed Directories: /usr/include/accountsservice-1.0, /usr/share/accountsservice, /usr/share/gtk-doc/html/libaccountsservice (optional), and /var/lib/AccountsService

Short Descriptions

accounts-daemon is the AccountsService daemon.

libaccountsservice.so contains the AccountsService API functions.

12.2 acpid-2.0.34


Introduction to acpid

The acpid (Advanced Configuration and Power Interface event daemon) is a completely flexible, totally extensible daemon for delivering ACPI events. It listens on netlink interface and when an event occurs, executes programs to handle the event. The programs it executes are configured through a set of configuration files, which can be dropped into place by packages or by the user.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/acpid

Installation of acpid

Install acpid by running the following commands:

./configure --prefix=/usr \
            --docdir=/usr/share/doc/acpid-2.0.34 &&
make

This package does not come with a test suite.

Now, as the root user:

make install                         &&
install -v -m755 -d /etc/acpi/events &&
cp -r samples /usr/share/doc/acpid-2.0.34

Configuring acpid

acpid is configured by user defined events. Place event files under /etc/acpi/events directory. If an event occurs, acpid recurses through the event files in order to see if the regex defined after “event” matches. If they do, action is executed.

The following brief example will suspend the system when the laptop lid is closed (it requires pm-utils-1.4.1):

cat > /etc/acpi/events/lid << "EOF"
event=button/lid
action=/etc/acpi/lid.sh
EOF

cat > /etc/acpi/lid.sh << "EOF"
#!/bin/sh
/bin/grep -q open /proc/acpi/button/lid/LID/state && exit 0
/usr/sbin/pm-suspend
EOF
chmod +x /etc/acpi/lid.sh

Unfortunately, not every computer labels ACPI events in the same way. To determine how your buttons are recognized, use the acpi_listen tool. Also, look in the samples directory under /usr/share/doc/acpid-2.0.34 for more examples.

Systemd Socket

To start the acpid daemon at boot, install the systemd unit from the blfs-systemd-units-20220720 package by running the following command as the root user:

make install-acpid

Note

This package uses socket based activation and will be started when something needs it. No standalone unit file is provided for this package.

Contents

Installed Programs: acpid, acpi_listen, and kacpimon

Installed Libraries: None

Installed Directories: /etc/acpi and /usr/share/doc/acpid-2.0.34

Short Descriptions

acpid is a program that listens for ACPI events and executes the rules that match the received event.

acpi_listen is a simple tool which connects to acpid and listens for events.

kacpimon is a monitor program that connects to three sources of ACPI events (events file, netlink and input layer) and then reports on what it sees while it is connected.

12.3 at-3.2.5


Introduction to at

The at package provide delayed job execution and batch processing. It is required for Linux Standards Base (LSB) conformance.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

at Dependencies

Required

An MTA

Optional

Linux-PAM-1.5.2

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/at

Installation of at

Before building at, as the root user you should create the group and user atd which will run the atd daemon:

groupadd -g 17 atd                                                  &&
useradd -d /dev/null -c "atd daemon" -g atd -s /bin/false -u 17 atd

Install at with the following commands:

./configure --with-daemon_username=atd        \
            --with-daemon_groupname=atd       \
            SENDMAIL=/usr/sbin/sendmail       \
            --with-jobdir=/var/spool/atjobs   \
            --with-atspool=/var/spool/atspool \
            --with-systemdsystemunitdir=/lib/systemd/system &&
make -j1

To test the results, issue: make test.

Now, as the root user:

make install docdir=/usr/share/doc/at-3.2.5 \
             atdocdir=/usr/share/doc/at-3.2.5

Configuring at

Config Files

/etc/at.allow and /etc/at.deny determines who can submit jobs via at or batch.

Linux PAM Configuration

If At has been built with Linux PAM support, you need to create a PAM configuration file, to get it working correctly with BLFS.

Issue the following commands as the root user to create the configuration file for Linux PAM:

cat > /etc/pam.d/atd << "EOF"
# Begin /etc/pam.d/atd

auth required pam_unix.so
account required pam_unix.so
password required pam_unix.so
session required pam_unix.so

# End /etc/pam.d/atd
EOF

Systemd Unit

To start the atd daemon at boot, enable the previously installed systemd unit by running the following command as the root user:

systemctl enable atd

Contents

Installed Programs: at, atd, atq (symlink), atrm (symlink), atrun, and batch

Installed Libraries: None

Installed Directories: /usr/share/doc/at-3.2.5

Short Descriptions

at queues, examines or deletes jobs for later execution.

atd is the daemon that runs jobs queued for later execution.

atq lists the user’s pending jobs, or all jobs, if superuser.

atrm deletes jobs, identified by their job number.

atrun runs jobs queued for later execution.

batch is a script that executes commands when system load levels permit.

12.4 autofs-5.1.8


Introduction to Autofs

Autofs controls the operation of the automount daemons. The automount daemons automatically mount filesystems when they are accessed and unmount them after a period of inactivity. This is done based on a set of pre-configured maps.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Autofs Dependencies

Required

libtirpc-1.3.3 and rpcsvc-proto-1.4.3

Optional

nfs-utils-2.6.2, libnsl-2.0.0, libxml2-2.10.3, MIT Kerberos V5-1.20.1, OpenLDAP-2.6.4 (client only), and Cyrus SASL-2.1.28

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/autofs

Kernel Configuration

Verify that automounter kernel support has been enabled:

File systems --->
    <*/M> Kernel automounter support (supports v3, v4, and v5) [CONFIG_AUTOFS_FS]

Optionally, enable the following options in the kernel configuration:

File systems  --->
    [*] Network File Systems  --->                                      [CONFIG_NETWORK_FILESYSTEMS]
        <*/M> NFS client support                                          [CONFIG_NFS_FS]
        <*/M> SMB3 and CIFS support (advanced network filesystem)         [CONFIG_CIFS]

Recompile and install the new kernel, if necessary.

Installation of Autofs

First fix an issue introduced by glibc-2.36:

grep -rl linux/fs modules | xargs sed -i "/linux\/fs/d"

Install Autofs by running the following commands:

./configure --prefix=/usr             \
            --with-mapdir=/etc/autofs \
            --with-libtirpc           \
            --with-systemd            \
            --without-openldap        \
            --mandir=/usr/share/man &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Caution

If autofs is already installed on your system, be sure to backup your configuration files. They’ll be overwritten by the following command.

Install the default configuration files, still as the root user:

make install_samples

Command Explanations

--with-libtirpc: This switch forces the package to use libtirpc for RPC functionality instead of relying on implementation from Glibc, which was removed in LFS 8.1.

--with-systemd: This switch enables installation of the bundled systemd units.

--without-openldap: This switch disables openldap if found. If openldap is desired, omit this switch. Note that openldap support in autofs requires MIT Kerberos V5-1.20.1.

Configuring Autofs

Config Files

/etc/sysconfig/autofs.conf, /etc/autofs/auto.master, /etc/autofs/auto.misc, and /etc/autofs/auto.net

Configuration Information

The installation process creates auto.master, auto.misc, auto.smb, and auto.net. Replace the auto.master file with the following commands as the root user:

mv /etc/autofs/auto.master /etc/autofs/auto.master.bak &&
cat > /etc/autofs/auto.master << "EOF"
# Begin /etc/autofs/auto.master

/media/auto  /etc/autofs/auto.misc  --ghost
#/home        /etc/autofs/auto.home

# End /etc/autofs/auto.master
EOF

This file creates a new media directory, /media/auto that will overlay any existing directory of the same name. In this example, the file, /etc/autofs/auto.misc, has a line:

          cd   -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

that will mount a cdrom as /media/auto/cd if that directory is accessed. The --ghost option tells the automounter to create “ghost” versions (i.e. empty directories) of all the mount points listed in the configuration file regardless whether any of the file systems are actually mounted or not. This is very convenient and highly recommended, because it will show you the available auto-mountable file systems as existing directories, even when their file systems aren’t currently mounted. Without the --ghost option, you’ll have to remember the names of the directories. As soon as you try to access one of them, the directory will be created and the file system will be mounted. When the file system gets unmounted again, the directory is destroyed too, unless the --ghost option was given.

Note

An alternative method would be to specify another automount location such as /var/lib/auto/cdrom and create a symbolic link from /media/cdrom to the automount location.

The auto.misc file must be configured to your working hardware. The loaded configuration file should load your cdrom if /dev/cdrom is active or it can be edited to match your device setup. Examples for floppies are available in the file and easily activated. Documentation for this file is available using the man 5 autofs command.

In the second line, if enabled, a user’s home directory would be mounted via NFS upon login. The /etc/home.auto would need to exist and have an entry similar to:

joe  example.org:/export/home/joe

where the directory /export/home/joe is exported via NFS from the system example.org. NFS shares are covered on the next page.

This package could also be used to mount SMB shares, however that feature is not configured in these instructions. For additional configuration information, see the man pages for auto.master(5). There are also web resources such as this AUTOFS HOWTO available.

Systemd Unit

To start Autofs at boot, enable the previously installed systemd unit by running the following command as the root user:

systemctl enable autofs

Note

You can also specify OPTIONS variable in the /etc/sysconfig/autofs file with any additional parameters that you might want to pass to the automount daemon.

Contents

Installed Program: automount

Installed Libraries: lookup_dir.so, lookup_file.so, lookup_files.so, lookup_hosts.so, lookup_ldap.so (optional), lookup_multi.so, lookup_nis.so, lookup_program.so, lookup_userhome.so, lookup_yp.so, mount_afs.so, mount_autofs.so, mount_bind.so, mount_changer.so, mount_ext2.so, mount_ext3.so, mount_ext4.so, mount_generic.so, mount_nfs.so, mount_nfs4.so, parse_amd.so, and parse_sun.so

Installed Directories: /usr/lib/autofs and /etc/autofs

Short Descriptions

automount is the daemon that performs the mounting when a request is made for the device.

12.5 BlueZ-5.66


Introduction to BlueZ

The BlueZ package contains the Bluetooth protocol stack for Linux.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

BlueZ Dependencies

Required

dbus-1.14.6, GLib-2.74.5, and libical-3.0.16

Optional

docutils-0.19 (to generate man pages)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/bluez

Kernel Configuration

If you are building this package to use bluetooth devices (rather than as a build dependency), enable the following options in the kernel configuration, also the options in the “Cryptographic API” section if you intend to run the tests, and recompile the kernel if necessary:

General Setup --->
    [ /*] Configure standard kernel features (expert users)     [CONFIG_EXPERT]
        (Note: if CONFIG_EXPERT is disabled, the following options will be
            hidden and enabled implicitly.  We DO NOT recommend to enable
            CONFIG_EXPERT unless you are really an expert user.)
        [*] Enable timerfd() system call                        [CONFIG_TIMERFD]
        [*] Enable eventfd() system call                        [CONFIG_EVENTFD]

[*] Networking support --->                     [CONFIG_NET]
    <*/M> Bluetooth subsystem support --->      [CONFIG_BT]
        <*/M> RFCOMM protocol support           [CONFIG_BT_RFCOMM]
        [*]   RFCOMM TTY support                [CONFIG_BT_RFCOMM_TTY]
        <*/M> BNEP protocol support             [CONFIG_BT_BNEP]
        [*]   Multicast filter support          [CONFIG_BT_BNEP_MC_FILTER]
        [*]   Protocol filter support           [CONFIG_BT_BNEP_PROTO_FILTER]
        <*/M> HIDP protocol support             [CONFIG_BT_HIDP]
            Bluetooth device drivers --->
                (Select the appropriate drivers for your Bluetooth hardware)

    <*/M> RF switch subsystem support ----      [CONFIG_RFKILL]

-*- Cryptographic API --->
    Crypto core or helper --- >
        <*/M> User-space cryptographic algorithm configuration   [CONFIG_CRYPTO_USER]
    Block ciphers --->
        <*/M> AES (Advanced Encryption Standard)                 [CONFIG_CRYPTO_AES]
    AEAD (authenticated encryption with associated data) ciphers --->
        <*/M> CCM (Counter with Cipher Block Chaining-MAC)       [CONFIG_CRYPTO_CCM]
    Hashes, digests, and MACs --->
        <*/M> CMAC (Cipher-based MAC)                            [CONFIG_CRYPTO_CMAC]
    Userspace interface --->
        <*/M> Hash algorithms                                    [CONFIG_CRYPTO_USER_API_HASH]
        <*/M> Symmetric key cipher algorithms                    [CONFIG_CRYPTO_USER_API_SKCIPHER]
        <*/M> AEAD cipher algorithms                             [CONFIG_CRYPTO_USER_API_AEAD]

Installation of BlueZ

Install BlueZ by running the following commands:

./configure --prefix=/usr         \
            --sysconfdir=/etc     \
            --localstatedir=/var  \
            --disable-manpages    \
            --enable-library      &&
make

To test the results, issue: make check.

Now, as the root user:

make install &&
ln -svf ../libexec/bluetooth/bluetoothd /usr/sbin

Install the main configuration file as the root user:

install -v -dm755 /etc/bluetooth &&
install -v -m644 src/main.conf /etc/bluetooth/main.conf

If desired, install the API documentation as the root user:

install -v -dm755 /usr/share/doc/bluez-5.66 &&
install -v -m644 doc/*.txt /usr/share/doc/bluez-5.66

Command Explanations

--disable-manpages: This switch disables generating the manual pages because of the reliance on ‘rst2man’ in docutils. Remove this switch if you have docutils-0.19 installed and wish to generate the manual pages.

--enable-library: This switch enables building the BlueZ 4 compatibility library which is required by some applications.

ln -svf ../libexec/bluetooth/bluetoothd /usr/sbin: This command makes access to the bluetooth daemon more convenient.

Configuring BlueZ

Configuration Files

/etc/bluetooth/main.conf is installed automatically during the installation. Additionally, there are two supplementary configuration files. You can optionally install the following files as the root user:

cat > /etc/bluetooth/rfcomm.conf << "EOF"
# Start rfcomm.conf
# Set up the RFCOMM configuration of the Bluetooth subsystem in the Linux kernel.
# Use one line per command
# See the rfcomm man page for options


# End of rfcomm.conf
EOF
cat > /etc/bluetooth/uart.conf << "EOF"
# Start uart.conf
# Attach serial devices via UART HCI to BlueZ stack
# Use one line per device
# See the hciattach man page for options

# End of uart.conf
EOF

Systemd Bluez Services

To start the bluetoothd daemon at boot, enable the previously installed systemd unit by running the following command as the root user:

systemctl enable bluetooth

To start the obexd daemon for a user session (to support some Bluetooth programs using it), enable the previously installed systemd unit for all users by running the following command as the root user:

systemctl enable --global obex

Note

Systemd will start the Bluetooth daemon only when a bluetooth device is detected on the system.

Contents

Installed Programs: bluemoon, bluetoothctl, bluetoothd (symlink), btattach, btmon, hex2hcd, l2ping, l2test, mpris-proxy, and rctest

Installed Library: libbluetooth.so

Installed Directories: /etc/bluetooth, /usr/{include,libexec}/bluetooth, and /usr/share/doc/bluez-5.66

Short Descriptions

bluemoon is a Bluemoon configuration utility.

bluetoothctl is the interactive Bluetooth control program.

bluetoothd is the Bluetooth daemon.

btmon provides access to the Bluetooth subsystem monitor infrastructure for reading HCI traces.

hex2hcd is used to convert a file needed by Broadcom devices to hcd (Broadcom bluetooth firmware) format.

l2ping is used to send a L2CAP echo request to the Bluetooth MAC address given in dotted hex notation.

l2test is a L2CAP testing program.

rctest is used to test RFCOMM communications on the Bluetooth stack.

libbluetooth.so contains the BlueZ 4 API functions.

12.6 Bubblewrap-0.7.0


Introduction to Bubblewrap

Bubblewrap is a setuid implementation of user namespaces, or sandboxing, that provides access to a subset of kernel user namespace features. Bubblewrap allows user owned processes to run in an isolated environment with limited access to the underlying filesystem.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Bubblewrap Dependencies

Optional

libxslt-1.1.37 (to generate manual pages) and libseccomp-2.5.4 (built with python bindings, for tests)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/bubblewrap

Installation of Bubblewrap

Install Bubblewrap by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=/usr --buildtype=release .. &&
ninja

Next, if you desire to run the test suite, fix an issue caused by the merged-/usr configuration in LFS:

sed 's@symlink usr/lib64@ro-bind-try /lib64@' -i ../tests/libtest.sh

To test the results, issue: ninja test

Now, as the root user:

ninja install

Command Explanations

--buildtype=release: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

Contents

Installed Program: bwrap

Installed Libraries: None

Installed Directories: None

Short Descriptions

bwrap generates a sandbox for a program to run in.

12.7 Colord-1.4.6


Introduction to Colord

Colord is a system service that makes it easy to manage, install, and generate color profiles. It is used mainly by GNOME Color Manager for system integration and use when no users are logged in.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Colord Dependencies

Required

dbus-1.14.6, GLib-2.74.5, Little CMS-2.14, Polkit-122, and SQLite-3.40.1

gobject-introspection-1.74.0, libgudev-237, libgusb-0.4.5, Systemd-252, and Vala-0.56.4

Optional

gnome-desktop-43.2 and colord-gtk-0.3.0 (to build the example tools), DocBook-utils-0.6.14, GTK-Doc-1.33.2, libxslt-1.1.37, SANE-1.0.32, ArgyllCMS, and Bash Completion

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/colord

Installation of Colord

There should be a dedicated user and group to take control of the colord daemon after it has started. Issue the following commands as the root user:

groupadd -g 71 colord &&
useradd -c "Color Daemon Owner" -d /var/lib/colord -u 71 \
        -g colord -s /bin/false colord

Fix a double free causing a build failure on 32-bit x86 and runtime crashes with some monitors:

sed '/cmsUnregisterPluginsTHR/d' -i lib/colord/cd-context-lcms.c

Install Colord by running the following commands:

mkdir build &&
cd build &&

meson --prefix=/usr            \
      --buildtype=release      \
      -Ddaemon_user=colord     \
      -Dvapi=true              \
      -Dsystemd=true           \
      -Dlibcolordcompat=true   \
      -Dargyllcms_sensor=false \
      -Dbash_completion=false  \
      -Ddocs=false             \
      -Dman=false ..           &&
ninja

Now, as the root user:

ninja install

To test the results, issue: ninja test. One test, colord-self-test-daemon, will fail if the package is already installed. The test suite must be run with the system-wide D-Bus Daemon running.

Command Explanations

--buildtype=release: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

-Ddaemon_user=colord: This switch is used so the colord daemon will run as an unprivileged user instead of the root user.

-Dvapi=true: This switch enables building the Vala bindings. Remove if you don’t have Vala-0.56.4 installed.

-Dsystemd=true: This switch enables installation of the systemd service.

-Dlibcolordcompat=true: This switch enables building a compatibility library for older packages that use Colord.

-Dargyllcms_sensor=false: This switch disables the ArgLLCMS sensor driver. Omit if you have ArgyllCMS installed and wish to use it.

-Dbash_completion=false: This switch disables Bash Completion support for Colord applications.

-Ddocs=false: This switch disables building of documentation. Omit if you have GTK-Doc-1.33.2 available.

-Dman=false: This switch disables building of man pages. Omit if you have DocBook-utils-0.6.14 available. Namespaced versions of the docbook-xsl stylesheets are also required.

Contents

Installed Programs: cd-create-profile, cd-fix-profile, cd-iccdump, cd-it8, and colormgr

Installed Libraries: libcolord.so, libcolordcompat.so, libcolordprivate.so, and libcolorhug.so

Installed Directories: /usr/include/colord-1, /usr/lib/colord-{plugins,sensors}, /usr/share/color{d}, /usr/share/gtk-doc/html/colord, and /var/lib/colord

Short Descriptions

cd-create-profile is the Color Manager Profile Creation Tool.

cd-fix-profile is a tool used to fix metadata in ICC profiles.

cd-iccdump dumps the contents of an ICC profile as human readable text.

cd-it8 is the Color Manager Testing Tool.

colormgr is a text-mode program that allows you to interact with colord on the command line.

libcolord.so contains the Colord API functions.

libcolordcompat.so contains legacy API functions for compatibility with older applications.

libcolordprivate.so contains internal API functions for the programs included with Colord.

libcolorhug.so contains a simple display hardware colorimiter.

12.8 cpio-2.13


Introduction to cpio

The cpio package contains tools for archiving.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

CPIO Dependencies

Optional

texlive-20220321 (or install-tl-unx)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/cpio

Installation of cpio

First, fix a build issue when using GCC-10 and higher:

sed -i '/The name/,+2 d' src/global.c

Install cpio by running the following commands:

./configure --prefix=/usr \
            --enable-mt   \
            --with-rmt=/usr/libexec/rmt &&
make &&
makeinfo --html            -o doc/html      doc/cpio.texi &&
makeinfo --html --no-split -o doc/cpio.html doc/cpio.texi &&
makeinfo --plaintext       -o doc/cpio.txt  doc/cpio.texi

If you have texlive-20220321 installed and wish to create PDF or Postscript documentation, issue one or both of the following commands:

make -C doc pdf &&
make -C doc ps

To test the results, issue: make check.

Now, as the root user:

make install &&
install -v -m755 -d /usr/share/doc/cpio-2.13/html &&
install -v -m644    doc/html/* \
                    /usr/share/doc/cpio-2.13/html &&
install -v -m644    doc/cpio.{html,txt} \
                    /usr/share/doc/cpio-2.13

If you built PDF or Postscript documentation, install it by issuing the following commands as the root user:

install -v -m644 doc/cpio.{pdf,ps,dvi} \
                 /usr/share/doc/cpio-2.13

Command Explanations

--enable-mt: This parameter forces the building and installation of the mt program.

--with-rmt=/usr/libexec/rmt: This parameter inhibits building the rmt program as it is already installed by the Tar package in LFS.

Contents

Installed Programs: cpio and mt

Installed Libraries: None

Installed Directories: /usr/share/doc/cpio-2.13

Short Descriptions

cpio copies files to and from archives.

mt controls magnetic tape drive operations.

12.9 cups-pk-helper-0.2.7


Introduction to cups-pk-helper

The cups-pk-helper package contains a PolicyKit helper used to configure Cups with fine-grained privileges.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

cups-pk-helper Dependencies

Required

Cups-2.4.2 and Polkit-122

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/cups-pk-helper

Installation of cups-pk-helper

Install cups-pk-helper by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=/usr .. &&
ninja

This package does not come with a test suite.

Now, as the root user:

ninja install

Contents

Installed Programs: cups-pk-helper-mechanism (library executable)

Installed Libraries: None

Installed Directories: None

12.10 dbus-1.14.6


Introduction to D-Bus

Even though D-Bus was built in LFS, there are some features provided by the package that other BLFS packages need, but their dependencies didn’t fit into LFS.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

D-Bus Dependencies

Required

Systemd-252

Xorg Libraries (for dbus-launch program)

Optional

For the tests: D-Bus Python-1.3.2, PyGObject-3.42.2, and Valgrind-3.20.0; for documentation: Doxygen-1.9.6, xmlto-0.0.28, Ducktype, and Yelp Tools

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/dbus

Installation of D-Bus

Install D-Bus by running the following commands (you may wish to review the output from ./configure –help first and add any desired parameters to the configure command shown below):

./configure --prefix=/usr                        \
            --sysconfdir=/etc                    \
            --localstatedir=/var                 \
            --runstatedir=/run                   \
            --enable-user-session                \
            --disable-doxygen-docs               \
            --disable-xml-docs                   \
            --disable-static                     \
            --docdir=/usr/share/doc/dbus-1.14.6  \
            --with-system-socket=/run/dbus/system_bus_socket &&
make

See below for test instructions.

Now, as the root user:

make install

If you are using a DESTDIR install, dbus-daemon-launch-helper needs to be fixed afterwards. Issue, as root user:

chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper &&
chmod -v      4750       /usr/libexec/dbus-daemon-launch-helper

The dbus tests cannot be run until after D-Bus Python-1.3.2 and PyGObject-3.42.2 have been installed. They must be run as an unprivileged user from a local session with bus address. To run the standard tests issue make check.

If you want to run the unit regression tests, configure requires additional parameters which expose additional functionality in the binaries that are not intended to be used in a production build of D-Bus. If you would like to run the tests, issue the following commands (for the tests, you don’t need to build the docs):

make distclean                                    &&
PYTHON=python3 ./configure --enable-tests         \
                           --enable-asserts       \
                           --disable-doxygen-docs \
                           --disable-xml-docs     &&
make                                              &&
make check

There have been reports that the tests may fail if running inside a Midnight Commander shell. You may get out-of-memory error messages when running the tests. These are normal and can be safely ignored.

Command Explanations

--disable-doxygen-docs: This switch disables doxygen documentation build and install, if you have doxygen installed. If doxygen is installed, and you wish to build them, remove this parameter.

--disable-xml-docs: This switch disables html documentation build and install, if you have xmlto installed. If xmlto is installed, and you wish to build them, remove this parameter.

--disable-static: This switch prevents installation of static versions of the libraries.

--enable-user-session: This parameter enables per-user DBus sessions with systemd.

--with-system-pid-file=/run/dbus/pid: This parameter specifies the location of the PID file.

--with-system-socket=/run/dbus/system_bus_socket: This parameter specifies the location of the system bus socket.

--enable-tests: Builds extra parts of the code to support all tests. Do not use on a production build.

--enable-embedded-tests: Builds extra parts of the code to support only unit tests. Do not use on a production build.

--enable-asserts: Enables debugging code to run assertions for statements normally assumed to be true. This prevents a warning that ‘--enable-tests’ on its own is only useful for profiling and might not give true results for all tests, but adds its own NOTE that this should not be used in a production build.

Configuring D-Bus

Config Files

/etc/dbus-1/session.conf, /etc/dbus-1/system.conf and /etc/dbus-1/system.d/*

Configuration Information

The configuration files listed above should probably not be modified. If changes are required, you should create /etc/dbus-1/session-local.conf and/or /etc/dbus-1/system-local.conf and make any desired changes to these files.

If any packages install a D-Bus .service file outside of the standard /usr/share/dbus-1/services directory, that directory should be added to the local session configuration. For instance, /usr/local/share/dbus-1/services can be added by performing the following commands as the root user:

cat > /etc/dbus-1/session-local.conf << "EOF"
<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- Search for .service files in /usr/local -->
  <servicedir>/usr/local/share/dbus-1/services</servicedir>

</busconfig>
EOF

D-Bus Session Daemon

There are many methods you can use to start a session daemon using the dbus-launch command. Review the dbus-launch man page for details about the available parameters and options. Here are some suggestions and examples:

# Start the D-Bus session daemon
eval `dbus-launch`
export DBUS_SESSION_BUS_ADDRESS
This method will not stop the session daemon when you exit your shell, therefore you should add the following line to your `~/.bash_logout` file:
# Kill the D-Bus session daemon
kill $DBUS_SESSION_BUS_PID

Contents

A list of the installed files, along with their short descriptions can be found at ../../../../lfs/view/11.3-systemd/chapter08/dbus.html#contents-dbus.

12.11 Fcron-3.2.1


Introduction to Fcron

The Fcron package contains a periodical command scheduler which aims at replacing Vixie Cron.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Fcron Dependencies

Optional

An MTA, text editor (default is vi from the Vim-9.0.1273 package), Linux-PAM-1.5.2, and DocBook-utils-0.6.14

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/fcron

Installation of Fcron

For security reasons, an unprivileged user and group for Fcron should be created (perform as the root user):

groupadd -g 22 fcron &&
useradd -d /dev/null -c "Fcron User" -g fcron -s /bin/false -u 22 fcron

Now fix some locations hard coded in the documentation:

find doc -type f -exec sed -i 's:/usr/local::g' {} \;

Install Fcron by running the following commands:

./configure --prefix=/usr          \
            --sysconfdir=/etc      \
            --localstatedir=/var   \
            --without-sendmail     \
            --with-piddir=/run     \
            --with-boot-install=no &&
make

This package does not come with a test suite.

Now, as the root user:

make install

DESTDIR install must be done as root user. Furthermore, if PAM configuration files should be installed in /etc/pam.d, you have to create this directory in the DESTDIR before doing the install.

Command Explanations

--without-sendmail: By default, Fcron will attempt to use the sendmail command from an MTA package to email you the results of the fcron script. This switch is used to disable default email notification. Omit the switch to enable the default. Alternatively, you can use the --with-sendmail=</path/to/MTA command> to use a different mailer command.

--with-boot-install=no: This prevents installation of the bootscript included with the package.

--with-piddir=/run: This fixes the systemd unit to use the proper directory for PID files so that systemctl does not hang and the unit starts correctly.

--with-editor=</path/to/editor>: This switch allows you to set the default text editor.

--with-dsssl-dir=</path/to/dsssl-stylesheets>: May be used if you have DocBook-utils-0.6.14 installed. Currently, the dsssl stylesheets are located at /usr/share/sgml/docbook/dsssl-stylesheets-1.79.

Configuring Fcron

Config Files

/etc/fcron.conf, /etc/fcron.allow, and /etc/fcron.deny

Configuration Information

There are no required changes in any of the config files. Configuration information can be found in the man page for fcron.conf.

fcron scripts are written using fcrontab. Refer to the fcrontab man page for proper parameters to address your situation.

If Linux-PAM is installed, two PAM configuration files are installed in etc/pam.d. Alternatively if etc/pam.d is not used, the installation will append two configuration sections to the existing /etc/pam.conf file. You should ensure the files match your preferences. Modify them as required to suit your needs.

Periodic Jobs

If you would like to set up a periodic hierarchy for the root user, first issue the following commands (as the root user) to create the /usr/bin/run-parts script:

cat > /usr/bin/run-parts << "EOF" &&
#!/bin/sh
# run-parts:  Runs all the scripts found in a directory.
# from Slackware, by Patrick J. Volkerding with ideas borrowed
# from the Red Hat and Debian versions of this utility.

# keep going when something fails
set +e

if [ $# -lt 1 ]; then
  echo "Usage: run-parts <directory>"
  exit 1
fi

if [ ! -d $1 ]; then
  echo "Not a directory: $1"
  echo "Usage: run-parts <directory>"
  exit 1
fi

# There are several types of files that we would like to
# ignore automatically, as they are likely to be backups
# of other scripts:
IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp"

# Main loop:
for SCRIPT in $1/* ; do
  # If this is not a regular file, skip it:
  if [ ! -f $SCRIPT ]; then
    continue
  fi
  # Determine if this file should be skipped by suffix:
  SKIP=false
  for SUFFIX in $IGNORE_SUFFIXES ; do
    if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then
      SKIP=true
      break
    fi
  done
  if [ "$SKIP" = "true" ]; then
    continue
  fi
  # If we've made it this far, then run the script if it's executable:
  if [ -x $SCRIPT ]; then
    $SCRIPT || echo "$SCRIPT failed."
  fi
done

exit 0
EOF
chmod -v 755 /usr/bin/run-parts

Next, create the directory layout for the periodic jobs (again as the root user):

install -vdm754 /etc/cron.{hourly,daily,weekly,monthly}

Finally, add the run-parts to the system fcrontab (while still the root user):

cat > /var/spool/fcron/systab.orig << "EOF"
&bootrun 01 * * * * root run-parts /etc/cron.hourly
&bootrun 02 4 * * * root run-parts /etc/cron.daily
&bootrun 22 4 * * 0 root run-parts /etc/cron.weekly
&bootrun 42 4 1 * * root run-parts /etc/cron.monthly
EOF

Systemd Unit

Enable fcron to start at boot using the previously installed systemd unit.

systemctl enable fcron

Finally, again as the root user, start fcron and generate the /var/spool/fcron/systab file:

systemctl start fcron &&
fcrontab -z -u systab

Contents

Installed Programs: fcron, fcrondyn, fcronsighup, and fcrontab

Installed Libraries: None

Installed Directories: /usr/share/doc/fcron-3.2.1 and /var/spool/fcron

Short Descriptions

fcron is the scheduling daemon.

fcrondyn is a user tool intended to interact with a running fcron daemon.

fcronsighup instructs fcron to reread the Fcron tables.

fcrontab is a program used to install, edit, list and remove the tables used by fcron.

12.12 GPM-1.20.7


Introduction to GPM

The GPM (General Purpose Mouse daemon) package contains a mouse server for the console and xterm. It not only provides cut and paste support generally, but its library component is used by various software such as Links to provide mouse support to the application. It is useful on desktops, especially if following (Beyond) Linux From Scratch instructions; it’s often much easier (and less error prone) to cut and paste between two console windows than to type everything by hand!

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Additional Downloads

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/GPM

Kernel Configuration

Enable the following option in the kernel configuration and recompile the kernel if necessary:

Device Drivers  --->
    Input device support --->   [CONFIG_INPUT]
        <*/M> Mouse interface   [CONFIG_INPUT_MOUSEDEV]

Installation of GPM

Install GPM by running the following commands:

patch -Np1 -i ../gpm-1.20.7-consolidated-1.patch &&
./autogen.sh                                     &&
./configure --prefix=/usr --sysconfdir=/etc      &&
make

This package does not come with a test suite.

Now, as the root user:

make install                                          &&

install-info --dir-file=/usr/share/info/dir           \
             /usr/share/info/gpm.info                 &&

rm -fv /usr/lib/libgpm.a                              &&
ln -sfv libgpm.so.2.1.0 /usr/lib/libgpm.so            &&
install -v -m644 conf/gpm-root.conf /etc              &&

install -v -m755 -d /usr/share/doc/gpm-1.20.7/support &&
install -v -m644    doc/support/*                     \
                    /usr/share/doc/gpm-1.20.7/support &&
install -v -m644    doc/{FAQ,HACK_GPM,README*}        \
                    /usr/share/doc/gpm-1.20.7

Command Explanations

./autogen.sh: This command creates the missing configure script.

install-info …: This package installs a .info file, but does not update the system dir file. This command makes the update.

ln -v -sfn libgpm.so.2.1.0 /usr/lib/libgpm.so: This command is used to create (or update) the .so symlink to the library.

Configuring GPM

Systemd Unit

To start the gpm daemon at boot, install the systemd unit from the blfs-systemd-units-20220720 package by running the following command as the root user:

make install-gpm

Config Files

/etc/gpm-root.conf and ~/.gpm-root: The default and individual user gpm-root configuration files.

Configuration Information

GPM is by default started with the following parameters: -m /dev/input/mice -t imps2. If the mentioned parameters don’t suit your needs, you can override them by running the following commands as the root user:

install -v -dm755 /etc/systemd/system/gpm.service.d &&
cat > /etc/systemd/system/gpm.service.d/99-user.conf << EOF
[Service]
ExecStart=/usr/sbin/gpm <list of parameters>
EOF

Contents

Installed Programs: disable-paste, display-buttons, display-coords, get-versions, gpm, gpm-root, hltest, mev, and mouse-test

Installed Library: libgpm.so

Installed Directory: /usr/share/doc/gpm-1.20.7

Short Descriptions

disable-paste is a security mechanism used to disable the paste buffer.

display-buttons is a simple program that reports the mouse buttons being pressed and released.

display-coords is a simple program that reports the mouse coordinates.

get-versions is used to report the GPM library and server versions.

gpm is a cut and paste utility and mouse server for virtual consoles.

gpm-root is a default handler for gpm. It is used to draw menus on the root window.

hltest is a simple sample application using the high-level library, meant to be read by programmers trying to use the high-level library.

mev is a program to report mouse events.

mouse-test is a tool for determining the mouse type and device it’s attached to.

libgpm.so contains the API functions to access the GPM daemon.

12.13 Hdparm-9.65


Introduction to Hdparm

The Hdparm package contains a utility that is useful for obtaining information about, and controlling ATA/IDE controllers and hard drives. It allows to increase performance and sometimes to increase stability.

This package is known to build and work properly using an LFS 11.3 platform.

Warning

As well as being useful, incorrect usage of Hdparm can destroy your information and in rare cases, drives. Use with caution and make sure you know what you are doing. If in doubt, it is recommended that you leave the default kernel parameters alone.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/hdparm

Installation of Hdparm

Build Hdparm by running the following command:

make

This package does not come with a test suite.

Now, as the root user:

make binprefix=/usr install

Contents

Installed Program: hdparm

Installed Libraries: None

Installed Directories: None

Short Descriptions

hdparm provides a command-line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem.

12.14 LSB-Tools-0.10


Introduction to LSB-Tools

The LSB-Tools package includes tools for Linux Standards Base (LSB) conformance.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/LSB-Tools

Installation of LSB-Tools

Install LSB-Tools by running the following commands:

python3 setup.py build

Now, as the root user:

python3 setup.py install --optimize=1

Configuration Information

The configuration for this package was done in LFS and Systemd. The file /etc/lsb-release should already exist. Be sure that the DISTRIB_CODENAME entry has been set properly.

Contents

Installed Programs: lsb_release, install_initd, and remove_initd

Installed Library: None

Installed Directories: /usr/lib/lsb and /usr/lib/python3.11/site-packages/lsbtools

Short Descriptions

lsb_release is a script to give LSB data.

install_initd is a script to activate SysV startup scripts.

remove_initd is a script to deactivate SysV startup scripts.

12.15 Lm-sensors-3-6-0


Introduction to Lm_sensors

The lm_sensors package provides userspace support for the hardware monitoring drivers in the Linux kernel. This is useful for monitoring the temperature of the CPU and adjusting the performance of some hardware (such as cooling fans).

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

lm_sensors Dependencies

Required

Which-2.21

Optional

RRDtool (required to build the sensord program) and dmidecode (runtime)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/lm_sensors

Kernel Configuration

Getting your kernel config right is an iterative process that may require that you recompile your kernel a couple of times. The simplest way to go about it is to start by enabling modules and then compile everything that may be needed by Lm Sensors as a module:

[*] Enable loadable module support  --->        [CONFIG_MODULES]

Device Drivers  --->
    [*] PCI support --->                        [CONFIG_PCI]
    I2C support --->
        <*/M> I2C device interface              [CONFIG_I2C_CHARDEV]
        I2C Hardware Bus support  --->
            <M> (configure all of them as modules)
    <*/M> Hardware Monitoring support  --->     [CONFIG_HWMON]
        <M> (configure all of them as modules)

Recompile your kernel and reboot into the new kernel. Don’t forget to make modules_install We will come back to the kernel in the Configuring section below.

Installation of Lm_sensors

Install Lm_sensors by running the following commands:

make PREFIX=/usr        \
     BUILD_STATIC_LIB=0 \
     MANDIR=/usr/share/man

This package does not come with a test suite.

Now, as the root user:

make PREFIX=/usr        \
     BUILD_STATIC_LIB=0 \
     MANDIR=/usr/share/man install &&

install -v -m755 -d /usr/share/doc/lm_sensors-3-6-0 &&
cp -rv              README INSTALL doc/* \
                    /usr/share/doc/lm_sensors-3-6-0

Command Explanations

BUILD_STATIC_LIB=0: This parameter disables compiling and installing the static version of libsensors.

PROG_EXTRA=sensord: This parameter enables compiling sensord, a daemon that can monitor your system at regular intervals. Compiling sensord requires RRDtool. Be sure to install RRDtool in /usr by running make prefix=/usr when building it. Otherwise, Lm_sensors will not find it easily.

Configuring Lm_sensors

Config File

/etc/sensors3.conf

Configuration Information

To find out what hardware sensors your system has, issue the following command as the root user:

sensors-detect

The appropriate modules should have been loaded and a summary is displayed at the end. Now you know what is needed and you can recompile your kernel to enable just the options you need (i.e., don’t enable the modules you cannot use).

Contents

Installed Programs: fancontrol, isadump, isaset, pwmconfig, sensors, sensors-conf-convert, sensors-detect, and optionally, sensord

Installed Library: libsensors.so

Installed Directories: /etc/sensors.d, /usr/include/sensors and /usr/share/doc/lm_sensors-3-6-0

Short Descriptions

fancontrol is a shell script for use with lm_sensors. It reads its configuration from a file, then calculates fan speeds from temperatures and sets the corresponding PWM outputs to the computed values.

isadump is a small helper program to examine registers visible through the ISA bus. It is intended to probe any chip that lives on the ISA bus working with an address register and a data register (I2C-like access) or a flat range (of up to 256 bytes).

isaset is a small helper program to set registers visible through the ISA bus.

pwmconfig tests the pulse width modulation (PWM) outputs of sensors and configures fancontrol.

sensors prints the current readings of all sensor chips.

sensors-conf-convert is a Perl script to convert lm-sensors version 2 configuration files to work with version 3.

sensors-detect is a Perl script that will walk you through the process of scanning your system for various hardware monitoring chips (sensors) supported by libsensors, or more generally by the lm_sensors tool suite.

sensord (optional) is a daemon that can be used to periodically log sensor readings.

libsensors.so contains the lm_sensors API functions.

12.16 Logrotate-3.21.0


Introduction to Logrotate

The logrotate package allows automatic rotation, compression, removal, and mailing of log files.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Logrotate Dependencies

Required

popt-1.19

Optional

An MTA (runtime)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/logrotate

Installation of Logrotate

Install logrotate by running the following command:

./configure --prefix=/usr &&
make

To test the results, issue: make test. One test fails because the very old compress is not present and two tests fail if an MTA is not installed.

Now, as the root user:

make install

Configuring Logrotate

Logrotate needs a configuration file, which must be passed as an argument to the command when executed. Create the file as the root user:

cat > /etc/logrotate.conf << EOF
# Begin /etc/logrotate.conf

# Rotate log files weekly
weekly

# Don't mail logs to anybody
nomail

# If the log file is empty, it will not be rotated
notifempty

# Number of backups that will be kept
# This will keep the 2 newest backups only
rotate 2

# Create new empty files after rotating old ones
# This will create empty log files, with owner
# set to root, group set to sys, and permissions 664
create 0664 root sys

# Compress the backups with gzip
compress

# No packages own lastlog or wtmp -- rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/lastlog {
    monthly
    rotate 1
}

# Some packages drop log rotation info in this directory
# so we include any file in it.
include /etc/logrotate.d

# End /etc/logrotate.conf
EOF

chmod -v 0644 /etc/logrotate.conf

Now create the /etc/logrotate.d directory as the root user:

mkdir -p /etc/logrotate.d

At this point additional log rotation commands can be entered, typically in the /etc/logrotate.d directory. For example:

cat > /etc/logrotate.d/sys.log << EOF
/var/log/sys.log {
   # If the log file is larger than 100kb, rotate it
   size   100k
   rotate 5
   weekly
   postrotate
      /bin/killall -HUP syslogd
   endscript
}
EOF

chmod -v 0644 /etc/logrotate.d/sys.log

You can designate multiple files in one entry:

cat > /etc/logrotate.d/example.log << EOF
file1
file2
file3 {
   ...
   postrotate
    ...
   endscript
}
EOF

chmod -v 0644 /etc/logrotate.d/example.log

You can use in the same line the list of files: file1 file2 file3. See the logrotate man page or https://www.techrepublic.com/article/manage-linux-log-files-with-logrotate/ for more examples.

The command logrotate /etc/logrotate.conf can be run manually, however, the command should be run daily. Other useful commands are logrotate -d /etc/logrotate.conf for debugging purposes and logrotate -f /etc/logrotate.conf forcing the logrotate commands to be run immediately. Combining the previous options -df, you can debug the effect of the force command. When debugging, the commands are only simulated and are not actually run. As a result, errors about files not existing will eventually appear because the files are not actually created.

To run the logrotate command daily, execute the following commands, as the root user, to create a systemd timer to run daily at 3:00 A.M. (local time):

cat > /usr/lib/systemd/system/logrotate.service << "EOF" &&
[Unit]
Description=Runs the logrotate command
Documentation=man:logrotate(8)
DefaultDependencies=no
After=local-fs.target
Before=shutdown.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/logrotate /etc/logrotate.conf
EOF
cat > /usr/lib/systemd/system/logrotate.timer << "EOF" &&
[Unit]
Description=Runs the logrotate command daily at 3:00 AM

[Timer]
OnCalendar=*-*-* 3:00:00
Persistent=true

[Install]
WantedBy=timers.target
EOF
systemctl enable logrotate.timer

Contents

Installed Programs: logrotate

Installed Library: None

Installed Directories: None

Short Descriptions

logrotate performs the log maintenance functions defined in the configuration files.

12.17 MC-4.8.29


Introduction to MC

MC (Midnight Commander) is a text-mode full-screen file manager and visual shell. It provides a clear, user-friendly, and somewhat protected interface to a Unix system while making many frequent file operations more efficient and preserving the full power of the command prompt.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

MC Dependencies

Required

GLib-2.74.5 and PCRE-8.45

slang-2.3.3

Optional

Doxygen-1.9.6, GPM-1.20.7, libssh2-1.10.0, Ruby-3.2.1, Samba-4.17.5, UnZip-6.0, a graphical environment, and Zip-3.0

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/MC

Installation of MC

Install MC by running the following commands:

./configure --prefix=/usr \
            --sysconfdir=/etc \
            --enable-charset &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Command Explanations

--sysconfdir=/etc: This switch places the global configuration directory in /etc.

--enable-charset: This switch adds support to mcedit for editing files in encodings different from the one implied by the current locale.

Configuring MC

Config Files

~/.config/mc/*

Configuration Information

The ~/.config/mc directory and its contents are created when you start mc for the first time. Then you can edit the main ~/.config/mc/ini configuration file manually or through the MC shell. Consult the mc(1) man page for details.

Contents

Installed Programs: mc and the symlinks mcdiff, mcedit and mcview

Installed Libraries: None

Installed Directories: /etc/mc and /usr/{libexec,share}/mc

Short Descriptions

cons.saver is used internally by mc for saving and restoring the text behind the panels on Linux text console.

mc is a visual shell.

mcdiff is an internal visual diff tool.

mcedit is an internal file editor.

mcview is an internal file viewer.

12.18 ModemManager-1.18.12


Introduction to ModemManager

ModemManager provides a unified high level API for communicating with mobile broadband modems, regardless of the protocol used to communicate with the actual device.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

ModemManager Dependencies

Required

libgudev-237

gobject-introspection-1.74.0, libmbim-1.26.4, libqmi-1.30.8, Polkit-122, and Vala-0.56.4

Optional

GTK-Doc-1.33.2

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/ModemManager

Installation of ModemManager

Install ModemManager by running the following commands:

./configure --prefix=/usr                 \
            --sysconfdir=/etc             \
            --localstatedir=/var          \
            --disable-static              \
            --disable-maintainer-mode     \
            --with-systemd-journal        \
            --with-systemd-suspend-resume &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Command Explanations

--with-systemd-suspend-resume: This switch forces ModemManager to use the systemd power management facilities.

--with-systemd-journal: This switch forces ModemManager to use the systemd journal for logging.

--disable-static: This switch prevents installation of static versions of the libraries.

--enable-gtk-doc: Use this parameter if GTK-Doc is installed and you wish to rebuild and install the API documentation.

Configuring ModemManager

Systemd Units

To start the ModemManager daemon at boot, enable the previously installed systemd unit by running the following command as the root user:

systemctl enable ModemManager

Contents

Installed Programs: mmcli and ModemManager

Installed Libraries: libmm-glib.so

Installed Directories: /etc/ModemManager, /usr/include/libmm-glib, /usr/include/ModemManager, /usr/lib/ModemManager, /usr/share/ModemManager, /usr/share/gtk-doc/html/libmm-glib (optional), and /usr/share/gtk-doc/html/ModemManager (optional)

Short Descriptions

mmcli is an utility used to control and monitor the ModemManager.

ModemManager is a D-Bus service used to communicate with modems.

libmm-glib.so contains API functions for communicating with mobile broadband modems, regardless of the protocol used to communicate with the actual device.

12.19 notification-daemon-3.20.0


Introduction to Notification Daemon

The Notification Daemon package contains a daemon that displays passive pop-up notifications.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Notification Daemon Dependencies

Required

GTK+-3.24.36 and libcanberra-0.30 (Built with GTK+-3.24.36 support).

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/notification-daemon

Installation of Notification Daemon

Install Notification Daemon by running the following commands:

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make

This package does not come with a test suite.

Now, as the root user:

make install

You can test the notification daemon with the command notify-send:

pgrep -l notification-da &&
notify-send -i info Information "Hi ${USER}, This is a Test"

The command pgrep -l notification-da is added to assure that it is the daemon of this package that is running, not another one, e.g. the daemon from xfce4-notifyd-0.8.1.

Contents

Installed Program: none

Installed Libraries: none

Installed Directory: none

12.20 p7zip-17.04


Introduction to p7zip

p7zip is the Unix command-line port of 7-Zip, a file archiver that archives with high compression ratios. It handles 7z, ZIP, GZIP, Brotli, BZIP2, XZ, TAR, APM, ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, ISO, Lizard, LZ5, LZFSE, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RAR, RPM, SquashFS, UDF, VHD, WIM, XAR, Z, and Zstd formats.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

p7zip Dependencies

Optional

wxWidgets

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/p7zip

Installation of p7zip

First, prevent p7zip from installing compressed manual pages:

sed '/^gzip/d' -i install.sh

Next, fix a security vulnerability:

sed -i '160a if(_buffer == nullptr || _size == _pos) return E_FAIL;' CPP/7zip/Common/StreamObjects.cpp

Install p7zip by running the following commands:

make all3

To test the results, issue: make test.

Now, as the root user:

make DEST_HOME=/usr \
     DEST_MAN=/usr/share/man \
     DEST_SHARE_DOC=/usr/share/doc/p7zip-17.04 install

Note

If using DESTDIR techniques, use DEST_DIR instead.

Contents

Installed Programs: 7z, 7za, and 7zr

Installed Libraries: None

Installed Directory: /usr/lib/p7zip and /usr/share/doc/p7zip-17.04

Short Descriptions

7z is a file archiver utility.

7za is a stand-alone executable handling less archive formats than 7z.

7zr is a minimal version of 7za that handles only 7z archives.

12.21 Pax-20201030


Introduction to Pax

pax is an archiving utility created by POSIX and defined by the POSIX.1-2001 standard. Rather than sort out the incompatible options that have crept up between tar and cpio, along with their implementations across various versions of UNIX, the IEEE designed a new archive utility. The name “pax” is an acronym for portable archive exchange. Furthermore, “pax” means “peace” in Latin, so its name implies that it shall create peace between the tar and cpio format supporters. The command invocation and command structure is somewhat a unification of both tar and cpio.

pax has been required to be present in LSB conformant systems since LSB version 3.0.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/pax

Installation of Pax

Install pax by running the following commands:.

Note

This package expands to the directory pax.

bash Build.sh

This package does not come with a test suite.

Now, as the root user:

Note

This package also creates hard links from pax to the programs cpio and tar in the build directory. The LFS editors do not recommend that they be installed as they will overwrite the GNU versions of these programs.

install -v pax /usr/bin &&
install -v -m644 pax.1 /usr/share/man/man1

Contents

Installed Program: pax

Short Descriptions

pax copies files to and from archives in several formats.

12.22 pciutils-3.9.0


Introduction to PCI Utils

The PCI Utils package contains a set of programs for listing PCI devices, inspecting their status and setting their configuration registers.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

pciutils Dependencies

cURL-7.88.1, Wget-1.21.3, or Lynx-2.8.9rel.1 (for the update-pciids script to function correctly).

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/pciutils

Installation of PCI Utils

Install PCI Utils by running the following commands:

make PREFIX=/usr                \
     SHAREDIR=/usr/share/hwdata \
     SHARED=yes

This package does not come with a test suite.

Now, as the root user:

make PREFIX=/usr                \
     SHAREDIR=/usr/share/hwdata \
     SHARED=yes                 \
     install install-lib        &&

chmod -v 755 /usr/lib/libpci.so

Command Explanations

SHARED=yes: This parameter enables building of the shared library instead of the static one.

ZLIB=no: This option prevents compression of the pci.ids file.

Configuring PCI Utils

The pci.ids data file is constantly being updated. To get a current version of this file, run update-pciids as the root user. This program requires the Which-2.21 script or program to find cURL-7.88.1, Lynx-2.8.9rel.1, or Wget-1.21.3 which are used to download the most current file, and then replace the existing file in /usr/share/hwdata.

You should update the /usr/share/hwdata/pci.ids file periodically. Execute the following commands, as the root user, to create a systemd timer to update it weekly on Sundays at 2:30 A.M. (local time):

cat > /usr/lib/systemd/system/update-pciids.service << "EOF" &&
[Unit]
Description=Update pci.ids file
Documentation=man:update-pciids(8)
DefaultDependencies=no
After=local-fs.target network-online.target
Before=shutdown.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/update-pciids
EOF
cat > /usr/lib/systemd/system/update-pciids.timer << "EOF" &&
[Unit]
Description=Update pci.ids file weekly

[Timer]
OnCalendar=Sun 02:30:00
Persistent=true

[Install]
WantedBy=timers.target
EOF
systemctl enable update-pciids.timer

Contents

Installed Programs: lspci, setpci, and update-pciids

Installed Library: libpci.so

Installed Directory: /usr/include/pci and /usr/share/hwdata

Short Descriptions

lspci is a utility for displaying information about all PCI buses in the system and all devices connected to them.

setpci is a utility for querying and configuring PCI devices.

update-pciids fetches the current version of the PCI ID list.

libpci.so is library that allows applications to access the PCI subsystem.

12.23 pm-utils-1.4.1


Introduction to Power Management Utilities

The Power Management Utilities provide simple shell command line tools to suspend and hibernate the computer. They can be used to run user supplied scripts on suspend and resume.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Power Management Utilities Dependencies

Optional

xmlto-0.0.28 (to generate man pages)

Optional (runtime)

Hdparm-9.65, Wireless Tools-29, ethtool, and vbetool

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/pm-utils

Kernel Configuration

If needed, enable the following options in the kernel configuration and recompile the kernel:

Power management and ACPI options --->
    <*> Suspend to RAM and standby            [CONFIG_SUSPEND]
    <*> Hibernation (aka 'suspend to disk')   [CONFIG_HIBERNATION]

Suspend to RAM allows the system to enter sleep states in which main memory is powered and thus its contents are preserved. The method cuts power to most parts of the machine aside from the RAM. Because of the large power savings, it is advisable for laptops to automatically enter this mode when the computer is running on batteries and the lid is closed (or the user is inactive for some time).

Suspend to disk (Hibernation) saves the machine’s state into swap space and completely powers off the machine. When the machine is powered on, the state is restored. Until then, there is zero power consumption. Suspend to RAM and hibernation are normally appropriate for portable devices such as laptops, but can be used on workstations. The capability is not really appropriate for servers.

To use hibernation, the kernel parameter resume=/dev/ has to be used on the kernel command line (in grub.cfg). The swap partition should be at least the size of the physical RAM on the system.

Installation of Power Management Utilities

Install Power Management Utilities by running the following commands:

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/pm-utils-1.4.1 &&
make

This package does not come with a test suite.

Now, as the root user:

make install

If you don’t have xmlto-0.0.28 installed, copy pregenerated man pages, as the root user:

install -v -m644 man/*.1 /usr/share/man/man1 &&
install -v -m644 man/*.8 /usr/share/man/man8 &&
ln -sv pm-action.8 /usr/share/man/man8/pm-suspend.8 &&
ln -sv pm-action.8 /usr/share/man/man8/pm-hibernate.8 &&
ln -sv pm-action.8 /usr/share/man/man8/pm-suspend-hybrid.8

Configuring Power Management Utilities

Suspend or resume functionality can be easily modified by installing files into the /etc/pm/sleep.d directory. These files, known as hooks, are run when the system is put into a sleep state or resumed. Default hooks are located in /usr/lib/pm-utils/sleep.d, and user hooks should be put in /etc/pm/sleep.d. See the pm-action(8) man page for more information.

In order to use hibernation with GRUB and a swap partition, you need to add kernel parameter resume=swap_partition (e.g. resume=/dev/sda1) to the kernel line in the /boot/grub/grub.cfg configuration file.

Contents

Installed Programs: on_ac_power, pm-hibernate, pm-is-supported, pm-powersave, pm-suspend and pm-suspend-hybrid

Installed Libraries: None

Installed Directories: /etc/pm, /usr/lib/pm-utils and /usr/share/doc/pm-utils-1.4.1

Short Descriptions

on_ac_power is a script that determines whether the system is running on AC power (rather than a battery).

pm-hibernate is a symlink to pm-action script that puts the computer into hibernate mode (the system is fully powered off and system state is saved to disk).

pm-is-supported is a script that checks whether power management features such as suspend and hibernate are supported.

pm-powersave is a script that puts the computer into powersaving (low power) mode.

pm-suspend is a symlink to pm-action script that puts the computer into suspend mode (most devices are shut down and system state is saved in RAM).

pm-suspend-hybrid is a symlink to pm-action script that puts the computer into hybrid-suspend mode (the system does everything it needs to hibernate, but suspends instead of shutting down).

12.24 Raptor-2.0.15


Introduction to Raptor

Raptor is a C library that provides a set of parsers and serializers that generate Resource Description Framework (RDF) triples.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Additional Downloads

Raptor Dependencies

Required

cURL-7.88.1 and libxslt-1.1.37

Optional

GTK-Doc-1.33.2, ICU-72.1 and libyajl

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/raptor

Installation of Raptor

First, apply a patch that fixes a couple of security issues:

patch -Np1 -i ../raptor-2.0.15-security_fixes-1.patch

Install Raptor by running the following commands:

./configure --prefix=/usr --disable-static &&
make

To test the results, issue: make check. Several of the XML tests may fail.

Now, as the root user:

make install

Command Explanations

--disable-static: This switch prevents installation of static versions of the libraries.

--with-icu-config=/usr/bin/icu-config: Use this switch if you have installed ICU-72.1 and wish to build Raptor with its support.

Contents

Installed Programs: rapper

Installed Libraries: libraptor2.so

Installed Directories: /usr/include/raptor2 and /usr/share/gtk-doc/html/raptor2

Short Descriptions

rapper is a RDF parsing and serializing utility.

libraptor2.so contains the Raptor API functions.

12.25 Rasqal-0.9.33


Introduction to Rasqal

Rasqal is a C library that handles Resource Description Framework (RDF) query language syntaxes, query construction, and execution of queries returning results as bindings, boolean, RDF graphs/triples or syntaxes.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Rasqal Dependencies

Required

Raptor-2.0.15

Optional

PCRE-8.45 and libgcrypt-1.10.1

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/rasqal

Installation of Rasqal

Install Rasqal by running the following commands:

./configure --prefix=/usr --disable-static &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Command Explanations

--disable-static: This switch prevents installation of static versions of the libraries.

Contents

Installed Programs: rasqal-config and roqet

Installed Library: librasqal.so

Installed Directories: /usr/include/rasqal and /usr/share/gtk-doc/html/rasqal

Short Descriptions

rasqal-config is an utility for retrieving the installation options of Rasqal.

roqet is an RDF query utility.

12.26 Redland-1.0.17


Introduction to Redland

Redland is a set of free software C libraries that provide support for the Resource Description Framework (RDF).

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Redland Dependencies

Required

Rasqal-0.9.33

Optional

Berkeley DB-5.3.28, libiodbc-3.52.15, SQLite-3.40.1, MariaDB-10.6.12 or MySQL, PostgreSQL-15.2, virtuoso, and 3store

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/redland

Installation of Redland

Install Redland by running the following commands:

./configure --prefix=/usr --disable-static &&
make

To test the results, issue make check.

Now, as the root user:

make install

Command Explanations

--disable-static: This switch prevents installation of static versions of the libraries.

Contents

Installed Programs: rdfproc, redland-config and redland-db-upgrade

Installed Libraries: librdf.so and /usr/lib/redland/librdf_storage_*.so

Installed Directories: /usr/lib/redland, /usr/share/gtk-doc/html/redland and /usr/share/redland

Short Descriptions

rdfproc is the Redland RDF processor utility.

redland-config is a script to get information about the installed version of Redland.

redland-db-upgrade upgrades older Redland databases to 0.9.12 format.

12.27 sg3_utils-1.47


Introduction to sg3_utils

The sg3_utils package contains low level utilities for devices that use a SCSI command set. Apart from SCSI parallel interface (SPI) devices, the SCSI command set is used by ATAPI devices (CD/DVDs and tapes), USB mass storage devices, Fibre Channel disks, IEEE 1394 storage devices (that use the “SBP” protocol), SAS, iSCSI and FCoE devices (amongst others).

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/sg3_utils

Installation of sg3_utils

Install sg3_utils by running the following commands:

./configure --prefix=/usr --disable-static &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Command Explanations

--disable-static: This switch prevents installation of static versions of the libraries.

Contents

Installed Programs: rescan-scsi-bus.sh, scsi_logging_level, scsi_mandat, scsi_readcap, scsi_ready, scsi_satl, scsi_start, scsi_stop, scsi_temperature, sg_bg_ctl, sg_compare_and_write, sg_copy_results, sg_dd, sg_decode_sense, sg_emc_trespass, sg_format, sg_get_config, sg_get_lba_status, sg_ident, sg_inq, sg_logs, sg_luns, sg_map, sg_map26, sg_modes, sg_opcodes, sg_persist, sg_prevent, sg_raw, sg_rbuf, sg_rdac, sg_read, sg_read_attr, sg_read_block_limits, sg_read_buffer, sg_read_long, sg_readcap, sg_reassign, sg_referrals, sg_rep_pip, sg_rep_zones, sg_requests, sg_reset, sg_reset_wp, sg_rmsn, sg_rtpg, sg_safte, sg_sanitize, sg_sat_identify, sg_sat_phy_event, sg_sat_read_gplog, sg_sat_set_features, sg_scan, sg_seek, sg_senddiag, sg_ses, sg_ses_microcode, sg_start, sg_stpg, sg_stream_ctl, sg_sync, sg_test_rwbuf, sg_timestamp, sg_turs, sg_unmap, sg_verify, sg_vpd, sg_wr_mode, sg_write_buffer, sg_write_long, sg_write_same, sg_write_verify, sg_write_x, sg_xcopy, sg_zone, sginfo, sgm_dd, and sgp_dd

Installed Library: libsgutils2.so

Installed Directories: None

Short Descriptions

rescan-scsi-bus.sh adds or removes SCSI devices without having to reboot.

scsi_logging_level accesses Linux SCSI logging level information.

scsi_mandat checks SCSI device support for mandatory commands.

scsi_readcap does the SCSI READ CAPACITY command on disks.

scsi_ready does the SCSI TEST UNIT READY on devices.

scsi_satl checks for SCSI to ATA Translation (SAT) device support.

scsi_start starts one or more SCSI disks.

scsi_stop stops one or more SCSI disks.

scsi_temperature fetches the temperature of a SCSI device.

sg_bg_ctl performs a SCSI BACKGROUND CONTROL command on a device to perform “advanced background operations”.

sg_compare_and_writesends the SCSI COMPARE AND WRITE command to device.

sg_copy_results sends the SCSI RECEIVE COPY RESULTS command (XCOPY related).

sg_dd copies data to and from files and devices. Specialised for devices that understand the SCSI command set.

sg_decode_sense takes SCSI sense data in binary or as a sequence of ASCII hexadecimal bytes and decodes it.

sg_emc_trespass changes ownership of a LUN from another Service-Processor to this one.

sg_format formats or resizes a SCSI disk (perhaps changes its block size).

sg_get_config sends a SCSI GET CONFIGURATION command (MMC-4 +).

sg_get_elem_status sends a SCSI GET PHYSICAL ELEMENT STATUS command to a device.

sg_get_lba_status sends the SCSI GET LBA STATUS command.

sg_ident sends a SCSI REPORT or SET IDENTIFYING INFORMATION command.

sginfo access mode page information for a SCSI (or ATAPI) device.

sg_inq sends a SCSI INQUIRY or ATA IDENTIFY (PACKET) DEVICE command and outputs the response.

sg_logs access log pages with SCSI LOG SENSE command.

sg_luns sends the SCSI REPORT LUNS command.

sg_map displays mapping between linux sg and other SCSI devices.

sg_map26 maps a special file to a SCSI generic (sg) device (or vice versa).

sgm_dd copies data to and from files and devices. Specialized for devices that understand the SCSI command set and does memory mapped transfers from sg devices.

sg_modes reads mode pages with the SCSI MODE SENSE command.

sg_opcodes reports information on supported SCSI commands or task management functions.

sgp_dd copies data to and from files and devices. Specialized for devices that understand the SCSI command set.

sg_persist sends a SCSI PERSISTENT RESERVE (IN or OUT) command to manipulate registrations and reservations.

sg_prevent sends a SCSI PREVENT ALLOW MEDIUM REMOVAL command.

sg_raw sends an arbitrary SCSI command to a device.

sg_rbuf reads data using the SCSI READ BUFFER command.

sg_rdac displays or modifies the RDAC Redundant Controller Page.

sg_read reads blocks of data continually from the same offset.

sg_read_attr performs a SCSI READ ATTRIBUTE command on a device.

sg_read_block_limits sends a SCSI READ BLOCK LIMITS command.

sg_read_buffer sends a SCSI READ BUFFER command.

sg_readcap sends a SCSI READ CAPACITY command.

sg_read_long sends a SCSI READ LONG command.

sg_reassign sends a SCSI REASSIGN BLOCKS command.

sg_referrals sends a SCSI REPORT REFERRALS command.

sg_rep_pip sends a SCSI REPORT PROVISIONING INITIALIZATION PATTERN command.

sg_rep_zones sends a SCSI REPORT ZONES command.

sg_requests sends one or more SCSI REQUEST SENSE commands.

sg_reset sends a SCSI device, target, bus or host reset; or checks reset state.

sg_reset_wp sends a SCSI RESET WRITE POINTER command.

sg_rmsn sends a SCSI READ MEDIA SERIAL NUMBER command.

sg_rtpg sends a SCSI REPORT TARGET PORT GROUPS command.

sg_safte fetches status information from a SCSI Accessed Fault-Tolerant Enclosure (SAF-TE) device.

sg_sanitize sends a SCSI SANITIZE command.

sg_sat_identify sends an ATA IDENTIFY (PACKET) DEVICE command via a SCSI to ATA Translation (SAT) layer.

sg_sat_phy_event sends an ATA READ LOG EXT command via a SAT pass through to fetch log page 11h which contains SATA phy event counters.

sg_sat_read_gplog sends an ATA READ LOG EXT command via a SCSI to ATA Translation (SAT) layer.

sg_sat_set_features sends an ATA SET FEATURES command via a SCSI to ATA Translation (SAT) layer.

sg_scan does a scan of sg devices (or given SCSI/ATAPI/ATA devices) and prints the results.

sg_seek performs a SCSI SEEK or PRE-FETCH command on a device and it’s cache.

sg_senddiag performs a SCSI SEND DIAGNOSTIC command.

sg_ses sends controls and fetches the current status from a SCSI Enclosure Services (SES) device.

sg_ses_microcode sends microcode to a SCSI enclosure.

sg_start sends a SCSI START STOP UNIT command to start, stop, load or eject medium.

sg_stpg sends a SCSI SET TARGET PORT GROUPS command.

sg_stream_ctl performs a SCSI STREAM CONTROL or GET STREAM STATUS command on a device to open or close an I/O stream.

sg_sync sends a SCSI command to synchronize the cache.

sg_test_rwbuf tests the SCSI host adapter by issuing write and read operations on a device’s buffer and calculating checksums.

sg_timestamp reports or sets the timestamp on a SCSI device.

sg_turs sends one or more SCSI TEST UNIT READY commands.

sg_unmap sends a SCSI UNMAP command.

sg_verify invokes SCSI VERIFY command(s) on a block device.

sg_vpd fetches Vital Product Data (VPD) pages using a SCSI INQUIRY command.

sg_write_buffer sends a SCSI WRITE BUFFER command.

sg_write_long sends a SCSI WRITE LONG command.

sg_write_same sends a SCSI WRITE SAME command.

sg_write_verify sends a SCSI WRITE AND VERIFY command.

sg_write_x performs SCSI WRITE commands on a device.

sg_wr_mode writes mode pages.

sg_xcopy copies data to and from files and devices using SCSI EXTENDED COPY (XCOPY).

sg_zone performs SCSI ZONE commands on a device, such as OPEN, CLOSE, FINISH or SEQUENTIALIZE.

libsgutils2.so contains the sg3_utils API functions.

12.28 Sysstat-12.7.2


Introduction to Sysstat

The Sysstat package contains utilities to monitor system performance and usage activity. Sysstat contains the sar utility, common to many commercial Unixes, and tools you can schedule via cron to collect and historize performance and activity data.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Sysstat Dependencies

There are no build-time requirements for this package; however, it is designed to be controlled by a cron daemon such as Fcron-3.2.1.

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/sysstat

Installation of Sysstat

Install Sysstat by running the following commands:

sa_lib_dir=/usr/lib/sa    \
sa_dir=/var/log/sa        \
conf_dir=/etc/sysconfig   \
./configure --prefix=/usr \
            --disable-file-attr &&
make

This package does not come with a working test suite.

Now, as the root user:

make install

Install the systemd unit by running the following commands as the root user:

install -v -m644 sysstat.service /usr/lib/systemd/system/sysstat.service &&
install -v -m644 cron/sysstat-collect.service /usr/lib/systemd/system/sysstat-collect.service &&
install -v -m644 cron/sysstat-collect.timer /usr/lib/systemd/system/sysstat-collect.timer &&
install -v -m644 cron/sysstat-summary.service /usr/lib/systemd/system/sysstat-summary.service &&
install -v -m644 cron/sysstat-summary.timer /usr/lib/systemd/system/sysstat-summary.timer

Fix the systemd unit by running the following command as the root user:

sed -i "/^Also=/d" /usr/lib/systemd/system/sysstat.service

Command Explanations

sa_lib_dir: This environment variable specifies the location of the package-specific library directory.

sa_dir: This environment variable specifies the location of the directory containing the data files.

conf_dir: This environment variable specifies the location of the system configuration directory.

--disable-file-attr: Do not set attributes on files being installed. This parameter causes the installation to ignore the man group variable resulting in the man files having root: root ownership.

Note

Run ./configure –help to see other influential environment variables you can pass to configure. You may want to use the history and compressafter variables to customize the amount of data files kept on the system.

Configuring Sysstat

Config Files

/etc/sysconfig/sysstat and /etc/sysconfig/sysstat.ioconf

Cron Information

To begin gathering Sysstat history information, you must add to, or create a privileged user’s crontab. The history data location is /var/log/sa. The user running Sysstat utilities via cron must have write access to this location.

Below is an example of what to install in the crontab. Adjust the parameters to suit your needs. Use man sa1 and man sa2 for information about the commands.

# 8am-7pm activity reports every 10 minutes during weekdays
0 8-18 * * 1-5 /usr/lib/sa/sa1 600 6 &

# 7pm-8am activity reports every hour during weekdays
0 19-7 * * 1-5 /usr/lib/sa/sa1 &

# Activity reports every hour on Saturday and Sunday
0 * * * 0,6 /usr/lib/sa/sa1 &

# Daily summary prepared at 19:05
5 19 * * * /usr/lib/sa/sa2 -A &

Ensure you submit the revised crontab to the cron daemon.

System Startup Information

At system startup, a LINUX RESTART message must be inserted in the daily data file to reinitialize the kernel counters. This can be automated by enabling the previously installed systemd unit by running the following command as the root user:

systemctl enable sysstat

Contents

Installed Programs: cifsiostat, iostat, mpstat, pidstat, sadf, sar, and tapestat

Installed Libraries: None

Installed Directories: /usr/lib/sa, /usr/share/doc/sysstat-12.7.2 and /var/log/sa

Short Descriptions

cifsiostat displays statistics about read and write operations on CIFS filesystems.

iostat reports CPU statistics and input/output statistics for devices and partitions.

mpstat writes activities for each available processor.

pidstat is used for monitoring individual tasks currently being managed by the Linux kernel.

sadf is used for displaying the contents of data files created by the sar command. But unlike sar, sadf can write its data in many different formats.

sar is used for displaying the contents of elected cumulative activity counters in the operating system.

tapestat is used for monitoring the activity of tape drives connected to a system.

12.29 Systemd-252


Introduction to systemd

While systemd was installed when building LFS, there are many features provided by the package that were not included in the initial installation because Linux-PAM was not yet installed. The systemd package needs to be rebuilt to provide a working systemd-logind service, which provides many additional features for dependent packages.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Additional Downloads

systemd Dependencies

Required

Linux-PAM-1.5.2

Polkit-122

Optional

btrfs-progs-6.1.3, cURL-7.88.1, cryptsetup-2.4.3, git-2.39.2, GnuTLS-3.8.0, iptables-1.8.9, libgcrypt-1.10.1, libidn2-2.3.4, libpwquality-1.4.5, libseccomp-2.5.4, libxkbcommon-1.5.0, make-ca-1.12, p11-kit-0.24.1, pcre2-10.42, qemu-7.2.0, qrencode-4.1.1, rsync-3.2.7, sphinx-6.1.3, Valgrind-3.20.0;, zsh-5.9 (for the zsh completions), gnu-efi, kexec-tools, libbpf, libdw, libfido2, libmicrohttpd, lz4, quota-tools, and tpm2-tss

Optional (to rebuild the manual pages)

docbook-xml-4.5, docbook-xsl-nons-1.79.2, libxslt-1.1.37, and lxml-4.9.2 (to build the index of systemd manual pages)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/systemd

Installation of systemd

First, fix a security issue in systemd-coredump:

patch -Np1 -i ../systemd-252-security_fix-1.patch

Remove two unneeded groups, render and sgx, from the default udev rules:

sed -i -e 's/GROUP="render"/GROUP="video"/' \
       -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in

Rebuild systemd by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=/usr                 \
      --buildtype=release           \
      -Ddefault-dnssec=no           \
      -Dfirstboot=false             \
      -Dinstall-tests=false         \
      -Dldconfig=false              \
      -Dman=auto                    \
      -Dsysusers=false              \
      -Drpmmacrosdir=no             \
      -Dhomed=false                 \
      -Duserdb=false                \
      -Dmode=release                \
      -Dpam=true                    \
      -Dpamconfdir=/etc/pam.d       \
      -Ddocdir=/usr/share/doc/systemd-252 \
      ..                            &&

ninja

Note

For the best test results, make sure you run the test suite from a system that is booted by the same systemd version you are rebuilding.

To test the results, issue: PATH+=:/usr/sbin ninja test.

Now, as the root user:

ninja install

Command Explanations

--buildtype=release: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

-Dpamconfdir=/etc/pam.d: Forces the PAM files to be installed in /etc/pam.d rather than /usr/lib/pam.d.

-Duserdb=false: Removes a daemon that does not offer any use under a BLFS configuration. If you wish to enable the userdbd daemon, replace “false” with “true” in the above meson command.

-Dhomed=false: Removes a daemon that does not offer any use under a traditional BLFS configuration, especially using accounts created with useradd. To enable systemd-homed, first ensure that you have cryptsetup-2.4.3 and libpwquality-1.4.5 installed, and then change “false” to “true” in the above meson command.

Configuring systemd

The /etc/pam.d/system-session file needs to be modified and a new file needs to be created in order for systemd-logind to work correctly. Run the following commands as the root user:

grep 'pam_systemd' /etc/pam.d/system-session ||
cat >> /etc/pam.d/system-session << "EOF"
# Begin Systemd addition

session  required    pam_loginuid.so
session  optional    pam_systemd.so

# End Systemd addition
EOF

cat > /etc/pam.d/systemd-user << "EOF"
# Begin /etc/pam.d/systemd-user

account  required    pam_access.so
account  include     system-account

session  required    pam_env.so
session  required    pam_limits.so
session  required    pam_unix.so
session  required    pam_loginuid.so
session  optional    pam_keyinit.so force revoke
session  optional    pam_systemd.so

auth     required    pam_deny.so
password required    pam_deny.so

# End /etc/pam.d/systemd-user
EOF

Warning

If upgrading from a previous version of systemd and an initrd is used for system boot, you should generate a new initrd before rebooting the system.

Contents

A list of the installed files, along with their short descriptions can be found at ../../../../lfs/view/11.3-systemd/chapter08/systemd.html#contents-systemd.

Listed below are the newly installed programs along with short descriptions.

Installed Programs: homectl (if cryptsetup-2.4.3 is installed), systemd-cryptenroll (if cryptsetup-2.4.3 is installed), and userdbctl (optionally)

Short Descriptions

homectl is a tool to create, remove, change, or inspect a home directory managed by systemd-homed; note that it’s useless for the classic UNIX users and home directories which we are using in LFS/BLFS book.

systemd-cryptenroll Is used to enroll or remove a system from full disk encryption, as well as set and query private keys and recovery keys.

userdbctl inspects users, groups, and group memberships.

pam_systemd.so is a PAM module used to register user sessions with the systemd login manager, systemd-logind.

12.30 UDisks-2.9.4


Introduction to UDisks

The UDisks package provides a daemon, tools and libraries to access and manipulate disks and storage devices.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

UDisks Dependencies

Required

libatasmart-0.19, libblockdev-2.28, libgudev-237, libxslt-1.1.37, and Polkit-122

Required at runtime

btrfs-progs-6.1.3, dosfstools-4.2, gptfdisk-1.0.9, mdadm-4.2, and xfsprogs-6.1.1

Systemd-252

Optional (Required if building GNOME)

gobject-introspection-1.74.0

Optional

D-Bus Python-1.3.2 (for the integration tests), GTK-Doc-1.33.2, LVM2-2.03.18, PyGObject-3.42.2 (for the integration tests), exFAT, and libiscsi

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/udisks2

Installation of UDisks

Install UDisks by running the following commands:

./configure --prefix=/usr        \
            --sysconfdir=/etc    \
            --localstatedir=/var \
            --disable-static     &&
make

To test the results, issue: make check. A more thorough test can be run with make ci. You must first create the directories /var/run/udisks2 and /var/lib/udisks2, and the optional python modules should be present.

Now, as the root user:

make install

Command Explanations

--disable-static: This switch prevents installation of static versions of the libraries.

--enable-gtk-doc: Use this parameter if GTK-Doc is installed and you wish to rebuild and install the API documentation.

Contents

Installed Programs: udisksctl and umount.udisks2

Installed Library: libudisks2.so

Installed Directories: /etc/udisks2, /usr/include/udisks2, /usr/libexec/udisks2, /usr/share/gtk-doc/html/udisks2, and /var/lib/udisks2

Short Descriptions

udisksctl is a command-line program used to interact with the udisksd daemon.

umount.udisks2 is a command-line program used to unmount file systems that have been mounted by the UDisks daemon.

libudisks2.so contains the UDisks API functions.

12.31 UnRar-6.2.6


Introduction to UnRar

The UnRar package contains a RAR extraction utility used for extracting files from RAR archives. RAR archives are usually created with WinRAR, primarily in a Windows environment.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/unrar

Installation of UnRar

Note

This package extracts the tarball to the unversioned directory unrar and not the expected directory unrar-6.2.6.

Install UnRar by running the following commands:

make -f makefile

This package does not come with a test suite.

Now, as the root user:

install -v -m755 unrar /usr/bin

Contents

Installed Program: unrar

Installed Libraries: None

Installed Directories: None

Short Descriptions

unrar uncompresses a RAR archive.

12.32 UnZip-6.0


Introduction to UnZip

The UnZip package contains ZIP extraction utilities. These are useful for extracting files from ZIP archives. ZIP archives are created with PKZIP or Info-ZIP utilities, primarily in a DOS environment.

This package is known to build and work properly using an LFS 11.3 platform.

Caution

The previous version of the UnZip package had some locale related issues. Currently there are no BLFS editors capable of testing these locale issues. Therefore, the locale related information is left on this page, but has not been tested. A more general discussion of these problems can be found in the Program Assumes Encoding section of the Locale Related Issues page.

Package Information

Additional Downloads

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/unzip

UnZip Locale Issues

Note

Use of UnZip in the JDK, Mozilla, DocBook or any other BLFS package installation is not a problem, as BLFS instructions never use UnZip to extract a file with non-ASCII characters in the file’s name.

These issues are thought to be fixed in the patch. But since none of the editors have data to test this, the following workarounds are retained in case they might still be needed.

The UnZip package assumes that filenames stored in the ZIP archives created on non-Unix systems are encoded in CP850, and that they should be converted to ISO-8859-1 when writing files onto the filesystem. Such assumptions are not always valid. In fact, inside the ZIP archive, filenames are encoded in the DOS codepage that is in use in the relevant country, and the filenames on disk should be in the locale encoding. In MS Windows, the OemToChar() C function (from User32.DLL) does the correct conversion (which is indeed the conversion from CP850 to a superset of ISO-8859-1 if MS Windows is set up to use the US English language), but there is no equivalent in Linux.

When using unzip to unpack a ZIP archive containing non-ASCII filenames, the filenames are damaged because unzip uses improper conversion when any of its encoding assumptions are incorrect. For example, in the ru_RU.KOI8-R locale, conversion of filenames from CP866 to KOI8-R is required, but conversion from CP850 to ISO-8859-1 is done, which produces filenames consisting of undecipherable characters instead of words (the closest equivalent understandable example for English-only users is rot13). There are several ways around this limitation:

1) For unpacking ZIP archives with filenames containing non-ASCII characters, use WinZip while running the Wine Windows emulator.

2) Use bsdtar -xf from libarchive-3.6.2 to unpack the ZIP archive. Then fix the damage made to the filenames using the convmv tool (https://j3e.de/linux/convmv/). The following is an example for the zh_CN.UTF-8 locale:

convmv -f cp936 -t utf-8 -r --nosmart --notest \
    </path/to/unzipped/files>

Installation of UnZip

First apply the patch:

patch -Np1 -i ../unzip-6.0-consolidated_fixes-1.patch

Now compile the package:

make -f unix/Makefile generic

The test suite does not work for target “generic”.

Now, as the root user:

make prefix=/usr MANDIR=/usr/share/man/man1 \
 -f unix/Makefile install

Command Explanations

make -f unix/Makefile generic: This target begins by running a configure script (unlike the older targets such as linux and linux_noasm) which creates a flags file that is then used in the build. This ensures that the 32-bit x86 build receives the right flags to unzip files which which are larger than 2GB when extracted.

Contents

Installed Programs: funzip, unzip, unzipfsx, zipgrep, and zipinfo

Installed Libraries: None

Installed Directories: None

Short Descriptions

funzip allows the output of unzip commands to be redirected.

unzip lists, tests or extracts files from a ZIP archive.

unzipfsx is a self-extracting stub that can be prepended to a ZIP archive. Files in this format allow the recipient to decompress the archive without installing UnZip.

zipgrep searches files in a ZIP archive for lines matching a pattern.

zipinfo produces technical information about the files in a ZIP archive, including file access permissions, encryption status, type of compression, etc.

12.33 UPower-1.90.0


Introduction to UPower

The UPower package provides an interface for enumerating power devices, listening to device events and querying history and statistics. Any application or service on the system can access the org.freedesktop.UPower service via the system message bus.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

UPower Dependencies

Required

libgudev-237, libusb-1.0.26, and Polkit-122

Optional (Required if building GNOME)

gobject-introspection-1.74.0

Optional

GTK-Doc-1.33.2, libxslt-1.1.37, docbook-xsl-nons-1.79.2, PyGObject-3.42.2, dbusmock-0.28.7, umockdev-0.17.16 (for part of the test suite), and libimobiledevice

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/upower

Kernel Configuration

Enable the following options in the kernel configuration and recompile the kernel if necessary:

General Setup --->
    [*] Namespaces support --->         [CONFIG_NAMESPACES]
        [*] User namespace              [CONFIG_USER_NS]

Installation of UPower

First, remove an unneeded dependency from a test:

sed '/parse_version/d' -i src/linux/integration-test.py

Install UPower by running the following commands:

mkdir build                         &&
cd    build                         &&
meson --prefix=/usr       \
      --buildtype=release \
      -Dgtk-doc=false     \
      -Dman=false         \
      ..                            &&
ninja

To test the results, issue: LC_ALL=C ninja test. Some checks may not pass due to missing files. Test suite should be run from a local GUI session started with dbus-launch.

Now, as the root user:

ninja install

Command Explanations

-Dgtk-doc=false: Prevents building the documentation. Remove this if you have GTK-Doc installed and wish to build the documentation.

-Dman=false: Prevents building the manual pages. Remove this if you have libxslt-1.1.37 and docbook-xsl-nons-1.79.2 installed and wish to build the manual pages.

Configuring UPower

Systemd Unit

To start the UPower service at boot, enable the previously installed systemd unit by running the following command as the root user:

systemctl enable upower

Contents

Installed Program: upower

Installed Libraries: libupower-glib.so

Installed Directories: /etc/UPower, /usr/include/libupower-glib, and /var/lib/upower

Short Descriptions

upower is the UPower command line tool.

libupower-glib.so contains the UPower API functions.

12.34 usbutils-015


Introduction to USB Utils

The USB Utils package contains utilities used to display information about USB buses in the system and the devices connected to them.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

USB Utils Dependencies

Required

libusb-1.0.26

git-2.39.2 and Wget-1.21.3

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/usbutils

Installation of USB Utils

Install USB Utils by running the following commands:

autoreconf -fiv &&

./configure --prefix=/usr --datadir=/usr/share/hwdata &&
make

This package does not come with a test suite.

Now, as the root user:

make install

To install the usb.ids data file, using Wget-1.21.3, run, as the root user:

install -dm755 /usr/share/hwdata/ &&
wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids

The script lsusb.py displays information in a more easily readable form than lsusb. To find the options, use lsusb.py -h. One form of use recommended by the developer is lsusb.py -ciu.

Configuring USB Utils

You should update the /usr/share/hwdata/usb.ids file periodically. Execute the following commands, as the root user, to create a systemd timer to update it weekly on Sundays at 2:30 A.M. (local time):

cat > /usr/lib/systemd/system/update-usbids.service << "EOF" &&
[Unit]
Description=Update usb.ids file
Documentation=man:lsusb(8)
DefaultDependencies=no
After=local-fs.target network-online.target
Before=shutdown.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids
EOF
cat > /usr/lib/systemd/system/update-usbids.timer << "EOF" &&
[Unit]
Description=Update usb.ids file weekly

[Timer]
OnCalendar=Sun 03:00:00
Persistent=true

[Install]
WantedBy=timers.target
EOF
systemctl enable update-usbids.timer

Contents

Installed Programs: lsusb, lsusb.py, usb-devices, and usbhid-dump

Installed Libraries: None

Installed Directories: None

Short Descriptions

lsusb is a utility for displaying information about all USB buses in the system and all devices connected to them, but not in human friendly form.

lsusb.py displays information about all USB buses in the system and all devices connected to them in reasonable human friendly form.

usb-devices is a shell script that displays details of USB buses and devices connected to them. It is designed to be used if /proc/bus/usb/devices is not available on your system.

usbhid-dump is used to dump report descriptors and streams from HID (human interface device) interfaces of USB devices.

12.35 Which-2.21 and Alternatives


The presence or absence of the which program in the main LFS book is probably one of the most contentious issues on the mailing lists. It has resulted in at least one flame war in the past. To hopefully put an end to this once and for all, presented here are two options for equipping your system with which. The question of which “which” is for you to decide.

Introduction to GNU Which

The first option is to install the actual GNU which package.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/which

Installation of Which

Install which by running the following commands:

./configure --prefix=/usr &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Program: which

Installed Libraries: None

Installed Directories: None

Short Descriptions

which shows the full path of (shell) commands installed in your PATH.

The ‘which’ Script

The second option (for those who don’t want to install the package) is to create a simple script (execute as the root user):

cat > /usr/bin/which << "EOF"
#!/bin/bash
type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
EOF
chmod -v 755 /usr/bin/which
chown -v root:root /usr/bin/which

This should work OK and is probably the easiest solution for most cases, but is not the most comprehensive implementation.

12.36 Zip-3.0


Introduction to Zip

The Zip package contains Zip utilities. These are useful for compressing files into ZIP archives.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/zip

Installation of Zip

Install Zip by running the following commands:

make -f unix/Makefile generic_gcc

This package does not come with a test suite.

Now, as the root user:

make prefix=/usr MANDIR=/usr/share/man/man1 -f unix/Makefile install

Command Explanations

make prefix=/usr -f unix/Makefile install: This command overrides the prefix variable that is set to /usr/local in the unix/Makefile. Alternatives to generic_gcc can be seen with a make -f unix/Makefile list command.

Contents

Installed Programs: zip, zipcloak, zipnote, and zipsplit

Installed Libraries: None

Installed Directories: None

Short Descriptions

zip compresses files into a ZIP archive.

zipcloak is a utility to encrypt and decrypt a ZIP archive.

zipnote reads or writes comments stored in a ZIP file.

zipsplit is a utility to split ZIP files into smaller files.