Launchpad Entry: desktop-o-xorg-tools-and-processes
Packages affected: xorg, xdiagnose
Refresh and update the Failsafe-X utility to make it used for a wider variety of failures and to provide more tools to help users troubleshoot problems.
Failsafe-X was originally designed for X crash situations such as errors in your xorg.conf. But these days most people do not need an xorg.conf at all, and X crashes are much, much less common. Now the most common X failures tend to be gpu hangs, blank/black screens on boots, screen corruption, and various modesetting problems - these tend to be due to issues in the kernel drm code rather than X itself, so simply restarting X and offering xorg.conf editing options isn't going to cut it for these types of problems.
The essence of the original failsafe-x was to provide tools to assist the user in identifying why X was not starting, and provide several simple tools to (hopefully) get them back to a usable state. We'll retain this essence but expand the scope to include certain types of kernel graphics failures.
The tool should list known workarounds in a simple GUI format, that permits the user to easily apply kernel parameters in grub, set various graphics options, blacklist graphics drivers, and so on. The tool should be developed to permit relatively easy addition of more workarounds as they come to light.
In addition to being triggered from the traditional "X failed to start" scenario, a new "boot failed" mode will be added to gfxboot's F6 menu; if the only action from the user after booting is to hold down the power button to restart, that should be counted as a failed boot, and Ubuntu should offer to launch into a recovery session. The tool will also be made available from the boot menu associated with the Recovery kernel options. To facilitate manual debugging the GUI tool should be able to be launched from within a running X session (this may also help with ensuring the tool gets tested itself).
While a GUI interface is the primary design goal, the backend logic should be developed in a way that will permit adding a command line interface later, if desired.
The current failsafe-x scripts are to be moved out of the 'xorg' package and merged into the xdiagnose package. xdiagnose then takes over installing the failsafe environment and setting the udev rule.
Both the general X apport hook and the intel GPU failure hook will also move to xdiagnose, so that all of the Ubuntu graphics failure handling code is consolidated. It is expected this will permit sharing of some common code, too.
The existing prototype xdiagnose GUI (which currently has a few options for setting kernel parameters) will be extended to include the functionality provided by failsafe-x's xenity dialogs. This includes regenerating, removing, or editing xorg.conf, reviewing Xorg.0.log errors, and switching to the vesa video driver. Once this is done, the xenity dialogs can be dropped in favor of the new GUI.
Additional features will be added as time permits. One feature would be including x-kit support to generate xorg.conf or xorg.conf.d snippets for setting various X options, adding quirks, and so on.
Another potential feature would permit moving aside (or restoring) .driconf and/or monitors.xml; these are produced by GUI tools so the user may not be aware of them, but they can occasionally cause troubles on upgrade (a setting which fixed a problem or had no effect on an earlier X version could cause a different behavior/problem on a newer X.) These two config files are not managed by the packaging system in any form, so won't cause conflicts if we move them. The GUI tools can be used to regenerate or edit them, so (at least for now) xdiagnose will not provide those features but may include functionality to launch the GUI tools themseves.