[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#515685: console-setup: needs to read xorg.conf on install to get xkb settings



On Tue, 2009-02-17 at 14:43 +0200, Anton Zinoviev wrote:
> On Mon, Feb 16, 2009 at 11:33:25PM +0100, Julien Cristau wrote:
> > 
> > Package: console-setup
> > Version: 1.28
> > Severity: normal
> > Blocks: 508244
> 
> Why is this bug blocking #508244?

Because new versions of X, when using input hotplug, get information
about input devices from hal instead of xorg.conf.  As such, the
keyboard configuration in xorg.conf is ignored, and we need to migrate
it somewhere else for hal to read.  console-setup seems like the obvious
choice, so we don't have to keep configuring keyboard layouts twice.

> > on upgrade from lenny to squeeze, console-setup will get installed as
> > dependency of xserver-xorg, and the keyboard layout for X will be read
> > from /etc/default/console-setup (unless for some reason that plan
> > doesn't work out, but so far it seems ok).
> >
> > In order to make the upgrade path work, and avoid prompting users or
> > unexpectedly changing their X kbd layout, console-setup will thus need
> > to read xorg.conf, with something like the following patch.  This is
> > only lightly tested at the moment (thus no patch tag), but I'm filing
> > this early in case people have comments already :)
> > Basically, I scan xorg.conf for the first InputDevice section with an
> > XkbLayout option, and use the options from that section.  This is not
> > quite complete (if you have multiple InputDevice sections with different
> > layouts, all but the first will be ignored), but should cover most
> > cases.
> >
> > One question though, it looks like it's not possible to set multiple
> > layouts using console-setup's debconf interface?  Is there another way
> > to preserve this kind of settings when they're set that way in
> > xorg.conf?
> 
> Thanks for your work.  I will finish it.  Console-setup's debconf 
> interface doesn't support multiple layouts (unless the language is 
> non-latin in which case latin+non-latin combination is supported).  
> However console-setup supports any combination of layouts in its 
> configuration file so I think it shouldn't be a problem to read 
> arbitrary configuration from xorg.conf.
> 
I looked at writing directly to /etc/default/console-setup so the
settings could be picked up later, but since I have no idea what to put
for the other variables there it didn't look like it would trivially
work.  What I'd like the logic to look like is something like "if this
is the initial console-setup install and there's an xorg.conf, use the
model/layout/variant/options from there directly (bypassing debconf so
multiple layouts can be preserved), and setup the rest as usual'.  Does
this sound sane/feasible?

> However I am not sure that it is OK for X to use the configuration of 
> console-setup when the system is upgraded (of course this is OK when X 
> is installed for first time).
> 
> First, there are some meaningless for the console options, for example 
> XkbGeometry.  Does this mean that XKBGEOMETRY has to be added in 
> /etc/default/console-setup? If the configuration of console-setup is 
> used only when X is installed for first time and not when X is only 
> upgraded then it would be unnecessary to support XKBGEOMETRY in 
> /etc/default/console-setup.
> 
See below.

> Suppose also that the user has installed both console-setup and X and 
> she wants different keyboard configurations on the console and in X.  In 
> this case after the upgrade the old settings for X will be ignored.
> 
I'm ok with that.  We'll document it, and people will have the option of
configuring that stuff directly in hal if they want to have different
console and X setups, but I think the default case should be to share
them.

> Another complication is that the user may have specified XkbSymbols 
> instead of XkbLayout, XkbVariant and XkbOptions.  This also is not 
> supported by console-setup's debconf but can be easily supported in 
> /etc/default/console-setup.  If you want I can change the next version 
> of console-setup to be able to read XkbSymbols from xorg.conf and to 
> ignore XKBLAYOUT, XKBVARIANT and XKBOPTIONS in 
> /etc/default/console-setup if there is also XKBSYMBOLS.

The evdev driver (which is pretty much the only relevant one for linux
going forward), as well as new (well, future) versions of the kbd
driver, only look at rmlvo, and ignore XkbSymbols and XkbGeometry, so
that should be ok.

Thanks for looking at this!

Cheers,
Julien



Reply to: