Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NUpci-0002UQ-69 for mharc-grub-devel@gnu.org; Tue, 12 Jan 2010 17:54:04 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUpcg-0002Sr-Sh for grub-devel@gnu.org; Tue, 12 Jan 2010 17:54:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUpcb-0002MR-RM for grub-devel@gnu.org; Tue, 12 Jan 2010 17:54:02 -0500 Received: from [199.232.76.173] (port=47218 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUpcb-0002M8-KO for grub-devel@gnu.org; Tue, 12 Jan 2010 17:53:57 -0500 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:42839) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUpcb-0000gf-5m for grub-devel@gnu.org; Tue, 12 Jan 2010 17:53:57 -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 1NUpcZ-0001Fx-67 for grub-devel@gnu.org; Tue, 12 Jan 2010 22:53:55 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1NUpcY-00030J-00; Tue, 12 Jan 2010 22:53:54 +0000 Date: Tue, 12 Jan 2010 22:53:54 +0000 From: Colin Watson To: The development of GNU GRUB Message-ID: <20100112225354.GL5847@riva.ucam.org> References: <20100112214743.GA3945@pina.cat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100112214743.GA3945@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 22:54:03 -0000 On Tue, Jan 12, 2010 at 09:47:43PM +0000, Carles Pina i Estany wrote: > Plan: > - Use the X11 layouts that usually are in /usr/share/X11/xkb/symbols . > - Create a new module that reads the layout from an environtment variable. > > * Approach 1 > The module will load the layout from /usr/share/X11/xkb/symbols/XX > replacing the array map that currently exists in > term/i386/pc/at_keyboard.c > > Negative points: > -Grub needs acces to /usr/share/X11/xkb/symbols to load the > layout > -xkb files doesn't look specially nice to parse (I think that I prefer > the .mo files :-) ). They are text files easy to understand for humans > > * Approach 2 > Small program (I guess that you prefer C, Python would be nice too) that > when Grub is installed would process the /usr/share/X11/xkb/symbols > files and generates the files that Grub will read. Code to read this > files would be much easier than before. > > This way, the layout tables could stay in /boot/grub/layouts . These > files would look like keycode - symbol pairs. Everything already in > binary, and only for the things that differ from English. > > So, if a layout has 40 different keycode-symbol pairs compared with > English, this would be 80 bytes per layout. Probably will be more, but > it should be of this order of magnitude. I can't remember whether I mentioned this before, but have a look at 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. (console-setup is Debian-specific, but perhaps we could incorporate the relevant bits of it in grub-extras, or do something else creative ...) -- Colin Watson [cjwatson@ubuntu.com]