simultaneous dirinstalls leave first /tmp/tmp.X and /tmp/tmp.X/dev mounted (patch)

2018-07-06 Diskussionsfäden andrew bezella
hello -

we're using fai 5.0.3 and have been seeing a problem when there are two
or more simultaneous dirinstalls taking place on a ubuntu xenial/16.04
host.  i haven't tested with newer versions of fai, but it looks like
/usr/lib/fai/updatebase hasn't changed that much between then and now. 

(apologies in advance for the long lines...)
 
the problem appears to be with the bind mount of /dev into the
$FAI_ROOT/dev chroot and the subsequent devpts mount at
$FAI_ROOT/dev/pts.  on our systems, this results in a shared(?) devpts
filesystem mounted repeatedly on the host's /dev/pts as well as
multiple times in the first dirinstall (/tmp/tmp.9TKUTDClPW below, both
dirinstalls in process):
devpts  on  
/dev/ptstype  devpts  
(rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/mapper/xenvg-beff2349--8d77--4ef3--9988--23d7ca0e2461.disk0-1  on  
/tmp/tmp.9TKUTDClPW type  ext4
(rw,relatime,block_validity,delalloc,barrier,user_xattr,acl)
/dev/mapper/xenvg-c10d187e--9fd6--4eb6--a916--19ade0447915.disk0-1  on  
/tmp/tmp.OTjBmSXukS type  ext4
(rw,relatime,block_validity,delalloc,barrier,user_xattr,acl)
tmpfs   on  
/tmp/tmp.9TKUTDClPW/var/lib/dpkgtype  tmpfs   (rw,noatime)
tmpfs   on  
/tmp/tmp.OTjBmSXukS/var/lib/dpkgtype  tmpfs   (rw,noatime)
procon  
/tmp/tmp.9TKUTDClPW/proctype  proc(rw,relatime)
sysfs   on  
/tmp/tmp.9TKUTDClPW/sys type  sysfs   (rw,relatime)
udevon  
/tmp/tmp.9TKUTDClPW/dev type  devtmpfs
(rw,nosuid,relatime,size=12305280k,nr_inodes=3076320,mode=755)
devpts  on  
/tmp/tmp.9TKUTDClPW/dev/pts type  devpts  
(rw,relatime,mode=600,ptmxmode=000)
devpts  on  
/dev/ptstype  devpts  
(rw,relatime,mode=600,ptmxmode=000)
procon  
/tmp/tmp.OTjBmSXukS/proctype  proc(rw,relatime)
sysfs   on  
/tmp/tmp.OTjBmSXukS/sys type  sysfs   (rw,relatime)
udevon  
/tmp/tmp.OTjBmSXukS/dev type  devtmpfs
(rw,nosuid,relatime,size=12305280k,nr_inodes=3076320,mode=755)
devpts  on  
/tmp/tmp.OTjBmSXukS/dev/pts type  devpts  
(rw,relatime,mode=600,ptmxmode=000)
devpts  on  
/dev/ptstype  devpts  
(rw,relatime,mode=600,ptmxmode=000)
devpts  on  
/tmp/tmp.9TKUTDClPW/dev/pts type  devpts  
(rw,relatime,mode=600,ptmxmode=000)

when that first dirinstall has completed, it tries to umount
everything.  however, this fails since there is the
extraneous /tmp/tmp.9TKUTDClPW/dev/pts that is apparently still in use
until the second dirinstall also completes (i'm unclear on the exact
details of how/why).  we're left with the first dirinstall error'ing
out:
The dirinstall took 369 seconds.
umount: /tmp/tmp.9TKUTDClPW/dev: target is busy
(In some cases useful info about processes that
 use the device is found by lsof(8) or fuser(1).)
Source hook: savelog.LAST.sh
ERRORS found in log files. See 
/var/log/fai/instance4.us.archive.org/dirinstall-20180706_233705/error.log
 
and its root and /dev left in place:
/dev/mapper/xenvg-beff2349--8d77--4ef3--9988--23d7ca0e2461.disk0-1  on  
/tmp/tmp.9TKUTDClPW type  ext4
(rw,relatime,block_validity,delalloc,barrier,user_xattr,acl)
udevon  
/tmp/tmp.9TKUTDClPW/dev type  devtmpfs
(rw,nosuid,relatime,size=12305280k,nr_inodes=3076320,mode=755)

i looked at how the schroot package avoids this and it uses `mount --
private`.  the attached patch applies that option to the $FAI_ROOT/dev
and $FAI_ROOT/dev/pts mounts set up via /usr/lib/fai/updatebase and
clears up this dirinstall problem.  i'll be testing it early next week
to ensure it doesn't introduce any issues on a netbooted install; if
that works (and barring feedback/concerns) i'll then submit an mr to
the fai repo.

thanks...

andy

-- 
andrew bezella 
internet archive--- a/lib/updatebase	2016-04-08 15:36:40.617083832 

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



UEFI + Legacy BIOS TFTP/PXELINUX

2018-07-06 Diskussionsfäden Rémy Dernat
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