Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Making Grub boot once into a specific profile?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Clapper
Apprentice
Apprentice


Joined: 29 Sep 2003
Posts: 177

PostPosted: Sat Dec 31, 2005 9:44 pm    Post subject: Making Grub boot once into a specific profile? Reply with quote

My goal is to have a button in KDE that, once clicked, will log me out, reboot the system, and choose a specific grub profile to boot into (windows, for games), but only boot directly into that profile once. When I reboot out of Windows, I'd like the normal grub menu to come up, which, naturally, has my Gentoo installation as the default.

How can I do this?

Someone had posted this small script:

Code:

!/bin/sh

# a simple script to reboot into windows once without user
# intervention.  Assumes that the menu listing corresponding to
# windows at least has "win" in the title.  If it doesn't, you can
# change the WINSTRING variable below.

mount /boot

WINSTRING=Windows
GRUBMENU=/boot/grub/menu.lst

let "WINNUM = `grep title $GRUBMENU | grep -in $WINSTRING | cut -d: -f1` - 1"
#echo "num is $WINNUM"
/sbin/grub --device-map=/boot/grub/device.map --batch savedefault --default=$WINNUM --once
quit
/usr/bin/reboot



Which looks like it does what I need. Unfortunately, from what I can tell, Grub has changed, and the "--default --once" options to the /sbin/grub line, above, cause errors.

There is probably a simple way to to this, I just don't know what it is!
Back to top
View user's profile Send private message
dspgen
Tux's lil' helper
Tux's lil' helper


Joined: 17 Aug 2005
Posts: 103

PostPosted: Sat Dec 31, 2005 9:48 pm    Post subject: Reply with quote

I'd like an answer to this also, cause it would be useful for doing remote kernel updates
Back to top
View user's profile Send private message
widremann
Veteran
Veteran


Joined: 14 Mar 2005
Posts: 1314

PostPosted: Sat Dec 31, 2005 10:14 pm    Post subject: Reply with quote

Lilo can do this. In fact, KDE already has built in support for using Lilo in such a fashion.
Back to top
View user's profile Send private message
Clapper
Apprentice
Apprentice


Joined: 29 Sep 2003
Posts: 177

PostPosted: Sat Dec 31, 2005 11:49 pm    Post subject: Reply with quote

Yes, I know lilo can do this. I hate to leave Grub just to be able to do this though....
Back to top
View user's profile Send private message
cynric
Guru
Guru


Joined: 08 Oct 2004
Posts: 439

PostPosted: Sun Jan 01, 2006 10:17 pm    Post subject: Reply with quote

No idea, but I'd like to know if you come up with anything. Here are some links I've found:

http://www.linuxquestions.org/questions/showthread.php?postid=756404
http://www.pcworld.com/howto/article/0,aid,118200,00.asp -- scroll down for grub
http://www.linuxjournal.com/article/4622 -- 2nd hit on find for "next boot"; its reply was intersting too

Hope something there sparks an answer.
Back to top
View user's profile Send private message
Kovid
Apprentice
Apprentice


Joined: 25 Aug 2003
Posts: 217
Location: California, USA

PostPosted: Mon Jan 02, 2006 12:13 am    Post subject: Reply with quote

info grub
Look into the savedefault command. If you can't figure it out, I'll post a link to a script I use.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum