キーマップがおかしくなったのは console-setup のせい

メイン・マシン (Debian Sid) で数日ぶりに sudo aptitude update; sudo aptitude -s full-upgrade すると、GNOME 関連が大量に来てた (ついに/やっと gvfs が来たりしてた) のと一緒に xorg の 1:7.4+1 が来てて、2chDebian スレで X.org祭り開催中 というコメントを見てたのだけど、だいじょうぶなんじゃないかと気楽に sudo aptitude full-upgrade してしまった。すると、なんと gdm でログインできなくなったのだった。
というのはちょっとおおげさで、ホントは US キーボードのキーマップになってて、アルファベットは OK なんだけど記号類が意図したものとちがう入力になっちゃってて、パスワードがちがうとハジかれてただけ。でも、直らないと困る。
2ch にも hal への言及があるし、DebianBTS をだらだらとのぞいてみても hal 用の XML ファイルを自分で書いたって人がいたりしたので (どこか忘れたけど)、hal 関連でなんとかしないといけないのかなと思ったのだけど、結論からいうと、うちの場合 console-setup がおかしかっただけみたいなのだった。
/usr/share/doc/xserver-xorg/NEWS.Debian.gz に以下のようにある (これ、apt-listchanges が拾ってくれなかったんだけど、"UNRELEASED" とかってまちがったことが書かれてるせいかな?)。

xserver-xorg (1:7.4+1) UNRELEASED; urgency=low

  Starting from this version, input devices are no longer configured
  statically in /etc/X11/xorg.conf.  Instead, input devices are detected at
  runtime (and can be hotplugged) and configured individually.  The default
  keyboard layout is shared with the console and is configured in
  /etc/default/console-setup.  As a result, devices configured to use the
  mouse or kbd driver are ignored by the X server by default.
  For more details, see:
  http://who-t.blogspot.com/2008/12/evdev-xorgconf-hal-and-other-fud.html
  http://who-t.blogspot.com/2008/10/new-keyboard-configuration-handling.html

 -- Julien Cristau   Wed, 25 Mar 2009 03:40:18 +0100

だいじなのは The default keyboard layout is shared with the console and is configured in /etc/default/console-setup. というところで、その /etc/default/console-setup は sudo dpkg-reconfigure console-setup すると再生成される。ただ、これがどうやってもまともなのを作ってくれないぽくて、しかたなく直接編集した。
おかしいのはこのファイルの最後のほうで、アップグレード時にてきとうに設定スクリプトに答えた結果だとこんな感じ。

# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.
XKBMODEL="jp106"
XKBLAYOUT="jp,jp"
XKBVARIANT="latin,"
XKBOPTIONS="grp:alt_shift_toggle,lv3:ralt_switch,grp_led:scroll"

/etc/X11/xorg.conf では "XkbLayout" が "jp,jp" ではなく "jp" なので、/etc/default/console-setup でも "jp" にし、XKBVARIANT と XKBOPTIONS のラインは消してしまった。すると、リブート後 gdm で記号類もふつうに入力できるようになった。
あと、sudo dpkg-reconfigure xserver-xorg すると、これが一切質問してこなくなってて、Section "InputDevice" や Section "Monitor"、Section "Screen" がばっさり消えてた。残ってるのは以下のラインだけ (コメントをのぞく)。

Section "Device"
	Identifier	"Configured Video Device"
EndSection

たぶん Debian でも、もう /etc/X11/xorg.conf なしでよくなったんだろう。試してないけど。
もうひとつ、xserver-xorg が xserver-xorg-input-evdev に依存するようになり、これが /usr/share/hal/fdi/policy/20thirdparty/10-x11-evdev.fdi なんてファイルを含んでるのは、強制的に evdev が使われるようになったということぽい (それっぽい設定ファイルになってる)。つまり、xserver-xorg-input-kbd と xserver-xorg-input-mouse は不要になったということなんだろうと思い、パージした。
ちょっといまどきの Linux デスクトップに近づいた気分。