Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot boot vmlinuz in efi
2015-12-28, 10:57
Post: #1
Cannot boot vmlinuz in efi
Hello, I've recently cam across this problem when trying to boot an installation iso of RHEL 6.7
I can boot centos 7, fedora 22, and rhel 7 with no issues in EFI and legacy mode.
However i cannot boot RHEL 6.7, when ever i try to boot the kernel i get the error code 2e008081 (http://ipxe.org/err/2e0080)

If i burn the iso to a usb key i can boot in both EFI and legacy.

Any idea why this is happening (old kernel version?), i've also tried coping vmlinuz from RHEL 7 iso and boot it with the initrd.img of RHEL 6, it boots but cannot recognize any network devices.

My last effort was to try to chain BOOTX64.efi, but i can't seem to make it load the config file.

Here's my menu entry:

:rhel67server
echo Starting RHEL 6.7 Server x64
set repo ${http-images}/iso_images/RHEL_6.7_server
imgfetch ${repo}/images/pxeboot/vmlinuzboot
initrd ${repo}/images/pxeboot/initrd.img
imgargs vmlinuzboot repo=${repo} initrd=initrd.img
boot vmlinuzboot || goto failed

i used imgfetch because if i use kernel it will stop with an error, with imgfetch it will go to boot and if failed then return to menu. BTW all other menu entries are exactly like this and they all work in EFI/Legacy.
Find all posts by this user
Quote this message in a reply
2015-12-28, 15:43
Post: #2
RE: Cannot boot vmlinuz in efi
The Redhat 6.x vmlinuz does not have the EFI_Stub functionality configured in the kernel. You will need to boot iPXE to grub.efi and a correctly-configured grub.conf to then boot vmlinuz.

iPXE->grub.efi->grub.conf-vmlinuz->initrd

Hope this helps...

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2015-12-28, 15:53 (This post was last modified: 2015-12-28 15:54 by silver310.)
Post: #3
RE: Cannot boot vmlinuz in efi
Yeah I just read about the efi stub issue.
I tried doing that with bootx64.efi but couldn't figure out how to automate it to boot vmlinuz immediately.

How hard would it be to compile a kernel for rhel 6 with efi stub enabled?
Find all posts by this user
Quote this message in a reply
2015-12-28, 16:09
Post: #4
RE: Cannot boot vmlinuz in efi
(2015-12-28 15:53)silver310 Wrote:  Yeah I just read about the efi stub issue.
I tried doing that with bootx64.efi but couldn't figure out how to automate it to boot vmlinuz immediately.

How hard would it be to compile a kernel for rhel 6 with efi stub enabled?

When I asked about this through my Redhat TAM, he said flatly it wasn't going to happen because of how much regression testing would have to be done. It's easy to do (kernel-devel), but you would not be supported if you asked RHT for support and they determined it was a kernel-level issue.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2015-12-28, 16:24 (This post was last modified: 2015-12-28 16:27 by silver310.)
Post: #5
RE: Cannot boot vmlinuz in efi
OK I get it. Any advice on how to pass a conf file to grub so it'll boot automatically?
I tried '' chain ${http-images} /rhel67/EFI/BOOT/BOOTX64.efi ${http-images} /rhel67/EFI/BOOT/BOOTX64.conf''

But I just get the grub shell.
Find all posts by this user
Quote this message in a reply
2015-12-28, 21:53
Post: #6
RE: Cannot boot vmlinuz in efi
(2015-12-28 16:24)silver310 Wrote:  OK I get it. Any advice on how to pass a conf file to grub so it'll boot automatically?
I tried '' chain ${http-images} /rhel67/EFI/BOOT/BOOTX64.efi ${http-images} /rhel67/EFI/BOOT/BOOTX64.conf''

But I just get the grub shell.

https://access.redhat.com/documentation/...g-efi.html

It's a little messy with the 6.x kernels...

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2015-12-29, 09:55 (This post was last modified: 2015-12-29 09:55 by silver310.)
Post: #7
RE: Cannot boot vmlinuz in efi
(2015-12-28 21:53)MultimediaMan Wrote:  
(2015-12-28 16:24)silver310 Wrote:  OK I get it. Any advice on how to pass a conf file to grub so it'll boot automatically?
I tried '' chain ${http-images} /rhel67/EFI/BOOT/BOOTX64.efi ${http-images} /rhel67/EFI/BOOT/BOOTX64.conf''

But I just get the grub shell.

https://access.redhat.com/documentation/...g-efi.html

It's a little messy with the 6.x kernels...


OK I officially give up, I've tried EVERYTHING!

set 210:string ${tftp-server}
set 209:string bootx64.efi
chain ${tftp-server}/bootx64.efi

set 210:string ${tftp-server}
set 209:string efidefault
chain ${tftp-server}/bootx64.efi

set 210:string ${tftp-server}
set 209:string /pxelinux.cfg/efidefault
chain ${tftp-server}/bootx64.efi

set netX.dhcp/filename:string bootx64.efi || goto failed
chain ${tftp-server}/bootx64.efi || goto failed

set netX.dhcp/filename:string bootx64.efi || goto failed
set 210:string ${tftp-server}
set 209:string efidefault
chain ${tftp-server}/bootx64.efi || goto failed

And about 100 more variations of those, and also 10 different grub versions, on many different locations on the server (at root of tftp, http, in folders in tftp, etc...), I've been doing this for the last 4 hours.
This is just ridicules, i've tried exactly what people posted that have worked, and what was written in that red-hat guide, every single time i get the grub shell.
Can i somehow tell when grub is looking for the config file? (if it's looking at all)

Also when trying to use "set netX.dhcp/xxxxx" manu times i get an invalid argument error even thou i have those exact same lines in the same file working without a problem.
Find all posts by this user
Quote this message in a reply
2015-12-29, 09:58
Post: #8
RE: Cannot boot vmlinuz in efi
(2015-12-29 09:55)silver310 Wrote:  
(2015-12-28 21:53)MultimediaMan Wrote:  
(2015-12-28 16:24)silver310 Wrote:  OK I get it. Any advice on how to pass a conf file to grub so it'll boot automatically?
I tried '' chain ${http-images} /rhel67/EFI/BOOT/BOOTX64.efi ${http-images} /rhel67/EFI/BOOT/BOOTX64.conf''

But I just get the grub shell.

https://access.redhat.com/documentation/...g-efi.html

It's a little messy with the 6.x kernels...


OK I officially give up, I've tried EVERYTHING!

set 210:string ${tftp-server}
set 209:string bootx64.efi
chain ${tftp-server}/bootx64.efi

set 210:string ${tftp-server}
set 209:string efidefault
chain ${tftp-server}/bootx64.efi

set 210:string ${tftp-server}
set 209:string /pxelinux.cfg/efidefault
chain ${tftp-server}/bootx64.efi

set netX.dhcp/filename:string bootx64.efi || goto failed
chain ${tftp-server}/bootx64.efi || goto failed

set netX.dhcp/filename:string bootx64.efi || goto failed
set 210:string ${tftp-server}
set 209:string efidefault
chain ${tftp-server}/bootx64.efi || goto failed

And about 100 more variations of those, and also 10 different grub versions, on many different locations on the server (at root of tftp, http, in folders in tftp, etc...), I've been doing this for the last 4 hours.
This is just ridicules, i've tried exactly what people posted that have worked, and what was written in that red-hat guide, every single time i get the grub shell.
Can i somehow tell when grub is looking for the config file? (if it's looking at all)

Also when trying to use "set netX.dhcp/xxxxx" manu times i get an invalid argument error even thou i have those exact same lines in the same file working without a problem.

Let me grab my notes for this: it will be later today. As I recall, it was a frustrating exercise.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2015-12-29, 22:11
Post: #9
RE: Cannot boot vmlinuz in efi
I do not recommend it, but you could use wimboot (since it creates an virtual filesystem) you would need something like this pseudo script
Code:
initrd -n bootx64.efi http://server/grub.efi bootx64.efi
initrd -n grub.conf http://server/grub.conf grub.conf
initrd -n kernel http://server/kernel kernel
initrd -n initrd http://server/initrd initrd
kernel http://server/wimboot
boot

this uses ipxe to download everything to a virtual fs. and grub is then only used to run the files from the virtual fs, at this time grub itself do not load anything from the network.

not sure about the exact name that is needed for grub, it might be bootmgr.efi, use pause and debug the output from wimboot.

In EFI it might work by just doing initrd for all the files (grub conf, kernel, initrd) before loading grub and with any luck the files will be available in the virtual efi fs.

Read FAQ before first post!
Are relevant ipxe.org error urls and PCIIDs included?
Visit this user's website Find all posts by this user
Quote this message in a reply
2015-12-30, 13:43
Post: #10
RE: Cannot boot vmlinuz in efi
OK so I've been trying to use syslinux to boot this image, but can't get ipxe to chain.
In legacy mode it works fine with the following menu entry:
set pxelinux ${tftp-server}/pxelinux/legacy
set 210:string /pxelinux/legacy
set 209:string /pxelinux.cfg/test
chain ${pxelinux}/pxelinux.0 || goto testing-legacy

pxelinux loads the config file without issues (haven't tried to boot anything, but for me if the config file is loaded then it's ok, legacy isn't an issue for ipxe anyway)
But in EFI mode using the exact menu entry
set pxelinux ${tftp-server}/pxelinux/efi
set 210:string /pxelinux/efi
set 209:string /pxelinux.cfg/test
chain ${pxelinux}/pxelinux.efi || goto testing-legacy

ipxe loaded the files, but when it tries to boot I get the following error
"Getting cached packed
my IP is x.x.x.x
could not boot: Error 0x7f048281 (http://ipxe.org/7f048281)"

What am I doing wrong?
Find all posts by this user
Quote this message in a reply
2015-12-30, 13:47
Post: #11
RE: Cannot boot vmlinuz in efi
(2015-12-30 13:43)silver310 Wrote:  could not boot: Error 0x7f048281 (http://ipxe.org/7f048281)"

What am I doing wrong?

It says that the efi can't be started, is it an efi executable in the correct format? (32bit vs 64bit etc)

Read FAQ before first post!
Are relevant ipxe.org error urls and PCIIDs included?
Visit this user's website Find all posts by this user
Quote this message in a reply
2015-12-30, 13:52 (This post was last modified: 2015-12-30 14:01 by silver310.)
Post: #12
RE: Cannot boot vmlinuz in efi
(2015-12-30 13:47)NiKiZe Wrote:  
(2015-12-30 13:43)silver310 Wrote:  could not boot: Error 0x7f048281 (http://ipxe.org/7f048281)"

What am I doing wrong?

It says that the efi can't be started, is it an efi executable in the correct format? (32bit vs 64bit etc)

Yes it's x64 efi, i've tried to use 32 bit but that gives an error right away, with x64 it tries (i think) to boot it and then gives an error.
OK so, I've tried to boot pxelinux.efi directly and it works, loads menu and config and everything, and now i see that
"Getting cached packet
My IP is x.x.x.x"
are the first two lines of pxelinux, so now i'm sure the image is the correct format and arch, and that ipxe did boot pxelinux.efi but then it gave an error and returned to ipxe.
Find all posts by this user
Quote this message in a reply
2015-12-31, 11:43
Post: #13
RE: Cannot boot vmlinuz in efi
SOLVED, finally.
So after 3 days I finally found a solution/workaround, I'll explain everything so other people might use this.

Basically it all comes down to GRUB2, I created a standalone bootx64.efi image with a single menu entry for the desired installation image, in this case RHEL 6.7

To make the standalone bootx64.efi:
install required packages
Code:
sudo yum install grub2-efi*

grub2 uses tftp to download images, while i use http with ipxe, so I had to create a new folder structure in my tftp root folder (until now it only had ipxe for legacy and efi)
Code:
cd /tftpboot
mkdir -p grub2-efi/rhel67server/boot/grub/
cd grub2-efi/rhel67server

now the config file:
Code:
vim boot/grub/grub.cfg

set timeout=0

menuentry 'RHEL 6.7 Server' --class os {
     insmod net
     insmod efinet
     insmod tftp
     insmod gzio
     insmod part_gpt
     insmod efi_gop
     insmod efi_uga

     # tftp server
     set net_default_server=192.168.0.1

     # dhcp did not work, no idea why
     # net_bootp

     # assign a static IP
     net_add_addr eno0 efinet0 192.168.0.100

     echo 'Loading vmlinuz ...'
     linux (tftp)/grub2-efi/rhel67server/vmlinuz repo="http://192.168.0.1/images/iso_images/RHEL_6.7_server" root=/dev/null

     echo 'Loading initial ramdisk ...'
     initrd (tftp)/grub2-efi/rhel67server/initrd.img
}

without "root=/dev/null" the installation couldn't find any hard-drives (no idea why)

now, while in /tftpboot/grub2-efi/rhel67server/ run the following command:
Code:
grub2-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi --fonts="unicode" -o bootx64.efi boot/grub/grub.cfg

you'll see a new file "bootx64.efi", copy to the same directory the kernel and initrd files of the wanted installation.

Finally in ipxe I just chain to the newly created file:
Code:
:rhel67-efi
echo Starting RHEL 6.7 Server x64 (EFI)
chain ${tftp-server}/grub2-efi/rhel67server/bootx64.efi || goto rhel67-efi


And that's it, work perfectly fine, hope this helps someone else, I'm going to add some older versions of RHEL and hopefully it'll work for them as well.
Only issue is that grub uses tftp and it's a lot slower, loading the same files (vmlinuz, initrd.img) via http takes less then a second, while via tftp it can take up to 15-20 seconds, is it possible from grub to use http instead of tftp?
Find all posts by this user
Quote this message in a reply
2016-05-24, 10:04 (This post was last modified: 2016-05-30 09:13 by sspans.)
Post: #14
RE: Cannot boot vmlinuz in efi
I've solved this by using a memdisk to store the vmlinuz/initrd.
Sample script below:

Code:
# needed to build a custom bootloader
yum install grub2-efi-modules

mkdir -p boot/grub
cp grub.cfg boot/grub/
tar cvf memdisk.tar vmlinuz initrd.img boot
grub2-mkimage  -v --memdisk=memdisk.tar -o bootx64.efi -O x86_64-efi memdisk tar echo sleep linux linuxefi lsefi reboot multiboot linux16 boot efi_uga gfxterm
rm -rf memdisk.tar boot

And a grub.cfg like this:
Code:
menuentry "CentOS-6" {
    set gfxpayload=keep
    linux (memdisk)/vmlinuz ks=http://boot.mccm.mcinfra.net/install/centos-6/install.ks ksdevice=link
    initrd (memdisk)/initrd.img
}

set timeout=0
set default="CentOS-6"
Find all posts by this user
Quote this message in a reply
2017-03-15, 12:04
Post: #15
RE: Cannot boot vmlinuz in efi
As I understood, this recompiled binary bootx64.efi will only work on tftp server with an IPaddress mentioned in grub.cfg file. Is there a way to make it general? Why are we assigning a static Ip address through grub.cfg?


(2015-12-31 11:43)silver310 Wrote:  SOLVED, finally.
So after 3 days I finally found a solution/workaround, I'll explain everything so other people might use this.

Basically it all comes down to GRUB2, I created a standalone bootx64.efi image with a single menu entry for the desired installation image, in this case RHEL 6.7

To make the standalone bootx64.efi:
install required packages
Code:
sudo yum install grub2-efi*

grub2 uses tftp to download images, while i use http with ipxe, so I had to create a new folder structure in my tftp root folder (until now it only had ipxe for legacy and efi)
Code:
cd /tftpboot
mkdir -p grub2-efi/rhel67server/boot/grub/
cd grub2-efi/rhel67server

now the config file:
Code:
vim boot/grub/grub.cfg

set timeout=0

menuentry 'RHEL 6.7 Server' --class os {
     insmod net
     insmod efinet
     insmod tftp
     insmod gzio
     insmod part_gpt
     insmod efi_gop
     insmod efi_uga

     # tftp server
     set net_default_server=192.168.0.1

     # dhcp did not work, no idea why
     # net_bootp

     # assign a static IP
     net_add_addr eno0 efinet0 192.168.0.100

     echo 'Loading vmlinuz ...'
     linux (tftp)/grub2-efi/rhel67server/vmlinuz repo="http://192.168.0.1/images/iso_images/RHEL_6.7_server" root=/dev/null

     echo 'Loading initial ramdisk ...'
     initrd (tftp)/grub2-efi/rhel67server/initrd.img
}

without "root=/dev/null" the installation couldn't find any hard-drives (no idea why)

now, while in /tftpboot/grub2-efi/rhel67server/ run the following command:
Code:
grub2-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi --fonts="unicode" -o bootx64.efi boot/grub/grub.cfg

you'll see a new file "bootx64.efi", copy to the same directory the kernel and initrd files of the wanted installation.

Finally in ipxe I just chain to the newly created file:
Code:
:rhel67-efi
echo Starting RHEL 6.7 Server x64 (EFI)
chain ${tftp-server}/grub2-efi/rhel67server/bootx64.efi || goto rhel67-efi


And that's it, work perfectly fine, hope this helps someone else, I'm going to add some older versions of RHEL and hopefully it'll work for them as well.
Only issue is that grub uses tftp and it's a lot slower, loading the same files (vmlinuz, initrd.img) via http takes less then a second, while via tftp it can take up to 15-20 seconds, is it possible from grub to use http instead of tftp?
Find all posts by this user
Quote this message in a reply
2017-09-11, 20:17
Post: #16
RE: Cannot boot vmlinuz in efi
(2017-03-15 12:04)adokania Wrote:  ... is it possible from grub to use http instead of tftp?

Yes, it is possible

Code:
# setup network
net_bootp

# boot using http
linux (http,server-ip)/vmlinuz
initrd (http,server-ip)/initrd.img

Renato
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)