grub dependencies

Bruce Dubbs bruce.dubbs at gmail.com
Mon Jun 20 09:18:56 PDT 2011


Andrew Benton wrote:
> On Sun, 19 Jun 2011 21:43:20 -0500
> Bruce Dubbs <bruce.dubbs at gmail.com> wrote:
> 
>> -------
>> The scripts in /etc/grub.d/ are quite complicated.  The also insist that 
>> the kernel names be in the form of
>>
>>     /boot/vmlinuz-* /vmlinuz-* /boot/kernel-*
>>
>> I like to name my kernels in the form of linux* so none were picked up.
>> I'm leaning towards just eliminating the use of grub-mkconfig other than 
>> for a warning not to use it.
> 
> I call my kernels bzImage so it doesn't work for me either.
> 
>> We can just use a
>>
>> cat  > /boot/grub/grub.cfg << "EOF"
>> ...
>> EOF
> 
> Works for me. 
> 
> set timeout=10
> 
> menuentry "Linux From Scratch" {
>    linux /boot/bzImage root=/dev/sdb2 quiet
> }
> 
> What more do you need? For me it's never needed any insmod or whatever
> 
>> If you already have GRUB2 loaded, upgrading is a bit trickier.  Running:
>>
>>    grub-install --grub-setup=/bin/true /dev/sda
>>
>> to an existing grub location (/boot/grub/ by default) will completely 
>> disable the ability to boot from the disk (including the grub command 
>> line) until you run:
>>
>>    grub-setup /dev/sda
>>
> 
> I don't follow you. Surely /boot/grub/ will be on the new LFS
> partition. How does that affect the currently installed grub/MBR?

Currently, I say:

"The location of the boot partition is a choice of the user that affects 
the configuration. One recommendation is to have a separate small 
(suggested size is 100 MB) partition just for boot information. That way 
each build, whether LFS or some commercial distro, can access the same 
boot files and access can be made from any booted system. If you choose 
to do this, you will need to mount the separate partition, move all 
files in the current /boot directory (e.g. the linux kernel you just 
built in the previous section) to the new partition. You will then need 
to unmount the partition and remount it as /boot. If you do this, be 
sure to update /etc/fstab."

Without that type of setup, updating the specific grub.cfg from another 
booted system requires a mount before editing.  You also have to copy 
any new kernel (and possibly system.map and config) you may want to use 
to the mounted /mnt/boot

The GRUB boot code that resides in the first track of the disk is not a 
part of any partition.  That code references the modules in /boot/grub. 
  If you change the modules with grub-install, but not change the 
program on the first disk track, grub is completely broken with 
unsatisfied internal references.

   -- Bruce



More information about the lfs-dev mailing list