All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: Syntax options for dynamic menu generation in grub-script
Date: Fri, 03 Sep 2010 14:22:40 +0200	[thread overview]
Message-ID: <4C80E890.9010301@gmail.com> (raw)
In-Reply-To: <AANLkTimoAULKAuVC82H8QwfYcYW3-_at=zGFKMnh_0Hk@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2132 bytes --]

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=
> 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.
>
>   
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:
>
>
>
>   
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=$device
    multiboot $core
  }
"
It looks for me that the second approach is simply trying to solve 2 problems at the same time.
Actualy 2 interfaces aren't contradictory. We may have an additional command menuentry_eval for second interface and then we can let the coders decide.



-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

      parent reply	other threads:[~2010-09-03 12:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24  6:03 Syntax options for dynamic menu generation in grub-script Jordan Uggla
2010-08-25  8:38 ` BVK Chaitanya
2010-09-03 12:22 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C80E890.9010301@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.