[casper] doesn't set $LANG properly

Bug #13485 reported by Martin Pitt
12
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
Fix Released
High
Matt Zimmerman

Bug Description

I just started Array 6 ppc/live with X.org 6.8.2-2, which claims to have finally
sorted out the keyboard selection. However, it still defaults to PC104/U.S.
although I selected German/nodeadkeys in d-i. It works correctly at the console
and the locale was correctly set to de_DE.UTF-8.

Revision history for this message
Martin Pitt (pitti) wrote :

Array 6 ppc/install works (mostly), I get a PC105/German layout by default. The
only error is that I selected "nodeadkeys" in the installer, but have dead keys.

Revision history for this message
Daniel Stone (daniels) wrote :

Matt, looks like debian-installer/keymap doesn't propagate from cdebconf through
to normal debconf? Martin, what're the Xkb* lines in /etc/X11/xorg.conf?

Revision history for this message
Matt Zimmerman (mdz) wrote :

It most certainly is, or it wouldn't work for me with dvorak. What gave you
that impression? Have you guys done more debugging around this issue?

Revision history for this message
Daniel Stone (daniels) wrote :

Matt, good point.

Martin, could you please grab
http://people.ubuntu.com/~daniels/detect-keyboard.sh, make it +x, and sudo
$(pwd)/detect-keyboard.sh, and send me the output?

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #2)
> Matt, looks like debian-installer/keymap doesn't propagate from cdebconf through
> to normal debconf? Martin, what're the Xkb* lines in /etc/X11/xorg.conf?

As expected, they match the layout I actually have:
        Option "XkbRules" "xorg"
        Option "XkbModel" "pc104"
        Option "XkbLayout" "us"

Revision history for this message
Daniel Stone (daniels) wrote :

Sorry, wrong thing. I meant to ask for you to get
http://people.ubuntu.com/~daniels/detect-keyboard.sh, make it +x, and run sudo
$(pwd)/detect-keyboard.sh, and put the output here.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #4)
> Matt, good point.
>
> Martin, could you please grab
> http://people.ubuntu.com/~daniels/detect-keyboard.sh, make it +x, and sudo
> $(pwd)/detect-keyboard.sh, and send me the output?

$ sudo ./detect-keyboard.sh
layout is de
rules are xorg
model is pc104
options are nodeadkeys

This is not entirely right (pc105 is the correct model), but at least it says
"de". Still it seems that this result is not actually written into the X.org
config. This is still on array6 ppc/live.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #1)
> Array 6 ppc/install works (mostly), I get a PC105/German layout by default. The
> only error is that I selected "nodeadkeys" in the installer, but have dead keys.

Confirmed with today's daily. Maybe the reason is that xorg.conf cannot be
written to with the live CD?

Revision history for this message
Martin Pitt (pitti) wrote :

Summary: the detection script should add support for "mac-usb-*" keyboards.

For reference, here is the IRC conversation:

<pitti> mdz: http://people.ubuntu.com/~pitti/config.dat-ppc-live-german
<mdz> Name: debian-installer/keymap
<mdz> Template: debian-installer/keymap
<mdz> Value: mac-usb-de-latin1-nodeadkeys
<mdz> Owners: base-config, d-i
<mdz> that looks reasonable
<pitti> ack
<pitti> mdz: btw, daniels' detection script works fine, too
<mdz> pitti: that's so strange
<pitti> $ sudo ./detect-keyboard.sh
<pitti> layout is de
<pitti> rules are xorg
<pitti> model is pc104
<pitti> options are nodeadkeys
<mdz> pitti: look at /var/lib/dpkg/info/xserver-xorg.config, line 1715
<mdz> this should be the same code as detect-keyboard.sh
<mdz> I don't see an entry in the case statement which corresponds to
mac-usb-de-latin1-nodeadkeys
<mdz> oh, I see, this fallback:
<mdz> *--de*) XMAP="de"; OPTIONS="nodeadkeys";;
<mdz> that is based purely on LANG
<mdz> so perhaps $LANG is not set properly at that point
<mdz> it seems like it may be specific to the mac-* layouts
<pitti> mdz: maybe, locale in the running system is correct; maybe it is read
too late
<pitti> mdz: however, the real fix seems to be to add the mac-usb keymaps then
<pitti> mdz: since we already saw that locale-based choice is wrong
<mdz> pitti: the question is whether $LANG is set in d-i
<mdz> I would expect so, but perhaps not
<pitti> mdz: ah, that's the reason why the detection script works in the running
system
<pitti> because LANG is correct then
<mdz> pitti: yes, it seems very likely that this is the source of the problem

Revision history for this message
Matt Zimmerman (mdz) wrote :

Colin, it seems likely that LANG is not set at the time that casper runs. Is
this true in general under d-i? Should I try to work around this in casper, or
is there a better way?

Even if we code for the mac-* layouts directly, $LANG is necessary to get our
best guess in general.

Revision history for this message
Michael Vogt (mvo) wrote :

I just tested the current live-cd on my i386 system and my keyboard was set to
pc105 with german layout. So it seems that it does not affect i386.

Revision history for this message
Andreas Mueller (amu) wrote :

(In reply to comment #11)
> I just tested the current live-cd on my i386 system and my keyboard was set to
> pc105 with german layout. So it seems that it does not affect i386.

works on i386, same error like pitti but on a Powerbook G4

ubuntu@ppc:~$ sudo ./detect-keyboard.sh
layout is de
rules are xorg
model is pc104
options are nodeadkeys

--- xorg.conf ----
Section "InputDevice"
        Identifier "Generic Keyboard"
        Driver "keyboard"
        Option "CoreKeyboard"
        Option "XkbRules" "xorg"
        Option "XkbModel" "pc104"
        Option "XkbLayout" "us"
EndSection

------------------

Revision history for this message
Daniel Stone (daniels) wrote :

Colin, any ideas? I'm about to upload an xserver-xorg which does
DI_KEYMAP=${RET##mac-usb-}, but getting the $LANG thing fixed would be phat.

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

In d-i, $LANG will be set to C.UTF-8. Use 'db_get debian-installer/locale' to
get the locale to use when chrooted into /target.

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

In case it wasn't clear, that meant that I think it should be fixed in casper.
apt-setup-udeb tries to do this, although apparently some of the code has gone
missing ...

Revision history for this message
Daniel Stone (daniels) wrote :

*swoons* -- my hero.

if [ "$LANG" = "C.UTF-8" ]; then
  # d-i sucks and it's Colin's fault
  REALLANG="$(db_get debian-installer/locale)"
else
  REALLANG="$LANG"
fi

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

Erm, no, don't try to do this in xserver-xorg - it won't work because that
debconf question has not been copied over. casper needs to set $LANG properly
and you shouldn't need to care.

Revision history for this message
Daniel Stone (daniels) wrote :

Phat. Reassigning with glee.

Revision history for this message
Matt Zimmerman (mdz) wrote :

casper (0.52) unstable; urgency=low

  * Arrange for $LANG to be set after pivot_root, so that (e.g.)
    xserver-xorg can use it to infer the keymap (Ubuntu #7138)

Revision history for this message
Daniel Stone (daniels) wrote :

And:
xorg (6.8.2-4) hoary; urgency=low

  * Fix additional security vulnerability in Xpm's bitmap_unit checking
    (closes: Ubuntu#7433, fdo#1920).
  * Remove mac-usb- prefix from d-i keyboard mappings before we run our
    detection routine (partially mitigates Ubuntu#7138).
  * Move mkfontscale from xbase-clients to xutils, as it does not depend on
    client-side X libraries, and mkfontdir from xutils was entirely reliant
    on mkfontscale (closes: Ubuntu#7391).
  * Add Swiss keymaps, thanks to Sylvain Pasche (closes: Ubuntu#7482).
  * Update i810 driver from HEAD, which now finally has support for validating
    modes against DDC ranges, and supports panels on pipe A (closes:
    Ubuntu#5864, Ubuntu#6973).

 -- Daniel Stone <email address hidden> Fri, 11 Mar 2005 12:53:55 +1100

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.