pxe/efi loader rootpath protocols

Baptiste Daroussin bapt at FreeBSD.org
Sat May 20 11:52:27 UTC 2017


Hi all,

In FreeBSD current some changes happened in the loader regarding
pxeboot/loader.efi when pxe booting.

The goal is to be able to support natively multiple protocols (at first: nfs,
tftpfs) in the future http.

After having gone some hackish way to avoid problem with chainloading with iPxe
chainloading (which I will explain below) I want to move to a proper way.

currently in releases if one passes via dhcp
root-path ip:path

the pxeloader will try look for a nfsroot on the nfs server <ip> under the path
<path>

if one set
root-path path

the loader will look for a nfsroot under <path> on the nfs server located on the
same machine the pxeboot was loader from via tftp

To activate the support for tftpfs by default in the loader, I looked for a way
to be able to specify the protocol in the dhcp request.

The natural direction would have been to add the protocol scheme in the
root-path
tftp://ip/path
and add a new
nfs://ip/path

Extending the current supported list of root-path (aka not breaking existing
setup).

While it looked good, I quickly found a problem: chainloading from ipxe which is
for example the default for net booting from qemu in bios mode.

ipxe already expect a scheme:/ and knows about tftp:/ but expect something else
so it will not load the pxeboot but try to boot directly from tftp:/

So I tried to workaround it by not changing the root-path but abusing a dhcp
option that defined a tftpserver to specify to the pxeboot it needs to use
tftpfs and not nfs.

While it worked, not all dhcp servers supports that, and that is still a problem
for the day we add http support.

The new approach I would like to go with it having a proper URI parser in
libstand for pxeboot/loader.efi to use and ignore the issue with iPXE.

Tell the people to configure properly their dhcp server (iPXE is provide a
user-class information IPXEBOOT) so the dhcp servers can avoid sending root-path
to iPXE for machines supposed to boot on pxeboot. The loader issueing a dhcp
request itself it will get the proper root-path and will do the right thing.

If you see any problem with this approach please tell it quickly. I want to go
fast as I want it in FreeBSD 11.1

I will issue a review soon

Best regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20170520/6054029c/attachment.sig>


More information about the freebsd-hackers mailing list