updating console-setup in X destroys screen

Bug #93338 reported by Simonics Zsolt
4
Affects Status Importance Assigned to Milestone
console-setup (Ubuntu)
Fix Released
Undecided
Colin Watson

Bug Description

Binary package hint: console-setup

I'm on the latest Feisty Fawn, using an x86 pc with nvidia graphics card, and proprietary nvidia driver (1.0.9631).

If I run apt-get update/upgrade under X (in a konsole, or rxvt terminal) and there is a new console-setup package, then when it says
Setting up console-setup (1.13ubuntu9) ...
 * Setting up console font and keymap... [ OK ]
it makes the X screen distorted, probably does something with the videocard registers. I have to switch to the virtual terminal and back to X (alt+ctrl+f1 -> alt+f7) to repair that. But I think it can confuse new or inexperienced users.
The solution is maybe to check if X runs, and if it is, then don't start /etc/init.d/console-setup, but I don't know enough about package management to make this fix.

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

Hi,
I cant reproduce this here.
/etc/init.d/console-setup contains here (on feisty) :

    start|force-reload|restart|reload)
        if [ -z "$DISPLAY" ] && ....
            ...
        elif ! run_by_init; then
            log_action_begin_msg "Saving console font and keymap for next boot"
            if setupcon --save-only; then
                log_action_end_msg 0
            else
                log_action_end_msg $?
            fi
        fi

so it does only some saving even with apt-get --reinstall .
Do you have a modified version of that file ?

Or not exported/empty DISPLAY ?
export|grep DISPLAY
declare -x DISPLAY=":0.0"

Revision history for this message
Simonics Zsolt (regiszt) wrote :

"Or not exported/empty DISPLAY ?"

That was the problem! Thank you!
I'm using rxvt and "su - " to get a root shell. I don't know if it's a proper way or not. How can I make that declare thing permanent?

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

If you would use su without the '-' the environment should be left intact.

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

OK I changed
       if [ -z "$DISPLAY" ] && ! pidof usplash >/dev/null; then
to
       if ! ps -Af | grep -q 'bin/X.* vt$(fgconsole) ' && ! pidof usplash >/dev/null; then
in
 /etc/init.d/console-setup
here. Now it works with su - too.

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

Ooops - I'm sorry but the above patch does not work as expected, since grep finds itself allways. Here a fixed version:

Change
       if [ -z "$DISPLAY" ] && ! pidof usplash >/dev/null; then
to
       if ! ps -Ao comm,command | grep -q "^X.* vt$(fgconsole) " &&
           ! pidof usplash >/dev/null; then
(starting a new line after && should be OK)

Revision history for this message
Martijn Koster (makuk66) wrote :

I have a feisty host that has X running. From an ssh session into that machine I run xen-tools's xen-create-image to creating a feisty domU.
When that runs debootstrap (in the host, not the guest), and installs console-setup, that corrupts video ram on X. I image the same thing could happen if you run debootstrap for a chroot setup, but have not tested that.

Perhaps console-setup should use "pidof X" instead of checking $DISPLAY? I think that would have helped Simonics too.

But I imagine the real problem here is that console-setup runs from the debootstrap, affecting the host instead of the target. Please advise.

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks for the suggestions. As fgconsole doesn't always actually return a console number under X, I've taken a somewhat different approach involving just checking whether the output of fgconsole is in [1-6]. I know this isn't perfect, but since running setupcon is just a nice-to-have I think it's good enough.

Changed in console-setup:
assignee: nobody → kamion
status: Unconfirmed → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

console-setup (1.13ubuntu10) feisty; urgency=low

  * Source debconf confmodule earlier in postinst (it should always be
    sourced as early as possible, as it re-executes the calling script).
  * Fix horrible confusion if the locale has no supported default codeset
    (LP: #84401).
  * Fix console-setup/codeset default to be one of the available choices.
  * Try harder to ensure that we aren't running under X when deciding
    whether to run setupcon on upgrade (thanks to Kurt J. Bosch for
    suggestions; LP: #93338).
  * Don't set an AltGr key by default for US layouts (LP: #76901).

 -- Colin Watson <email address hidden> Sun, 1 Apr 2007 16:49:02 +0100

Changed in console-setup:
status: Fix Committed → 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.