All of lore.kernel.org
 help / color / mirror / Atom feed
* [Design] savedefault
@ 2009-03-23 20:25 phcoder
  2009-03-23 23:01 ` Pavel Roskin
  0 siblings, 1 reply; 2+ messages in thread
From: phcoder @ 2009-03-23 20:25 UTC (permalink / raw)
  To: The development of GRUB 2

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-23 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-23 20:25 [Design] savedefault phcoder
2009-03-23 23:01 ` Pavel Roskin

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.