LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Horrible ordeal trying to boot LFS. Tried older version - won't boot either (https://www.linuxquestions.org/questions/linux-from-scratch-13/horrible-ordeal-trying-to-boot-lfs-tried-older-version-wont-boot-either-808135/)

Lyle 05-16-2010 06:45 AM

Horrible ordeal trying to boot LFS. Tried older version - won't boot either
 
I spent days on 6.6, finally i gave up, i couldnt get it to boot it would have a kernel panic.... Now i tried 6.5 since 6.6 didnt work. Now grub wont compile, i assume its because i have an x64, the book says to use LILO instead in that case, but provides no instructions as to how to do that, and grub is bad enough with instructions so im not going at LILO blind, so i follow the instructions for grub2 from 6.6 instead...

Now i reboot for the test and i am able to get to command prompt for grub2. Following the book (6.6) type
Code:

grub> root (h0,1)
it finds it and thinks its ext2 (i thought its ext3 but whatever). Than i try the next command
Code:

grub> kernel /boot/grub/core.img
but it says it can't find it (even though its there) so im unable to boot of course......

Before when i issued
Code:

grub-mkconfig -o /boot/grub/grub.cfg
it put the path to the root and kernel. This time it put almost nothing. This is my current grub.cfg

Code:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=0
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###


Now my computer is partitioned with lfs on the very first partition. I told it (hd0,1) which as i understand is correct for grub2. I really have no clue what if anything i am doing wrong or if lfs or linux in general has developed a soul to hate me with, but id really like to make it boot?

EricTRA 05-16-2010 09:20 AM

Hello,

It's so strange that you didn't get it to work. There must be some typo made along the way. I'm no expert at all and I got mine running. Can you mount (since you cannot boot) the LFS partition and post the output of
Code:

ls <mountpoint>/boot
Kind regards,

Eric

Lyle 05-16-2010 09:57 AM

Quote:

Originally Posted by EricTRA (Post 3970508)
Hello,

It's so strange that you didn't get it to work. There must be some typo made along the way. I'm no expert at all and I got mine running. Can you mount (since you cannot boot) the LFS partition and post the output of
Code:

ls <mountpoint>/boot
Kind regards,

Eric

ls */boot
Code:

config-2.6.30.2  grub  lfskernel-2.6.30.2  System.map-2.6.30.2

EricTRA 05-16-2010 10:34 AM

Hello,

From the LFS 6.6 book, page 214 (Linux-2.6.32.8) comes this quote:
Quote:

The filename below can be changed to suit your taste, but the stem of the filename should be vmlinux to be compatible with the automatic setup of the boot process described in the next section. The following command assumes an x86 architecture:
Code:

cp -v arch/x86/boot/bzImage /boot/vmlinux-2.6.32.8-lfs-6.6

You apparently didn't follow the book as you should because your kernel image has the name
Code:

lfskernel-2.6.30.2
which, following the book, is advised to begin with vmlinux to be compatible with the boot setup.

Can you check and redo the kernel part and the GRUB part? I'll bet you'll have better results then. Just follow the book and don't change anything to customize to your likings unless you know exactly what your doing and to what packages your changes might affect.

Kind regards,

Eric

EricTRA 05-16-2010 10:59 AM

Hi,

Please disregard my previous post, I just checked the LFS 6.5 book which mentions the lfskernel name. That's apparently a change they made in 6.6 using the new Grub.

I'd just try to run the Grub part again to see if it detects your kernel correctly.

Kind regards,

Eric

Lyle 05-17-2010 02:51 AM

Quote:

Originally Posted by EricTRA (Post 3970552)
which, following the book, is advised to begin with vmlinux to be compatible with the boot setup.

Ok, that was why it wasnt booting. Now its able to boot to the LFS bootloader, but crashes from there. Im thinking it just doesnt work on 64 bit machines without a 32 bit host.

EricTRA 05-17-2010 02:59 AM

Hi Lyle,

A question, have you compiled everything for 32bit environment and changed to 64bit where packages indicated what should be done for 64bit? Having a 64bit CPU doesn't mean you HAVE to compile for that architecture. You can perfectly compile everything, just following the book, for a 32bit platform. I haven't tried to compile a full 64bit LFS yet but from what I've noticed reading the book, it doesn't always seem clear where you need to apply changes all the time.

Also once you have compiled everything following the LFS book you should be able to boot into LFS. The host is not needed any more after the full completion of the LFS book. You should be able to boot into it, if not then most likely you have made a mistake.

I remember from my last run loosing 4 hours just because of a space character I typed in by mistake.

Kind regards,

Eric

Lyle 05-20-2010 12:39 PM

Quote:

Originally Posted by EricTRA (Post 3971128)
Hi Lyle,

A question, have you compiled everything for 32bit environment and changed to 64bit where packages indicated what should be done for 64bit?

I don't recall anything specific to 64-bit except some symlinks which i did do. Did i overlook something?

EricTRA 05-20-2010 12:42 PM

Hi,

Since I only did the 32bit part I wouldn't be able to tell you, but I assume it's a 'tricky' part that has to be well looked at so that your system can find the correct libraries.

Kind regards,

Eric

exvor 05-20-2010 08:56 PM

This illustrates why I hate grub2.... I really wish LFS would have stayed with legacy_grub since grub2 is still considered experimental.

for the OP what I am wondering is if you are trying to boot the disk image or what. Or do you just name your kernels with the .img extension?


All times are GMT -5. The time now is 12:36 PM.