Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-11 Diskussionsfäden Thomas Lange
Ok, I found a bug. My Thinkpad X230 does not work correctly using
UEFI. Using a Dell notebook shows, that my tftp, DHCP setup is correct
and loads ldlinux.e64 and then the pxelinux.cfg/. config files.

-- 
regards Thomas


Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-10 Diskussionsfäden John G Heim
Yeah, I'm sure. The syslinux-efi package works as advertized. I mean, 
you cannot boot an EFI machine via pxelinux.0. That would hang.


Are you saying that you're not seeing a request for ldlinux.e64 right 
after the request for syslinux.efi? There's no error message in the tftp 
logs? File not found, permission denied, something? I can't explain 
that. But after all, this isn't exactly an FAI problem. When I started 
experimenting with the syslinux-efi package, I set it up to boot into 
the ubuntu installer. In fact, that's how I made my base file for FAI 
installs of bionic. But fai isn't really involved up to this point. It 
has to be some kind of problem with tftp.


You can run a tftp client and get all the files you need during a pxe 
boot .On the server, I say, "tail -f /var/log/syslog | grep tftp" and 
then on the target machine (assuming linux is installed somehow), I run 
the tftp client and get the bootloader, either pxelinux.0 or 
syslinux.efi, the library file ldlinux.e64, and the config file. You 
ought to see the log entries scroll by on the fai server.






On 07/10/2018 06:02 AM, Thomas Lange wrote:

Hi John,

I didn't manage to get network booting using UEFI without grub but
with syslinux running. I copied the syslinux.efi and ldlinux.e64 into
my tftp directory. Using tcpdump I see that the UEFI is getting the
syslinux.efi file (even I use a different name and a symlink). I do
not see any request for the ldlinux.e64 file.

In your setup, are you really getting syslinux with UEFI use the
config from fai-chboot? Maybe your computer has still CSM (the legacy
mode) enabled, and you are still using pxelinux.



Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-10 Diskussionsfäden Thomas Lange
Hi John,

I didn't manage to get network booting using UEFI without grub but
with syslinux running. I copied the syslinux.efi and ldlinux.e64 into
my tftp directory. Using tcpdump I see that the UEFI is getting the
syslinux.efi file (even I use a different name and a symlink). I do
not see any request for the ldlinux.e64 file.

In your setup, are you really getting syslinux with UEFI use the
config from fai-chboot? Maybe your computer has still CSM (the legacy
mode) enabled, and you are still using pxelinux.

-- 
regards Thomas


Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-09 Diskussionsfäden Rémy Dernat
Hi,

Yes ! Thanks ! It works after modifying the file "60-misc" like described
by Thomas and this line :

```
primary /boot/efi 204800K vfat rw
```
to
```
primary /boot/efi 204800K vfat rw createopts="-s2 -F32"
```

Thank you very much.

Best regards,
Rémy.

Le lun. 9 juil. 2018 à 15:39, Thomas Lange 
a écrit :

> The current version of 60-misc now uses this
> code
>
> if [ -d /sys/firmware/efi ]; then
> echo GRUB_EFI
> elif ifclass -o I386 AMD64 ; then
> echo GRUB_PC
> fi
>
>
> --
> regards Thomas
>


Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-09 Diskussionsfäden Thomas Lange
The current version of 60-misc now uses this
code

if [ -d /sys/firmware/efi ]; then
echo GRUB_EFI
elif ifclass -o I386 AMD64 ; then
echo GRUB_PC
fi


-- 
regards Thomas


Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-09 Diskussionsfäden Rémy Dernat
Hi John, Toomas,

Thank you very much.

I changed my config to match your config, John, however, I still have an
error (which is a new one).

First of all, it boots fine (the first time), launching the install,
retrieving syslinux.efi, but it detects the class "GRUB_PC" instead of
"GRUB_EFI" (obviously, it should load GRUB_EFI !).

```
root@faiserv:/srv/fai/config# grep -r GRUB_PC .
./package_config/DEBIAN:PACKAGES install GRUB_PC
./package_config/UBUNTU:PACKAGES install GRUB_PC
./class/60-misc:ifclass -o GRUB_PC GRUB_EFI ||echo GRUB_PC

root@faiserv:/srv/fai/config# find . -name GRUB_PC
./scripts/GRUB_PC
./disk_config/GRUB_PC

root@faiserv:/srv/fai/config# grep -r GRUB_EFI .
./package_config/GRUB_EFI:PACKAGES aptitude GRUB_EFI
./package_config/DEBIAN:PACKAGES install GRUB_EFI
./package_config/UBUNTU:PACKAGES install GRUB_EFI
./class/60-misc:ifclass -o GRUB_PC GRUB_EFI ||echo GRUB_PC

root@faiserv:/srv/fai/config# find . -name GRUB_EFI
./package_config/GRUB_EFI
./scripts/GRUB_EFI
./disk_config/GRUB_EFI
```

I am a bit lost (...); I do not why it is loading GRUB_PC instead of
GRUB_EFI.

I also tried to switch to the DEMO class to check if it comes from my
defined class; I get the same result: it load also the GRUB_PC class.

My 60-misc class is :
```
cat class/60-misc
#! /bin/bash

ifclass -o CENTOS SLC && exit 0
if ifclass -o I386 AMD64 ; then
ifclass -o GRUB_PC GRUB_EFI ||echo GRUB_PC
fi
```

Best regards,
Rémy.


Le ven. 6 juil. 2018 à 17:14, John G Heim  a écrit :

> Sorry to reply to your posts out of order but I would not follow the
> advice in that message. It is at least out dated. You do not have to
> change your dhcp config after each install and you can continue to use
> your fai-chboot config files.  Syslinux does support EFI booting. It's
> in the syslinux-efi package.
>
> Here is the code in my dhcp config file that sets the filename option
> depending on EFI/BIOS boot:
>
> === begin ===
> # tell a kernel how to boot via PXE or NFS
> server-name faiserver;
> next-server faiserver;
> # Check pxe boot code #93 to determine whether we are booting via BIOS
> or EFI
> # 2018-07-04: jheim
> option architecture-type code 93 = unsigned integer 16;
> class "pxeclients" {
> match if substring (option vendor-class-identifier, 0, 9) =
> "PXEClient";
> if option architecture-type = 00:00 {
> filename "fai/pxelinux.0";
> } else {
> filename "fai/syslinux.efi64";
> }
> }
> === end ===
>
> The file syslinux.efi64 is from the debian syslinux-efi package. It's
> original name/path was /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi. I
> renamed it syslinux.efi64 to distinguish it from the 32-bit syslinux.efi
> file. Then I decided not to bother with 32-bit EFI boots. You also need
> some libs in your tftp directory to support EFI booting via syslinux. I
> think if you modify your dhcp config as abobe, copy the necessary files
> from the syslinux-efi package to your tftp space, you'll successfully
> boot into the FAI install. You will also need to create new disk config
> files to partition via gpt instead of msdos. (More on that below.)
>
> 1. Cut/passte above code into your dhcp config.
> 2. apt-get install syslinux-efi
> 3a. cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi /srv/tftp/fai/
> 3b. cp /usr/lib/syslinux/modules/efi64/ldlinux.e64 /srv/tftp/fai/
>
> Done with the boot stuff. Now the disk config stuff.  Code that detects
> whether you have booted via BIOS or EFI already exists in the fai-doc
> examples. It's in a class script called 60-grub. It creates either
> GRUB_PC or GRUB_EFI class. You have to retain your old BIOS disk config
> files for older machines. I used to create a class called LARGEDISK for
> disks large enough to partition into /, /var/ usr, ... So I just renamed
> that GRUB_PC.  Then I copied that file to GRUB_EFI andmodified it for
> gpt partitioning and EFI boot. It looks like this:
>
> === begin ===
> # 2018-07-04: jheim
> disk_config disk1 disklabel:gpt fstabkey:label align-at:1
> primary /boot/efi 204800K vfat rw
> primary/usr/local  157286400Kext4 rw,relatime
> createopts="-L LOCALFS"
> primary/   72G-  ext4 rw,relatime
> createopts="-L ROOTFS"
> primaryswap8Gswap rw
> createopts="-L SWAPFS"
> # EOF
> === end ===
>
>
>
>
>
>
>
> On 07/06/2018 07:27 AM, Rémy Dernat wrote:
> > 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 

Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-06 Diskussionsfäden John G Heim
Sorry to reply to your posts out of order but I would not follow the 
advice in that message. It is at least out dated. You do not have to 
change your dhcp config after each install and you can continue to use 
your fai-chboot config files.  Syslinux does support EFI booting. It's 
in the syslinux-efi package.


Here is the code in my dhcp config file that sets the filename option 
depending on EFI/BIOS boot:


=== begin ===
# tell a kernel how to boot via PXE or NFS
server-name faiserver;
next-server faiserver;
# Check pxe boot code #93 to determine whether we are booting via BIOS 
or EFI

# 2018-07-04: jheim
option architecture-type code 93 = unsigned integer 16;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if option architecture-type = 00:00 {
filename "fai/pxelinux.0";
} else {
filename "fai/syslinux.efi64";
}
}
=== end ===

The file syslinux.efi64 is from the debian syslinux-efi package. It's 
original name/path was /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi. I 
renamed it syslinux.efi64 to distinguish it from the 32-bit syslinux.efi 
file. Then I decided not to bother with 32-bit EFI boots. You also need 
some libs in your tftp directory to support EFI booting via syslinux. I 
think if you modify your dhcp config as abobe, copy the necessary files 
from the syslinux-efi package to your tftp space, you'll successfully 
boot into the FAI install. You will also need to create new disk config 
files to partition via gpt instead of msdos. (More on that below.)


1. Cut/passte above code into your dhcp config.
2. apt-get install syslinux-efi
3a. cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi /srv/tftp/fai/
3b. cp /usr/lib/syslinux/modules/efi64/ldlinux.e64 /srv/tftp/fai/

Done with the boot stuff. Now the disk config stuff.  Code that detects 
whether you have booted via BIOS or EFI already exists in the fai-doc 
examples. It's in a class script called 60-grub. It creates either 
GRUB_PC or GRUB_EFI class. You have to retain your old BIOS disk config 
files for older machines. I used to create a class called LARGEDISK for 
disks large enough to partition into /, /var/ usr, ... So I just renamed 
that GRUB_PC.  Then I copied that file to GRUB_EFI andmodified it for 
gpt partitioning and EFI boot. It looks like this:


=== begin ===
# 2018-07-04: jheim
disk_config disk1 disklabel:gpt fstabkey:label align-at:1
primary /boot/efi 204800K vfat rw
primary/usr/local  157286400Kext4 rw,relatime 
createopts="-L LOCALFS"
primary/   72G-  ext4 rw,relatime 
createopts="-L ROOTFS"
primaryswap8Gswap rw 
createopts="-L SWAPFS"

# EOF
=== end ===







On 07/06/2018 07:27 AM, Rémy Dernat wrote:

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@faiserv:/srv# tree -L 2
.
├── fai
│   ├── config
│   └── nfsroot
├── nfs4
└── tftp
     └── fai

root@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 :
```

Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-06 Diskussionsfäden John G Heim
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 > 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@faiserv:/srv# tree -L 2
.
├── fai
│   ├── config
│   └── nfsroot
├── nfs4
└── tftp
     └── fai

root@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@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 

Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-06 Diskussionsfäden John G Heim
Just a note ... You can still use syslinux/pxelinux to do FAI installs 
for both EFI and BIOS. In other words, you don't have to switch to grub, 
you can still use the syslinux pxe config files you created via fai-chboot.


Here is a link to an article that shows how to get isc-dhcp-server to 
detect whether you are booting via EFI or BIOS and set the filename 
option appropriately:

https://www.syslinux.org/archives/2014-October/022683.html

I just modified my faiserver to support both EFI and BIOS yesterday. It 
turned out being way easier than I expected. The only changed I had to 
make to my various configurations were the following:
1: Make the dhcp server detect EFI boot vs BIOS and set filename option 
appropriately (see above).
2: Rename my FAI setup-storage config files (in the disk_config sub 
directory) based on the classes FAI already creates, GRUB_PC and GRUB_EFI.

3: Modify the GRUB_EFI setup_storage config file:
3a.  Chage thedisklabel from msdos to gpt
3b: Change all logical partitions to primary.

There is sample code in the fai-docs package that shows how to create 
those classes, GRUB_PC and GRUB_EFI. I'd guess most people are already 
using that. So the only change I had to make to my FAI config was to 
rename my disk_config files to match those classes and then make some 
minor changes to the disk-config file to work with gpt instead of msdos.




On 07/06/2018 08:19 AM, tt-...@kky.ttu.ee wrote:

Hi!

Just went through setting up UEFI boot over PXE and TFTP. Of great help 
in figuring out what was going on was to add logging to the TFTP server:


Kill the tftp server started at boot and manually start one with

# /usr/sbin/in.tftpd –vvv --listen --user tftp --address 0.0.0.0:69 
--secure /srv/fai


or similar (check the startup script of in.tftpd, add –v’s generously).

Then you will see in the syslog, which files are being requested and 
whether they are actually being transmitted.


A successful UEFI boot with grub generates about 15 TFTP requests, 
starting with:


Jun 30 18:22:40 server in.tftpd[11435]: RRQ from 172.24.0.68 filename 
fai/efi/x86_64-efi/core.efi


Jun 30 18:22:40 server in.tftpd[11436]: RRQ from 172.24.0.68 filename 
/fai/efi/x86_64-efi/normal.mod


Jun 30 18:22:40 server in.tftpd[11437]: RRQ from 172.24.0.68 filename 
/fai/efi/x86_64-efi/extcmd.mod


[…]

A missing or misplaced file will show up as

Jun 30 18:22:40 server in.tftpd[11449]: RRQ from 172.24.0.68 filename 
/fai/efi/grub.cfg


Jun 30 18:22:40 server in.tftpd[11449]: sending NAK (1, File not found) 
to 172.24.0.68


Hoping this helps,

Toomas

*From:*linux-fai  *On Behalf Of *Rémy Dernat
*Sent:* Friday, July 6, 2018 3:28 PM
*To:* linux-fai@uni-koeln.de
*Subject:* UEFI + Legacy BIOS TFTP/PXELINUX

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@faiserv:/srv# tree -L 2

.

├── fai

│   ├── config

│   └── nfsroot

├── nfs4

└── tftp

     └── fai

root@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 :

```


Re: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-06 Diskussionsfäden Rémy Dernat
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  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@faiserv:/srv# tree -L 2
> .
> ├── fai
> │   ├── config
> │   └── nfsroot
> ├── nfs4
> └── tftp
> └── fai
>
> root@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@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
>


RE: UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-06 Diskussionsfäden tt-fai
Hi!

 

Just went through setting up UEFI boot over PXE and TFTP. Of great help in 
figuring out what was going on was to add logging to the TFTP server:

Kill the tftp server started at boot and manually start one with

# /usr/sbin/in.tftpd –vvv --listen --user tftp --address 0.0.0.0:69 --secure 
/srv/fai

or similar (check the startup script of in.tftpd, add –v’s generously).

 

Then you will see in the syslog, which files are being requested and whether 
they are actually being transmitted.

A successful UEFI boot with grub generates about 15 TFTP requests, starting 
with:

Jun 30 18:22:40 server in.tftpd[11435]: RRQ from 172.24.0.68 filename 
fai/efi/x86_64-efi/core.efi

Jun 30 18:22:40 server in.tftpd[11436]: RRQ from 172.24.0.68 filename 
/fai/efi/x86_64-efi/normal.mod

Jun 30 18:22:40 server in.tftpd[11437]: RRQ from 172.24.0.68 filename 
/fai/efi/x86_64-efi/extcmd.mod

[…]

 

A missing or misplaced file will show up as 

Jun 30 18:22:40 server in.tftpd[11449]: RRQ from 172.24.0.68 filename 
/fai/efi/grub.cfg

Jun 30 18:22:40 server in.tftpd[11449]: sending NAK (1, File not found) to 
172.24.0.68

 

Hoping this helps,

Toomas

 

From: linux-fai  On Behalf Of Rémy Dernat
Sent: Friday, July 6, 2018 3:28 PM
To: linux-fai@uni-koeln.de
Subject: UEFI + Legacy BIOS TFTP/PXELINUX

 

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@faiserv:/srv# tree -L 2

.

├── fai

│   ├── config

│   └── nfsroot

├── nfs4

└── tftp

└── fai

 

root@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@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