View previous topic :: View next topic |
Author |
Message |
Clapper Apprentice
Joined: 29 Sep 2003 Posts: 177
|
Posted: Sat Dec 31, 2005 9:44 pm Post subject: Making Grub boot once into a specific profile? |
|
|
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 |
|
|
dspgen Tux's lil' helper
Joined: 17 Aug 2005 Posts: 103
|
Posted: Sat Dec 31, 2005 9:48 pm Post subject: |
|
|
I'd like an answer to this also, cause it would be useful for doing remote kernel updates |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sat Dec 31, 2005 10:14 pm Post subject: |
|
|
Lilo can do this. In fact, KDE already has built in support for using Lilo in such a fashion. |
|
Back to top |
|
|
Clapper Apprentice
Joined: 29 Sep 2003 Posts: 177
|
Posted: Sat Dec 31, 2005 11:49 pm Post subject: |
|
|
Yes, I know lilo can do this. I hate to leave Grub just to be able to do this though.... |
|
Back to top |
|
|
cynric Guru
Joined: 08 Oct 2004 Posts: 439
|
|
Back to top |
|
|
Kovid Apprentice
Joined: 25 Aug 2003 Posts: 217 Location: California, USA
|
Posted: Mon Jan 02, 2006 12:13 am Post subject: |
|
|
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 |
|
|
|
|
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
|
|