Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NUqWU-0002XJ-J2 for mharc-grub-devel@gnu.org; Tue, 12 Jan 2010 18:51:42 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUqWT-0002WP-4W for grub-devel@gnu.org; Tue, 12 Jan 2010 18:51:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUqWO-0002Ur-Ct for grub-devel@gnu.org; Tue, 12 Jan 2010 18:51:40 -0500 Received: from [199.232.76.173] (port=51159 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUqWO-0002Uo-8b for grub-devel@gnu.org; Tue, 12 Jan 2010 18:51:36 -0500 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:48230) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUqWN-0004vI-Ll for grub-devel@gnu.org; Tue, 12 Jan 2010 18:51:36 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1NUqWM-0008Fm-5I for grub-devel@gnu.org; Tue, 12 Jan 2010 23:51:34 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1NUqWL-0003Rc-00; Tue, 12 Jan 2010 23:51:33 +0000 Date: Tue, 12 Jan 2010 23:51:33 +0000 From: Colin Watson To: The development of GNU GRUB Message-ID: <20100112235133.GM5847@riva.ucam.org> References: <20100112214743.GA3945@pina.cat> <20100112225354.GL5847@riva.ucam.org> <20100112232959.GA6071@pina.cat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100112232959.GA6071@pina.cat> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: keyboard layouts X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 23:51:41 -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 ] keycodes. (Not quite two lines but I hope you don't mind ...) -- Colin Watson [cjwatson@ubuntu.com]