From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OrVIK-0003TP-4i for mharc-grub-devel@gnu.org; Fri, 03 Sep 2010 08:23:00 -0400 Received: from [140.186.70.92] (port=48449 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrVID-0003T8-BJ for grub-devel@gnu.org; Fri, 03 Sep 2010 08:22:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrVIC-00037I-57 for grub-devel@gnu.org; Fri, 03 Sep 2010 08:22:53 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:34328) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrVIC-00037D-0q for grub-devel@gnu.org; Fri, 03 Sep 2010 08:22:52 -0400 Received: by fxm3 with SMTP id 3so1184452fxm.0 for ; Fri, 03 Sep 2010 05:22:51 -0700 (PDT) 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=ucFQwpH1tNcLQt9EwyN9/x/NiI6GiCd3CSdSccaVHeM=; b=rjbn5heYZyVmN/I9/tBWOBmkUFGh4wukS+8pFy9ih+NO1gqu/JUWa8+YNCfqgCIggd AF+QD+cf8lJAo2fVstWAz/sldAmWzSaFk1JTKHnxOB+f8IR6e61nQQkFfDK1+HQe9dkc 2MZ7zKFBIGibiAxCtT2PfoxYs0mC1+534AFcI= 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=Ks+G3Q0PEOJvc6j1a3GUAy81a/ZGbqSVgJesIFygcj+GjeFFIJgEWXdpo4iX15WnK+ Or4UUeZxRn/282MobfnxqlNFeXywa1FnXjpx86iCmO0AXnjs7wqY8SRBWwUW0AGYt9TY DujqJRnemKzliW/3vSKPWtrRmHFrGXO//Xamo= Received: by 10.223.108.71 with SMTP id e7mr593205fap.13.1283516571026; Fri, 03 Sep 2010 05:22:51 -0700 (PDT) Received: from debian.bg45.phnet (100.71.63.81.cust.bluewin.ch [81.63.71.100]) by mx.google.com with ESMTPS id b9sm784192faq.7.2010.09.03.05.22.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Sep 2010 05:22:49 -0700 (PDT) Message-ID: <4C80E890.9010301@gmail.com> Date: Fri, 03 Sep 2010 14:22:40 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100805 Icedove/3.0.6 MIME-Version: 1.0 To: grub-devel@gnu.org References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig9A756CAFC97D0FC86D2220F8" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Syntax options for dynamic menu generation in grub-script 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: Fri, 03 Sep 2010 12:22:58 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9A756CAFC97D0FC86D2220F8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/24/2010 08:03 AM, Jordan Uggla wrote: > There has been some discussion recently on IRC about how to implement > dynamic menu generation in grub-script, and I think the discussion is > worth moving to the mailing list as whatever option we choose we will > be stuck supporting for a long time to come. > > Dynamic menu generation basically means that "menuentry" will become a > true command that can be executed from loops / conditional statements > and that the resulting menu entry can be different depending on > different circumstances. For instance, you could detect all GNU/Linux > installations on a computer at boot and generate menu entries for > every kernel image found, passing the detected UUID for the root=3D > statement in the kernel parameters (see osdetect.cfg from bvk's > osdetect bzr branch which does this as well as detecting other OSs). > > Two main options for the syntax of the menuentry command have been > fleshed out so far: > > 1. In the first, menu entries act very similar to functions, passing > variables like the kernel image path via positional parameters ( $1 > being the title of the menu entry ). As an example, here is how you > could generate a menu for choosing among detected grub2 installations > with this syntax: > > This is basically implemented right now. > > =20 This is the way which makes sense to any C coder. > 2. The other option would be to pass the source of the menu entry as a > regular string, using normal shell syntax to construct this string. An > implementation of the same example would be: > > > > =20 This is a way which basically makes usage of eval-like interface. Wouldn't eval program be enough to achieve this? Sth like: eval " menuentry \"Load $core\" { root=3D$device multiboot $core } " It looks for me that the second approach is simply trying to solve 2 prob= lems at the same time. Actualy 2 interfaces aren't contradictory. We may have an additional comm= and menuentry_eval for second interface and then we can let the coders de= cide. --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig9A756CAFC97D0FC86D2220F8 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/ iF4EAREKAAYFAkyA6JYACgkQNak7dOguQgn0QgEAtlu2zLT/ZwQP/vkA9w0OLDJ9 l54KqILfeClR+wXpYMEA/3/K8xqdTVtz1CCCVjS4UTVHRXsHKYwC5E0YAIP7LGIr =ZnHT -----END PGP SIGNATURE----- --------------enig9A756CAFC97D0FC86D2220F8--