All of lore.kernel.org
 help / color / mirror / Atom feed
From: Serbinenko Vladimir <serbinenko.vova@list.ru>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Scripting and keystrokes
Date: Mon, 13 Jun 2005 21:39:00 +0200	[thread overview]
Message-ID: <42ADE0D4.3080508@list.ru> (raw)
In-Reply-To: <200506132052.31588.okuji@enbug.org>

Yoshinori K. Okuji wrote:

>On Monday 13 June 2005 20:09, Serbinenko Vladimir wrote:
>  
>
>>Other idea: change menu syntax to select like command (see man bash) but
>>instead of prompting for number GRUB will write it to menu. What do you
>>think about it?
>>    
>>
>
>I am too stupid to imagine it. Can you show an example?
>
>
>  
>
I'm sorry that I wrote this letter too fast and w/o examples.
Example
If you write in normal bash:
select x in "Debian Linux" "Gentoo Linux" "Mandrake Linux";
do
    case "$x" in
        ("Debian Linux") 
            echo lets boot debian;
            break;;
       ("Gentoo Linux")
            echo lets boot gentoo;
            break;;
      ("Mandrake Linux")
            echo lets drake;
            break;;
    esac;
done
It will show
1) Debian Linux
2) Gentoo Linux
3) Mandrake Linux
And ask for number and then execute corresponding entry. If GRUB adapts
this syntax it will show menu
Debian Linux
Gentoo Linux
Mandrake Linux
ask use to choose and then boot corresponding entry.
Disadvantages:
    You must write two times the name.
Advantages:
    It's close to bash
    Sub-menus.
    "dynamic" menus (created by scripts)
    Easy creating of similar entries

select x in "Debian Linux" "Gentoo Linux" "Mandrake Linux network1"
"Mandrake Linux network2";
do
    case "$x" in
        ("Debian Linux") 
            echo lets boot debian;
            break;;
      ("Mandrake Linux "* )
            echo lets drake with PROFILE=${x:15};
            break;;
       ("Gentoo Linux")
            echo lets boot gentoo;
            break;;
    esac;
done

In this case script determines which value to pass in PROFILE variable.
Here it's not particularly advantaging but if you have more parameters.
like:
Mandrake Linux network1
Mandrake Linux network2
Mandrake Linux console network1
Mandrake Linux console network2
Mandrake Linux console nonfb network1
Mandrake Linux console nonfb network2
Mandrake Linux console nonfb failsafe network1
Mandrake Linux console nonfb failsafe network2

Script can check if keywords console, network1, network2, nonfb and
failsafe are present and boot corresponding config.
   
                                                                        
                                 Vladimir







  reply	other threads:[~2005-06-13 20:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-31 13:48 network support : memory management problem Vincent Guffens
2005-05-31 16:45 ` Vincent Guffens
2005-05-31 17:08   ` Marco Gerards
2005-06-06 10:03     ` Vincent Guffens
2005-06-08 19:38       ` Marco Gerards
2005-06-09 23:09         ` Vincent Guffens
2005-06-12  8:54           ` Scripting and keystrokes Serbinenko Vladimir
2005-06-13 18:09             ` Serbinenko Vladimir
2005-06-13 18:52               ` Yoshinori K. Okuji
2005-06-13 19:39                 ` Serbinenko Vladimir [this message]
2005-06-13 18:50             ` Yoshinori K. Okuji
2005-06-13 19:47               ` Serbinenko Vladimir
2005-05-31 22:56 ` network support : memory management problem Yoshinori K. Okuji

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=42ADE0D4.3080508@list.ru \
    --to=serbinenko.vova@list.ru \
    --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.