FYI

-----------------
For grub-1.98 !!!
-----------------

http://ubuntuforums.org/showthread.php?t=1195275
describes a way to save the last chosen boot option to default

Involved is /etc/default/grub file which must be user created:
==============================================
cat > /etc/default/grub << EOF
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
#GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_LINUX_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
EOF
============================================
There is no silly update-grub command, so use grub-mkconfig to update.


------------------------------------
For grub-1.98, there is broken build
http://www.mail-archive.com/grub-de...@gnu.org/msg15254.html
------------------------------------
One solution that worked is to NOT build in a separate build directory.

E.g., instead of:
mkdir build
cd build
../configure --bla-bla-bla
make

Do:
./configure --bla-bla-bla
make

----------------------------------------
Grub-1.98 puts 3 lines in a common area which can (should?) be removed
in the individual "menuentry" blocks:
insmod ext2
set root='([drive],[partition])'
search --bla-bla-bla

Since the search is redundant of set root, it is not necessary.

Since the silly 'echo Loading linux ...' will scroll off almost
immediately it is not necessary.

The resulting grub.cfg I got (after removing redundant and silly) was:
=============================================
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="${saved_entry}"
if [ ${prev_saved_entry} ]; then
  set saved_entry=${prev_saved_entry}
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
  fi
}
insmod ext2
set root='(hd4,10)'
search --no-floppy --fs-uuid --set 11b62acd-ee91-43f7-a619-c4b5cb5fa5e7
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=10
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "GNU/Linux, with Linux 2.6.33.5" --class gnu-linux --class
gnu --class os {
        savedefault
        linux   /boot/vmlinux-2.6.33.5 root=/dev/sdd10 ro
}
menuentry "GNU/Linux, with Linux 2.6.33" --class gnu-linux --class gnu
--class os {
        savedefault
        linux   /boot/vmlinux-2.6.33 root=/dev/sdd10 ro
}
menuentry "GNU/Linux, with Linux 2.6.32.8" --class gnu-linux --class
gnu --class os {
        savedefault
        linux   /boot/vmlinux-2.6.32.8 root=/dev/sdd10 ro
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
=========================================================

This has some variance with what is in lfs/dev for grub-1.98.

Those --class businesses are probably silly.

I (think) used this sequence which produced a good result:
* create /etc/default/grub
* grub-install --grub-setup=/bin/true /dev/sdd
* grub-mkconfig -o /boot/grub/grub.cfg

I rebooted and chose menuentry "GNU/Linux, with Linux 2.6.33"
and (amongst other grub garbage) /boot/grub/grubenv contained:
saved_entry=GNU/Linux, with Linux 2.6.33

On subsequent reboot, this was the default.

The lfs/dev updated language involving search looks sensible.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to