Xorg-Server-21.1.24

#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-1374

### Chapter 24. Graphical Environments

- Prev

  Xwayland-24.1.13

- Next

  Xorg Input Drivers

- Up
- Home

# Xorg-Server-21.1.24

## Introduction to Xorg Server

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

### Note

This version of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable version of the System V books.

### Package Information

- Download (HTTP): https://www.x.org/pub/individual/xserver/xorg-server-21.1.24.tar.xz

- Download MD5 sum: 19c2d104a6c9ba85b4896ef75b2d1084

- Download size: 4.9 MB

- Estimated disk space required: 199 MB (with tests)

- Estimated build time: 0.3 SBU (using parallelism=4; with tests)

### Additional Downloads

- With the removal of the xf86-video-* drivers, the TearFree option is no longer functional. To work around this, upstream has added the TearFree option to the default modesetting driver. This patch backports this feature. Apply this patch if you are going to use Xorg in an environment without a compositor (such as TWM, IceWM, Openbox, or Fluxbox).

  Optional patch: https://www.linuxfromscratch.org/patches/blfs/svn/xorg-server-21.1.24-tearfree_backport-1.patch

### Xorg Server Dependencies

#### Required

libxcvt-0.1.3, Pixman-0.46.4, Xorg Fonts (only font-util), and at runtime: xkeyboard-config-2.48

#### Recommended

dbus-1.16.2, elogind-257.16 (runtime; `libelogind` also referred at build time but it's not really useful), libepoxy-1.5.10 (needed for glamor), libtirpc-1.3.7, and xorg-libinput-1.5.0 (runtime)

### Note

Although it's possible to build this package without dbus-1.16.2 installed or run the Xorg server without elogind-257.16 functioning, it would require running the Xorg server as the `root` user or Xorg server will malfunction or even fail to start. The BLFS editors strongly discourage skipping these two dependencies. Do not attempt to do so unless you really know what you are doing.

#### Optional

acpid-2.0.34 (runtime), Doxygen-1.18.0 (to build API documentation), fop-2.11 (to build documentation), libunwind-1.8.3, Nettle-4.0, libgcrypt-1.12.2, XCB Utilities (to build Xephyr), xmlto-0.0.29 (to build documentation), xkeyboard-config-2.48 (for tests), rendercheck (for tests), and xorg-sgml-doctools (to build documentation)

## Kernel Configuration

The traditional Device Dependent X (DDX) drivers have been removed from BLFS in favor of the `modesetting_drv` driver which will be built as a part of this package. To use the `modesetting_drv` driver, the kernel must provide a Direct Rendering Manager (DRM) driver for your GPU.

If your GPU supports 3D acceleration and Mesa-26.1.7 provides a Gallium3D driver for utilizing its 3D capability, you should have already enabled the necessary kernel configuration options in Mesa Kernel Configuration. Otherwise, you need to find the kernel configuration option of the DRM driver for the GPU and enable it. Notably, the virtual GPUs provided by some virtual machine managers:

    Device Drivers --->
      Graphics support --->
        <*/M>   Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
                                                                          ...  [DRM]
        < /*/M> DRM driver for VMware Virtual GPU                       [DRM_VMWGFX]
        < /*/M> DRM Support for bochs dispi vga interface (qemu stdvga)  [DRM_BOCHS]
        < /*/M> Virtual Box Graphics Card                            [DRM_VBOXVIDEO]

If the kernel does not provide a DRM driver for your GPU, on most x86 systems the “simple frame buffer” DRM driver running on VESA or UEFI frame buffer can be used as a fallback. Enable the following options in the kernel configurations if you don't have a dedicated DRM driver for the GPU, or you want to keep the simple frame buffer driver as a fallback in case the dedicated driver fails:

    Device Drivers --->
      Firmware Drivers --->
        [*] Mark VGA/VBE/EFI FB as generic system framebuffer       [SYSFB_SIMPLEFB]
      Graphics support --->
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
                                                                          ...  [DRM]
        Drivers for system framebuffers --->
          <*> Simple framebuffer driver                              [DRM_SIMPLEDRM]

To allow the kernel to print debug messages at an early boot stage, `CONFIG_DRM` and `CONFIG_DRM_SIMPLEDRM` should not be built as kernel modules unless an initramfs will be used.

If you want to use the simple frame buffer driver on a system booted via BIOS (instead of UEFI), add the following line before the first `menuentry` block in the `/boot/grub/grub.cfg` file to initialize the VESA frame buffer:

    set gfxpayload=1024x768x32

You may replace `1024`, `768`, and `32` with a resolution and color depth setting suitable for your monitor.

If all of these DRM drivers do not work for you and you need to use a DDX driver with a non-DRM kernel GPU driver (usually named `CONFIG_FB_*` in the kernel configuration, or existing as out-tree kernel modules), or you need an device specific functionality requiring a DDX driver, consult a prior version of BLFS, or an even earlier prior version for more DDX drivers.

## Installation of Xorg Server

First, if you need the TearFree option to work around screen tearing, apply the backported patch:

    patch -Np1 -i ../xorg-server-21.1.24-tearfree_backport-1.patch

Install the server by running the following commands:

    mkdir build &&
    cd    build &&

    meson setup ..               \
          --prefix=$XORG_PREFIX  \
          --localstatedir=/var   \
          -D glamor=true         \
          -D systemd_logind=true \
          -D xkb_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 &&
    install -v -d -m1777 /tmp/.{ICE,X11}-unix &&
    cat >> /etc/sysconfig/createfiles << "EOF"
    /tmp/.ICE-unix dir 1777 root root
    /tmp/.X11-unix dir 1777 root root
    EOF

## Command Explanations

`-D glamor=true`: Ensure building the Glamor module. It's needed to build the `modesetting_drv` driver which replaces the traditional Device Dependent X (DDX) drivers.

`-D secure-rpc=false`: This option disables building RPC support if libtirpc-1.3.7 is not installed.

`-D systemd_logind=true`: This switch makes the building system error out if dbus-1.16.2 is not installed. The BLFS editors discourage building this package without dbus-1.16.2 installed.

`-D suid_wrapper=true`: Builds the suid-root wrapper for legacy DDX driver support on rootless xserver systems.

cat >> /etc/sysconfig/createfiles...: This command creates the `/tmp/.ICE-unix` and `/tmp/.X11-unix` directories at startup, and ensures that the permissions and ownership are correct as required by the server.

`-D xephyr=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` 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

- Prev

  Xwayland-24.1.13

- Next

  Xorg Input Drivers

- Up
- Home