From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S6YsX-0000S4-U9 for mharc-grub-devel@gnu.org; Sat, 10 Mar 2012 21:51:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6YsS-0000M0-Uo for grub-devel@gnu.org; Sat, 10 Mar 2012 21:51:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6YsQ-000342-P4 for grub-devel@gnu.org; Sat, 10 Mar 2012 21:51:20 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:33481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6YsQ-00033x-G0 for grub-devel@gnu.org; Sat, 10 Mar 2012 21:51:18 -0500 Received: by wibhj13 with SMTP id hj13so1752604wib.12 for ; Sat, 10 Mar 2012 18:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=75FbHnfSgtsb+C1+UpLz3Tv/1WuJ4nwSfpWOUJrupEs=; b=XeKAW++Q7fC3cnRUDNPvMFJYbsdvP4TaaH3ZnyyUFBY2FepDYH3QFg66WVCr4koPM6 m+6GKmtOFzKaf1DaWVTx+8L8t/RjjBjHq8UNGccs1d/ZpOtwRKCUgsc/mpHqJSgr7skv XfNIbLxot4GNVDU4xYj6EOPFuoWPe8VeyeXnaLl4hHYT04RShENq7ZsD/6OyO6rmu5uB YgsFwAuX9pzgJFKxMZUN2nwJSMymk0HXudvWnQjSzqhj4KAkIIzkVB+V1bkrU11aFMRa eHFZ0qXkHlGkq4TUxZ0KnilXk+DmDmMeBUfFFbMT3fOthi19EEBGhU6bO9tXzcqtx9lq QICw== Received: by 10.216.45.146 with SMTP id p18mr4422753web.47.1331434276366; Sat, 10 Mar 2012 18:51:16 -0800 (PST) Received: from fedora.x201.phnet (207-116.62-81.cust.bluewin.ch. [81.62.116.207]) by mx.google.com with ESMTPS id p10sm21182692wic.0.2012.03.10.18.51.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 10 Mar 2012 18:51:15 -0800 (PST) Message-ID: <4F5C1321.1050403@gmail.com> Date: Sun, 11 Mar 2012 03:51:13 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: Grub version variable in shell References: <4F5C10A0.1060802@googlemail.com> In-Reply-To: <4F5C10A0.1060802@googlemail.com> X-Enigmail-Version: 1.3.5 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7C4E1A08CE595128376D3C0F" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.177 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Sun, 11 Mar 2012 02:51:22 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7C4E1A08CE595128376D3C0F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11.03.2012 03:40, Andreas Born wrote: > Hi, > > it would be great to have a variable like version or grub_version in > the shell. Sorry, if there is already such an option and I didn't find > it. But I only saw cpu and platform as well as the feature variables. > > This is useful, if you want to use some new feature or don't want to > use some ugly workaround anymore, which you needed for an older version= =2E=20 We don't use grub_version because it would give only very approximate idea of features supported and so only marginally useful and is likely to make devs use suboptimal method. Instead we define variables like feature_foo. Good example is from root setting code: if [ x$feature_platform_search_hint =3D xy ]; then search --no-floppy --fs-uuid --set=3Droot --hint-bios=3Dhd0,gpt10 --hint-efi=3Dhd0,gpt10 --hint-baremetal=3Dahci0,gpt10 UUID else search --no-floppy --fs-uuid --set=3Droot UUID fi > Currently, I'm doing a check like 'if keymap' to show a minimal menu > to pre-1.99 users with a warning that they're version is too old > instead of giving them garbage if at all. But that check does not feel > really reliable nor clean. ;) > Especially given the recent discussion regarding backwards > incompatible changes, this would be a really big help even if they're > only small changes. But I imagine there are other uses too. The early > there is such a variable the more useful it is, but I wouldn't > consider it critical. > > On the other hand it's quite hard to parse a version string on the > grub shell, especially if distributions choose to change it to some > Brainf**k imitation. Or they give the code a major revamp and then > don't change it. Well, maybe grub could get a Brainf**k parser at > least. :D > > For completeness two-line patch attached. (Untested) > > Andreas Born > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig7C4E1A08CE595128376D3C0F 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.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk9cEyEACgkQNak7dOguQgmwpAD/cNgq/CANX8ioFSuZWcTsdpfa nu4M3FYBF9DQoUgMowkA/3bqcN03QONc2VqHR/Nn+orxyPJNuJvZQkaXuWBewdCs =ZwL2 -----END PGP SIGNATURE----- --------------enig7C4E1A08CE595128376D3C0F--