guidance-backends overwrites xorg.conf without confirmation or notification, if video card has changed since last boot

Bug #257809 reported by Dana Goyette
2
Affects Status Importance Assigned to Milestone
kde-guidance (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: kde-guidance

Some laptops allow the user to choose between an integrated GPU (for power savings) and a discrete GPU (for performance). One of my friends has such a laptop; I've set it up with a customized xorg.conf file, tweaked with Device entries for both Intel and NVIDIA drivers, to make the GPU switch as "transparent" as possible. On several occasions, I've also booted my own system (with video and touchpad tweaks) in a USB enclosure, connected to other computers. Under both situations, I've noticed the following behavior:

Upon booting with a different GPUs or computers, I was unpleasantly surprised when I Xorg started without any of my settings... and sometimes dropped back to failsafe mode. I noticed the losing settings when I ended up randomly, unexpectedly clicking things, due to Xorg having lost my "disable tapping" setting.

I took a look in xorg.conf, and noted that something had trampled upon it, without confirmation, and without notification. Most of my custom settings were gone, and all of the whitespace that keeps my comments organized was entirely gone.
Here's my xorg.conf file, for reference; it has entries to make it work on multiple hardware configurations:
www.csc.calpoly.edu/~dgoyette/xorg.conf

I grepped around in various places to figure out what was overwriting xorg.conf, and identified the following script as the offender:
guidance-backends: /usr/share/python-support/guidance-backends/displayconfig-hwprobe.py
When I dpkg-divert i... so I dpkg-diverted it out of place, and have hence had no issues.

I understand the need for things to "just work" upon video card swap, but this script seems 'evil' for not respecting any of my settings....... and it didn't even make a working xorg.conf file! I booted with the Intel GPU, and the file it generated had only my NVIDIA(!) section, with all whitespace removed, and with the Synaptics section gone. If it helps, I can let the script run again, and add the created xorg.conf file to this bug report.

I believe this script should either be entirely removed, or should either leave the file alone, or prompt before overwriting it, if any of the following conditions are true:
1. If the xorg.conf file already has a defined section for the current device (as it should ideally work without changing).
2. If the xorg.conf file is heavily customized ("heavily" will need some definition), as advanced tweaks are there for a reason!

The mechanics of this prompting would need some work, though... perhaps use the new usplash prompting interface? If that's not feasible, please make it leave xorg.conf alone ... or at the very least, generate a working configuration, and then TELL the user that the xorg configuration file has been automatically regenerated.

Additional note: why is this (kde-guidance) installed on Ubuntu (non-KDE) systems? If it's not just for KDE, then "kde-guidance" seems like a misnomer.

The offending section of the python file:

    if previous_hardware is not None and previous_hardware!=hardware_config:
        # Run dpkg and configure the new hardware.
        syslog.syslog(syslog.LOG_INFO, "Graphics card hardware has changed. Reconfiguring xorg.conf using 'dpkg-reconfigure xserver-xorg'.")
        cmd = ['dpkg-reconfigure','xserver-xorg']
        environ = os.environ.copy()
        environ['DEBIAN_FRONTEND'] = 'noninteractive'
        #os.spawnvpe(os.P_WAIT, 'dpkg-reconfigure', cmd, environ)
        result = ExecWithCapture('/usr/sbin/dpkg-reconfigure', cmd, 0, '/', 0,1, -1, environ)
        for line in result.split('\n'):
            syslog.syslog(syslog.LOG_INFO,"dpkg-reconfigure:"+line)

description: updated
description: updated
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Displayconfig is unmaintained and nonexistent in Intrepid, so this won't be fixed.
Although in your case it probably is fixed, since displayconfig is no longer around to muck up your xorg.conf. ;-)

Changed in kde-guidance:
status: New → Won't Fix
Revision history for this message
Dana Goyette (danagoyette) wrote :

I'd consider the removal of that displayconfig script a fix in and of itself.... so you might consider marking it "fixed" rather than "won't fix".

Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Fair enough.

Changed in kde-guidance:
status: Won't Fix → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.