Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pxelinux.0 EFI equivalent? Booting to menus for EFI-clients
2018-11-02, 15:26
Post: #1
pxelinux.0 EFI equivalent? Booting to menus for EFI-clients
Hello! I'm having some trouble booting to menus with my EFI-clients. I'm new to EFI and can't figure out how to adapt my current setup.

Running on CentOS 7.5 using latest syslinux and iPXE.

I embedded this script and compiled the ipxe.efi:
Code:
#!ipxe

dhcp
chain http://10.0.0.3/boot.php

Relevant config for isc-dhcp-server. I have activated all of the "option space ipxe" options:
Code:
#EFI 32 & 64bit
class "UEFI-32-1" {
    match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00006";
    filename "gpxe/ipexe.efi";
  }

  class "UEFI-64-1" {
    match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007";
    filename "gpxe/ipxe.efi";
  }

#BIOS
  if not exists ipxe.bus-id {
    filename "gpxe/undionly.kpxe";
  } else {
    filename "http://10.0.0.3/boot.php";
  }

The boot.php chains boot2.php to match the MAC-address with mysql and decide to either sanboot, load the default menu or load the menu to restore/capture an image:
PHP Code:
<?php
echo "#!ipxe\n";
echo 
"chain ".
"http://".$_SERVER["SERVER_NAME"].
dirname$_SERVER["REQUEST_URI"] ).
"boot2.php?mac=\${net0/mac}\n";
?>
boot2.php:
PHP Code:
--snip--

if(
$restore->num_rows 0){
        echo 
"#!ipxe\n";
        echo 
"set 209:string http://10.0.0.3/boot/pxelinux.cfg/restore\n";
        echo 
"set 210:string http://10.0.0.3/boot/\n";
        echo 
"chain http://10.0.0.3/boot/pxelinux.0\n";
}


if(
$sanboot->num_rows == '0' && $restore->num_rows == '0' ){
        echo 
"#!ipxe\n";
        echo 
"set 209:string http://10.0.0.3/boot/pxelinux.cfg/default\n";
        echo 
"set 210:string http://10.0.0.3/boot/\n";
        echo 
"chain http://10.0.0.3/boot/pxelinux.0\n";


This works perfectly with BIOS-clients, but obviously not with EFI-clients.

I made a test menu as per the wiki:

Code:
menu
  item linux    Boot Linux
  item shell    Enter iPXE shell
  item exit     Exit to BIOS
  choose --default exit --timeout 3000 target && goto ${target}

Trying this makes the VM crash:

PHP Code:
if($sanboot->num_rows == '0' && $restore->num_rows == '0' ){
        echo 
"#!ipxe\n";
        echo 
"set 209:string http://10.0.0.3/boot/pxelinux.cfg/default.efi\n";
        echo 
"set 210:string http://10.0.0.3/boot/\n";
        echo 
"chain http://10.0.0.3/boot/syslinux.efi\n";


This results in error 2e008081:

PHP Code:
if($boot->num_rows == '0' && $restore->num_rows == '0' ){
        echo 
"#!ipxe\n";
        echo 
"set 209:string http://10.0.0.3/boot/pxelinux.cfg/default.efi\n";
        echo 
"set 210:string http://10.0.0.3/boot/\n";
        echo 
"chain http://10.0.0.3/boot/ldlinux.c32\n";


So i think biggest problem is I can't figure out how to boot to menus for EFI-clients.

This works ok, but results in kernel panic I guess because it does not use the bootx64.efi:

PHP Code:
if($sanboot->num_rows == '0' && $restore->num_rows == '0' ){
        echo 
"#!ipxe\n";
        echo 
"kernel http://10.0.0.3/boot/linux/clonezilla/vmlinuz\n";
        echo 
"initrd http://10.0.0.3/boot/linux/clonezilla/initrd.img boot=live hostname=oneiric config quiet noswap nolocales edd=on nomodeset ocs_live_run='ocs-live-general' ocs_live_extra_param='' keyboard-layouts='SE' ocs_live_batch='no' ocs_lang='' video=uvesafb:mode_option=640x480-16 ip=frommedia  fetch=http://10.0.0.3/boot/linux/clonezilla/filesystem.squashfs\n";
        echo 
"boot\n";


I bet it's something really basic, but I don't know what to do.

Thanks!
Find all posts by this user
Quote this message in a reply
2018-11-28, 16:19
Post: #2
RE: pxelinux.0 EFI equivalent? Booting to menus for EFI-clients
simple config for detecting efi: http://ipxe.org/howto/chainloading#uefi

You have all kernel cmdline arguments on the initrd, try to move boot=live etc up to the kernel line.
Also remember that for efi you will have to add initrd=initrd.img to the kernel cmdline.

And finally, why are you involving syslinux at all?

Modified kernel and initrd line:
PHP Code:
if($sanboot->num_rows == '0' && $restore->num_rows == '0' ){
        echo 
"#!ipxe\n";
        echo 
"kernel http://10.0.0.3/boot/linux/clonezilla/vmlinuz initrd=initrd.img boot=live hostname=oneiric config quiet noswap nolocales edd=on nomodeset ocs_live_run='ocs-live-general' ocs_live_extra_param='' keyboard-layouts='SE' ocs_live_batch='no' ocs_lang='' video=uvesafb:mode_option=640x480-16 ip=frommedia  fetch=http://10.0.0.3/boot/linux/clonezilla/filesystem.squashfs\n";
        echo 
"initrd http://10.0.0.3/boot/linux/clonezilla/initrd.img\n";
        echo 
"boot\n";


Read the FAQ before posting.
Did you include relevant ipxe.org error urls?
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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