Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 135228 - grub 0.96-r2 do not use /boot/grub/defaultfile
Summary: grub 0.96-r2 do not use /boot/grub/defaultfile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-01 21:46 UTC by Xuefer
Modified: 2006-06-04 19:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xuefer 2006-06-01 21:46:09 UTC
package: sys-boot/grub-0.96-r2
cpu piii (vmware)
gcc 3.4.5
# uname -a
Linux gentoo 2.6.16-gentoo-r6 #10 Fri Jun 2 11:28:41 CST 2006 i686 Pentium III (Coppermine) GNU/Linux
emerge --info:
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium3 -mfpmath=sse -mmmx -msse -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -pipe -funroll-all-loops -ftracer -funit-at-a-time -fpeel-loops -funswitch-loops"
CHOST="i686-pc-linux-gnu"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s"

grub.conf:
timeout 3
default saved
fallback 0

title GNU/Linux
root (hd0,1)
kernel /boot/vmlinuz-2.6.16-gentoo-r6 root=/dev/hda2
savedefault

title GNU/Linux
root (hd0,1)
kernel /boot/vmlinuz-2.6.16-gentoo-r6 root=/dev/hda2
savedefault fallback

grub installtion:
    GNU GRUB  version 0.96  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> find /boot/grub/default    
 (hd0,1)
grub> root (hd0,
 Possible partitions are:
   Partition num: 0,  Filesystem type unknown, partition type 0x2d
   Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 4,  Filesystem type unknown, partition type 0x82
   Partition num: 5,  Filesystem type unknown, partition type 0x2d
   Partition num: 6,  Filesystem type unknown, partition type 0x2d
   Partition num: 7,  Filesystem type unknown, partition type 0x2d
   Partition num: 8,  Filesystem type unknown, partition type 0x2d

grub> root (hd0,1)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,1)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

grub> quit
(the Filesystem type unknown is because i'm not using 2 linux/swap partitions not the whole disk for vmware.

# cat /boot/grub/default 
1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.

reboot

the grub always default to 0 (first) item, and gives an error:
  Booting command-list

root (hd0,1)
 Filesystem type is ext2fs, partition type 0x83
kernel /boot/vmlinuz-2.6.16-gentoo-r6 root=/dev/hda2
   [Linux-bzImage, setup=0x1400, size=0x196421]
savedefault

Error 1: Filename must be either an absolute pathname or blocklist

Press any key to continue...

c to
grub> find /boot/grub/default
 (hd0,1)

grub>

no problem with 0.97-r2
Comment 1 Xuefer 2006-06-01 21:57:48 UTC
changed to "blocker"

the savedefault/fallback is really for making robust sys-boot, why just block there with "Press any key to continue" ? is it possible to have grub ignore error/unknown commands if and only if when it's selected automaticly (by count down) ? it may be a feature request to have something like adding a new command "ignoreerrors".
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-06-02 02:18:14 UTC
Works just fine here, you are doing something wrong. And I'm really curious how do you know which one it actually boots, having two identical items is just about completely useless for diagnosing anything.
Comment 3 Xuefer 2006-06-02 19:28:44 UTC
i did have problem with 1 of remote servers, while the other 2 looks fine. have to get ppl to modify the menu and boot it up.
and yes, having two identical items is useless, but that's only for my local testing.
> And I'm really curious how do you know which one it actually boots
so.. i can always see which menu it selected automatically. i've also try different testing with "savedefault" too, as in grub manual (info grub)

what cflags/ldflags would u suggest? i could try to recompile if you need.

> Works just fine here, you are doing something wrong
i hope so, but when i:
1. emerge grub 0.97, it just works. (with or without setup again)
2. emerge grub 0.96, fail again. (with or without setup again)
i can reproduce it by doing 1 2 1 2 ...
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-06-03 00:41:14 UTC
(In reply to comment #3)
> what cflags/ldflags would u suggest? i could try to recompile if you need.

Your ricer flags are irrelevant, grub ignores them all unless you did set USE="custom-cflags". If you did, just close this bug as INVALID, it's completely unsupported.

> > Works just fine here, you are doing something wrong
> i hope so, but when i:
> 1. emerge grub 0.97, it just works. (with or without setup again)
> 2. emerge grub 0.96, fail again. (with or without setup again)
> i can reproduce it by doing 1 2 1 2 ...

All I'm saying is that booting two identical kernel is a bad way to test grub-set-default feature. Does the number in /boot/grub/default change back to 0 after reboot? If it does, then grub-set-default works as expected.

Does this fix the error you get?

title GNU/Linux
root (hd0,1)
kernel (hd0,1)/vmlinuz-2.6.16-gentoo-r6 root=/dev/hda2
savedefault
Comment 5 Xuefer 2006-06-04 02:18:34 UTC
> Your ricer flags are irrelevant, grub ignores them all unless you did set
> USE="custom-cflags". If you did, just close this bug as INVALID, it's
> completely unsupported.
thanks for this tips. i have no custom-cflags in USE flags. sorry for missing the USE flags:
USE="-X -ia64 -ppc -mips -java -doc -ipv6 -opengl -motif -gtk -gtk2
-perl -glx -xv -gpm
-sdl -alsa -apm -arts -avi -cups -eds -emboss -encode -fortran -gnome -spell
-apache2
jikes withsamplescripts
truetype bzip2 fam sdk toolbar
fastcgi cgi sqlite silvercity enscript server
nptl nptlonly cairo readline
multislot unicode utf-8 utf8
python python2.4 xml2 sed zh_CN cjk
acc bitmap-fonts
extensions threads idn
mmxext mp mmx sse mtrri bash-completion cscope termcap-compat"

> All I'm saying is that booting two identical kernel is a bad way to test
> grub-set-default feature. Does the number in /boot/grub/default change back to
> 0 after reboot? If it does, then grub-set-default works as expected.
nope, but i can even cat it under grub, it's 1 with some comments followed


with
kernel (hd0,1)/vmlinuz-2.6.16-gentoo-r6 root=/dev/hda2
savedefault
=> Error 15 file not found

with
kernel (hd0,1)/boot/vmlinuz-2.6.16-gentoo-r6 root=/dev/hda2
savedefault
=> Error 1: Filename must be either an absolute pathname or blocklist

with
kernel (hd0,1)/boot/vmlinuz-2.6.16-gentoo-r6 root=/dev/hda2
(without savedefault)
=> no problem

i wish i can see what path/file that grub is looking for the "default"
Comment 6 Xuefer 2006-06-04 19:32:48 UTC
i can confirm that this bug is fixed in grub 0.96-r3, inside grub-0.96-patches-1.0.tar.bz2 patch/100_all_grub-cvs-stage2-init.patch http://bugs.gentoo.org/83287
but -r3 is ~x86 unstable (contains other "fix")

thanks for you time