Home / Alt manpages / proc_fb(5)

  • proc_fb(5)
  • File format
  • linux

Inspect Linux Framebuffer Devices Through /proc/fb

You will finish with a read-only check that tells you whether this kernel exposes /proc/fb, records any framebuffer entries it reports, and handles an empty result without treating it as a fault. This guide follows proc_fb(5) from Linux man-pages 6.7, installed here with package version 6.7-2.

Allow about ten minutes. You need a shell and a running Linux system with /proc mounted. The commands only read kernel status. They do not load a graphics driver, create /dev/fb0, change the console, or restart a service.

1. Check whether the interface is present

Start with a file test. This distinguishes a missing procfs entry from an entry that exists but happens to contain no lines:

if test -r /proc/fb; then
    printf '%s\n' '/proc/fb is readable'
else
    status=$?
    printf 'Cannot read /proc/fb (test status %s)\n' "$status" >&2
    exit 1
fi

The manpage defines /proc/fb as framebuffer information when the kernel was compiled with CONFIG_FB. That compile-time condition is the key boundary: installing a user-space utility cannot add this procfs interface to a kernel built without the option. A failed readability test can also mean that procfs is not mounted or that access is restricted.

Checkpoint: run the test and confirm that it prints either /proc/fb is readable or the diagnostic. Do not use ls /dev/fb* as a substitute. Device nodes and the procfs report are related, but they answer different questions.

2. Read the report without changing state

Once the file test succeeds, print it directly:

$ cat /proc/fb

On a machine with registered framebuffer information, expect one or more text lines describing the entries. On this host the command produces no output, which is a valid observation: the file is available, but it currently reports no framebuffer information. An empty result is not proof that the monitor is disconnected, that the graphics stack is broken, or that a DRM device is absent.

Save a diagnostic snapshot when investigating a machine remotely. The redirection creates or replaces only the named report file, so choose a path you own:

report="${TMPDIR:-/tmp}/proc-fb.$$.txt"
cat /proc/fb > "$report"
printf 'Saved %s\n' "$report"
sed -n '1,20p' "$report"

This command needs no elevated privilege in the normal case. The shell expands $$ to the current process ID, reducing collisions for short-lived reports. The file contains kernel-reported information, not a configuration that can be edited and reloaded.

3. Turn the result into a useful script check

For automation, test the interface first and then test whether it has any content. The second condition is deliberately separate:

if test ! -r /proc/fb; then
    printf '%s\n' 'framebuffer procfs interface unavailable' >&2
    exit 2
fi

if test -s /proc/fb; then
    printf '%s\n' 'framebuffer information is present'
    cat /proc/fb
else
    printf '%s\n' 'no framebuffer information reported'
fi

test -s checks for a non-zero file size. It does not interpret driver names, count devices, or promise that a framebuffer is usable for a particular application. That modest claim is easier to keep correct across kernels and hardware.

Checkpoint: check the exit status immediately after running your script:

$ printf '%s\n' "$?"
0

The example exits with status 2 only when the interface is unavailable. An available but empty report is treated as an ordinary result and exits successfully. If your caller needs to distinguish that case too, add exit 1 inside the else branch, but document that your policy is stricter than the procfs interface itself.

4. Investigate missing or surprising output

First confirm that you are examining the host you think you are examining:

$ uname -r
$ findmnt -T /proc/fb
$ stat /proc/fb

findmnt and stat are read-only diagnostics. If findmnt cannot show a proc filesystem, inspect how this environment is assembled before drawing conclusions. Containers, rescue systems and restricted sandboxes can expose a different view of procfs from the host kernel.

If the entry is absent, check the running kernel's configuration when it is available:

config="/boot/config-$(uname -r)"
if test -r "$config"; then
    grep '^CONFIG_FB=' "$config" || printf '%s\n' 'CONFIG_FB is not set in this config'
else
    printf 'Kernel config is not readable at %s\n' "$config" >&2
fi

A missing configuration file is not evidence that CONFIG_FB is disabled. Some distributions keep configuration elsewhere, compress it, or omit it. Avoid changing boot parameters or installing a random framebuffer module merely because this one file is empty.

5. Keep the boundary clear

/proc/fb is an information interface, not a control panel. Reading it cannot select a resolution, enable a console, bind a driver, or repair a display. It also does not replace checks for DRM, a desktop session, a display server, or a particular application. Use the narrow result for the narrow question: what framebuffer information does this running kernel expose through procfs?

There is no undo step because every command in this guide is read-only. If you saved a snapshot under /tmp, remove that one file after collecting the required evidence:

rm -- "$report"

Only run that cleanup after confirming that $report still names the intended report. Do not substitute a broad wildcard or an unreviewed variable.

Done means

  • You tested readability of /proc/fb before interpreting its contents.
  • You recorded whether the report was populated or empty.
  • Your script distinguishes an unavailable interface from an available empty report.
  • You checked procfs and kernel context before blaming a graphics driver.
  • You made no service, boot, device-node or kernel configuration changes.