Skip to content

v25.11 fails to run standalone on FreeBSD #3013

@jbeich

Description

@jbeich

Regressed by #2627. Affects DRM (niri on VT console) but not Wayland backend (niri on sway).

$ rm -rf ~/.config/niri
$ niri
 INFO niri: starting version 25.11 (v25.11-5-g83a733e0)
DEBUG niri_config: loaded config from "/home/foo/.config/niri/config.kdl"
 INFO niri::backend::tty: using as the render node: "/dev/dri/card0"
DEBUG niri::backend::tty: adding device: 156 "/dev/dri/card0"
DEBUG niri::backend::tty: this is the primary node
DEBUG niri::backend::tty: not a primary node, skipping
 INFO niri: listening on Wayland socket: wayland-2
 INFO niri: IPC listening on: /var/run/user/1234/niri.wayland-2.81008.sock
 WARN niri::utils::xwayland::satellite: error spawning xwayland-satellite at "xwayland-satellite", disabling integration: No such file or directory (os error 2)
 WARN niri::utils::spawning: error spawning "waybar": Os { code: 2, kind: NotFound, message: "No such file or directory" }

# FreeBSD devfs(4) is dynamic, so major/minor numbers are random
$ ls -lL /dev/dri/
total 0
crw-rw----  1 root video  0x9c  6 Nov 20:28 card0
crw-rw----  1 root video 0x130  6 Nov 20:28 renderD128
# from <sys/types.h> aka https://github.com/freebsd/freebsd-src/blob/releng/15.0/sys/sys/types.h
$ major() { _d=$1; echo $(( (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff)) )); }
$ minor() { _d=$1; echo $(( (((_d >> 24) & 0xff00) | (_d & 0xffff00ff)) )); }
$ major 0x9c
0
$ minor 0x9c
156
$ major 0x130
1
$ minor 0x130
48

# libdrm doesn't use major/minor numbers on FreeBSD
$ ./test
primary = /dev/dri/card0
render = /dev/dri/renderD128

$ cat test.c
#include <fcntl.h>
#include <stdio.h>
#include <xf86drm.h>

int main() {
  int fd = open("/dev/dri/card0", O_RDONLY, NULL);
  if (fd < 0) return 1;

  printf("primary = %s\n", drmGetPrimaryDeviceNameFromFd(fd));
  printf("render = %s\n", drmGetRenderDeviceNameFromFd(fd));
  return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions