View previous topic :: View next topic |
Author |
Message |
pdr l33t
Joined: 20 Mar 2004 Posts: 618
|
Posted: Sat May 16, 2009 2:41 pm Post subject: Grub cannot execute binary file [SOLVED] |
|
|
I'm not installing, but since it is grub thought this the most appropriate forum.
AMD64 x86.
Just emerged a new grub and the note says to run grub-install again. Have done this on 3 32-bit systems and was fine. On by amd64 server I get:
Code: | /sbin/grub-install: line 436: //sbin/grub: cannot execute binary file |
That gets repeated 5 times. Checking grub-install script I see that - yes, it is trying to run grub:
Code: | $grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file |
where grub_shell is defined previously as
Code: | exec_prefix=/
sbindir=${exec_prefix}/sbin
grub_shell=${sbindir}/grub |
Which explains why after expansion grub_shell ends up being //sbin/grub.
OK - so I modified grub-install so I would end up with /sbin/grub - and I still get 5 "... /sbin/grub: cannot execute binary file" errors.
Yahoo. So I check "file /sbin/grub" and get:
Code: | /sbin/grub: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, statically linked, stripped |
WTF? OK, I "emerge -pv grub" and see that it is hard masked for amd64 and that I have to use grub-static. I re-emerge grub-static and see that it is the one printing the message that I have to grub-install again (and that it replaced /sbin/grub).
No joy. Same symptoms and /sbin/grub is still a 32-bit ELF.
The docs do NOT say that I have to install multi-lib to use grub (and did not when I first installed my server) - any idea how to fix?
Last edited by pdr on Sat May 16, 2009 11:08 pm; edited 1 time in total |
|
Back to top |
|
|
sera Retired Dev
Joined: 29 Feb 2008 Posts: 1017 Location: CET
|
Posted: Sat May 16, 2009 5:48 pm Post subject: |
|
|
Adding 32bit elf support to your kernel will likely do the trick.
Code: | CONFIG_IA32_EMULATION=y
CONFIG_IA32_AOUT=y
|
For grub-static multilib should not be needed. |
|
Back to top |
|
|
pdr l33t
Joined: 20 Mar 2004 Posts: 618
|
Posted: Sat May 16, 2009 11:08 pm Post subject: |
|
|
Thanks - that did the trick. |
|
Back to top |
|
|
|