Skip to the content.

24. Graphical Environments


This chapter contains instructions to build and configure a graphical user environment.

For a long time the only graphical environment usable with GNU/Linux has been the X Window System. It uses a client/server model which allows writing applications completely independent of the graphical hardware. This has the drawback that accessing modern hardware acceleration is difficult, so that other approaches are developed. Two new systems are available: Wayland and Vulkan. The former is a simpler replacement for X, easier to develop and maintain, using the OpenGL framework. The main desktop environments GNOME and KDE have been ported to it. The later allows direct access to graphical hardware through a portable interface. It is newer and not yet included in BLFS.

This chapter provides the basic components of the X Window System and Wayland. For X, the chosen implementation is Xorg, which is a modular implementation and requires more than 100 packages to be installed. The distribution of Xorg is given a release number by the developers, in this case Xorg-7. Individual packages are updated as needed without changing this number.

24.1 Introduction to Xorg-7


Xorg is a freely redistributable, open-source implementation of the X Window System. This system provides a client/server interface between display hardware (the mouse, keyboard, and video displays) and the desktop environment, while also providing both the windowing infrastructure and a standardized application interface (API).

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

Xorg Download and Installation Instructions

Xorg-7.0 introduced a completely auto-tooled, modular build system. With the new modular build system, it is no longer possible to download the entire package in a single file. In fact, there will be well over 100 packages that need to be fetched from the download location. To assist with such a large task, installing Wget-1.21.3 is strongly recommended for downloading the needed files. A complete wget file list is provided for each page that includes multiple packages.

Given the number of packages available, deciding which packages you need to install for your particular setup may seem a bit overwhelming at first. Take a look at this page and this thread to get an idea of what you will need. If you are unsure, you should install all packages at the cost of extra disk space.

Note

Even if you intend to download only the necessary packages, you should download the wget file lists. The list of files are ordered by dependency, and the package versions listed in the files are known to work well with each other. Further, the wget file lists contain comments for specific packages that are deprecated or are not recommended to install. Newer packages are likely intended for the next release of Xorg and have already proved to be incompatible with current versions of software installed in BLFS. The installed size of Xorg can be reduced considerably by installing only the packages that you will need and use, however, the BLFS book cannot account for all dependencies and build options for the individual Xorg packages. The instructions assume that all packages have been built. A wiki page containing dependency information is under development. You are encouraged to add to these pages if you discover additional information that may be helpful to other users who selectively install individual packages.

Additionally, because of the large number of repetitive commands, you are encouraged to partially automate the build. Instructions have been given that utilize the Sudo-1.9.13p1 package. It is recommended that you use the :NOPASSWD configuration option for the user that will be building the xorg packages.

Setting up the Xorg Build Environment

Note

The following instructions assume that the shell startup files have been set up as described in The Bash Shell Startup Files.

As with previous releases of the X Window System, it may be desirable to install Xorg into an alternate prefix. This is no longer common practice among Linux distributions. The common installation prefix for Xorg on Linux is /usr. There is no standard alternate prefix, nor is there any exception in the current revision of the Filesystem Hierarchy Standard for Release 7 of the X Window System. Alan Coopersmith of Sun Microsystems, once stated “At Sun, we were using /usr/X11 and plan to stick with it.” Only the /opt/* prefix or the /usr prefix adhere to the current FHS guidelines.

The BLFS editors recommend using the /usr prefix.

Choose your installation prefix, and set the XORG_PREFIX variable with the following command:

export XORG_PREFIX="<PREFIX>"

Throughout these instructions, you will use the following configure switches for all of the packages. Create the XORG_CONFIG variable to use for this parameter substitution:

export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc \
    --localstatedir=/var --disable-static"

Create an /etc/profile.d/xorg.sh configuration file containing these variables as the root user:

cat > /etc/profile.d/xorg.sh << EOF
XORG_PREFIX="$XORG_PREFIX"
XORG_CONFIG="--prefix=\$XORG_PREFIX --sysconfdir=/etc --localstatedir=/var --disable-static"
export XORG_PREFIX XORG_CONFIG
EOF
chmod 644 /etc/profile.d/xorg.sh

Note

There is some confusion about the above ‘here’ document. The backslash in front of the dollar sign is correct. Bash will remove it when creating /etc/profile.d/xorg.sh. However, if you are creating the file with an editor, a copy and paste operation will not remove the backslash. It must then be removed manually.

If you’ve installed Sudo-1.9.13p1, ensure that XORG_PREFIX and XORG_CONFIG are available in the sudo environment. As the root user, run the following command:

cat > /etc/sudoers.d/xorg << EOF
Defaults env_keep += XORG_PREFIX
Defaults env_keep += XORG_CONFIG
EOF

If you are not using the standard Xorg prefix…

Warning

If you’ve decided to use the standard /usr prefix, you must omit the remainder of this page and continue at util-macros-1.20.0.

If you’ve decided to not use the standard prefix, be sure to add $XORG_PREFIX/bin to your PATH environment variable, and $XORG_PREFIX/lib/pkgconfig and $XORG_PREFIX/share/pkgconfig to your PKG_CONFIG_PATH variable. It is also helpful to specify additional search paths for gcc and an include directory for the aclocal program. Issue the following commands as the root user:

cat >> /etc/profile.d/xorg.sh << "EOF"

pathappend $XORG_PREFIX/bin             PATH
pathappend $XORG_PREFIX/lib/pkgconfig   PKG_CONFIG_PATH
pathappend $XORG_PREFIX/share/pkgconfig PKG_CONFIG_PATH

pathappend $XORG_PREFIX/lib             LIBRARY_PATH
pathappend $XORG_PREFIX/include         C_INCLUDE_PATH
pathappend $XORG_PREFIX/include         CPLUS_INCLUDE_PATH

ACLOCAL="aclocal -I $XORG_PREFIX/share/aclocal"

export PATH PKG_CONFIG_PATH ACLOCAL LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
EOF

The script above needs to be activated. Normally it will be automatic at login, but to activate it now, as a regular user, run:

source /etc/profile.d/xorg.sh

You should also add $XORG_PREFIX/lib to the /etc/ld.so.conf file. Again, as the root user, issue the following command:

echo "$XORG_PREFIX/lib" >> /etc/ld.so.conf

You should also modify /etc/man_db.conf, adding appropriate MANDATORY_MANPATH, MANPATH_MAP, and MANDB_MAP entries following the examples for /usr/X11R6. Issue the following command as the root user:

sed -e "s@X11R6/man@X11R6/share/man@g" \
    -e "s@/usr/X11R6@$XORG_PREFIX@g"   \
    -i /etc/man_db.conf

Some applications look for shared files in /usr/share/X11. Create a symbolic link to the proper location as the root user:

ln -svf $XORG_PREFIX/share/X11 /usr/share/X11

If building KDE, some cmake files look for Xorg in places other than $XORG_PREFIX. Allow cmake to find Xorg with:

ln -svf $XORG_PREFIX /usr/X11R6

24.2 util-macros-1.20.0


Introduction to util-macros

The util-macros package contains the m4 macros used by all of the Xorg packages.

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

Package Information

util-macros Dependencies

Required

Xorg build environment (should be set for the following instructions to work)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/util-macros

Installation of util-macros

Install util-macros by running the following commands:

./configure $XORG_CONFIG

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Libraries: None

Installed Directory: $XORG_PREFIX/share/pkgconfig and $XORG_PREFIX/share/util-macros

24.3 xorgproto-2022.2


Introduction to xorgproto

The xorgproto package provides the header files required to build the X Window system, and to allow other applications to build against the installed X Window system.

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

Package Information

xorgproto Dependencies

Required

util-macros-1.20.0

Optional

fop-2.8, libxslt-1.1.37, xmlto-0.0.28 and asciidoc-10.2.0 (to build additional documentation)

Note

There is a reciprocal dependency with fop-2.8. If you wish to build the documentation, you’ll need to re-install the Protocol Headers after the installation is complete and fop-2.8 has been installed.

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

Installation of xorgproto

Install xorgproto by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX -Dlegacy=true .. &&
ninja

This package does not come with a test suite.

Now, as the root user:

ninja install &&
mv -v $XORG_PREFIX/share/doc/xorgproto{,-2022.2}

Command Explanations

-Dlegacy=true: Installs legacy headers needed by old programs (such as LessTif).

Contents

Installed Programs: None

Installed Libraries: None

Installed Directories: $XORG_PREFIX/include/GL, $XORG_PREFIX/include/X11, and $XORG_PREFIX/share/doc/xorgproto-2022.2

24.4 libXau-1.0.11


Introduction to libXau

The libXau package contains a library implementing the X11 Authorization Protocol. This is useful for restricting client access to the display.

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

Package Information

libXau Dependencies

Required

xorgproto-2022.2

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

Installation of libXau

Install libXau by running the following commands:

./configure $XORG_CONFIG &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Library: libXau.so

Installed Directories: None

Short Descriptions

libXau.so is the library of X authority database routines.

24.5 libXdmcp-1.1.4


Introduction to libXdmcp

The libXdmcp package contains a library implementing the X Display Manager Control Protocol. This is useful for allowing clients to interact with the X Display Manager.

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

Package Information

libXdmcp Dependencies

Required

xorgproto-2022.2

Optional

xmlto-0.0.28, fop-2.8, libxslt-1.1.37, and Xorg-SGML-doctools (for documentation)

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

Installation of libXdmcp

Install libXdmcp by running the following commands:

./configure $XORG_CONFIG --docdir=/usr/share/doc/libXdmcp-1.1.4 &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Library: libXdmcp.so

Installed Directory: $XORG_PREFIX/share/doc/libXdmcp-1.1.4

Short Descriptions

libXdmcp.so is the X Display Manager Control Protocol library.

24.6 xcb-proto-1.15.2


Introduction to xcb-proto

The xcb-proto package provides the XML-XCB protocol descriptions that libxcb uses to generate the majority of its code and API.

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

Package Information

xcb-proto Dependencies

Xorg build environment (needed for the instructions below)

Optional

libxml2-2.10.3 (required to run the tests)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcb-proto

Installation of xcb-proto

Install xcb-proto by running the following commands:

PYTHON=python3 ./configure $XORG_CONFIG

To test the results, issue: make check.

Now, as the root user:

make install

If you are upgrading from version 1.15.1 or lower, the old pkgconfig file needs to be removed. Issue, as the root user:

rm -f $XORG_PREFIX/lib/pkgconfig/xcb-proto.pc

Contents

Installed Programs: None

Installed Libraries: None

Installed Directory: $XORG_PREFIX/share/xcb and $XORG_PREFIX/lib/python3.11/site-packages/xcbgen

24.7 libxcb-1.15


Introduction to libxcb

The libxcb package provides an interface to the X Window System protocol, which replaces the current Xlib interface. Xlib can also use XCB as a transport layer, allowing software to make requests and receive responses with both.

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

Package Information

libxcb Dependencies

Required

libXau-1.0.11 and xcb-proto-1.15.2

libXdmcp-1.1.4

Optional

Doxygen-1.9.6 (to generate API documentation) and libxslt-1.1.37

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

Installation of libxcb

Install libxcb by running the following commands:

PYTHON=python3                \
./configure $XORG_CONFIG      \
            --without-doxygen \
            --docdir='${datadir}'/doc/libxcb-1.15 &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Command Explanations

PYTHON=python3: This variable forces configure to use python3 instead of python2. The configure script for this package will automatically default to python2 if it is present.

--without-doxygen: Do not use doxygen to generate API documentation (default: auto). Without it, if Doxygen-1.9.6 is installed, the API documentation will be generated and installed.

Contents

Installed Programs: None

Installed Libraries: libxcb.so, libxcb-composite.so, libxcb-damage.so, libxcb-dpms.so, libxcb-dri2.so, libxcb-dri3.so, libxcb-glx.so, libxcb-present.so, libxcb-randr.so, libxcb-record.so, libxcb-render.so, libxcb-res.so, libxcb-screensaver.so, libxcb-shape.so, libxcb-shm.so, libxcb-sync.so, libxcb-xf86dri.so, libxcb-xfixes.so, libxcb-xinerama.so, libxcb-xinput.so, libxcb-xkb.so, libxcb-xtest.so, libxcb-xvmc.so, and libxcb-xv.so

Installed Directories: $XORG_PREFIX/include/xcb and $XORG_PREFIX/share/doc/libxcb-1.15

Short Descriptions

libxcb.so is an interface to the X Window System protocol.

24.8 Xorg Libraries


Introduction to Xorg Libraries

The Xorg libraries provide library routines that are used within all X Window applications.

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

Package Information

Xorg Libraries Dependencies

Required

Fontconfig-2.14.2 and libxcb-1.15

Optional

asciidoc-10.2.0, xmlto-0.0.28 with one or more of the following: fop-2.8, Links-2.28, Lynx-2.8.9rel.1, ncompress (for some tests), and W3m (to generate additional PDF or text documentation for the libXfont package).

dbus-1.14.6

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

Downloading Xorg Libraries

First, create a list of files to be downloaded. This file will also be used to verify the integrity of the downloads when complete:

cat > lib-7.md5 << "EOF"
ce2fb8100c6647ee81451ebe388b17ad  xtrans-1.4.0.tar.bz2
e932752126240f0846b35eef6b1f2c3d  libX11-1.8.4.tar.xz
964942427fcc5a9fa0539661421857c8  libXext-1.3.5.tar.xz
742863a552ecd53cdb957b7b276213cc  libFS-1.0.9.tar.xz
b444a0e4c2163d1bbc7b046c3653eb8d  libICE-1.1.1.tar.xz
ffa434ed96ccae45533b3d653300730e  libSM-1.2.4.tar.xz
e613751d38e13aa0d0fd8e0149cec057  libXScrnSaver-1.2.4.tar.xz
b122ff9a7ec70c94dbbfd814899fffa5  libXt-1.2.1.tar.bz2
ed52d396115fbc4d05300762aab79685  libXmu-1.1.4.tar.xz
b3c58c94e284fd6940d3615e660a0007  libXpm-3.5.15.tar.xz
c1ce21c296bbf3da3e30cf651649563e  libXaw-1.0.14.tar.bz2
86f182f487f4f54684ef6b142096bb0f  libXfixes-6.0.0.tar.bz2
af0a5f0abb5b55f8411cd738cf0e5259  libXcomposite-0.4.6.tar.xz
ebf7fb3241ec03e8a3b2af72f03b4631  libXrender-0.9.11.tar.xz
4cdd1886fe5cce6f68554296edb46db8  libXcursor-1.2.1.tar.xz
ca55d29fa0a8b5c4a89f609a7952ebf8  libXdamage-1.1.6.tar.xz
6d3f1b15bb5b0bb71ae9f0a5103c1fc4  libfontenc-1.1.7.tar.xz
c179daa707f5f432f1bc13977e5bb329  libXfont2-2.0.6.tar.xz
69dc24ba444a0f6bd99423dbf8fd0260  libXft-2.3.7.tar.xz
74055672a111a98ce2841d2ec4057b05  libXi-1.8.tar.bz2
228c877558c265d2f63c56a03f7d3f21  libXinerama-1.1.5.tar.xz
850cbc7c921c9d5d0135734b114ff6ac  libXrandr-1.5.3.tar.xz
66c9e9e01b0b53052bb1d02ebf8d7040  libXres-1.2.2.tar.xz
02f128fbf809aa9c50d6e54c8e57cb2e  libXtst-1.2.4.tar.xz
70bfdd14ca1a563c218794413f0c1f42  libXv-1.0.12.tar.xz
11a358e7229fa28dc9801c1e64fe2e18  libXvMC-1.0.13.tar.xz
74d1acf93b83abeb0954824da0ec400b  libXxf86dga-1.1.6.tar.xz
5b913dac587f2de17a02e17f9a44a75f  libXxf86vm-1.1.5.tar.xz
d2f1f0ec68ac3932dd7f1d9aa0a7a11c  libdmx-1.1.4.tar.bz2
1466cf950c914ad2db1dbb76c9a724db  libpciaccess-0.17.tar.xz
8af2275955d40166bb647b14e4896ab1  libxkbfile-1.1.2.tar.xz
faa74f7483074ce7d4349e6bdc237497  libxshmfence-1.3.2.tar.xz
EOF

To download the needed files using wget, use the following commands:

mkdir lib &&
cd lib &&
grep -v '^#' ../lib-7.md5 | awk '{print $2}' | wget -i- -c \
    -B https://www.x.org/pub/individual/lib/ &&
md5sum -c ../lib-7.md5

Installation of Xorg Libraries

Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the Sudo-1.9.13p1 package.

  3. Use su -c “command arguments” (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

as_root()
{
  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"
  fi
}

export -f as_root

Some libraries come with a test suite. If you wish to execute them, either comment out the rm -rf … below, so that, after all libraries are installed, you can come back to the corresponding directory and run make check, or do individual builds, running the tests for each of those distributed with working test suites. Alternatively, you can uncomment the line #make check …, and at the end, check the test results with:

grep -A9 summary *make_check.log

BLFS developers have confirmed that libX11, libXt, libXmu, libXpm, and libxshmfence are distributed with working test suites.

First, start a subshell that will exit on error:

bash -e

Install all of the packages by running the following commands:

for package in $(grep -v '^#' ../lib-7.md5 | awk '{print $2}')
do
  packagedir=${package%.tar.?z*}
  tar -xf $package
  pushd $packagedir
  docdir="--docdir=$XORG_PREFIX/share/doc/$packagedir"
  case $packagedir in
    libXfont2-[0-9]* )
      ./configure $XORG_CONFIG $docdir --disable-devel-docs
    ;;

    libXt-[0-9]* )
      ./configure $XORG_CONFIG $docdir \
                  --with-appdefaultdir=/etc/X11/app-defaults
    ;;

    libXpm-[0-9]* )
      sed -i '/TestAll.*TRUE/s|^|//|' test/TestAllFiles.h
      ./configure $XORG_CONFIG $docdir --disable-open-zfile
    ;;
    
    * )
      ./configure $XORG_CONFIG $docdir
    ;;
  esac

  make
  #make check 2>&1 | tee ../$packagedir-make_check.log
  as_root make install
  popd
  rm -rf $packagedir
  as_root /sbin/ldconfig
done

Finally, exit the shell that was started earlier:

exit

Command Explanations

sed … test/TestAllFiles.h: Fix a test file to work without the optional compress program.

--disable-open-zfile: Allow libXpm to build without the optional compress command present.

--disable-devel-docs: Disable generation of text documentation in the libXfont2 package if xmlto-0.0.28 is installed without a text browser. Omit this parameter (or the entire case statement) if a text browser is installed.

--with-fop: Use fop-2.8 to generate PDF documentation (only for the libXfont package).

Configuration of Xorg Libraries

If you’ve chosen to install Xorg into /usr, then no further configuration is necessary and you can skip the rest of this section. If you’ve opted for an alternate prefix, you should create two symlinks to satisfy the expected environment of several packages. Execute the following commands as the root user:

ln -sv $XORG_PREFIX/lib/X11 /usr/lib/X11 &&
ln -sv $XORG_PREFIX/include/X11 /usr/include/X11

Contents

Installed Programs: cxpm and sxpm

Installed Libraries: libdmx.so, libfontenc.so, libFS.so, libICE.so, libpciaccess.so, libSM.so, libX11.so, libX11-xcb, libXaw6.so, libXaw7.so, libXaw.so, libXcomposite.so, libXcursor.so, libXdamage.so, libXext.so, libXfixes.so, libXfont2.so, libXft.so, libXinerama.so, libXi.so, libxkbfile.so, libXmu.so, libXmuu.so, libXpm.so, libXrandr.so, libXrender.so, libXRes.so, libxshmfence.so, libXss.so, libXt.so, libXtst.so, libXvMC.so, libXvMCW.so, libXv.so, libXxf86dga.so and libXxf86vm.so

Installed Directories: $XORG_PREFIX/include/X11/fonts, $XORG_PREFIX/include/X11/ICE, $XORG_PREFIX/include/X11/SM, $XORG_PREFIX/include/X11/Xmu, $XORG_PREFIX/include/X11/Xtrans, $XORG_PREFIX/share/doc/libFS, $XORG_PREFIX/share/doc/libICE-1.1.1, $XORG_PREFIX/share/doc/libSM-1.2.4, $XORG_PREFIX/share/doc/libX11-1.8.4, $XORG_PREFIX/share/doc/libXaw, $XORG_PREFIX/share/doc/libXext, $XORG_PREFIX/share/doc/libXi, $XORG_PREFIX/share/doc/libXmu-1.1.4, $XORG_PREFIX/share/doc/libXrender, $XORG_PREFIX/share/doc/libXt, $XORG_PREFIX/share/doc/libXtst, $XORG_PREFIX/share/doc/libXvMC, $XORG_PREFIX/share/doc/xtrans and $XORG_PREFIX/share/X11/locale

Short Descriptions

cxpm checks the format of an XPM file.

sxpm shows an XPM file and/or converts XPM 1 or 2 files to XPM 3.

libdmx.so is the X Window System DMX (Distributed Multihead X) extension library.

libfontenc.so is the X11 font encoding library.

libFS.so is the library interface to the X Font Server.

libICE.so is the X Inter Client Exchange Library.

libpciaccess.so is the generic PCI Access library for X.

libSM.so is the X Session Management Library.

libX11.so is the Xlib Library.

libXaw6.so is the X Athena Widgets Library, version 6.

libXaw7.so is the X Athena Widgets Library, version 7.

libXaw.so are symbolic links to the current X Athena Widgets Library, version 7.

libXcomposite.so is the X Composite Library.

libXcursor.so is the X Cursor management library.

libXdamage.so is the X Damage Library.

libXext.so is the Misc X Extension Library.

libXfixes.so provides augmented versions of core protocol requests.

libXfont2.so is the X font library.

libXft.so is the X FreeType interface library.

libXinerama.so is the Xinerama Library.

libXi.so is the X Input Extension Library.

libxkbfile.so is the xkbfile Library.

libXmu.so is the X interface library for miscellaneous utilities not part of the Xlib standard.

libXmuu.so is the Mini Xmu Library.

libXpm.so is the X Pixmap Library.

libXrandr.so is the X Resize, Rotate and Reflection extension library.

libXrender.so is the X Render Library.

libXRes.so is the X-Resource extension client library.

libxshmfence.so exposes an event API on top of Linux futexes.

libXss.so is the X11 Screen Saver extension client library.

libXt.so is the X Toolkit Library.

libXtst.so is the Xtst Library.

libXvMC.so is the X-Video Motion Compensation Library.

libXvMCW.so is the XvMC Wrapper including the Nonstandard VLD extension.

libXv.so is the X Window System video extension library.

libXxf86dga.so is the client library for the XFree86-DGA extension.

libXxf86vm.so is the client library for the XFree86-VidMode X extension.

24.9 libxcvt-0.1.2


Introduction to libxcvt

libxcvt is a library providing a standalone version of the X server implementation of the VESA CVT standard timing modelines generator. It is meant to be a direct replacement to the version formerly provided by the Xorg server.

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

Package Information

libxcvt Dependencies

Required

Xorg build environment (should be set for the following instructions to work)

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

Installation of libxcvt

Install libxcvt by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX --buildtype=release .. &&
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.

Contents

Installed Program: cvt

Installed Library: libxcvt.so

Installed Directory: $XORG_PREFIX/include/libxcvt

Short Descriptions

cvt calculates VESA Coordinated Video Timing (CVT) modelines for use with X.

libxcvt.so contains functions for calculating VESA CVT.

24.10 xcb-util-0.4.1


Introduction to xcb-util

The xcb-util package provides additional extensions to the XCB library, many that were previously found in Xlib, but are not part of core X protocol.

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

Package Information

xcb-util Dependencies

Required

libxcb-1.15

Optional

Doxygen-1.9.6 (for documentation)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcb-util

Installation of xcb-util

Install xcb-util by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Library: libxcb-util.so

Installed Directories: None

Short Descriptions

libxcb-util.so Provides utility functions for other XCB utilities.

24.11 xcb-util-image-0.4.1


Introduction to xcb-util-image

The xcb-util-image package provides additional extensions to the XCB library.

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

Package Information

xcb-util-image Dependencies

Required

xcb-util-0.4.1

Optional

Doxygen-1.9.6 (for documentation)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcb-util-image

Installation of xcb-util-image

Install xcb-util-image by running the following commands:

./configure $XORG_CONFIG &&
make

To test the results, issue: LD_LIBRARY_PATH=$XORG_PREFIX/lib make check.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Library: libxcb-image.so

Installed Directories: None

Short Descriptions

libxcb-image.so Is a port of Xlib’s XImage and XShmImage functions.

24.12 xcb-util-keysyms-0.4.1


Introduction to xcb-util-keysyms

The xcb-util-keysyms package contains a library for handling standard X key constants and conversion to/from keycodes.

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

Package Information

xcb-util-keysyms Dependencies

Required

libxcb-1.15

Optional

Doxygen-1.9.6 (to generate documentation)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcb-util-keysyms

Installation of xcb-util-keysyms

Install xcb-util-keysyms by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Library: libxcb-keysyms.so

Installed Directories: None

Short Descriptions

libxcb-keysyms.so provides the standard X key constants and API functions for conversion to/from keycodes.

24.13 xcb-util-renderutil-0.3.10


Introduction to xcb-util-renderutil

The xcb-util-renderutil package provides additional extensions to the XCB library.

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

Package Information

xcb-util-renderutil Dependencies

Required

libxcb-1.15

Optional

Doxygen-1.9.6 (for documentation)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcb-util-renderutil

Installation of xcb-util-renderutil

Install xcb-util-renderutil by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Library: libxcb-render-util.so

Installed Directories: None

Short Descriptions

libxcb-render-util.so Provides convenience functions for the Render extension.

24.14 xcb-util-wm-0.4.2


Introduction to xcb-util-wm

The xcb-util-wm package contains libraries which provide client and window-manager helpers for EWMH and ICCCM.

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

Package Information

xcb-util-wm Dependencies

Required

libxcb-1.15

Optional

Doxygen-1.9.6 (for documentation)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcb-util-wm

Installation of xcb-util-wm

Install xcb-util-wm by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Libraries: libxcb-ewmh.so and libxcb-icccm.so

Installed Directories: None

Short Descriptions

libxcb-ewmh.so provides the client and window-manager helpers for EWMH.

libxcb-icccm.so provides the client and window-manager helpers for ICCCM.

24.15 xcb-util-cursor-0.1.4


Introduction to xcb-util-cursor

The xcb-util-cursor package provides a module that implements the XCB cursor library. It is the XCB replacement for libXcursor.

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

Package Information

xcb-util-cursor Dependencies

Required

xcb-util-image-0.4.1 and xcb-util-renderutil-0.3.10

Optional

Doxygen-1.9.6 (for documentation)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcb-util-cursor

Installation of xcb-util-cursor

Install xcb-util-cursor by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Library: libxcb-cursor.so

Installed Directories: None

Short Descriptions

libxcb-cursor.so Is a port of Xlib’s libXcursor functions.

24.16 Mesa-22.3.5


Introduction to Mesa

Mesa is an OpenGL compatible 3D graphics library.

Note

Mesa is updated relatively often. You may want to use the latest available 22.3.x mesa version.

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

Package Information

Additional Downloads

Mesa Dependencies

Required

Xorg Libraries, libdrm-2.4.115, and Mako-1.2.4

libva-2.17.0 (to provide VA-API support for some gallium drivers, note that there is a circular dependency. You must build libva first without EGL and GLX support, install this package, and rebuild libva), libvdpau-1.5 (to build VDPAU drivers), LLVM-15.0.7 (required for Gallium3D, nouveau, and radeonsi drivers and for swrast, the software rasterizer which is sometimes referred to as llvmpipe. See https://docs.mesa3d.org/systems.html for more information), and wayland-protocols-1.31 (required for Plasma-5.26.5, GNOME, and recommended for GTK+-3.24.36)

Optional

libgcrypt-1.10.1, libunwind-1.6.2, lm-sensors-3-6-0 , Nettle-3.8.1, Valgrind-3.20.0, mesa-demos (provides more than 300 extra demos to test Mesa; this includes the same programs added by the patch above), Bellagio OpenMAX Integration Layer (for mobile platforms), glslang (for vulkan drivers), libtizonia, and libvulkan

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

Installation of Mesa

If you have downloaded the xdemos patch (needed if testing the Xorg installation per BLFS instructions), apply it by running the following command:

patch -Np1 -i ../mesa-22.3.5-add_xdemos-1.patch

Install Mesa by running the following commands:

mkdir build &&
cd    build &&

meson setup                   \
      --prefix=$XORG_PREFIX   \
      --buildtype=release     \
      -Dplatforms=x11,wayland \
      -Dgallium-drivers=auto  \
      -Dvulkan-drivers=""     \
      -Dvalgrind=disabled     \
      -Dlibunwind=disabled    \
      ..                      &&

ninja

To test the results, issue: meson configure -Dbuild-tests=true && ninja test.

Now, as the root user:

ninja install

If desired, install the optional documentation by running the following commands as the root user:

install -v -dm755 /usr/share/doc/mesa-22.3.5 &&
cp -rfv ../docs/* /usr/share/doc/mesa-22.3.5

Command Explanations

--buildtype=release: This switch ensures a fully-optimized build, and disables debug assertions which will severely slow down the libraries in certain use-cases. Without this switch, build sizes can span into the 2GB range.

-Dgallium-drivers="...": This parameter controls which Gallium3D drivers should be built.

-Dplatforms="...": This parameter controls which windowing systems will be supported. Available linux platforms are x11 and wayland.

-Dvulkan-drivers="": This switch allows choosing which Vulkan drivers are built. The default is auto, but this requires the optional dependency glslang. So it is better to pass an empty list, in order to remove the need for that dependency. Nothing in BLFS uses Vulkan anyway.

-Dvalgrind=disabled: This parameter disables the usage of Valgrind during the build process. Remove this parameter if you have Valgrind installed, and wish to check for memory leaks.

-Dlibunwind=disabled: This parameter disables the usage of libunwind.

meson configure -Dbuild-tests=true: This command will reconfigure the build to set -Dbuild-tests=true, but keep the other options specified in the meson setup command unchanged. It allows ninja test to build and run unit tests.

-Degl-native-platform="...": This parameter controls which Embedded Graphics Library support will be built. Available linux options are auto (default), x11, wayland, surfaceless, and drm.

Contents

Installed Programs: glxgears and glxinfo

Installed Libraries: libEGL.so, libGL.so, libGLESv1_CM.so, libGLESv2.so, libgbm.so, libglapi.so, and libxatracker.so

Installed Drivers: crocus_dri.so, i915_dri.so, iris_dri.so, kms_swrast_dri.so, nouveau_dri.so, nouveau_drv_video.so, r300_dri.so, r600_dri.so, r600_drv_video.so, radeonsi_dri.so, radeonsi_drv_video.so, swrast_dri.so, virtio_gpu_dri.so, virtio_gpu_drv_video.so, vmwgfx_dri.so, libvdpau_nouveau.so, libvdpau_r300.so libvdpau_r600.so, and libvdpau_radeonsi.so libvdpau_virtio_gpu.so (Many of these drivers are hard-linked).

Installed Directories: $XORG_PREFIX/{include/{EGL,GLES,GLES2,GLES3,KHR}, $XORG_PREFIX/lib/{dri,vdpau}}, $XORG_PREFIX/share/drirc.d (contains workarounds for various applications, particularly browsers and games), and /usr/share/doc/mesa-22.3.5

Short Descriptions

glxgears is a GL demo useful for troubleshooting graphics problems.

glxinfo is a diagnostic program that displays information about the graphics hardware and installed GL libraries.

libEGL.so provides a native platform graphics interface as defined by the EGL-1.4 specification.

libgbm.so is the Mesa Graphics Buffer Manager library.

libGLESv1_CM.so is the Mesa OpenGL ES 1.1 library.

libGLES2.so is the Mesa OpenGL ES 2.0 library.

libGL.so is the main Mesa OpenGL library.

24.17 xbitmaps-1.1.2


Introduction to xbitmaps

The xbitmaps package contains bitmap images used by multiple applications built in Xorg chapter.

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

Package Information

xbitmaps Dependencies

Required

util-macros-1.20.0

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

Installation of xbitmaps

Install xbitmaps by running the following commands:

./configure $XORG_CONFIG

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Libraries: None

Installed Directory: $XORG_PREFIX/include/X11/bitmaps

24.18 Xorg Applications


Introduction to Xorg Applications

The Xorg applications provide the expected applications available in previous X Window implementations.

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

Package Information

Xorg Applications Dependencies

Required

libpng-1.6.39, Mesa-22.3.5, xbitmaps-1.1.2, and xcb-util-0.4.1

Optional

Linux-PAM-1.5.2 and both cairo-5c and Nickle (only if you wish to try to run the undocumented xkeyhost script).

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

Downloading Xorg Applications

First, create a list of files to be downloaded. This file will also be used to verify the integrity of the downloads when complete:

cat > app-7.md5 << "EOF"
5d3feaa898875484b6b340b3888d49d8  iceauth-1.0.9.tar.xz
c4a3664e08e5a47c120ff9263ee2f20c  luit-1.1.1.tar.bz2
fd2e6e5a297ac2bf3d7d54799bf69de0  mkfontscale-1.2.2.tar.xz
05423bb42a006a6eb2c36ba10393de23  sessreg-1.1.3.tar.xz
2f72c7170cdbadc8ef786b2f9cfd4a69  setxkbmap-1.3.3.tar.xz
9f7a4305f0e79d5a46c3c7d02df9437d  smproxy-1.0.7.tar.xz
e96b56756990c56c24d2d02c2964456b  x11perf-1.6.1.tar.bz2
dbcf944eb59343b84799b2cc70aace16  xauth-1.1.2.tar.xz
5b6405973db69c0443be2fba8e1a8ab7  xbacklight-1.2.3.tar.bz2
82a90e2feaeab5c5e7610420930cc0f4  xcmsdb-1.0.6.tar.xz
89e81a1c31e4a1fbd0e431425cd733d7  xcursorgen-1.0.8.tar.xz
f67116760888f2e06486ee3d179875d2  xdpyinfo-1.3.3.tar.xz
34aff1f93fa54d6a64cbe4fee079e077  xdriinfo-1.0.7.tar.xz
61219e492511b3d78375da76defbdc97  xev-1.2.5.tar.xz
41afaa5a68cdd0de7e7ece4805a37f11  xgamma-1.0.7.tar.xz
48ac13856838d34f2e7fca8cdc1f1699  xhost-1.0.9.tar.xz
ac6b7432726008b2f50eba82b0e2dbe4  xinput-1.6.3.tar.bz2
a11d4d6eeda762f13818684c0670f89f  xkbcomp-1.4.6.tar.xz
05ce1abd8533a400572784b1186a44d0  xkbevd-1.1.5.tar.xz
cf65ca1aaf4c28772ca7993cfd122563  xkbutils-1.0.5.tar.xz
f62b99839249ce9a7a8bb71a5bab6f9d  xkill-1.0.6.tar.xz
da5b7a39702841281e1d86b7349a03ba  xlsatoms-1.1.4.tar.xz
ab4b3c47e848ba8c3e47c021230ab23a  xlsclients-1.1.5.tar.xz
f33841b022db1648c891fdc094014aee  xmessage-1.0.6.tar.xz
0d66e07595ea083871048c4b805d8b13  xmodmap-1.0.11.tar.xz
9cf272cba661f7acc35015f2be8077db  xpr-1.1.0.tar.xz
33c090d8632a300e63efbf36edd6a333  xprop-1.2.6.tar.xz
f822a8d5f233e609d27cc22d42a177cb  xrandr-1.5.2.tar.xz
85f04a810e2fb6b41ab872b421dce1b1  xrdb-1.2.1.tar.bz2
33b04489e417d73c90295bd2a0781cbb  xrefresh-1.0.7.tar.xz
18ff5cdff59015722431d568a5c0bad2  xset-1.2.5.tar.xz
fa9a24fe5b1725c52a4566a62dd0a50d  xsetroot-1.1.3.tar.xz
d698862e9cad153c5fefca6eee964685  xvinfo-1.1.5.tar.xz
f783a209f2e3fa13253cedb65eaf9cdb  xwd-1.0.8.tar.bz2
26d46f7ef0588d3392da3ad5802be420  xwininfo-1.1.5.tar.bz2
5ff5dc120e8e927dc3c331c7fee33fc3  xwud-1.0.6.tar.xz
EOF

To download the needed files using wget, use the following commands:

mkdir app &&
cd app &&
grep -v '^#' ../app-7.md5 | awk '{print $2}' | wget -i- -c \
    -B https://www.x.org/pub/individual/app/ &&
md5sum -c ../app-7.md5

Installation of Xorg Applications

Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the Sudo-1.9.13p1 package.

  3. Use su -c “command arguments” (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

as_root()
{
  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"
  fi
}

export -f as_root

First, start a subshell that will exit on error:

bash -e

Install all of the packages by running the following commands:

for package in $(grep -v '^#' ../app-7.md5 | awk '{print $2}')
do
  packagedir=${package%.tar.?z*}
  tar -xf $package
  pushd $packagedir
     case $packagedir in
       luit-[0-9]* )
         sed -i -e "/D_XOPEN/s/5/6/" configure
       ;;
     esac

     ./configure $XORG_CONFIG
     make
     as_root make install
  popd
  rm -rf $packagedir
done

Finally, exit the shell that was started earlier:

exit

Unless you installed the optional dependencies, remove an undocumented script which is reported to be broken (xkeystone provided by the xrandr package).

as_root rm -f $XORG_PREFIX/bin/xkeystone

Contents

Installed Programs: iceauth, luit, mkfontdir, mkfontscale, sessreg, setxkbmap, smproxy, x11perf, x11perfcomp, xauth, xbacklight, xcmsdb, xcursorgen, xdpr, xdpyinfo, xdriinfo, xev, xgamma, xhost, xinput, xkbbell, xkbcomp, xkbevd, xkbvleds, xkbwatch, xkill, xlsatoms, xlsclients, xmessage, xmodmap, xpr, xprop, xrandr, xrdb, xrefresh, xset, xsetroot, xvinfo, xwd, xwininfo, and xwud

Installed Libraries: None

Installed Directories: None

Short Descriptions

iceauth is the ICE authority file utility.

luit provides locale and ISO 2022 support for Unicode terminals.

mkfontdir creates an index of X font files in a directory.

mkfontscale creates an index of scalable font files for X.

sessreg manages utmp/wtmp entries for non-init clients.

setxkbmap sets the keyboard using the X Keyboard Extension.

smproxy is the Session Manager Proxy.

x11perf is an X11 server performance test program.

x11perfcomp is an X11 server performance comparison program.

xauth is the X authority file utility.

xbacklight adjusts backlight brightness using RandR extension.

xcmsdb is the Device Color Characterization utility for the X Color Management System.

xcursorgen creates an X cursor file from a collection of PNG images.

xdpr dumps an X window directly to a printer.

xdpyinfo is a display information utility for X.

xdriinfo queries configuration information of DRI drivers.

xev prints contents of X events.

xgamma alters a monitor’s gamma correction through the X server.

xhost is a server access control program for X.

xinput is a utility to configure and test X input devices.

xkbbell is an XKB utility program that raises a bell event.

xkbcomp compiles an XKB keyboard description.

xkbevd is the XKB event daemon.

xkbvleds shows the XKB status of keyboard LEDs.

xkbwatch monitors modifier keys and LEDs.

xkill kills a client by its X resource.

xlsatoms lists interned atoms defined on the server.

xlsclients lists client applications running on a display.

xmessage displays a message or query in a window.

xmodmap is a utility for modifying keymaps and pointer button mappings in X.

xpr prints an X window dump.

xprop is a property displayer for X.

xrandr is a primitive command line interface to RandR extension.

xrdb is the X server resource database utility.

xrefresh refreshes all or part of an X screen.

xset is the user preference utility for X.

xsetroot is the root window parameter setting utility for X.

xvinfo prints out X-Video extension adaptor information.

xwd dumps an image of an X window.

xwininfo is a window information utility for X.

xwud is an image displayer for X.

24.19 xcursor-themes-1.0.6


Introduction to xcursor-themes

The xcursor-themes package contains the redglass and whiteglass animated cursor themes.

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

Package Information

xcursor-themes Dependencies

Required

Xorg Applications

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xcursor-themes

Installation of xcursor-themes

Note

We explicitly install the cursor themes in /usr instead of $XORG_PREFIX so non-Xorg desktop environments can find them.

Install xcursor-themes 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 Programs: None

Installed Libraries: None

Installed Directories: /usr/share/icons/handhelds, /usr/share/icons/redglass, and /usr/share/icons/whiteglass

24.20 Xorg Fonts


Introduction to Xorg Fonts

The Xorg font packages provide some scalable fonts and supporting packages for Xorg applications. Many people will want to install other TTF or OTF fonts in addition to, or instead of, these. Some are listed at the section called “TTF and OTF fonts”.

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

Package Information

Xorg Fonts Dependencies

Required

xcursor-themes-1.0.6

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

Downloading Xorg Fonts

First, create a list of files to be downloaded. This file will also be used to verify the integrity of the downloads when complete:

cat > font-7.md5 << "EOF"
ec6cea7a46c96ed6be431dfbbb78f366  font-util-1.4.0.tar.xz
c2bcfdc52b8b6462228342cedae2fed9  encodings-1.0.6.tar.xz
0497de0176a0dfa5fac2b0552a4cf380  font-alias-1.0.4.tar.bz2
fcf24554c348df3c689b91596d7f9971  font-adobe-utopia-type1-1.0.4.tar.bz2
e8ca58ea0d3726b94fe9f2c17344be60  font-bh-ttf-1.0.3.tar.bz2
53ed9a42388b7ebb689bdfc374f96a22  font-bh-type1-1.0.3.tar.bz2
bfb2593d2102585f45daa960f43cb3c4  font-ibm-type1-1.0.3.tar.bz2
4ee18ab6c1edf636b8e75b73e6037371  font-misc-ethiopic-1.0.4.tar.bz2
3eeb3fb44690b477d510bbd8f86cf5aa  font-xfree86-type1-1.0.4.tar.bz2
EOF

To download the needed files using wget, use the following commands:

mkdir font &&
cd font &&
grep -v '^#' ../font-7.md5 | awk '{print $2}' | wget -i- -c \
    -B https://www.x.org/pub/individual/font/ &&
md5sum -c ../font-7.md5

Installation of Xorg Fonts

Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the Sudo-1.9.13p1 package.

  3. Use su -c “command arguments” (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

as_root()
{
  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"
  fi
}

export -f as_root

First, start a subshell that will exit on error:

bash -e

Install all of the packages by running the following commands:

for package in $(grep -v '^#' ../font-7.md5 | awk '{print $2}')
do
  packagedir=${package%.tar.?z*}
  tar -xf $package
  pushd $packagedir
    ./configure $XORG_CONFIG
    make
    as_root make install
  popd
  as_root rm -rf $packagedir
done

Finally, exit the shell that was started earlier:

exit

When all of the fonts have been installed, the system must be configured so that Fontconfig can find the TrueType fonts. Since the fonts are outside of the default search path of several packages if XORG_PREFIX is not /usr, make symlinks to the Xorg TrueType font directories in /usr/share/fonts by running the following commands as the root user:

install -v -d -m755 /usr/share/fonts                               &&
ln -svfn $XORG_PREFIX/share/fonts/X11/OTF /usr/share/fonts/X11-OTF &&
ln -svfn $XORG_PREFIX/share/fonts/X11/TTF /usr/share/fonts/X11-TTF

Contents

Installed Programs: bdftruncate and ucs2any

Installed Libraries: None

Installed Directories: $XORG_PREFIX/share/fonts

Short Descriptions

bdftruncate generates a truncated BDF font from an ISO 10646-1 encoded BDF font.

ucs2any generates BDF fonts in any encoding from an ISO 10646-1 encoded BDF font.

24.21 XKeyboardConfig-2.38


Introduction to XKeyboardConfig

The XKeyboardConfig package contains the keyboard configuration database for the X Window System.

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

Package Information

XKeyboardConfig Dependencies

Required

Xorg Libraries

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xkeyboard-config

Installation of XKeyboardConfig

Install XKeyboardConfig by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX --buildtype=release .. &&
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.

Contents

Installed Programs: None

Installed Libraries: None

Installed Directory: $XORG_PREFIX/share/X11/xkb

24.22 Xwayland-22.1.8


Introduction to Xwayland

The Xwayland package is an Xorg server running on top of the wayland server. It has been separated from the main Xorg server package. It allows running X clients inside a wayland session.

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

Package Information

Xwayland Dependencies

Required

libxcvt-0.1.2, Pixman-0.42.2, wayland-protocols-1.31, and Xorg Fonts (only font-util)

libepoxy-1.5.10, libtirpc-1.3.3, and Mesa-22.3.5

Optional

git-2.39.2 (to download packages needed for the tests), libgcrypt-1.10.1, Nettle-3.8.1, xmlto-0.0.28, Xorg Legacy Fonts (only bdftopcf, for building fonts required for the tests), rendercheck (for tests), and weston (for tests)

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

Installation of Xwayland

Install xwayland by running the following commands:

sed -i '/install_man/,$d' meson.build &&

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX         \
      --buildtype=release           \
      -Dxkb_output_dir=/var/lib/xkb \
      ..                            &&
ninja

Building the test framework needs some work. First, weston brings in several dependencies, but the number can be reduced by disabling unneeded features. The meson command for a stripped down build of weston is shown in Upstream continuous integration build.

Running the tests involves downloading two other frameworks, in addition to the mentioned optional dependencies:

mkdir tools &&
pushd tools &&

git clone https://gitlab.freedesktop.org/mesa/piglit.git --depth 1 &&
cat > piglit/piglit.conf << EOF                                    &&
[xts]
path=$(pwd)/xts
EOF

git clone https://gitlab.freedesktop.org/xorg/test/xts --depth 1   &&

export DISPLAY=:22           &&
../hw/vfb/Xvfb $DISPLAY &
VFB_PID=$!                   &&
cd xts                       &&
CFLAGS=-fcommon ./autogen.sh &&
make                         &&
kill $VFB_PID                &&
unset DISPLAY VFB_PID        &&
popd

Then the tests can be run with:

XTEST_DIR=$(pwd)/tools/xts PIGLIT_DIR=$(pwd)/tools/piglit ninja test

Now, as the root user:

ninja install

If Xorg-Server-21.1.7 is not installed and you do not plan to install it later, you can install Xvfb from this package. As the root user:

install -vm755 hw/vfb/Xvfb /usr/bin

Command Explanations

sed -i ‘/install_man/,$d’ meson.build: Prevents installing a manual page for Xserver, which is also provided by Xorg-Server-21.1.7. Remove this command if Xorg-Server-21.1.7 is not installed and you don’t plan to install it later.

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

Contents

Installed Program: Xwayland

Installed Library: None

Installed Directory: None

Short Descriptions

Xwayland Allows X clients to run under wayland.

24.23 Xorg-Server-21.1.7


Introduction to Xorg Server

The Xorg Server is the core of the X Window system.

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

Package Information

Xorg Server Dependencies

Required

libxcvt-0.1.2, Pixman-0.42.2, Xorg Fonts (only font-util), and at runtime: xkeyboard-config-2.38

libepoxy-1.5.10 (needed for glamor), libtirpc-1.3.3, Systemd-252, and Xorg Libinput-1.2.1 (runtime)

Optional

acpid-2.0.34 (runtime), Doxygen-1.9.6 (to build API documentation), fop-2.8 (to build documentation), libunwind-1.6.2, Nettle-3.8.1, libgcrypt-1.10.1, xcb-util-keysyms-0.4.1, xcb-util-image-0.4.1, xcb-util-renderutil-0.3.10, xcb-util-wm-0.4.2 (all four to build Xephyr), xmlto-0.0.28 (to build documentation), xkeyboard-config-2.38 (for tests), rendercheck (for tests), and xorg-sgml-doctools (to build documentation)

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

Installation of Xorg Server

Install the server by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX \
      --localstatedir=/var  \
      -Dsuid_wrapper=true   \
      -Dxkb_output_dir=/var/lib/xkb &&
ninja

To test the results, issue: ninja test. You will need to run ldconfig as the root user first or some tests may fail.

Now as the root user:

ninja install &&
mkdir -pv /etc/X11/xorg.conf.d

Command Explanations

-Dsuid_wrapper=true: Builds the suid-root wrapper for legacy driver support on rootless xserver systems.

-Dsystemd_logind=false: This switch disables systemd-logind integration, allowing Xorg Server to work without having the systemd PAM module configured.

-Dxephyr=true: This option allows building Xephyr if its dependencies are met.

Contents

Installed Programs: gtf, X, Xnest, Xorg, Xvfb, and optionally Xephyr

Installed Libraries: several under $XORG_PREFIX/lib/xorg/modules/ including the modesetting_drv.so driver

Installed Directories: /etc/X11/xorg.conf.d, $XORG_PREFIX/include/xorg, $XORG_PREFIX/lib/xorg, and $XORG_PREFIX/share/X11/xorg.conf.d

Short Descriptions

gtf calculates VESA GTF mode lines.

X is a symbolic link to Xorg.

Xephyr is a nested X server which supports modern X extensions.

Xnest is a nested X server.

Xorg is the X11R7 X Server.

Xvfb is the virtual framebuffer X server for X Version 11.

modesetting_drv.so provides a video driver for machines using Kernel Mode Setting (KMS). This will use glamor if that has been enabled and the hardware offers acceleration.

24.24 Xorg Drivers


Introduction to Xorg Drivers

The Xorg Drivers page contains the instructions for building Xorg drivers that are necessary in order for Xorg Server to take advantage of the hardware that it is running on. At least one input and one video driver are required for Xorg Server to start.

On machines using KMS, the modesetting driver is provided by xorg-server and can be used instead of the video driver for the specific hardware, but with reduced performance. It can also be used (without hardware acceleration) in virtual machines running under qemu.

Note

If you are unsure which video hardware you have, you can use lspci from pciutils-3.9.0 to find out which video hardware you have and then look at the descriptions of the packages in order to find out which driver you need.

Note

In addition to the drivers listed below, there are several other drivers for very old hardware that may still be relevant. The latest versions of these drivers may be downloaded from https://www.x.org/archive/individual/driver. Instructions for building these now intermittently maintained drivers may be found in a prior version of BLFS: https://www.linuxfromscratch.org/blfs/view/7.6/x/x7driver.html

libevdev 1.13.0

Introduction to libevdev

The libevdev package contains common functions for Xorg input drivers.

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

Package Information

libevdev Dependencies

Optional

Doxygen-1.9.6 and Valgrind-3.20.0 (optional for tests)

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

Kernel Configuration

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

Device Drivers  --->
    Input device support --->
        <*> Generic input layer (needed for keyboard, mouse, ...) [CONFIG_INPUT]
        <*>   Event interface                       [CONFIG_INPUT_EVDEV]
        [*]   Miscellaneous devices  --->           [CONFIG_INPUT_MISC]
            <*/m>    User level driver support      [CONFIG_INPUT_UINPUT]

The last item is not strictly required for libevdev. If it is compiled as a module, it is not loaded automatically. It is needed for full test coverage.

Installation of libevdev

Install libevdev by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX    \
      --buildtype=release      \
      -Ddocumentation=disabled &&
ninja

The regression tests can be run as the root user with ninja test, in a graphical session. You need to have enabled the CONFIG_INPUT_UINPUT setting in the kernel for full test coverage. If it is enabled as a module, the module is named uinput and needs to be loaded before running the tests. Note that on some systems, the tests may cause a hard lockup and require a reboot. On laptops, the system will go into Sleep and need to be woken up to finish the test suites.

Now, as the root user:

ninja install

Contents

Installed Xorg Programs: libevdev-tweak-device, mouse-dpi-tool, and touchpad-edge-detector

Installed Xorg Library: libevdev.so

Installed Xorg Directory: $XORG_PREFIX/include/libevdev-1.0

Short Descriptions

libevdev-tweak-device is a tool to change some kernel device properties.

mouse-dpi-tool is a tool to estimate the resolution of a mouse.

touchpad-edge-detector touchpad-edge-detector is a tool that reads the touchpad events from the kernel and calculates the minimum and maximum for the x and y coordinates, respectively.

libevdev.so is a library of Xorg driver input functions.

Xorg Evdev Driver-2.10.6

Introduction to Xorg Evdev Driver

The Xorg Evdev Driver package contains a Generic Linux input driver for the Xorg X server. It handles keyboard, mouse, touchpads and wacom devices, though for touchpad and wacom advanced handling, additional drivers are required.

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

Package Information

Xorg Evdev Driver Dependencies

Required

libevdev-1.13.0, mtdev-1.1.6, and Xorg-Server-21.1.7

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-evdev-driver

Installation of Xorg Evdev Driver

Install Xorg Evdev Driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Xorg Driver: evdev_drv.so

Short Descriptions

evdev_drv.so is an Xorg input driver for Linux generic event devices.

libinput-1.22.1

Introduction to Libinput

libinput is a library that handles input devices for display servers and other applications that need to directly deal with input devices.

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

Package Information

libinput Dependencies

Required

libevdev-1.13.0 and mtdev-1.1.6

Optional

Valgrind-3.20.0 (to run the tests), GTK+-3.24.36 (to build the GUI event viewer), libunwind-1.6.2 (required for tests), libwacom-2.6.0, sphinx-6.1.3 (required to build documentation), and pyparsing-3.0.9 (for one non-root test)

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

Kernel Configuration for Running the Libinput Test Suite

Although libinput works with the same kernel configuration used by libevdev-1.13.0, its extensive test suite requires the presence of /dev/uinput (as well as both Valgrind-3.20.0 and libunwind-1.6.2).

If you wish to run the full tests, enable the following option in the kernel configuration and recompile the kernel if necessary:

Device Drivers --->
    Input device support --->
        Miscellaneous Devices --->
        <*/M>   User level driver support        [CONFIG_INPUT_UINPUT]

If you build this as a module, it needs to be inserted before the test suite runs.

On an Xorg system you will also need to prevent the events generated during the test suite from interfering with your desktop. Copy the file test/50-litest.conf into ${XORG_PREFIX}/share/X11/xorg.conf.d and restart X. For further information see libinput test suite.

Installation of Libinput

Install libinput by running the following commands:

mkdir build &&
cd    build &&

meson setup --prefix=$XORG_PREFIX    \
            --buildtype=release      \
            -Ddebug-gui=false        \
            -Dtests=false            \
            -Dlibwacom=false         \
            -Dudev-dir=/usr/lib/udev \
            ..                      &&
ninja

Note

If you want to run the full tests, remove -Dtests from the meson command above. Please read “kernel configuration for running the libinput test suite” (above).

If you have enabled the full tests, you can run the main tests as the root user by executing: ninja test. A very large number of tests will be run. One test fails on wayland.

Now, as the root user:

ninja install

If you have passed -Ddocumentation=true to meson, you can install the generated documentation by running the following commands as the root user:

install -v -dm755      /usr/share/doc/libinput-1.22.1/html &&
cp -rv Documentation/* /usr/share/doc/libinput-1.22.1/html

Command Explanations

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

-Ddebug-gui=false: This switch disables creation of a visual debug helper for libinput. Remove if you want it, and you have GTK+-3.24.36 installed.

-Dtests=false: This switch disables compilation of the main tests. Even with the tests defined as false, you can still run the first four minor tests, as a regular user, but one will be skipped if pyparsing-3.0.9 is not installed.

-Dlibwacom=false: Remove this option if you have libwacom-2.6.0 installed, or if you are installing GNOME.

-Dudev-dir=/usr/lib/udev: In case that the value of XORG_PREFIX is not set to /usr, this option prevents the package from installing Udev rules and helpers into $XORG_PREFIX/lib/udev which is not searched by Udev daemon. This option is not needed for systems with XORG_PREFIX set to /usr, but does no harm.

-Ddocumentation=true: This switch enables generation of the documentation. Add it if you want to generate the documentation. You must have Doxygen-1.9.6 and Graphviz-7.1.0 installed.

Contents

Installed Programs: libinput

Installed Libraries: libinput.so

Installed Directories: /etc/libinput, $XORG_PREFIX/libexec/libinput, $XORG_PREFIX/usr/share/libinput, and (optionally) $XORG_PREFIX/share/doc/libinput-1.22.1

Short Descriptions

libinput is a set of tools to interface with the libinput library.

libinput.so contains API functions for handling input devices.

Xorg Libinput Driver-1.2.1

Introduction to Xorg Libinput Driver

The X.Org Libinput Driver is a thin wrapper around libinput and allows for libinput to be used for input devices in X. This driver can be used as as drop-in replacement for evdev and synaptics.

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

Package Information

Xorg Libinput Driver Dependencies

Required

libinput-1.22.1 and Xorg-Server-21.1.7

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-libinput-driver

Installation of Xorg Libinput Driver

Install Xorg Libinput Driver by running the following commands:

./configure $XORG_CONFIG &&
make

To test the results, issue make check.

Now, as the root user:

make install

Contents

Installed Xorg Driver: libinput_drv.so

Short Descriptions

libinput_drv.so is an Xorg input driver for mouse, keyboard, touchpad, touchscreen, and tablet devices.

Xorg Synaptics Driver-1.9.2

Introduction to Xorg Synaptics Driver

The Xorg Synaptics Driver package contains the X.Org Input Driver, support programs and SDK for Synaptics touchpads. Even though the evdev driver can handle touchpads very well, this driver is required if you want to use advanced features like multi tapping, scrolling with touchpad, turning the touchpad off while typing, etc.

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

Package Information

Xorg Synaptics Driver Dependencies

Required

libevdev-1.13.0 and Xorg-Server-21.1.7

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-synaptics-driver

Installation of Xorg Synaptics Driver

Install Xorg Synaptics Driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: synclient and syndaemon

Installed Xorg Driver: synaptics_drv.so

Short Descriptions

synclient is a command line utility used to query and modify Synaptics driver options.

syndaemon is a program that monitors keyboard activity and disables the touchpad when the keyboard is being used.

synaptics_drv.so is an Xorg input driver for touchpads.

Xorg Wacom Driver-1.1.0

Introduction to Xorg Wacom Driver

The Xorg Wacom Driver package contains the X.Org X11 driver and SDK for Wacom and Wacom-like tablets. It is not required to use a Wacom tablet, the xf86-input-evdev driver can handle these devices without problems.

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

Package Information

Xorg Wacom Drivers Dependencies

Required

Xorg-Server-21.1.7

Optional

Doxygen-1.9.6 and Graphviz-7.1.0

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-wacom-driver

Kernel Configuration

To use a Wacom tablet with USB interface, enable the following options in your kernel configuration and recompile. Note that other configuration options could be required for tablet with a serial or bluetooth interface:

Device Drivers  --->
    HID support  --->
        -*- HID bus support                                      [CONFIG_HID]
            Special HID drivers --->
                <*/M> Wacom Intuos/Graphire tablet support (USB) [CONFIG_HID_WACOM]

Installation of Xorg Wacom Driver

Install Xorg Wacom Driver by running the following commands:

./configure $XORG_CONFIG &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Contents

Installed Programs: isdv4-serial-debugger, isdv4-serial-inputattach, and xsetwacom

Installed Xorg Driver: wacom_drv.so

Short Descriptions

xsetwacom is a commandline utility used to query and modify wacom driver settings.

wacom_drv.so is an Xorg input driver for Wacom devices.

Xorg AMDGPU Driver-23.0.0

Introduction to Xorg AMDGPU Driver

The Xorg AMDGPU Driver package contains the X.Org Video Driver for newer AMD Radeon video cards and newer AMD-CPUs with integrated graphics (APUs). This includes video cards starting with Volcanic Islands. It can also be used for Southern and Sea Islands if the experimental support was enabled in the kernel.

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

Note

For Direct Rendering to work, you need to enable the radeonsi Gallium driver at Mesa-22.3.5 build time. Also, all cards and newer APUs require Firmware to be available when the kernel driver is loaded. If you have not followed the instructions in the Firmware for Video Cards part of About Firmware which provided that firmware in /lib/firmware for a modular build, firmware can be obtained from https://anduin.linuxfromscratch.org/BLFS/linux-firmware/ - see the section called “Kernel Configuration for additional firmware” below for additional firmware.

Package Information

Xorg AMDGPU Driver Dependencies

Required

Xorg-Server-21.1.7 (must be built with glamor enabled)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-amdgpu-driver

Kernel Configuration

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

Device Drivers  --->
    Graphics support --->
        <*> Direct Rendering Manager (XFree86 ... support) --->     [CONFIG_DRM]
        <*/M> AMD GPU                                               [CONFIG_DRM_AMDGPU]
            < /*> Enable amdgpu support for SI parts                [CONFIG_DRM_AMDGPU_SI]
            < /*> Enable amdgpu support for CIK parts               [CONFIG_DRM_AMDGPU_CIK]

The last two options enable experimental support for Southern and Sea Islands AMD GPUs so they can be used with this driver. Note that the support is marked experimental and disabled by default. Xorg ATI Driver-19.1.0 should be used for those GPUs.

Kernel Configuration for additional firmware

If you need to add firmware, install the file(s) and then point to them in the kernel configuration and recompile the kernel if necessary. To find out which firmware you need, consult the Decoder ring for engineering vs marketing names. Download any firmware for your card which is named like: <ENGINEERING_NAME>_rlc.bin, etc. Below is an example for Radeon R7 M340 GPU, which is codenamed Iceland/Topaz, along with a network card that also requires the firmware:

CONFIG_EXTRA_FIRMWARE="amdgpu/topaz_ce.bin amdgpu/topaz_k_smc.bin amdgpu/topaz_mc.bin
                       amdgpu/topaz_me.bin amdgpu/topaz_mec2.bin amdgpu/topaz_mec.bin
                       amdgpu/topaz_pfp.bin amdgpu/topaz_rlc.bin amdgpu/topaz_sdma1.bin
                       amdgpu/topaz_sdma.bin amdgpu/topaz_smc.bin rtl_nic/rtl8168e-3.fw"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

Note

CONFIG_EXTRA_FIRMWARE should all be on one line. It is shown above as multiple lines for presentation only.

Tip

You can check dmesg output after boot to see which firmware is missing.

Alternatively, if you change CONFIG_DRM_AMDGPU to ‘=m’ in your linux kernel .config the firmware can be loaded automatically from /lib/firmware/amdgpu/ when it installs the module. This offers a tiny space saving, but also means that the screen will be blank for a longer time before the framebuffer appears. Distros take this approach because it is not practical to specify every possible firmware and the kernel would be excessively big.

Installation of Xorg AMDGPU Driver

Install Xorg AMDGPU Driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Xorg Driver: amdgpu_drv.so

Short Descriptions

amdgpu_drv.so is an Xorg video driver for latest AMD Radeon video cards.

Xorg ATI Driver-19.1.0

Introduction to Xorg ATI Driver

The Xorg ATI Driver package contains the X.Org Video Driver for ATI Radeon video cards including all chipsets ranging from R100 to the “Volcanic Islands” chipsets.

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

Note

For Direct Rendering to work with newer Radeon Cards (R300 and later chipsets), you need to enable the r300, r600 and radeonsi Gallium drivers at Mesa-22.3.5 build time. Also, some cards require Firmware to be available when the kernel driver is loaded. In that case, if you have not followed the instructions in the Firmware for Video Cards part of About Firmware which provided that firmware in /lib/firmware for a modular build, firmware can be obtained from https://anduin.linuxfromscratch.org/BLFS/linux-firmware/ - see the section called “Kernel Configuration for additional firmware” below for additional firmware.

Package Information

Additional Downloads

Xorg ATI Driver Dependencies

Required

Xorg-Server-21.1.7 (recommended to be built with glamor enabled)

Note

Glamor is required for Southern, Sea or Volcanic Islands GPUs, and used by default in all other R600 or later radeon GPUs. To see which GPUs are in these categories, read the Decoder ring for engineering vs marketing names.

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-ati-driver

Kernel Configuration

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

Device Drivers  --->
    Graphics support --->
        <*> Direct Rendering Manager (XFree86 ... support) ---> [CONFIG_DRM]
        <*> ATI Radeon                                          [CONFIG_DRM_RADEON]

Kernel Configuration for additional firmware

If you need to add firmware, install the file(s) and then point to them in the kernel configuration and recompile the kernel if necessary. To find out which firmware you need, consult the Decoder ring for engineering vs marketing names. Download any firmware for your card which is named like: <ENGINEERING_NAME>_rlc.bin, etc. Note that for R600 and R700 family, generic R600_rlc.bin and R700_rlc.bin are necessary in addition to the model specific firmware, while for later generations you need the BTC_rlc.bin in addition to the model specific firmware. Below is an example for a Radeon HD6470 which is a “Northern Islands” GPU, plus an RTL network chip that also requests extra firmware:

CONFIG_EXTRA_FIRMWARE="radeon/BTC_rlc.bin radeon/CAICOS_mc.bin radeon/CAICOS_me.bin
radeon/CAICOS_pfp.bin radeon/CAICOS_smc.bin rtl_nic/rtl8168e-3.fw"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

Note

CONFIG_EXTRA_FIRMWARE should all be on one line. It is shown above as two lines for presentation only.

Tip

You can check dmesg output after boot to see which firmware is missing.

Alternatively, if you change CONFIG_DRM_RADEON to ‘=m’ in your .config the firmware can be loaded automatically from /lib/firmware/radeon when it installs the module. This offers a tiny space saving, but also means that the screen will be blank for a longer time before the framebuffer appears. Distros take this approach because it is not practical to specify every possible firmware and the kernel would be excessively big.

Installation of Xorg ATI Driver

First, apply a patch including fixes for known performance regressions and future problems with Xorg-Server.

patch -Np1 -i ../xf86-video-ati-19.1.0-upstream_fixes-1.patch

Install Xorg ATI Driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Xorg Drivers: ati_drv.so and radeon_drv.so

Short Descriptions

ati_drv.so is a wrapper driver for ATI video cards that autodetects ATI video hardware and loads the radeon, mach64 or r128 driver depending on which video card is in use.

radeon_drv.so is an Xorg video driver for ATI Radeon based video cards.

Xorg Fbdev Driver-0.5.0

Introduction to Xorg Fbdev Driver

The Xorg Fbdev Driver package contains the X.Org Video Driver for framebuffer devices. This driver is often used as fallback driver if the hardware specific and VESA drivers fail to load or are not present. If this driver is not installed, Xorg Server will print a warning on startup, but it can be safely ignored if hardware specific driver works well.

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

Package Information

Xorg Fbdev Driver Dependencies

Required

Xorg-Server-21.1.7

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-fbdev-driver

Installation of Xorg Fbdev Driver

Install Xorg Fbdev Driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Xorg Driver: fbdev_drv.so

Short Descriptions

fbdev_drv.so is an Xorg video driver for framebuffer devices.

Xorg Intel Driver-20230223

Introduction to Xorg Intel Driver

The Xorg Intel Driver package contains the X.Org Video Driver for Intel integrated video chips including 8xx, 9xx, Gxx, Qxx, HD, Iris, and Iris Pro graphics processors.

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

Note

This driver is for Intel integrated GPU, and a development version is needed to work properly with the latest hardware. This version is now one year old and has some problems. The “Kernel Modes Setting (KMS)” driver shipped along with Xorg Server is said to give better results.

Package Information

Xorg Intel Driver Dependencies

Required

xcb-util-0.4.1 and Xorg-Server-21.1.7

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-intel-driver

Kernel Configuration

Enable the following options in the kernel configuration. Recompile the kernel if necessary:

Device Drivers  --->
    Graphics support --->
        <*> Direct Rendering Manager (XFree86 ... support) ---> [CONFIG_DRM]
        <*> Intel 8xx/9xx/G3x/G4x/HD Graphics                   [CONFIG_DRM_I915]

Installation of Xorg Intel Driver

Install Xorg Intel Driver by running the following commands:

./autogen.sh $XORG_CONFIG     \
            --enable-kms-only \
            --enable-uxa      \
            --mandir=/usr/share/man &&
make

This package does not come with a test suite.

Now, as the root user:

make install &&

mv -v /usr/share/man/man4/intel-virtual-output.4 \
      /usr/share/man/man1/intel-virtual-output.1 &&

sed -i '/\.TH/s/4/1/' /usr/share/man/man1/intel-virtual-output.1

Working around problems with the Intel driver

The SandyBridge New Acceleration (SNA) code is intended to replace the old UXA (UMA Acceleration Architecture), but it is a large body of code and may cause problems. However, the version of the code in the version control system listed above has been tested successfully with both SNA and UXA capabilities.

To work around this problem, as well as enabling support for UXA, it is necessary to force UXA to be used by creating a configuration file. If this problem applies to you, create the following file as the root user and modify it as needed:

cat >> /etc/X11/xorg.conf.d/20-intel.conf << "EOF"
Section   "Device"
        Identifier "Intel Graphics"
        Driver     "intel"
        #Option     "DRI" "2"            # DRI3 is default
        #Option     "AccelMethod"  "sna" # default
        #Option     "AccelMethod"  "uxa" # fallback
EndSection
EOF

Command Explanations

--enable-kms-only: This switch omits the UMS (User Mode Setting) code.

--enable-uxa: This switch allows the old UXA code to be compiled in addition to the default SNA.

Contents

Installed Program: intel-virtual-output

Installed Library: libIntelXvMC.so

Installed Xorg Driver: intel_drv.so

Short Descriptions

intel-virtual-output is a utility to connect the integrated Intel GPU to discrete outputs on hybrid systems.

intel_drv.so is an Xorg video driver for Intel integrated graphics chipsets.

Xorg Nouveau Driver-1.0.17

Introduction to Xorg Nouveau Driver

The Xorg Nouveau Driver package contains the X.Org Video Driver for NVidia Cards including RIVA TNT, RIVA TNT2, GeForce 256, QUADRO, GeForce2, QUADRO2, GeForce3, QUADRO DDC, nForce, nForce2, GeForce4, QUADRO4, GeForce FX, QUADRO FX, GeForce 6XXX and GeForce 7xxx chipsets.

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

Package Information

Xorg Nouveau Drivers Dependencies

Required

Xorg-Server-21.1.7 (recommended to be built with glamor enabled)

Note

The new “Maxwell” and “Pascal” GPUs require Glamor to be built with the Xorg server.

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-nouveau-driver

###

Kernel Configuration

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

Device Drivers  --->
    Graphics support --->
        <*> Direct Rendering Manager (XFree86 ... support) --->     [CONFIG_DRM]
        <*> Nouveau (NVIDIA) cards                                  [CONFIG_DRM_NOUVEAU]
            [*]   Support for backlight control                     [CONFIG_DRM_NOUVEAU_BACKLIGHT]

Installation of Xorg Nouveau Driver

Note

Please ensure that you have installed Mesa-22.3.5 with the nouveau fixes patch prior to continuing.

First, fix the Xorg Nouveau Driver to build with the latest Xorg Server:

grep -rl slave | xargs sed -i s/slave/secondary/

Install Xorg Nouveau Driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Xorg Driver: nouveau_drv.so

Short Descriptions

nouveau_drv.so is an Xorg video driver for nVidia video cards.

Xorg VMware Driver-13.4.0

Introduction to Xorg VMware Driver

The Xorg VMware Driver package contains the X.Org Video Driver for VMware SVGA virtual video cards.

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

Package Information

Xorg VMware Driver Dependencies

Required

Xorg-Server-21.1.7

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/xorg-vmware-driver

Kernel Configuration

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

Device Drivers  --->
    Graphics support  --->
        <*> Direct Rendering Manager (XFree86 ... support) --->      [CONFIG_DRM]
        <*> DRM driver for VMware Virtual GPU                        [CONFIG_DRM_VMWGFX]
            [*]   Enable framebuffer console under vmwgfx by default [CONFIG_DRM_VMWGFX_FBCON]

Installation of Xorg VMware Driver

Install Xorg VMware Driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Xorg Driver: vmware_drv.so

Short Descriptions

vmware_drv.so is an Xorg video driver for VMware SVGA virtual video card.

intel-media-driver-23.1.2

Introduction to intel-media-driver

The intel-media-driver package provides a VA API driver for Intel GPUs that are provided with Broadwell CPUs and higher. This includes support for a variety of codecs.

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

Package Information

Note

The tarball intel-media-23.1.2.tar.gz will extract to the directory media-driver-intel-media-23.1.2.

intel-media-driver Dependencies

Required

CMake-3.25.2, Intel-gmmlib-22.3.4, and libva-2.17.0

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/intel-media-driver

Installation of intel-media-driver

Note

This package takes a long time to build because it compiles code specific to each individual generation of Intel GPUs and for a variety of media codecs.

Install intel-media-driver by running the following commands:

mkdir build &&
cd    build &&

cmake -DCMAKE_INSTALL_PREFIX=/usr   \
      -DINSTALL_DRIVER_SYSCONF=OFF  \
      -DBUILD_TYPE=Release          \
      -Wno-dev ..                   &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Libraries: libigfxcmrt.so

Installed Drivers: iHD_drv_video.so

Installed Directories: /usr/include/igfxcmrt

Short Descriptions

libigfxcmrt.so provides API functions which allow running GPU kernels on the render engine.

libva-2.17.0

Introduction to libva

The libva package contains a library which provides access to hardware accelerated video processing, using hardware to accelerate video processing in order to offload the central processing unit (CPU) to decode and encode compressed digital video. The VA API video decode/encode interface is platform and window system independent targeted at Direct Rendering Infrastructure (DRI) in the X Window System however it can potentially also be used with direct framebuffer and graphics sub-systems for video output. Accelerated processing includes support for video decoding, video encoding, subpicture blending, and rendering.

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

Package Information

Additional Downloads

libva Dependencies

Required

libdrm-2.4.115

Mesa-22.3.5

Optional

Doxygen-1.9.6, Wayland-1.21.0, and intel-gpu-tools

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

Installation of libva

Install libva by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Installation of intel-vaapi-driver

The intel-vaapi-driver is designed specifically for video cards based on an Intel GPU. Unpack the intel-vaapi tarball:

tar -xvf ../intel-vaapi-driver-2.4.1.tar.bz2 &&
cd intel-vaapi-driver-2.4.1

Install the driver by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: None

Installed Libraries: libva-drm.so, libva-glx.so, libva.so, libva-wayland.so, and libva-x11.so

Installed Driver: i965_drv_video.so

Installed Directory: $XORG_PREFIX/include/va

Short Descriptions

libva.so contains API functions which provide access to hardware accelerated video processing.

libvdpau-1.5

Introduction to libvdpau

The libvdpau package contains a library which implements the VDPAU library.

VDPAU (Video Decode and Presentation API for Unix) is an open source library (libvdpau) and API originally designed by Nvidia for its GeForce 8 series and later GPU hardware targeted at the X Window System. This VDPAU API allows video programs to offload portions of the video decoding process and video post-processing to the GPU video-hardware.

Currently, the portions capable of being offloaded by VDPAU onto the GPU are motion compensation (mo comp), inverse discrete cosine transform (iDCT), VLD (variable-length decoding) and deblocking for MPEG-1, MPEG-2, MPEG-4 ASP (MPEG-4 Part 2), H.264/MPEG-4 AVC and VC-1, WMV3/WMV9 encoded videos. Which specific codecs of these that can be offloaded to the GPU depends on the version of the GPU hardware; specifically, to also decode MPEG-4 ASP (MPEG-4 Part 2), Xvid/OpenDivX (DivX 4), and DivX 5 formats, a GeForce 200M (2xxM) Series (the eleventh generation of Nvidia’s GeForce graphics processing units) or newer GPU hardware is required.

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

Package Information

libvdpau Dependencies

Required

Xorg Libraries

Optional

Doxygen-1.9.6, Graphviz-7.1.0, and texlive-20220321 or install-tl-unx

Runtime Dependency

Mesa-22.3.5

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

Installation of libvdpau

Install libvdpau by running the following commands:

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX .. &&
ninja

To test the results, issue: ninja test. There is only one test for this package, dlclose, and it is known to fail on some systems.

Now, as the root user:

ninja install

If doxygen is present at build time place the documentation in a versioned directory as the root user:

[ -e $XORG_PREFIX/share/doc/libvdpau ] && mv -v $XORG_PREFIX/share/doc/libvdpau{,1.5}

Contents

Installed Programs: None

Installed Library: libvdpau.so

Installed Directories: $XORG_PREFIX/{include,lib}/vdpau

Short Descriptions

libvdpau.so contains functions to offload portions of the video decoding process and video post-processing to the GPU video-hardware.

libvdpau-va-gl-0.4.0

Introduction to libvdpau-va-gl

The libvdpau-va-gl package contains a library which implements the VDPAU library. Libvdpau_va_gl uses OpenGL under the hood to accelerate drawing and scaling and the VA-API (if available) to accelerate video decoding. For now VA-API is available on some Intel chips, and on some AMD video adapters with the help of the libvdpau driver.

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

Package Information

libvdpau-va-gl Dependencies

Required

CMake-3.25.2, libvdpau-1.5, and libva-2.17.0

Optional

Doxygen-1.9.6, Graphviz-7.1.0, and texlive-20220321 or install-tl-unx

Runtime Dependency

Mesa-22.3.5

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

Installation of libvdpau-va-gl

Install libvdpau-va-gl by running the following commands:

mkdir build &&
cd    build &&

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$XORG_PREFIX .. &&
make

To test the results, issue: make check. The tests must be run from an Xorg environment.

Now, as the root user:

make install

Configuration

To allow libvdpau to find libvdpau-va-gl, set an environment variable. As the root user:

echo "export VDPAU_DRIVER=va_gl" >> /etc/profile.d/xorg.sh

Contents

Installed Programs: None

Installed Library: libvdpau_va_gl.so

Installed Directories: None

Short Descriptions

libvdpau_va_gl.so contains functions to implement the OpenGL backend to the VDPAU (Video Decode and Presentation API for Unix) API.

24.25 twm-1.0.12


Introduction to twm

The twm package contains a very minimal window manager.

This package is provided for testing the completed Xorg installation.

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

Package Information

twm Dependencies

Required

Xorg-Server-21.1.7

Xorg Legacy Fonts

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

Installation of twm

Install twm by running the following commands:

sed -i -e '/^rcdir =/s,^\(rcdir = \).*,\1/etc/X11/app-defaults,' src/Makefile.in &&
./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Command Explanations

sed -i -e ‘/^rcdir =/s…: This command ensures the twm configuration file gets installed in the proper location.

Contents

Installed Programs: twm

Installed Libraries: None

Installed Directory: /etc/X11/app-defaults

Short Descriptions

twm is the Tab Window Manager for the X Window System.

24.26 xterm-379


Introduction to xterm

xterm is a terminal emulator for the X Window System.

This package is provided for testing the completed Xorg installation.

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

Package Information

xterm Dependencies

Required

Xorg Applications

Required (at runtime)

A monospace TTF or OTF font such as Dejavu fonts

Optional

Emacs-28.2, PCRE-8.45 or pcre2-10.42, Valgrind-3.20.0 and man2html

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

Installation of xterm

Install xterm by running the following commands:

sed -i '/v0/{n;s/new:/new:kb=^?:/}' termcap &&
printf '\tkbs=\\177,\n' >> terminfo &&

TERMINFO=/usr/share/terminfo \
./configure $XORG_CONFIG     \
    --with-app-defaults=/etc/X11/app-defaults &&

make

This package does not come with a test suite.

Now, as the root user:

make install    &&
make install-ti &&

mkdir -pv /usr/share/applications &&
cp -v *.desktop /usr/share/applications/

Command Explanations

sed -i … termcap, printf … » terminfo: These commands modify the terminal description so that the Backspace key is expected to send the character with ASCII code 127. This is done for consistency with the Linux console.

TERMINFO=/usr/share/terminfo: This ensures that the xterm terminfo files are installed to the system terminfo database.

--with-app-defaults=...: Sets the location for the app-defaults directory.

make install-ti: This command installs corrected terminfo description files for use with xterm.

Configuring xterm

There are two ways to configure xterm. You can add the X resource definitions to the user’s ~/.Xresources file, or add them to the system-wide $XORG_PREFIX/share/X11/app-defaults/Xterm file.

In order for xterm to follow the locale settings in the environment, use TrueType fonts, and follow the Linux convention about the code sent by the Backspace key, add the following definitions as the root user:

cat >> /etc/X11/app-defaults/XTerm << "EOF"
*VT100*locale: true
*VT100*faceName: Monospace
*VT100*faceSize: 10
*backarrowKeyIsErase: true
*ptyInitialErase: true
EOF

Contents

Installed Programs: koi8rxterm, resize, uxterm, and xterm

Installed Libraries: None

Installed Directories: None

Short Descriptions

koi8rxterm is a wrapper script to set up xterm with a KOI8-R locale。

resize prints a shell command for setting the TERM and TERMCAP environment variables to indicate the current size of xterm window。

uxterm is a wrapper script that modifies the current locale to use UTF-8 and starts xterm with the proper settings。

xterm is a terminal emulator for the X Window System.

24.27 xclock-1.1.1


Introduction to xclock

The xclock package contains a simple clock application which is used in the default xinit configuration.

This package is provided for testing the completed Xorg installation.

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

Package Information

xclock Dependencies

Required

Xorg Libraries

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

Installation of xclock

Install xclock by running the following commands:

./configure $XORG_CONFIG &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: xclock

Installed Libraries: None

Installed Directory: None

Short Descriptions

xclock is an analog/digital clock for X.

24.28 xinit-1.4.2


Introduction to xinit

The xinit package contains a usable script to start the xserver.

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

Package Information

xinit Dependencies

Required

Xorg Libraries

twm-1.0.12, xclock-1.1.1, and xterm-379 (used in the default xinitrc file)

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

Installation of xinit

Install xinit by running the following commands:

./configure $XORG_CONFIG --with-xinitdir=/etc/X11/app-defaults &&
make

This package does not come with a test suite.

Now, as the root user:

make install &&
ldconfig

Contents

Installed Programs: xinit and startx

Installed Libraries: None

Installed Directories: None

Short Descriptions

startx initializes an X session.

xinit is the X Window System initializer.

24.29 Xorg-7 Testing and Configuration


Testing Xorg

Note

Before starting Xorg for the first time, is is useful to rebuild the library cache by running ldconfig as the root user.

Note

Before starting Xorg for the first time, is is often needed to reboot the system to ensure all appropriate daemons are started and appropriate security issues are properly set. As an alternative, logging out and logging back in may work, but as of this writing has not been tested.

Warning

If Xorg hangs for some reason (for example, lacking a proper input driver), the system may stop responding to any user input. As a precaution, you can enable a magic SysRq key before testing Xorg. As the root user, issue:

echo 4 > /proc/sys/kernel/sysrq

Then if Xorg hangs, it’s possible to use Alt+SysRq+R to reset the keyboard mode. Now it should be able to use Ctrl+Alt+Fx (replace x with a VT number) to switch to another VT. If it works, login and kill Xorg using command line in the new VT.

To test the Xorg installation, issue startx. This command brings up a rudimentary window manager called twm with three xterm windows and one xclock window. The xterm window in the upper left is a login terminal and running exit from this terminal will exit the X Window session. The third xterm window may be obscured on your system by the other two xterms.

Note

When testing Xorg with the twm window manager, there will be several warnings in the Xorg log file, $HOME/.local/share/xorg/Xorg.0.log, about missing font files. In addition, there will be several warnings on the text mode terminal (usually tty1) about missing fonts. These warnings do not affect functionality, but can be removed if desired by installing the Xorg Legacy Fonts.

Generally, there is no specific configuration required for Xorg, but customization is possible. For details, see the section called “Setting up Xorg Devices” below.

Checking the Direct Rendering Infrastructure (DRI) Installation

DRI is a framework for allowing software to access graphics hardware in a safe and efficient manner. It is installed in X by default (using Mesa) if you have a supported video card.

To check if DRI drivers are installed properly, check the log file $HOME/.local/share/xorg/Xorg.0.log (or /var/log/Xorg.0.log if you have built Xorg-Server-21.1.7 with the suid bit) for statements such as:

(II) intel(0): direct rendering: DRI2 Enabled

or

(II) NOUVEAU(0): Loaded DRI module

Note

DRI configuration may differ if you are using alternate drivers, such as those from NVIDIA or AMD.

Another way to determine if DRI is working properly is to use one of the two optionally installed OpenGL demo programs in Mesa-22.3.5. From an X terminal, run glxinfo and look for the phrase:

name of display: :0
display: :0  screen: 0
direct rendering: Yes

If direct rendering is enabled, you can add verbosity by running LIBGL_DEBUG=verbose glxinfo. This will show the drivers, device nodes and files used by the DRI system.

To confirm that DRI2 hardware acceleration is working, you can (still in the X terminal) run the command **glxinfo grep -E “(OpenGL vendor OpenGL renderer OpenGL version)”**. If that reports something other than Software Rasterizer then you have working acceleration for the user who ran the command.

If your hardware does not have any DRI2 driver available, it will use a Software Rasterizer for Direct Rendering. In such cases, you can use a new, LLVM-accelerated, Software Rasterizer called LLVMPipe. In order to build LLVMPipe just make sure that LLVM-15.0.7 is present at Mesa build time. Note that all decoding is done on the CPU instead of the GPU, so the display will run slower than with hardware acceleration. To check if you are using LLVMpipe, review the output of the glxinfo command above. An example of the output using the Software Rasterizer is shown below:

OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits)
OpenGL version string: 3.0 Mesa 10.4.5

You can also force LLVMPipe by exporting the LIBGL_ALWAYS_SOFTWARE=1 environment variable when starting Xorg.

Again, if you have built the Mesa OpenGL demos, you can also run the test program glxgears. This program brings up a window with three gears turning. The X terminal will display how many frames were drawn every five seconds, so this will give a rough benchmark. The window is scalable, and the frames drawn per second is highly dependent on the size of the window. On some hardware, glxgears will run synchronized with the vertical refresh signal and the frame rate will be approximately the same as the monitor refresh rate.

Debugging Xorg

When starting xorg, there are a couple of ways to check what any issues you may have. If the system comes up, you can see what driver is being used by running xdriinfo. If there are issues or you just want to check, look at Xorg.0.log.

The location of Xorg.0.log depends on how Xorg is installed. If the instructions in the book are followed closely and Xorg is started from the command line, it will be located in the $HOME/.local/share/xorg/ directory. If Xorg is started by a display manager (e.g. lightdm-1.32.0, lxdm-0.5.3, or GDM-43.0) or if $XORG_PREFIX/libexec/Xorg has the suid bit set, it will be located in the /var/log/ directory.

Xorg.0.log Issues

When you look at Xorg.0.log, check for entries like (EE) or (WW). Below are some common entries:

(WW) Open ACPI failed (/var/run/acpid.socket)

This warning is because acpid-2.0.34 is not installed. If you are not on a laptop, it can be safely ignored. On a laptop, install acpid-2.0.34 to enable actions like recognizing when the lid is closed.

(WW) VGA arbiter: cannot open kernel arbiter, no multi-card support

This warning is displayed when a regular user starts Xorg. The library libpciaccess.so issues this warning when it tries to open /dev/vga_arbiter. If there is only one video card in the system, it can safely be ignored. If desired, the permissions of this device can be changed by adding a udev rule and adding the local user to the video group. As the root user:

cat > /etc/udev/rules.d/99-vga-arbiter.rules << EOF
# /etc/udev/rules.d/99-vga-arbiter.rules: Set vga_arbiter group/mode

ACTION=="add", KERNEL=="vga_arbiter", GROUP="video" MODE="0660"
EOF

usermod -a -G video <user running xorg>
(EE) AIGLX error: dlopen of /opt/xorg/lib/dri/i965_dri.so failed

This error, accompanied by (EE) AIGLX error: unable to load driver i965, occurs in some systems with Intel based graphics devices. It is caused by a mismatch between the current Xorg-Server-21.1.7 and Mesa-22.3.5. Xorg no longer uses the i965 driver and uses the crocus or iris mesa drivers as indicated by the xdriinfo command. It can safely be ignored.

If desired, this warning can be removed by commenting out lines 330-331 and 337-338 (LogMessage) of glx/glxdricommon.c in the Xorg-Server-21.1.7 package.

Hybrid Graphics

Hybrid Graphics is still in experimental state for Linux. Xorg Developers have developed a technology called PRIME that can be used for switching between integrated and muxless discrete GPU at will. Automatic switching is not possible at the moment.

In order to use PRIME for GPU switching, make sure that you are using Linux Kernel 3.4 or later (recommended). You will need latest DRI and DDX drivers for your hardware and Xorg Server 1.13 or later.

Xorg Server should load both GPU drivers automatically. You can check that by running:

xrandr --listproviders

There should be two (or more) providers listed, for example:

Providers: number : 2
Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:Intel
Provider 1: id: 0x56 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 1 associated providers: 1 name:radeon

In order to be able to run a GLX application on a discrete GPU, you will need to run the following command, where is the more powerful discrete card, and is the card which has a display connected:

xrandr --setprovideroffloadsink <provider> <sink>

Note

With newer Xorg drivers, such as modesetting or intel, which are DRI3 capable, the above command is no longer necessary. It does no harm however.

Then, you will need to export the DRI_PRIME=1 environment variable each time you want the powerful GPU to be used. For example,

DRI_PRIME=1 glxinfo | grep -E "(OpenGL vendor|OpenGL renderer|OpenGL version)"

will show OpenGL vendor, renderer and version for the discrete GPU.

If the last command reports same OpenGL renderer with and without DRI_PRIME=1, you will need to check your installation.

Setting up Xorg Devices

For most hardware configurations, modern Xorg will automatically get the server configuration correct without any user intervention. There are, however, some cases where auto-configuration will be incorrect. Following are some example manual configuration items that may be of use in these instances.

Setting up X Input Devices

For most input devices, no additional configuration will be necessary. This section is provided for informational purposes only.

A sample default XKB setup could look like the following (executed as the root user):

cat > /etc/X11/xorg.conf.d/xkb-defaults.conf << "EOF"
Section "InputClass"
    Identifier "XKB Defaults"
    MatchIsKeyboard "yes"
    Option "XkbLayout" "fr"
    Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
EOF

The “XkbLayout” line is an example for a French (AZERTY) keyboard. Change it to your keyboard model. That line is not needed for a QWERTY (US) keyboard.

Fine Tuning Display Settings

Again, with modern Xorg, little or no additional configuration is necessary. If you should need extra options passed to your video driver, for instance, you could use something like the following (again, executed as the root user):

cat > /etc/X11/xorg.conf.d/videocard-0.conf << "EOF"
Section "Device"
    Identifier  "Videocard0"
    Driver      "radeon"
    VendorName  "Videocard vendor"
    BoardName   "ATI Radeon 7500"
    Option      "NoAccel" "true"
EndSection
EOF

Another common setup is having multiple server layouts for use in different environments. Though the server will automatically detect the presence of another monitor, it may get the order incorrect:

cat > /etc/X11/xorg.conf.d/server-layout.conf << "EOF"
Section "ServerLayout"
    Identifier     "DefaultLayout"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" LeftOf "Screen0"
    Option         "Xinerama"
EndSection
EOF

24.30 Tuning Fontconfig


Overview of Fontconfig

If you only read text in English, and are happy with the common libre fonts listed on the next page, you may never need to worry about the details of how fontconfig works. But there are many things which can be altered if they do not suit your needs.

Although this page is long, it barely scratches the surface and you will be able to find many alternative views on the web (but please remember that some things have changed over the years, for example the autohinter is no longer the default). The aim here is to give you enough information to understand the changes you are making.

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

The Xft Font Protocol

The Xft font protocol provides antialiased font rendering through freetype, and fonts are controlled from the client side using fontconfig (except for rxvt-unicode-9.31 which can use fonts listed in ~/.Xresources, and AbiWord-3.0.5 which only uses the specified font). The default search path is /usr/share/fonts and ~/.local/share/fonts although for the moment the old and deprecated location ~/.fonts still works. Fontconfig searches directories in its path recursively and maintains a cache of the font characteristics in each directory. If the cache appears to be out of date, it is ignored, and information is fetched from the fonts themselves (that can take a few seconds if you installed a lot of fonts).

If you’ve installed Xorg in any prefix other than /usr, any X fonts were not installed in a location known to Fontconfig. Symlinks were created from the OTF and TTF X font directories to /usr/share/fonts/X11-{OTF,TTF}. This allows Fontconfig to use the OpenType and TrueType fonts provided by X, although many people will prefer to use more modern fonts.

Fontconfig uses names to define fonts. Applications generally use generic font names such as “Monospace”, “Sans” and “Serif”. Fontconfig resolves these names to a font that has all characters that cover the orthography of the language indicated by the locale settings.

Useful Commands

The following commands may be helpful when working with fontconfig:

**fc-list less** : show a list of all available fonts (/path/to/filename: Font Name:style). If you installed a font more than 30 seconds ago but it does not show, then it or one of its directories is not readable by your user.

fc-match ‘Font Name’ : will tell you which font will be used if the named font is requested. Typically you would use this to see what happens if a font you have not installed is requested, but you can also use it if the system is giving you a different font from what you expected (perhaps because fontconfig does not agree that the font supports your language).

**fc-match -a ‘Type’ less** : will provide a list of all fonts which can be used for that type (Monospace, Sans, Serif). Note that in-extremis fontconfig will take a glyph from any available font, even if it is not of the specified type, and unless it knows about the font’s type it will assume it is Sans.

If you wish to know which font will be used for a string of text (i.e. one or more glyphs, preceded by a space), paste the following command and replace the xyz by the text you care about:

**FC_DEBUG=4 pango-view –font=monospace -t xyz grep family** : this requires Pango-1.50.12 and ImageMagick-7.1.0-61 - it will invoke display to show the text in a tiny window, and after closing that the last line of the output will show which font was chosen. This is particularly useful for CJK languages, and you can also pass a language, e.g. PANGO_LANGUAGE=en;ja (English, then assume Japanese) or just zh-cn (or other variants - ‘zh’ on its own is not valid).

The various files

The main files are in /etc/fonts/conf.d/, which was intended to be a directory populated by symlinks to some of the files in /usr/share/fontconfig/conf.avail/. But many people, and some packages, create the files directly. Each file name must be in the form of two digits, a dash, somename.conf and they are read in sequence.

By convention, the numbers are assigned as follows:

You can also have a personal fonts.conf in $XDG_CONFIG_HOME which is ~/.config/fontconfig/.

The rules to choose a font

If the requested font is installed, and provided it contains the codepoints required for the current language (in the source, see the .orth files in the fc-lang/ directory), it will be used.

But if the document or page requested a font which is not installed (or, occasionally, does not contain all the required codepoints) the following rules come into play: First, 30-metric-aliases.conf is used to map aliases for some fonts with the same metrics (same size, etc). After that, an unknown font will be searched for in 45-latin.conf - if it is found it will be mapped as Serif or Monospace or Sans, otherwise it will be assumed to be Sans. Then 50-latin.conf provides ordered lists of the fallbacks - Dejavu fonts will be used if you installed them. Cyrillic and Greek appear to be treated in the same way. There are similar files with a 65- prefix for Persian and other non-latin writing systems. All of these files prefer commercial fonts if they are present, although modern libre fonts are often at least their equals.

Since fontconfig-2.12.5 there is also generic family matching for some emoji and math fonts, see {45,60}-generic.conf.

In the rare cases where a font does not contain all the expected codepoints, see ‘Trial the First:’ at I stared into the fontconfig for the long details.

Hinting and Anti-aliasing

It is possible to change how, or if, fonts are hinted. The following example file contains the default settings, but with comments. The settings are very much down to the user’s preferences and to the choice of fonts, so a change which improves some pages may worsen others. The preferred location for this file is: ~/.config/fontconfig/fonts.conf

To try out different settings, you may need to exit from Xorg and then rerun startx so that all applications use the new settings. And if you use Gnome or KDE their desktops can override these changes. To explore the possibilities, create a file for your user:

mkdir -pv ~/.config/fontconfig &&
cat > ~/.config/fontconfig/fonts.conf << "EOF"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

  <match target="font" >
    <!-- autohint was the old automatic hinter when hinting was patent
    protected, so turn it off to ensure any hinting information in the font
    itself is used, this is the default -->
    <edit mode="assign" name="autohint">  <bool>false</bool></edit>

    <!-- hinting is enabled by default -->
    <edit mode="assign" name="hinting">   <bool>true</bool></edit>

    <!-- for the lcdfilter see https://www.spasche.net/files/lcdfiltering/ -->
    <edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit>

    <!-- options for hintstyle:
    hintfull: is supposed to give a crisp font that aligns well to the
    character-cell grid but at the cost of its proper shape.

    hintmedium: poorly documented, maybe a synonym for hintfull.
    hintslight is the default: - supposed to be more fuzzy but retains shape.

    hintnone: seems to turn hinting off.
    The variations are marginal and results vary with different fonts -->
    <edit mode="assign" name="hintstyle"> <const>hintslight</const></edit>

    <!-- antialiasing is on by default and really helps for faint characters
    and also for 'xft:' fonts used in rxvt-unicode -->
    <edit mode="assign" name="antialias"> <bool>true</bool></edit>

    <!-- subpixels are usually rgb, see
    http://www.lagom.nl/lcd-test/subpixel.php -->
    <edit mode="assign" name="rgba">      <const>rgb</const></edit>

    <!-- thanks to the Arch wiki for the lcd and subpixel links -->
  </match>

</fontconfig>
EOF

You will now need to edit the file in your preferred editor.

For more examples see the blfs-support thread which started at 2016-09/00128, particularly 2016-09/00137, and the original poster’s preferred solution at 2016-09/00147. There are other examples in Fontconfig in the Arch wiki and Fontconfig in the Gentoo wiki.

Disabling Bitmap Fonts

In previous versions of BLFS, the ugly old Xorg bitmap fonts were installed. Now, many people will not need to install any of them. But if for some reason you have installed one or more bitmap fonts, you can prevent them being used by fontconfig by creating the following file as the root user :

cat > /etc/fonts/conf.d/70-no-bitmaps.conf << "EOF"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- Reject bitmap fonts -->
 <selectfont>
  <rejectfont>
   <pattern>
     <patelt name="scalable"><bool>false</bool></patelt>
   </pattern>
  </rejectfont>
 </selectfont>
</fontconfig>
EOF

Adding extra font directories

Normally, system fonts and user fonts are installed in directories beneath the locations specified in The Xft Font Protocol and there is no obvious reason to put them elsewhere. However, a full BLFS install of texlive-20220321 puts many fonts in /opt/texlive/2022/texmf-dist/fonts/ in the opentype/ and truetype/ subdirectories. Although pulling in all of these files may appear useful (it allows you to use them in non TeX programs), there are several problems with such an approach:

  1. There are hundreds of files, which makes selecting the font hard.

  2. Some of the files do odd things, such as displaying semaphore flags instead of ASCII letters, or mapping cyrillic codepoints to character forms appropriate to Old Church Slavonic instead of the expected current shapes: fine if that is what you need, but painful for normal use.

  3. Several fonts have multiple sizes and impenetrable short names, which both make selecting the correct font even harder.

  4. When a font is added to CTAN, it is accompanied by TeX packages to use it in the old engines (xelatex does not normally need this), and then the version is often frozen whilst the font is separately maintained. Some of these fonts such as Dejavu fonts are probably already installed on your BLFS system in a newer version, and if you have multiple versions of a font it is unclear which one will be used by fontconfig.

However, it is sometimes useful to look at these fonts in non-TeX applications, if only to see whether you wish to install a current version. If you have installed all of texlive, the following example will make one of the Arkandis Open Type fonts available to other applications, and all three of the ParaType TrueType fonts. Adjust or repeat the lines as desired, to either make all the opentype/ or truetypefonts available, or to select different font directories. As the root user:

cat > /etc/fonts/conf.d/09-texlive.conf << "EOF"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <dir>/opt/texlive/2022/texmf-dist/fonts/opentype/arkandis/berenisadf</dir>
  <dir>/opt/texlive/2022/texmf-dist/fonts/truetype/paratype</dir>
</fontconfig>
EOF

If you do this, remember to change all instances of the year in that file when you upgrade texlive to a later release.

Preferring certain fonts

There are many reasons why people may wish to have pages which specify a particular font use a different font, or prefer specific fonts in Monospace or Sans or Serif. As you will expect, there a number of different ways of achieving this.

Fontconfig user docs

Fontconfig installs user documentation that includes an example ‘User configuration file’ which among other things prefers WenQuanYi ZenHei (a Sans font) if a Serif font is requested for Chinese (this part might be anachronistic unless you have non-free Chinese fonts, because in 65-nonlatin.conf this font is already among the preferred fonts when Serif is specified for Chinese) and to prefer the modern VL Gothic font if a Sans font is specified on a Japanese page (otherwise a couple of other fonts would be preferred if they have been installed).

If you have installed the current version, the user documentation is available in html, PDF and text versions at /usr/share/doc/fontconfig-2.14.2/ : change the version if you installed a different one.

Prefer a specific font

As an example, if for some reason you wished to use the Nimbus Roman No9 L font wherever Times New Roman is referenced (it is metrically similar, and preferred for Times Roman, but the Serif font from Liberation fonts will be preferred for the Times New Roman font if installed), as an individual user you could install the font and then create the following file:

mkdir -pv ~/.config/fontconfig/conf.d &&
cat >  ~/.config/fontconfig/conf.d/35-prefer-nimbus-for-timesnew.conf << "EOF"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- prefer Nimbus Roman No9 L for Times New Roman as well as for Times,
 without this Tinos and Liberation Serif take precedence for Times New Roman
 before fontconfig falls back to whatever matches Times -->
    <alias binding="same">
        <family>Times New Roman</family>
        <accept>
            <family>Nimbus Roman No9 L</family>
        </accept>
    </alias>
</fontconfig>
EOF

This is something you would normally do in an individual user’s settings, but the file in this case has been prefixed ‘35-‘ so that it could, if desired, be used system-wide in /etc/fonts/conf.d/.

Prefer chosen CJK fonts

The following example of a local configuration (i.e. one that applies for all users of the machine) does several things:

  1. If a Serif font is specified, it will prefer the UMing variants, so that in the zh-cn, zh-hk and zh-tw languages things should look good (also zh-sg which actually uses the same settings as zh-cn) without affecting Japanese.

  2. It prefers the Japanese IPAex fonts if they have been installed although VL Gothic will take precedence for (Japanese) Sans if it has also been installed.

  3. Because WenQuanYi ZenHei covers Korean Hangul glyphs and is also preferred for Serif in 65-nonlatin.conf, if installed it will be used by default for Korean Serif. To get a proper Serif font, the UnBatang font is specified here - change that line if you installed a different Serif font from the choice of Korean fonts.

  4. The Monospace fonts are forced to the preferred Sans fonts. If the text is in Korean then WenQuanYi ZenHei will be used.

In a non-CJK locale, the result is that suitable fonts will be used for all variants of Chinese, Japanese and Hangul Korean. All other languages should already work if a font is present. As the root user:

cat > /etc/fonts/local.conf << "EOF"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <alias>
        <family>serif</family>
        <prefer>
            <family>AR PL UMing</family>
            <family>IPAexMincho</family>
            <!-- WenQuanYi is preferred as Serif in 65-nonlatin.conf,
            override that so a real Korean font can be used for Serif -->
            <family>UnBatang</family>
        </prefer>
    </alias>
    <alias>
         <family>sans-serif</family>
         <prefer>
             <family>WenQuanYi Zen Hei</family>
             <family>VL Gothic</family>
             <family>IPAexGothic</family>
         </prefer>
    </alias>
    <alias>
         <family>monospace</family>
         <prefer>
             <family>VL Gothic</family>
             <family>IPAexGothic</family>
             <family>WenQuanYi Zen Hei</family>
         </prefer>
    </alias>
</fontconfig>
EOF

Editing Old-style conf files

Some fonts, particularly Chinese fonts, ship with conf files which can be installed in /etc/fonts/conf.d. However, if you do that and then use a terminal to run any command which uses fontconfig you may see error messages such as :

Fontconfig warning: "/etc/fonts/conf.d/69-odofonts.conf", line 14: Having multiple <family> in <alias> isn't supported and may not work as expected.

In practice, these old rules do not work. For non-CJK users, fontconfig will usually do a good job without these rules. Their origin dates back to when CJK users needed handcrafted bitmaps to be legible at small sizes, and those looked ugly next to antialiased Latin glyphs - they preferred to use the same CJK font for the Latin glyphs. There is a side-effect of doing this : the (Serif) font is often also used for Sans, and in such a situation the (English) text in Gtk menus will use this font - compared to system fonts, as well as being serif it is both faint and rather small. That can make it uncomfortable to read.

Nevertheless, these old conf files can be fixed if you wish to use them. The following example is the first part of 64-arphic-uming.conf from UMing - there are a lot more similar items which also need changing :

   <match target="pattern">
       <test qual="any" name="lang" compare="contains">
           <string>zh-cn</string>
           <string>zh-sg</string>
       </test>
       <test qual="any" name="family">
           <string>serif</string>
       </test>
       <edit name="family" mode="prepend" binding="strong">
           <string>AR PL UMing CN</string>
       </edit>
    </match>
The process to correct this is straightforward but tedious - for every item which produces an error message, using your editor (as the root user) edit the installed file to repeat the whole block as many times as there are multiple variables, then reduce each example to have only one of them. You may wish to work on one error at a time, save the file after each fix, and from a separate term run a command such as **fc-list 2>&1 less** to see that the fix worked. For the block above, the fixed version will be :
   <match target="pattern">
       <test qual="any" name="lang" compare="contains">
           <string>zh-cn</string>
       </test>
       <test qual="any" name="family">
           <string>serif</string>
       </test>
       <edit name="family" mode="prepend" binding="strong">
           <string>AR PL UMing CN</string>
       </edit>
    </match>
   <match target="pattern">
       <test qual="any" name="lang" compare="contains">
           <string>zh-sg</string>
       </test>
       <test qual="any" name="family">
           <string>serif</string>
       </test>
       <edit name="family" mode="prepend" binding="strong">
           <string>AR PL UMing CN</string>
       </edit>
    </match>

See Also

I stared into the fontconfig …

The blog entries by Eevee are particularly useful if fontconfig does not think your chosen font supports your language, and for preferring some non-MS Japanese fonts when an ugly MS font is already installed.

Fontconfig in the Arch wiki

Arch has a lot of information in its wiki at font_configuration.

Fontconfig in the Gentoo wiki

Gentoo has some information in its wiki at Fontconfig although a lot of the details (what to enable, and Infinality) are specific to Gentoo.

24.31 TTF and OTF fonts


About TTF and OTF fonts

Originally, Xorg provided only bitmap fonts. Later, some scalable Type1 fonts were added, but the desktop world moved on to using TrueType and Open Type fonts. To support these, Xorg uses Xft, the X FreeType interface library.

These fonts can provide hints, which fontconfig uses to adjust them for maximum readability on computer monitors. On linux you should always prefer the hinted versions, if available (in general the latin, cyrillic and greek alphabets can use hints, most other writing systems do not use hinting).

A few fonts are provided as collections (TTC or OTC) where font data is shared between different fonts, thus saving disk space. Treat these in exactly the same way as individual TTF or OTF files.

If a font provides both TTF and OTF forms, prefer the OTF form in linux, it may provide more features for programs which know how to use them (such as xelatex).

For some scripts pango is required to render things correctly, either by selecting different glyph forms, or by combining glyphs - in both cases, according to the context. This applies particularly to arabic and indic scripts.

Standard scalable fonts that come with X provide very poor Unicode coverage. You may notice in applications that use Xft that some characters appear as a box with four binary digits inside. In this case, a font with the required glyphs has not been found. Other times, applications that don’t use other font families by default and don’t accept substitutions from Fontconfig will display blank lines when the default font doesn’t cover the orthography of the user’s language.

The fonts available to a program are those which were present when it was started, so if you add an extra font and wish to use it in a program which is currently running, then you will have to close and restart that program.

Some people are happy to have dozens, or even hundreds, of font files available, but if you ever wish to select a specific font in a desktop application (for example in a word processor) then scrolling through a lot of fonts to find the right one is slow and awkward - fewer is better. So, for some font packages you might decide to install only one of the fonts - but nevertheless install the different variants (italic, bold, etc) as these are all variations for the same font name.

In the past, everybody recommended running fc-cache as the root user after installing or removing fonts, but this is no-longer necessary on linux, fontconfig will do it automatically if needed and if its caches are more than 30 seconds old. But if you add a font and want to immediately use it then you can run that command (as a normal user).

There are several references below to CJK characters. This stands for Chinese, Japanese and Korean, although modern Korean is now almost all written using the phonetic Hangul glyphs (it used to sometimes use Hanja glyphs which are similar to Chinese and Japanese). Unicode decided to go for Han Unification and to map some Chinese and Japanese glyphs to the same codepoints. This was very unpopular in Japan, and the result is that different fonts will render some codepoints in quite different shapes. In addition, Simplified Chinese will sometimes use the same codepoint as Traditional Chinese but will show it differently, somewhat analogous to the different shapes used for the letters ‘a’ and ‘g’ in English (single-storey and two-storey), except that in a language context one will look “wrong” rather than just “different”.

Unlike most other packages in this book, the BLFS editors do not monitor the versions of the fonts on this page - once a font is good enough for general use, the typical additions in a new version are minor (e.g. new currency symbols, or glyphs not for a modern language, such as emojis or playing cards). Therefore, none of these fonts show version or md5 information.

The list below will not provide complete Unicode coverage. Unicode is updated every year, and most additions are now for historic writing systems. For almost-complete coverage you can install Noto fonts (about 180 fonts when last checked) but that number of fonts makes it much less convenient to select a specific font in a document, and most people will regard many of them as a waste of space. We used to recommend the Unicode Font Guide, but that has not been updated since 2008 and many of its links are dead.

Rendered examples of most of these fonts, and many others, with details of what languages they cover, some examples of latin fonts with the same metrics (listed as “Substitute latin fonts”) and various files of dummy text to compare fonts of similar types, can be found at this font comparison page. That site also covers other current writing systems.

Fonts are often supplied in zip files, requiring UnZip-6.0 to list and extract them, but even if the current release is a tarball you should still check to see if it will create a directory scattering the contents of a zipfile or tarball across the current directory can be very messy, and a few fonts create odd __MACOSX/ directories. In addition, many fonts are supplied with permissions which do not let ‘other’ read them - if a font is to be installed for system-wide use, any directories must be mode 755 and all the files mode 644, so change them if necessary. If you forget, the root user may be able to see a particular font in fc-list but a normal user will not.

As a font installation example, consider the installation of the Dejavu fonts. In this particular package, the TTF files are in a subdirectory. From the unpacked source directory, run the following commands as the root user:

install -v -d -m755 /usr/share/fonts/dejavu &&
install -v -m644 ttf/*.ttf /usr/share/fonts/dejavu &&
fc-cache -v /usr/share/fonts/dejavu

If you wish, you can also install any licenses or other documentation, either alongside the font or in a corresponding directory under /usr/share/doc/.

A few fonts ship with source as well as with the completed TTF or OTF file(s). Unless you intend to modify the font, and have the correct tools (sometimes FontForge-20230101, but often commercial tools), the source will provide no benefit, so do not install it. One or two fonts even ship with Web Open Font Format (WOFF) files - useful if you run a webserver and want to use that font on it, but not useful for desktops.

To provide greater Unicode coverage, you are recommended to install some of the following fonts, depending on what websites and languages you wish to read. The next part of this page details some fonts which cover at least latin alphabets, the final part deals with come CJK issues.

Note

You are strongly recommended to install the Dejavu fonts.

Caladea

Caladea (created as a Chrome OS extra font) is metrically compatible with MS Cambria and can be used if you have to edit a document which somebody started in Microsoft Office using Cambria and then return it to them.

Cantarell fonts

Cantarell fonts – The Cantarell typeface family provides a contemporary Humanist sans serif. It is particularly optimised for legibility at small sizes and is the preferred font family for the GNOME-3 user interface.

Please be aware that the current version includes a VF (Variable Font) file can provide all the individual fonts (also supplied) but breaks xelatex if it is found by fontconfig. The individual fonts work fine.

Carlito

Carlito (created as another Chrome OS extra font) is metrically compatible with MS Calibri and can be used if you have to edit a document which somebody started in Microsoft Office using Calibri and then return it to them.

DejaVu fonts

DejaVu fonts – These fonts are an extension of, and replacement for, the Bitstream Vera fonts and provide Latin-based scripts with accents and punctuation such as “smart-quotes” and variant spacing characters, as well as Cyrillic, Greek, Arabic, Hebrew, Armenian, Georgian and some other glyphs. In the absence of the Bitstream Vera fonts (which had much less coverage), these are the default fallback fonts.

GNU FreeFont

GNU FreeFont – This set of fonts covers many non-CJK characters, in particular some of the variants of latin and cyrillic letters used in minority languages, but the glyphs are comparatively small (unlike DejaVu fonts which are comparatively large) and rather light weight (“less black” when black on white is used) which means that in some contexts such as terminals they are not visually pleasing, for example when most other glyphs are provided by another font. On the other hand, some fonts used primarily for printed output, and many CJK fonts, are also light weight.

Gelasio

Gelasio is metrically compatible with MS Georgia and fontconfig will use it if ever Georgia is requested but not installed.

Liberation fonts

The Liberation fonts provide libre substitutes for Arial, Courier New, and Times New Roman. Fontconfig will use them as substitutes for those fonts, and also for the similar Helvetica, Courier, Times Roman although for these latter it can prefer a different font (see the examples in the ‘Substitutes’ PDFs at zarniwhoop.uk).)

Many people will find the Liberation fonts useful for pages where one of those fonts is requested.

Microsoft Core Fonts

The Microsoft Core fonts date from 2002. They were supplied with old versions of Microsoft Windows and were apparently made available for general use. You can extract them from the ‘exe’ files using bsd-tar from libarchive-3.6.2. Be sure to read the license before using them. At one time some of these fonts (particularly Arial, Times New Roman, and to a lesser extent Courier New) were widely specified on web pages. The full set contains Andale Mono, Arial, Arial Black, Comic Sans MS, Courier New, Georgia, Impact, Times New Roman, Trebuchet MS, Verdana and Webdings.

Please note that if you only want to use a font with the same metrics (character size, etc) as Arial, Courier New, or Times New Roman you can use the libre Liberation Fonts (above), and similarly you can replace Georgia with Gelasio.

Although many old posts recommend installing these fonts for better-looking output, there are more recent posts that these are ugly or ‘broken’. One suggestion is that they do not support anti-aliasing.

The newer fonts which Microsoft made their defaults in later releases of MS Windows or MS Office (Calibri and Cambria) have never been freely available. But if you do not have them installed you can find metric equivalents (Carlito, Caladea) above.

Noto fonts

The Noto fonts (‘No Tofu’, i.e. avoiding boxes with dots [hex digits] when a glyph cannot be found) is a set of fonts which aim to cover every glyph in unicode, no matter how obscure. These fonts, or at least the Sans Serif fonts, are used by KF5 (initially only for gtk applications). If you want to cover historic languages, you can download all the fonts by clicking on the link at the top of that page.

People using languages written in Latin, Greek or Cyrillic alphabets need only install Noto Sans itself, and perhaps Noto Sans Symbols for currency symbols. For more details on the CJK fonts see Noto Sans CJK below. There are also separate fonts for every other current writing system, but these too will also require Noto Sans (or Noto Serif) and perhaps Noto Symbols.

However, you should be aware that fontconfig knows nothing about Noto fonts. The ‘Noto Sans Something’ fonts are each treated as separate fonts (and for Arabic there is not a specifically Sans name), so if you have other fonts installed then the choice of which font to use for missing glyphs where ‘Noto Sans’ is specified will be random, except that Sans fonts will be preferred over known Serif and Monospace fonts because Sans is the fallback for unknown fonts.

Oxygen fonts

When KDE Frameworks 5 was first released, it used the Oxygen fonts which were designed for integrated use with the KDE desktop. Those fonts are no-longer actively maintained, so KDE made a decision to switch to Noto fonts, but for the moment they are still required by ‘startkde’.

Originally these fonts were only supplied as source, needing CMake-3.25.2 and FontForge-20230101 to create the TTF files. But for a while the source has also included the prepared TTF. The only unusual feature is that each TTF file is in its own subdirectory (oxygen-fonts/{*-?00}/) with the source in further subdirectories. You could just install the whole tarball if you prefer, although that will waste space.

Source Code Pro

This set of fonts from Adobe (seven different weights) includes what is now the preferred monospace font for those applications which use gsettings-desktop-schemas-43.0. The github release source-code-pro contains OTF (preferred) and TTF as well as the source and WOFF fonts.

To use this in terminals, you probably only want the Regular font.

There is also an older TTF version of this available from Google fonts but that has very limited coverage (adequate for most European languages using a latin alphabet).

CJK fonts:

As indicated earlier, usage of a combination of Chinese, Japanese and Korean can be tricky - each font only covers a subset of the available codepoints, the preferred shapes of the glyphs can differ between the languages, and many of the CJK fonts do not actually support modern Korean.

Also, by default fontconfig prefers Chinese to Japanese. Tuning that is covered at Prefer chosen CJK fonts.

Although Unicode has been extended to allow a very large number of CJK codepoints, those outside the Base Plane (greater than U+0xFFFF) are not commonly used in Mandarin (the normal form of written Chinese, whether Simplified (PRC) or Traditional (Taiwan)), or Japanese.

For Hong Kong, which uses Traditional Chinese and where Cantonese is the dominant language, the Hong Kong Supplementary Character Set was added to Unicode in 2005 and revised in 2009 (it is part of CJK Extension B and contains more than 1900 characters). Earlier fonts will not be able to support either Cantonese or use of these characters where local names are written in Mandarin. The UMing HK, Noto Sans CJK HK and WenQuanYi Zen Hei fonts all seem to cover Hong Kong usage (fontconfig disagrees about Noto Sans CJK HK).

The Han glyphs are double-width, other glyphs in the same font may be narrower. For their CJK content, all of these fonts can be regarded as monospaced (i.e. fixed width).

If all you wish to do is to be able to render CJK glyphs, installing WenQuanYi ZenHei may be a good place to start if you do not already have a preference.

Chinese fonts:

In Chinese, there are three font styles in common use: Sung (also known as Song or Ming) which is the most-common ornamented (“serif”) form, Kai (“brush strokes”) which is an earlier ornamented style that looks quite different, and modern Hei (“sans”). Unless you appreciate the differences, you probably do not want to install Kai fonts.

Noto Sans CJK

Noto Sans CJK – Sans-Serif sets of all CJK fonts in a ttc – as the link says, you can choose to install the TTC and cover all the languages in all weights in a 110MB file, or you can download subsets. There are also Monospace versions.

Opendesktop fonts

A copy of version 1.4.2 of the opendesktop-fonts is preserved at Arch. This was a later development of fireflysung which BLFS used to recommend, adding Kai and Mono fonts. The name of the Sung font remains ‘AR PL New Sung’ so they cannot both be installed together.

At one time there was a 1.6 release, and more recently some versions at github, which also included a Sans font (Odohei), but those have dropped off the web and it is unclear if there was a problem. Fontconfig does not know anything about the later fonts (AR PL New Kai, AR PL New Sung Mono) and will default to treating them as Sans.

UMing

UMing fonts – sets of Chinese Ming fonts (from Debian, use the ‘.orig’ tarball) in a ttc which contain variations of Simplified and Traditional Chinese (Taiwanese, with second variant for different bopomofo, and Cantonese for Hong Kong). This ships with old-syntax files which you can install to /etc/fonts/conf.d/ but see Editing Old-Style conf files.

WenQuanYi Zen Hei

WenQuanYi Zen Hei provides a Sans-Serif font which covers all CJK scripts including Korean. Although it includes old-style conf files, these are not required: fontconfig will already treat these fonts (the ‘sharp’ contains bitmaps, the monospace appears not to be Mono in its ASCII part) as Sans, Serif, and Monospace. If all you wish to do is to be able to render Han and Korean text without worrying about the niceties of the shapes used, the main font from this package is a good font to use.

Japanese fonts:

In Japanese, Gothic fonts are Sans, Mincho are Serif. BLFS used to only mention the Kochi fonts, but those appear to now be the least-preferred of the Japanese fonts.

Apart from the fonts detailed below, also consider Noto Sans CJK.

IPAex fonts

The IPAex fonts are the current version of the IPA fonts. Use Google Translate on the home page, then click on the download link for IPAex Font Ver.004.01. Unfortunately, fontconfig only knows about the older IPAfonts and the forked IPA Mona font (which is not easily available and which apparently does not meet Debian’s Free Software guidelines). Therefore if you install the IPAex fonts you may wish to make it known to fontconfig, see Prefer chosen CJK fonts for one possible way to do this.

Kochi fonts

The Kochi Substitute fonts were the first truly libre Japanese fonts (the earlier Kochi fonts were allegedly plagiarized from a commercial font).

VL Gothic

The VL Gothic font is a modern Japanese font in two variants with monotonic or proportional spacing for the non-Japanese characters.

Korean fonts:

In Korean, Batang or Myeongjo (the older name) are Serif, Dotum or Gothic are the main Sans fonts. BLFS previously recommended the Baekmuk fonts, but the Nanum and Un fonts are now preferred to Baekmuk by fontconfig because of user requests.

A convenient place to see examples of these and many other Korean fonts is Free Korean Fonts. Click on ‘Gothic Fonts’ or ‘All Categories -> Myeongjo Fonts’, then click on the font example to see more details including the License, and click on the link to download it. For Nanum, you will need to be able to read Korean to find the download link on the page you get to. For Un there are direct links and you can find the un-fonts-core tarball in the releases/ directory.

Alternatively, consider Noto Sans CJK (all of the variants cover Hangul) or WenQuanYi ZenHei.

24.32 Xorg Legacy


Introduction to Xorg Legacy

Xorg’s ancestor (X11R1, in 1987) at first only provided bitmap fonts, with a tool (bdftopcf) to assist in their installation. With the introduction of xorg-server-1.19.0 and libXfont2 many people will not need them. There are still a few old packages which might require, or benefit from, these deprecated fonts and so the following packages are shown here.

Note

The font-adobe-100dpi package installs 100 dots per inch versions of Courier, Helvetica, New Century Schoolbook and Times fonts.

The remaining font packages here provide 75dpi versions of those fonts, and various miscellaneous fonts - mostly for legacy encodings. Those are primarily to silence warnings when testing Xorg. In previous versions of BLFS a lot more legacy fonts were installed.

Please consult the BLFS-7.10 systemd book at https://www.linuxfromscratch.org/blfs/view/7.10-systemd/x/x7font.html if you wish to install any of those other fonts.

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

Package Information

Xorg Legacy Dependencies

Required

Xorg Fonts

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

Downloading Xorg Legacy

First, create a list of files to be downloaded. This file will also be used to verify the integrity of the downloads when complete:

cat > legacy.dat << "EOF"
2a455d3c02390597feb9cefb3fe97a45 app/ bdftopcf-1.1.tar.bz2
1347c3031b74c9e91dc4dfa53b12f143 font/ font-adobe-100dpi-1.0.3.tar.bz2
6c9f26c92393c0756f3e8d614713495b font/ font-adobe-75dpi-1.0.3.tar.bz2
cb7b57d7800fd9e28ec35d85761ed278 font/ font-jis-misc-1.0.3.tar.bz2
0571bf77f8fab465a5454569d9989506 font/ font-daewoo-misc-1.0.3.tar.bz2
a2401caccbdcf5698e001784dbd43f1a font/ font-isas-misc-1.0.3.tar.bz2
c88eb44b3b903d79fb44b860a213e623 font/ font-misc-misc-1.1.2.tar.bz2
EOF

To download the needed files using wget, use the following commands:

mkdir legacy &&
cd    legacy &&
grep -v '^#' ../legacy.dat | awk '{print $2$3}' | wget -i- -c \
     -B https://www.x.org/pub/individual/ &&
grep -v '^#' ../legacy.dat | awk '{print $1 " " $3}' > ../legacy.md5 &&
md5sum -c ../legacy.md5

Installation of Xorg Legacy

Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the Sudo-1.9.13p1 package.

  3. Use su -c “command arguments” (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

as_root()
{
  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"
  fi
}

export -f as_root

First, start a subshell that will exit on error:

bash -e

Install all of the packages by running the following commands:

for package in $(grep -v '^#' ../legacy.md5 | awk '{print $2}')
do
  packagedir=${package%.tar.bz2}
  tar -xf $package
  pushd $packagedir
    ./configure $XORG_CONFIG
    make
    as_root make install
  popd
  rm -rf $packagedir
  as_root /sbin/ldconfig
done

Finally, exit the shell that was started earlier:

exit

Contents

Installed Programs: bdftopcf

Installed Libraries: None

Installed Directories: $XORG_PREFIX/share/fonts/100dpi, $XORG_PREFIX/share/fonts/75dpi, $XORG_PREFIX/share/fonts/misc

Short Descriptions

bdftopcf converts an X font from Bitmap Distribution Format to Portable Compiled Format.