LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 7.1 First Boot, grub error (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-7-1-first-boot-grub-error-4175444890/)

stoat 01-13-2013 06:15 PM

Maybe it's just a typo. These are different...
Quote:

Originally Posted by engineer in post #26
Code:

[root@localhost boot]# ls
config-3.2.6  grub  System.map-3.2.6  vmlinuz-3.2.6-lfs.7.1


Quote:

Originally Posted by engineer in post #28

I've also checked that the files were copied in Section 8.3 (vmlinuz-3.2.6-lfs-7.1, System.map-3.2.6, and config-3.2.6) were all placed in the /boot directory of the /mnt/lfs partition for the LFS system.


stoat 01-14-2013 03:41 PM

Quote:

Originally Posted by engineer in post #28

Where does grub look for the information to choose which kernels (or OS) to display for selection on booting? Is this the information in the grub.cfg file? If so, it is correctly reading that file, since the kernel listed in Grub's boot menu is the 3.2.6 lfs kernel. Once I choose a kernel to boot, where does Grub look for the image (or what tells grub where to look for the image)?

GRUB 2 is more complicated, does more things, and has components with new names, but it still works basically a lot like legacy GRUB did. In a traditional BIOS-MBR setup like yours (I think), a small program (boot.img) is embedded in the master boot record of the first hard drive and is executed at boot time. That little program loads and executes a bigger one (a copy of core.img) that usually and traditionally is embedded in the normally unused sectors between the master boot record and the first partition (nowadays, this copy of core.img goes in other places for GPT drives and EFI computers). The core.img program includes modules to access the file system where it finds the grub.cfg file and other needed modules. It creates the menu screen using the information in grub.cfg. You select something from the menu and core.img uses the information in the grub.cfg file to find the boot files to load and execute, to load other modules that may be needed, and to pass parameters to the kernel.

If you are using the boot loader of another system (such as Fedora's) to boot LFS, then its boot.img and core.img were embedded and its grub.cfg is being used, so that menuentry stuff you have been agonizing over needs to be in Fedora's grub.cfg. In that case, a grub.cfg in the LFS /boot partition would not be needed nor used. But if you installed LFS's GRUB in the master boot record (with the grub-install /dev/sda command), then LFS's core.img was embedded and its grub.cfg is being used and where your menuentry stuff has to go and be accurate.

engineer 01-14-2013 07:04 PM

Quote:

Originally Posted by stoat (Post 4869301)
Maybe it's just a typo. These are different...

Well, I owe you a cold beverage.

After I fixed the typo, it booted. Facepalm.

engineer 01-14-2013 07:27 PM

Quote:

Originally Posted by engineer (Post 4870102)
Well, I owe you a cold beverage.

After I fixed the typo, it booted. Facepalm.

I've been trying to not be lazy and type the commands so that I could learn them. Turns out this isn't the first time that plan backfired.


All times are GMT -5. The time now is 03:09 AM.