LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB error: Invalid or unsupported executable format (https://www.linuxquestions.org/questions/linux-newbie-8/grub-error-invalid-or-unsupported-executable-format-638484/)

newtovanilla 04-28-2008 04:32 PM

GRUB error: Invalid or unsupported executable format
 
Hi, I built a 2.4.36 kernel and edited the menu.lst file to have the name of this new kernel and when I selected it from the menu on reboot I received the error: "Invalid or unsupported executable format".

1) How can I find out what executable format the kernel image file that I built is in? What command do I use and how do I interpret the output?

2) How can I find out what executable formats GRUB supports? What file will tell me this?

There was no error in building the kernel.

fancylad 04-29-2008 09:26 AM

Try this:

Quote:

file <name of kernel>
file will read the file header of any file and try to tell you what kind of file it is. If it is executable it will tell you that. If the output is just "data" then it means it can't identify the file type.

Here's the output for the kernel in my Ubuntu laptop:

Quote:

matt-laptop:/proc# file /boot/vmlinuz-2.6.18-5-686
/boot/vmlinuz-2.6.18-5-686: Linux kernel x86 boot executable RO-rootFS, root_dev 0x6803, swap_dev 0x1, Normal VGA

johnny_g 04-29-2008 09:56 AM

This error also occured to me when grub was trying to boot the wrong partition. I edited the configuration properly and then everything went ok. Don't know if this helps though...

bigrigdriver 04-29-2008 10:03 AM

Quote:

Hi, I built a 2.4.36 kernel and edited the menu.lst file to have the name of this new kernel
It takes more than just adding the name of the kernel to the menu.lst to boot the new kernel.

The process of compiling a kernel produces a compressed kernel image (bzImage) which is located somewhere in /usr/src (exact location varies among distros). You need to either copy that image to /boot as vmlinuz-<kernel number> or put a symlink in /boot to the bzImage in /usr/src, then edit /boot/grub/menu.lst to show the new kernel.

You also have to make a new initrd for the new kernel (if your distro requires one) and put it in /boot, with appropriate edit of menu.lst.

newtovanilla 04-29-2008 02:14 PM

this is the output from "file <name of kernel>
 
Thank you for the command input on "File".

/boot/vmlinuz-2.4.36: Linux x86 kernel root=0x802-ro vga=normal, bzImage, version 2.4.36

This is the file that is named in the Grub boot parameters in the menu.lst file. How can I find out if the initrd file is correct or not, if that is the problem? Also, how can I find out if the correct partition is being looked at to find the bzImage file, and do I need to tell the boot process that this is a bzImage file or will it know automatically?


All times are GMT -5. The time now is 10:40 AM.