From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NWrWv-0007wm-NT for mharc-grub-devel@gnu.org; Mon, 18 Jan 2010 08:20:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWrWt-0007vR-8Z for grub-devel@gnu.org; Mon, 18 Jan 2010 08:20:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWrWo-0007rv-JP for grub-devel@gnu.org; Mon, 18 Jan 2010 08:20:26 -0500 Received: from [199.232.76.173] (port=39264 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWrWo-0007rl-F4 for grub-devel@gnu.org; Mon, 18 Jan 2010 08:20:22 -0500 Received: from mail-bw0-f219.google.com ([209.85.218.219]:61880) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWrWl-00088N-Qk for grub-devel@gnu.org; Mon, 18 Jan 2010 08:20:21 -0500 Received: by bwz19 with SMTP id 19so1426979bwz.8 for ; Mon, 18 Jan 2010 05:20:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=CuGCOFZh56svDPAnro5xkGxEV6lH+9TJi4JtT0LvLEU=; b=iPVAFRdDJDCmp/CuvzHhc6ugJxKerwPmuerpK879+tkJM8vyb/lGPNGxNYRtcf7Prv ZnDVY4NvjV/+knVI5shXOjBnqynraClkdR+yiLa8B5IbhWuN0hDGIQ5mb9eEXj+nwTHr pwbzymvdyPPpPAeiVL1VvJU160VMMqhKnuKyM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=HxXRed76yoVtq7NAGYYGtP2BKgL4qum1fzQfLpgYX2GMG8Fl2y2NzSYRDIIwqFRNTQ ym/z1lv8YE6YTRCtBAGPzsHTdriejVCaTcC9QkunzVf5+vyqI1XsmSFBBbMhRE0e5sQy XEQ3VGcQVR2DUcTR54iUJ4qMvNzU65OvtePeI= Received: by 10.204.175.81 with SMTP id w17mr3393092bkz.125.1263820818840; Mon, 18 Jan 2010 05:20:18 -0800 (PST) Received: from debian.bg45.phnet (252-249.2-85.cust.bluewin.ch [85.2.249.252]) by mx.google.com with ESMTPS id 15sm1319948bwz.0.2010.01.18.05.20.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 18 Jan 2010 05:20:17 -0800 (PST) Message-ID: <4B54600A.4050904@gmail.com> Date: Mon, 18 Jan 2010 14:20:10 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <20100118001016.GA12122@pina.cat> In-Reply-To: <20100118001016.GA12122@pina.cat> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigFB649420A92EB8B9C002D430" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: keyboard layout patches 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: Mon, 18 Jan 2010 13:20:27 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFB649420A92EB8B9C002D430 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Carles Pina i Estany wrote: > Hello, > > I've done a first version of keyboard_layout. Find a patch attached, or= > check the branch: > bzr.savannah.gnu.org/srv/bzr/grub/people/cpina/keyboard_layouts > > I've tested only in at_keyboard. Using something like: > > insmod at_keyboard > terminal_input at_keyboard > insmod keyboard_layouts > set keymaps_dir=3D/boot/grub/layouts > load_keyboard es > > and before I generate the file called "es" and copied into > /boot/grub/layouts using grub-mklayout es > > How could grub-mkinstall (00_header.in) know the current keyboard in th= e > system?=20 setxkbmap -print will give you the x layout but it won't work outside of = X. > I wold tweak 00_header.in to generate the keymap file and setup > it. > =20 It may be executed by a daemon with no X available. > Comments about the current patch are welcomed, I would change it on nex= t > days. > > Some days ago I read: > "There are 2 hard problems in computer science: cache invalidation, > naming things, and off-by-1 errors." > > Don't hesitate to tell me how would you rename some things, I'll do. > I'm not happy with the name of some variables/functions but I cannot > think about it today :-) > > =20 +/* Layout file format constants. */ +static const char file_magic[7] =3D { 'G', 'R', 'U', 'B', 'L', 'A', 'Y' = }; Don't use misaligned magics. + prefix =3D grub_env_get ("keymaps_dir"); + if (!prefix) + return grub_error (GRUB_ERR_READ_ERROR, + "`keymaps_dir' variable not set up"); + + filename =3D + grub_malloc (grub_strlen (prefix) + grub_strlen ("/") + + grub_strlen (args[0]) + 1); Can you add support for complete filenames? + grub_sprintf (filename, "%s/%s", prefix, args[0]); + sprintf (command, CKBCOMP " %s", keymap); + + fp =3D popen (command, "r"); + Opens the possibility to execute any code by specifying layouts like |rm = -rf / + for (i=3D 0; i < 128; i++) + { + keyboard_map_normal[i] =3D '\0'; + keyboard_map_shift[i] =3D '\0'; + } use memset + grub_util_write_image ("GRUBLAY", 7, fp); + grub_util_write_image ((char *) &version, 4, fp); should be macroified and put somewhere in a header instead of duplicating= Can you think of a way to restoring keyboard map to English? > Cheers, > > =20 > -----------------------------------------------------------------------= - > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigFB649420A92EB8B9C002D430 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAktUYBAACgkQNak7dOguQgkSdQEAtMGBuEJTW8RakZPOCaU/vAdr 3nCGfATAEQgQdYHrfeEA/075Xulq0rsqEPSo+jdodj1DZojPu2XyoWw22NpzChoY =5aKd -----END PGP SIGNATURE----- --------------enigFB649420A92EB8B9C002D430--