UEFI + Legacy BIOS TFTP/PXELINUX

John G Heim jheim at math.wisc.edu
Fri Jul 6 16:46:46 CEST 2018


Are you sure the problem isn't in the boot sequence on your host? If you 
have pxe/net boot before disk, it is going to pxe boot over and over. 
The reason I ask is that in my experience, if the disk is partitioned, 
the reboot whil hang. I work 100% will Dell computers in my job so maybe 
other EFI/BIOS detect an unbootable disk differently. But in my 
experience, it does not matter if the disk does not have a bootable 
partition, as long as there is a partition table on the disk, it won't 
move on to pxe boot again.

There is sample code in the fai-doc package that creates the classes 
GRUB_PC and GRUB_EFI during the install. Then there are scripts to 
properly install/configure grub depending on whether you are booting via 
BIOS or EFI. If grub is not getting installed correctly, you should 
check if those classes are properly being created during your FAI installs.

Another thing that might be wrong is your disk config. You have to use 
gpt and configure an EFI boot partition in your setup-storage config 
file in the disk_config sub directory.



On 07/06/2018 08:25 AM, Rémy Dernat wrote:
> Hmmm.... Now it is installing fine, but it is trying to reinstall at 
> each reboot, because the boot from the local disk failed (although the 
> entry is well written is the UEFI boot menu).
> 
> My grub.cfg is now:
> ```
> set menu_color_normal=white/black
> set menu_color_highlight=black/light-gray
> set timeout=5
> # for debug:
> #set pager=1
> #set debug=all
> 
> insmod efi_gop
> insmod efi_uga
> if loadfont ${prefix}/unicode.pf2
> then
>      insmod gfxterm
>      set gfxmode=auto
>      set gfxpayload=keep
>      terminal_output gfxterm
> fi
> 
> menuentry "Install from FAI" {
>       linux  vmlinuz-3.16.0-6-amd64 ip=dhcp aufs rw root=/dev/nfs 
> nfsroot=IP.IP.IP.IP:/srv/fai/nfsroot 
> FAI_FLAGS=verbose,sshd,createvt,reboot FAI_ACTION=install 
> server=faiserv.acme.ltd FAI_CONFIG_SRC=nfs://faiserv.acme.ltd/srv/fai/config
>       initrd initrd.img-3.16.0-6-amd64
> }
> ```
> 
> It looks like FAI install is just loading the FAIBASE class. I think 
> that "FAI_CONFIG_SRC=nfs://faiserv.acme.ltd/srv/fai/config" is not 
> loading at the install step. Maybe I have some syntax error...
> 
> Best regards,
> Rémy.
> 
> Le ven. 6 juil. 2018 à 14:27, Rémy Dernat <remy.d1 at gmail.com 
> <mailto:remy.d1 at gmail.com>> a écrit :
> 
>     Hi,
> 
>     I am trying to set up an UEFI boot pxe mainly because our hardware
>     servers do not support full legacy BIOS anymore (particularly hard
>     disk plugin on those servers).
> 
>     Our legacy pxelinux works just fine from a while now (and thanks for
>     it).
> 
>     I followed this link :
>     https://lists.uni-koeln.de/pipermail/linux-fai/2014-February/010294.html
>     ... with no luck. I created an "UEFI" specific class to avoid the
>     erase of DEFAULT, and put everything in that new class, because we
>     will need to keep the pxelinux config.
> 
>     My tftp fai folder is organised like this:
>     ```
>     root at faiserv:/srv# tree -L 2
>     .
>     ├── fai
>     │   ├── config
>     │   └── nfsroot
>     ├── nfs4
>     └── tftp
>          └── fai
> 
>     root at faiserv:/srv/tftp/fai# tree -L 2
>     .
>     ├── c2960s-universalk9-tar.150-2a.SE9.tar
>     ├── cisco-ios-150-2a.tar -> c2960s-universalk9-tar.150-2a.SE9.tar
>     ├── efi
>     │   ├── fonts
>     │   ├── grub.cfg
>     │   ├── grub.cfg.nok
>     │   ├── i386-pc
>     │   ├── locale
>     │   ├── pxelinux.cfg -> ../pxelinux.cfg
>     │   ├── unicode.pf2
>     │   └── x86_64-efi
>     ├── gpxelinux.0
>     ├── initrd.img-3.16.0-4-amd64
>     ├── initrd.img-3.16.0-6-amd64
>     ├── ldlinux.c32
>     ├── lpxelinux.0
>     ├── pxelinux.0
>     ├── pxelinux.0.back
>     ├── pxelinux.cfg
>     │   ├── 0A01FD03
>     │   ├── 0A01FFF2
>     │   ├── A226B5A1.disable
>     │   ├── A226B5A2.disable
>     │   ├── A226B5A3.disable
>     │   ├── A226B5A4.disable
>     │   ├── A226B5A5.disable
>     │   ├── A226B5A6.disable
>     │   ├── A226B5A7.disable
>     │   ├── A226B5A9
>     │   ├── A226B5AA.disable
>     │   ├── A226B5AB.disable
>     │   ├── A226B5B0.disable
>     │   ├── A226B5B4.disable
>     │   ├── A226B5B8
>     │   └── default
>     ├── syslinux.efi
>     ├── vmlinuz-3.16.0-4-amd64
>     └── vmlinuz-3.16.0-6-amd64
> 
>     ```
> 
>     I do not know if the UEFI is also searching for a filename matching
>     its IP address with the hexa value, so I created a symbolic link to
>     the pxelinux.cfg parent directory...
> 
> 
>     I have no problem with DHCP, and my client is loading the grub.cfg
>     menu. However, it fails while searching for the nfsroot. The error I
>     get (with debug=all) is (replacing sensitive informations):
>     ```
>     kern/disk.c:196 : Opening `tftp,IP.IP.IP.IP'...
>     disk/efi/efidisk.c:461 : opening tftp
>     kern/disk.c: 281: Opening `tftp,IP.IP.IP.IP' failed.
>     kern/disk.c: 295: Closing `tftp'.
>     ```
> 
> 
>     Here is my grub.cfg config :
>     ```
>     root at faiserv:/srv/tftp/fai/efi# cat grub.cfg
>     set menu_color_normal=white/black
>     set menu_color_highlight=black/light-gray
>     set timeout=5
>     # for debug:
>     #set pager=1
>     set debug=all
> 
>     insmod efi_gop
>     insmod efi_uga
>     if loadfont ${prefix}/unicode.pf2
>     then
>          insmod gfxterm
>          set gfxmode=auto
>          set gfxpayload=keep
>          terminal_output gfxterm
>     fi
> 
>     menuentry "Install from FAI" {
>           linux  vmlinuz-3.16.0-6-amd64 rw ip=dhcp root=/dev/nfs
>     nfsroot=IP.IP.IP.IP:/srv/fai/nfsroot
>     FAI_FLAGS=verbose,sshd,createvt,reboot FAI_ACTION=install
>     server=faiserv.acme.ltd
>     FAI_CONFIG_SRC=nfs://faiserv.acme.ltd/srv/fai/config
>           initrd initrd.img-3.16.0-6-amd64
>     }
> 
>     ```
> 
> 
>     Any help would be greatly appreciated.
> 
>     Thanks,
>     Rémy
> 


More information about the linux-fai mailing list