Alice Wonder wrote:
> Going through LFS 7.3 and about ready to make it bootable but Fedora's
> grub is giving me issue.
>
> The plan was to share /boot between LFS and Fedora 18 as I have done in
> the past (been awhile since I ran LFS - LFS 4.something last time I
> think). Hell, I've shared /boot between Fedora, CentOS, Ubuntu, and LFS.
> That was grub 1 and it was easy because /etc/grub was a symlink
> to /boot/grub - but it seems grub2 is not so KISS (or maybe it's just
> Fedora's butchering of grub2 ??).
>
> First problem - Fedora does not use /boot/grub - it uses /boot/grub2 but
> LFS (with grub2) uses /boot/grub
>
> Second problem - Fedora /boot/grub2/grub.cfg says not to hand edit it,
> which gives me the impression that if I do hand edit it, a Fedora kernel
> update is likely to wipe it. It says to modify files in /etc/grub.d -
> but Fedora's /etc/grub.d is only available when Fedora is booted, so
> when booted into other distros (like LFS) it won't be available.
>
> The solution I believe is to create a /boot for LFS on it's hard drive
> (I have separate physical disk, but this makes me sad - would be nice
> for people with one HDD to be able to do this) and have a Fedora grub
> entry that tells its grub to load the LFS /boot on sdd - kind of like
> grub can load a Windows boot loader.

Every distro wants to do their own thing.  Most will automatically 
change from what you have to their custom eye candy.

You really have a couple of choices.  One choice is to install grub2 per 
the LFS instructions.  Then edit the /boot/grub/grub.cfg file to 
manually add menuentries for any other desired entries.  This bypasses 
the eye candy and shortens up the grub.cfg.

My .cfg only has a few lines before the menuentries:

set default=0
set timeout=5
insmod ext2
set root=(hd0,1)

The menuentries for other distros really only need:

menuentry "Some descriptive title" {
   linux  kernel kernel-options
   initrd initrd-image
}

Note that this is a lot faster too.

Specifying where the kernel and initrd are located depends on your 
setup.  If you or a distro have used a separate partition for /boot, 
then it's just /kernel-name.  If it's on a partition, then it may be 
something like (hd0,7)/boot/kernel-name

The only drawback to this is if you get a new distro or install an 
update to the kernel in a distro, it will probably try to reinstall grub 
the way it wants to instead of the way you want to.

The other option is to use the distro that controls grub to find your 
LFS kernel and hope it adds it correctly for you.  The last time I ran 
grub-mkconfig (which is what the distros do), I had about 48 entries. 
Over 30 of the entries were nonsense.  You still need to edit the file 
after that, IMO.  The .cfg file name may also change.  As you note, they 
name it /boot/grub/grub2.cfg, but it needs to be the one on the 
partition that fedora recognizes as /boot.  That's the file that needs 
to be edited if you let them control.

The solution to distros overwriting your grub.cfg is to keep a backup.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to