All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin Watson <cjwatson@ubuntu.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: keyboard layouts
Date: Tue, 12 Jan 2010 23:51:33 +0000	[thread overview]
Message-ID: <20100112235133.GM5847@riva.ucam.org> (raw)
In-Reply-To: <20100112232959.GA6071@pina.cat>

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 ]
keycodes.

(Not quite two lines but I hope you don't mind ...)

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



  reply	other threads:[~2010-01-12 23:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12 21:47 keyboard layouts Carles Pina i Estany
2010-01-12 22:53 ` Colin Watson
2010-01-12 23:29   ` Carles Pina i Estany
2010-01-12 23:51     ` Colin Watson [this message]
2010-01-13  9:24 ` Yves Blusseau
2010-01-13 16:23   ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-09 23:23 Carles Pina i Estany
2010-03-19 23:45 Carles Pina i Estany
2011-04-22 22:34 Keyboard layouts (was Re: GRUB 1.99~rc2 released) Vladimir 'φ-coder/phcoder' Serbinenko
2011-05-23 13:22 ` Keyboard layouts Treutwein Bernhard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100112235133.GM5847@riva.ucam.org \
    --to=cjwatson@ubuntu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.