Bug#815154: gnome-control-center removes XKBMODEL and XKBOPTIONS from /etc/default/keyboard

Felipe Sateler fsateler at debian.org
Thu Feb 25 14:52:12 GMT 2016


On 23 February 2016 at 13:41, Anton Zinoviev <anton at lml.bas.bg> wrote:
> On Tue, Feb 23, 2016 at 11:51:35AM -0300, Felipe Sateler wrote:
>> On 19 February 2016 at 14:52, Anton Zinoviev <anton at lml.bas.bg> wrote:
>> >
>> > XKBMODEL has no default value (at least in console-setup).  It should always be
>> > present and never as empty value.
>
> Thanks to this discussion, now I think it will be a good idea for console-setup
> to compute some default XKBMODEL.
>
>> This is not what keyboard(5) says:
>>
>>
>> XKBMODEL
>>      Specifies the XKB keyboard model name.  Default: pc105 for  most
>>      platforms.
>
> Thank you.  I acknowledge that this is a bug in the documentation.  I will have
> to rewrite this man-page so that it becomes clearer which parts in it are
> software independent and which are related specificly to console-setup.

Great that we find agreement :)

>
>> On 20 February 2016 at 11:02, Anton Zinoviev <anton at lml.bas.bg> wrote:
>> > In case it is difficult to preserve the existing value, you can use 'pc105' as a
>> > default value.  Alternatively, the following table with default values can be
>> > used:
>> >
>> > Architecture  Subarchitecture Model
>> > -----------------------------------
>> > m68k          atari           ataritt
>> > m68k          mac             macintosh_old
>> > m68k          Other           pc105
>> > powerpc       amiga           amiga
>> > powerpc       Other           pc105
>> > Other                         pc105
>>
>> Maybe console-setup should encode this table itself, so that the
>> documentation becomes correct.
>
> In fact, console-setup can compute default XKBMODEL if one is missing.  If the
> file /etc/default/keyboard becomes corrupt, then this will be corrected when the
> package is upgraded (or the user uses dpkg-reconfigure).
>
> The reason no such logic exists in /bin/setupcon (the script used to actually
> configure the console) is that the script setupcon can be used on any Linux or
> FreeBSD variety (not just Debian) and I don't know how to implement a table like
> this in a distribution independent way.  Therefore, all such logic is encoded in
> the package scripts (mostly debconf config and postinst).

I agree that a non-trivial if (Debian) { /* guess xkbmodel */ } feels
hackish. But the architecture can be obtained via uname which should
be quite portable, and the subarchitecture you have already posted a
script to detect in the necessary cases. Alternatively, the maintainer
scripts could preseed the value into /var/lib/console-setup or some
other private directory, and have setupcon try to read that when
XKBMODEL is not set. Then other OSes can preseed the file in the
manner most appropriate for them.

>  Even if I include such
> a logic in setupcon, it will be somewhat primitive, so a warning to the user will
> have to be issued when XKBMODEL is missing.

This may be a good idea.

-- 

Saludos,
Felipe Sateler




More information about the Pkg-systemd-maintainers mailing list