5

I would like to know the exact process used by Ubuntu (if possible with location of configuration file) in order to start X (with lightdm).

I did not find any precise, detailed and comprehensive documentation of this process.

Some of the questions I would like to be detailed are :

  • What scripts and configuration files are used (I mean where are they)?
  • How to customize them in a clean way?
  • How does X determine which graphics card (and thus the driver) it will use (since xorg.conf seems useless nowaday) on computer with integrated and discrete cards?
  • How to force X to use a specific driver (in order to avoid lots of useless log messages)?
  • What are the relations between the linux kernel driver and xorg graphics driver?

1 Answer 1

2

I started answering this (as I do when I start answering a lot of questions on AU) because I wanted to know more. You've asked some pretty decent questions about how things work that I confess, I didn't immediately have answers to. I've done my best.

You'll understand what I'm talking about when you look at man xorg.conf and find things like this:

VIDEOADAPTOR SECTION
       Nobody wants to say how this works.  Maybe nobody knows ...

Seriously.


LightDM is started by Upstart (the init system, started by the Kernel on boot) here:

/etc/init/lightdm.conf

That feeds into the lightdm command which reads (seat information, etc) from:

/etc/lightdm/lightdm.conf
/etc/lightdm/lightdm.conf.d/*

And then starts X which looks for the following configurations:

/etc/X11/<cmdline>
/usr/etc/X11/<cmdline>
/etc/X11/$XORGCONFIG
/usr/etc/X11/$XORGCONFIG
/etc/X11/xorg.conf
/etc/xorg.conf
/usr/etc/X11/xorg.conf.<hostname>
/usr/etc/X11/xorg.conf
/usr/lib/X11/xorg.conf.<hostname>
/usr/lib/X11/xorg.conf
/etc/X11/xorg.conf.d/*
/usr/etc/X11/xorg.conf.d/*

If present in the configuration, that's how X would pick the driver/monitor/etc layout... If it's not, the newer XRandR extensions have a major part to play in guessing and persisting monitor settings.

If you don't want a best guess, you can force it in a direction by:

But if you let xrandr handle things, once you log in, the configuration comes from:

~/.config/monitors.xml

After X starts there's a load of session gubbins (autostarts, etc) that start that aren't particularly relevant to the graphics process but they're probably worth mentioning. Mentioned.

There are two bits that elude proper explanation:

  • The relationship between Xorg and Kernel drivers has made me go thoroughly cross-eyed. I found a very exhausti{ve,ng} book on the subject[PDF!] but haven't had the time to even scratch it.
  • How Xorg/XRandr picks the right driver.

There's certainly a lot more automagical wrangling than there used to be.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .