All of lore.kernel.org
 help / color / mirror / Atom feed
From: phcoder <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [Design] savedefault
Date: Mon, 23 Mar 2009 21:25:25 +0100	[thread overview]
Message-ID: <49C7F035.1090101@gmail.com> (raw)

Hello we had a discussion on IRC about implementing savedefault. We've 
found 3 possible solutions:
1) just add support for it in grub-mkimage in following way:
load_env

menuentry "menu entry 1" {
    default=0
    save_env
	....
}
menuentry "menu entry 2" {
    default=1
    save_env
	....
}

This method has disadvantage of the necessity of counting entries in 
grub-mkconfig. This is easily broken OS-specific script count entries 
wrong. Also it breaks if user adds entries manually in the middle of the 
file

2) Export a variable selected_menu. Then syntax would be sth like
load_env

menuentry "menu entry 1" {
    default=$selected_menu
    save_env
	....
}
menuentry "menu entry 2" {
    default=$selected_menu
    save_env
	....
}
3) Add label support syntax would be sth like:
default=ubuntu
menuentry --label ubuntu "Ubuntu" {
	....
}
And for savedefault it would be something like
load_env
menuentry --label linux_<random id> "Linux" {
    default=linux_<random id>
    save_env
	....
}


-- 

Regards
Vladimir 'phcoder' Serbinenko



             reply	other threads:[~2009-03-23 20:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 20:25 phcoder [this message]
2009-03-23 23:01 ` [Design] savedefault Pavel Roskin

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=49C7F035.1090101@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.