Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub Error 13
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Onizuka
n00b
n00b


Joined: 10 Feb 2004
Posts: 2

PostPosted: Tue Feb 10, 2004 5:15 am    Post subject: Grub Error 13 Reply with quote

Gentoo noob here, doing my second Gentoo install, the first on my Athlon 1 Ghz machine. I did a stage 1 install, and everything apparently looked fine (yay!). I manually compiled the 2.6.1-gentoo-r1 kernel from gentoo-dev-sources. I've never really compiled a kernel before, so I tried to keep it pretty basic and only chose the things I knew were essential. When I try to boot into it from Grub, I get "Error 13: Invalid or unsupported executable format". Ok, well at least I know I've set up Grub correctly, because I'm getting this far in the first place.

I followed the handbook instructions for installing the kernel. I did the following:

emerge gentoo-dev-sources
then made sure /usr/src/linux was right (it was)
cd /usr/src/linux
make menuconfig

when done, saved the config
then per the config, did make && make modules_install
(from the "For other systems, 2.6 kernel" - is this right or should I follow the 2.4 steps with the make dep and make bzImage?)

then cp vmlinux /boot/kernel-2.6.1-gentoo-rc1
cp System.map /boot/System.map-2.6.1-gentoo-rc1

in my make.conf i'm using CHOST="i686-pc-linux-gnu" and
CFLAGS="-O3 -march=i686 -funroll-loops -pipe -fomit-frame-pointer"

...uh oh, just saw the athlon option for -march - should I be using this instead?

Anyway I also made sure to pick Athlon/K7/Duron whatever option when configuring my kernel. Any ideas what I'm doing wrong?
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Tue Feb 10, 2004 5:58 am    Post subject: Reply with quote

You should be using the -march=athlon CFLAG. Or, just to be safe, you could try the -mcpu=athlon instead. Also make sure you have support for ELF binaries in the kernel (this is most likely the problem). You should probably include support for AOUT and MISC binaries also:
Code:
#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_MISC=y

_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Tue Feb 10, 2004 6:00 am    Post subject: Reply with quote

In make menuconfig:
Code:
Executable file formats  --->
[*] Kernel support for ELF binaries
<*> Kernel support for a.out and ECOFF binaries
<*> Kernel support for MISC binaries

_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
Skystorm
n00b
n00b


Joined: 15 Aug 2003
Posts: 24
Location: Göteborg, Sweden

PostPosted: Wed Feb 11, 2004 4:06 am    Post subject: Reply with quote

Hi everybody,

I am in the process of installing Gentoo on my laptop (already done that before on a desktop computer) and now I have the very same problem.

The laptop uses a Mobile Celeron 800 (Coppermine), so I am pretty sure my march-flag ist set correctly to "pentium3" (but I already tried mcpu instead, no success).

I also have all the above options for executable file formats set in my kernel (gentoo-dev-sources-2.6.2), but nevertheless Grub gives me error 13... :(

I followed the steps in the Gentoo Installation Handbook; compiled the kernel with "make && make modules_install".

Thanks in advance,
Skystorm
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Wed Feb 11, 2004 6:25 am    Post subject: Re: Grub Error 13 Reply with quote

Onizuka wrote:
then per the config, did make && make modules_install
(from the "For other systems, 2.6 kernel" - is this right or should I follow the 2.4 steps with the make dep and make bzImage?)

then cp vmlinux /boot/kernel-2.6.1-gentoo-rc1
cp System.map /boot/System.map-2.6.1-gentoo-rc1


I think I have found the problem here! You were following the "for other systems" instructions because you have an athlon, and I didn't clue into it because I don't browse there! Anyway the kernel image you want to use is not the vmlinux but the bzImage, so do this:
Code:
mount /boot
cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel-2.6.1-gentoo-rc1

and I'm sure this will take care of your problem. :wink:
_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
Onizuka
n00b
n00b


Joined: 10 Feb 2004
Posts: 2

PostPosted: Thu Feb 12, 2004 2:26 am    Post subject: Reply with quote

I just finished doing a complete reinstall from stage 1 to fix my problem with using the wrong march type. Still have the same problem, but I'll try compiling the kernel with the steps listed under "for x86-based systems, 2.4 kernel"

so I do:
make bzImage modules modules_install ?

I heard that you shouldn't do make dep any more for 2.6. The reason I did just the make && make modules_install was that section was the only one that dealt with the 2.6 kernel, along with people's experiences in other places. Someone should update the install handbook to be a little more explicit :)
_________________
Now is the winter of your discontent!
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Thu Feb 12, 2004 2:30 am    Post subject: Reply with quote

Your make command was fine. The problem is an Athlon is an x86 CPU, so you should follow the instructions for an x86 compiling a 2.6 kernel. The compile/install process is:
Code:
cd /usr/src/linux
make menuconfig
make && make modules install
mount /boot
cp arch/i386/boot/bzImage /boot/kernel-2.6.1-gentoo-rc1

You don't need to make dep for 2.6.
The only problem was:
Code:
cp vmlinux /boot/kernel-2.6.1-gentoo-rc1

Should have been to copy the bzImage as above.
_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum