Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] booting to grub prompt, but config works
Date: Sat, 10 May 2008 18:57:58
Message-Id: 200805102057.27611.alan.mckinnon@gmail.com
In Reply to: Re: [gentoo-user] booting to grub prompt, but config works by Mark Knecht
1 On Saturday 10 May 2008, Mark Knecht wrote:
2 > On Sat, May 10, 2008 at 1:55 AM, Alan McKinnon
3 > <alan.mckinnon@×××××.com> wrote: <SNIP>
4 >
5 > > # change menu.lst to grub.conf
6 > > if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ;
7 > > then
8 > > mv -f "${dir}"/menu.lst "${dir}"/grub.conf
9 > > ewarn
10 > > ewarn "*** IMPORTANT NOTE: menu.lst has been renamed
11 > > to grub.conf"
12 > > ewarn
13 > > fi
14 > >
15 > >
16 > > it's called essentially this way in post_inst():
17 > >
18 > > setup_boot_dir /boot
19 > >
20 > > what it does is in essence:
21 > >
22 > > 1. fail if /boot does not exist
23 > > 2. create /boot/boot as a link to /boot
24 > > 3. create /boot/grub
25 > > 4. if you don't have a grub.conf and do have a menu.lst then rename
26 > > it to grub.conf
27 > >
28 > >
29 > >
30 > > --
31 > > Alan McKinnon
32 >
33 > Yeah, it was that last bit that I wondered about. So, assuming you do
34 > have a grub.conf what happens? Does nothing in the ebuild ever make
35 > the menu.lst->grub.conf link? Did older ebuilds make this link? I
36 > have no recollection of making one by hand.
37
38 The code only does what is in the code :-) But I seem to have missed
39 this bit which comes right after the bit I quoted above:
40
41 if [[ ! -e ${dir}/menu.lst ]]; then
42 einfo "Linking from new grub.conf name to menu.lst"
43 ln -snf grub.conf "${dir}"/menu.lst
44 fi
45
46 Obviously, if you don't have menu.lst it is created as a symlink to
47 grub.conf
48
49 However, the compile step of the ebuild doesn't write even a template
50 grub.conf, this is what you get after compilation:
51
52 nazgul portage # ls -al sys-boot/grub-0.97-r5/image/boot/grub/
53 total 36
54 drwxr-xr-x 2 root root 80 May 10 20:42 ./
55 drwxr-xr-x 3 root root 72 May 10 20:42 ../
56 -rw-r--r-- 1 root root 33856 May 10 20:42 splash.xpm.gz
57
58 Presumably the user must do this manually. It's been so long since I've
59 done this I forget how it works - I routinely just scp a working
60 grub.conf from a working setup on another machine.
61
62 The make-links setup steps in the ebuild are obviously there for the
63 case when grub is remerged in the future
64
65 > The GNU grub manual I found online talks only about menu.lst. Is
66 > having a grub.conf file a Gentoo thing? I've run *almost* nothing but
67 > Gentoo for 8 years now so I have no real knowledge of how other
68 > distros set this up.
69
70 Red Hat definitely uses grub.conf
71 Debian/Ubuntu definitely use menu.lst
72 from my experience. Different distros tend to do different things with
73 these files, some barf if what they are looking for is absent, some
74 don't.
75
76 For a long time now I've just always had a grub.conf and make a symlink
77 if menu.lst doesn't exist
78
79 --
80 Alan McKinnon
81 alan dot mckinnon at gmail dot com
82
83 --
84 gentoo-user@l.g.o mailing list