Source: debian-installer
Followup-For: Bug #1075713
X-Debbugs-Cc: tj.iam...@proton.me

Creating a modified non-ISO bootable image that can be interactively
debugged proved a trial and a half, but after creating a custom initrd
and modifying several of the d-i scripts that mess with console I've
finally got there!

I added a few TRACE/DEBUG messages into xorg's fbdev_drv FBDevProbe() to
learn the control flow.

https://sources.debian.org/src/xserver-xorg-video-fbdev/1%3A0.5.0-2/src/fbdev.c/#L312

Omitting the superfluous Xorg log entries this reveals:

$ grep fbdev mnt/img/var/log/Xorg.0.log
[    50.418] (==) Matched fbdev as autoconfigured driver 2
[    50.418] (II) LoadModule: "fbdev"
[    50.418] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    50.418] (II) Module fbdev: vendor="X.Org Foundation"
[    50.418] (II) FBDEV: driver for framebuffer: fbdev
[    50.445] fbdev trace: FBDevPciProbe()
[    50.445] (II) Loading sub module "fbdevhw"
[    50.445] (II) LoadModule: "fbdevhw"
[    50.445] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    50.445] (II) Module fbdevhw: vendor="X.Org Foundation"
[    50.445] fbdev trace: FBDevPciProbe() return
[    50.445] (WW) Falling back to old probe method for fbdev
[    50.445] fbdev trace: FBDevProbe()
[    50.445] (II) Loading sub module "fbdevhw"
[    50.445] (II) LoadModule: "fbdevhw"
[    50.445] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    50.445] (II) Module fbdevhw: vendor="X.Org Foundation"
[    50.445] fbdev: FBDevProbe() for() numDevSection=0
[    50.445] fbdev: FBDevProbe() isPci0 isISA=0
[    50.445] fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '(null)', NULL)
[    50.445] fbdev trace: FBDevProbe() return
[    50.445] (II) UnloadModule: "fbdev"
[    50.445] (II) UnloadSubModule: "fbdevhw"

The crux here is 

  fbdevHWProbe(NULL, '(null)', NULL)

that is for the code:

  if (fbdevHWProbe(NULL,dev,NULL)) {

The 2nd argument should be the framebuffer name but it is only set
earlier if there is a manual xorg.conf Device section for this driver
with "fbdev" set:

  dev = xf86FindOptionValue(devSections[i]->options,"fbdev");

So without a real name the call fails since there is no device to open:

fbdevHWProbe(struct pci_device *pPci, char *device, char **namep)
{
  int fd;

  if (pPci)
    fd = fbdev_open_pci(pPci, namep);
  else
    fd = fbdev_open(-1, device, namep);

  if (-1 == fd)
    return FALSE;
  close(fd);
  return TRUE;
}

But adding a manual config:

~ # cat /usr/share/X11/xorg.conf.d/05-fbdev.conf
Section "Device"
Identifier "fbElusive"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
EndSection

Still fails:

[   207.890] fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '/dev/fb0', NULL)
[   207.890] fbdev trace: FBDevProbe() return

If it succeeded the first statement in the if() clause would report:

  TRACE("FBDevProbe() fbdevHWProbe()");

Since this code hasn't changed in a while I'm currently struggling to
figure out how this ever worked!

I'm now going to create another custom initrd for the v6.8.12 kernel
and add it to this image to see if that will make a difference although
I cannot see how, unless it affects the PCI detection logic in some way.

If that doesn't work I cannot see how the fbdev fallback path can work as in
the v6.8.12 ISO although there it obviously does.

Reply via email to