Hi all, I remember from the times of SuSE 7.x, when after installing SuSE along with Windows 9x and 2k, the reboot menu has the option of rebooting one of the OS'es installed i.e. one could reboot into windows from linux without having to wait for the boot menu and press up or down to select the OS. Times has changed, now with grub we boot even the NSA systems (if well hacked i'm sure we can!) but, in my ignorance, such a feature was kind of interesting and i am particularly interested in having it back...So question is : How can one change the next boot within linux without making it definitive ? i know i can edit menu.lst and change the default entry but then, next reboot i will have to press a key to chose linux instead of windows, change the file again and so on...call me lazy if you want, but it really will save me a lot of time... I've digging and googling around, i've learned a lot about boot process, grub and lilo but still haven't found anything... I will appreciate any help (docs, tips, man pages - oh yes, RTFM - ) :-] Cheers -- Macintosh for Productivity, Linux for Development Palm for Mobility, Windows for Solitaire .-. Datacorp IT /v\ We Run SuSE // \\ *The LINUX Experts* Miguel Albuquerque /( )\ 15 Chemin Bessinge ^^-^^ 1223 Cologny,GE - CH Mobile +41 79 543 1935 http://counter.li.org Linux user #301007 http://www.datacorp.ch
On Thursday 30 September 2004 13:24, Miguel Albuquerque wrote:
How can one change the next boot within linux without making it definitive ?
If you use LILO then you can issue the command (as root): # lilo -R Name_of_bootable_image_configured_in_lilo.conf regards Jonas -- Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. -Andrew S. Tanenbaum. Computer Networks.
Thank you very much, works great ! So should I assume that with grub i can't do the same ? :-[ Cheers On Thu, 2004-09-30 at 13:59, Jonas Helgi Palsson wrote:
On Thursday 30 September 2004 13:24, Miguel Albuquerque wrote:
How can one change the next boot within linux without making it definitive ?
If you use LILO then you can issue the command (as root):
# lilo -R Name_of_bootable_image_configured_in_lilo.conf
regards Jonas
-- Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. -Andrew S. Tanenbaum. Computer Networks. -- Macintosh for Productivity, Linux for Development Palm for Mobility, Windows for Solitaire
.-. Datacorp IT /v\ We Run SuSE // \\ *The LINUX Experts* Miguel Albuquerque /( )\ 15 Chemin Bessinge ^^-^^ 1223 Cologny,GE - CH Mobile +41 79 543 1935 http://counter.li.org Linux user #301007 http://www.datacorp.ch
On Thursday 30 September 2004 15:37, Miguel Albuquerque wrote:
Thank you very much, works great ! So should I assume that with grub i can't do the same ? :-[
Here is a small script that I bashed together a few months ago: ----8<----8<--[bootonce]--8<----8<----8<---- #! /bin/bash # BASH script to use GRUB's boot-once feature GRUB_ENTRY_COUNT=`grep "^[[:blank:]]*title\>" /boot/grub/menu.lst | wc --lines` function is_number() { echo "$1" | egrep -q '^[0-9]+$' } function is_entry() { is_number $1 && [ $1 -ge 0 -a $1 -lt $GRUB_ENTRY_COUNT ] } function usage() { local i echo "Usage: ${0##*/} [0..$[ GRUB_ENTRY_COUNT - 1 ]]" grep "^[[:blank:]]*title\>" /boot/grub/menu.lst | sed 's:^[[:blank:]]*[Tt][Ii][Tt][Ll][Ee][[[:blank:]]\+::' | while read S; do echo "$[ i ]: $S" (( i++ )) done exit 1 } # See if there's a --stage2= option in /etc/grub.conf: [ -f "/etc/SuSE-release" ] && STAGE2="`sed -n '/--stage2=/ s/^.*--stage2=\([^[:blank:]]*\).*$/\1/p' /etc/grub.conf`" # If the file does not exist, remove the STAGE2 variable [ -f "$STAGE2" ] || unset STAGE2 # For debugging put a comment sign in front of the next line: GRUB="grub --batch" # Allow only one parameter is_entry $1 || usage ${GRUB-cat} <<EOF savedefault ${STAGE2+--stage2=$STAGE2} --default=$1 --once quit EOF ---->8---->8---->8---->8---->8---- Watch out if your mail client wraps long lines! Usage: bootonce [entry_number] Without parameters, it displays available entries in GRUB. With a parameter, it sets the GRUB entry to boot into at next boot only. A typical sequence would be: $ bootonce 0: Linux 1: Windows $ bootonce 1 shutdown -r now Instead of 'shutdown -r now', one can logout of KDE, and choose 'Reboot' from the KDM menu. Works for me. The 'bootonce' script is for GRUB only. Cheers, Leen
participants (3)
-
Jonas Helgi Palsson
-
Leendert Meyer
-
Miguel Albuquerque