[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: keyboard layouts
Re: keyboard layouts
Tue, 12 Jan 2010 23:51:33 +0000
On Tue, Jan 12, 2010 at 11:29:59PM +0000, Carles Pina i Estany wrote:
> On Jan/12/2010, Colin Watson wrote:
> > the gfxboot-theme-ubuntu package in Ubuntu, specifically the
> > scrape-console-setup script. It makes use of console-setup to process
> > XKB keymaps into a form that can then be run through loadkeys and
> > reformatted so that gfxboot can use them. A similar approach might be
> > feasible in GRUB.
> Legal question: gfxboot-theme-ubuntu is licensed under GPL 2. I
> understand that this means that we cannot share code. In the other hand,
> I think that you are the author, so you could give the copyright of this
> code to the FSF if needed. Is it possible?
GPL 2 or later, actually, so we could share it. But yes, I'd be willing
to assign for the purposes of a GRUB derivative of scrape-console-setup,
if you chose to use that source. I did not write all of
gfxboot-theme-ubuntu by any means, but I wrote both the scrape-* scripts
there from scratch.
console-setup is also GPL 2 or later, but you'd have to ask Anton
Zinoviev if you chose to copy it.
> Integration question: some of that code is done using Perl. Actually are
> quite small scripts (373 lines the longer one). I don't know if we want
> to add Perl as a Grub dependency :-/, or if it's worth. We can redo the
> script in C.
scrape-console-setup is really only incidentally in Perl; it's not that
complicated and could be done in any reasonable language. You'd need to
rewrite much of it for GRUB's keymaps anyway.
ckbcomp, though, is very complicated and difficult to reimplement. If
you were going to reimplement it, then it might be worth looking at
something like embedding a partial XKB parser in GRUB after all ...
To my knowledge, there is no serious alternative to XKB as a source of
keymaps. The old-style Linux keymaps (console-data et al) are long
since moribund, and XKB is what nearly everyone will be using on their
running systems anyway so it's good to be consistent with those keymaps
as far as possible.
> Ok, the process of scrape-console-setup (I have not been able to test it
> yet) is to use ckbcomp to convert from XKB keymaps to the "loadkeys"
> keymaps, and then does some process on this second keymaps.
Yes. The reason is, as you say, that the loadkeys format is a lot
closer to what a boot loader tends to want. Processing XKB is fairly
hard (although GRUB is more sophisticated than gfxboot, so who knows).
> Can you write in two lines the format of the layout that gfxboot use?
> (else I will try to generate it soon...)
You can look at gfxboot-theme-ubuntu/keytables.inc for the generated
version. It's a series of arrays of [ level1 level2 level3 level4 ]
(Not quite two lines but I hope you don't mind ...)
Colin Watson address@hidden