netboot from NFS in an UEFI environment

Lucian Carata lc525 at cam.ac.uk
Sun Mar 24 22:55:46 UTC 2019


I am indeed passing root-path as {NFS-server-IP}:path/to/freebsd/root

But it looks to me loader.efi doesn't look at root-path at all (at least not until it fails).
I see it first searches for a device (currdev) and when it finds one (net0 in my case when PXE booting) it tries to determine whether it is a valid device in sanity_check_currdev() by doing:

> stat("/boot/defaults/loader.conf")
> stat("/boot/kernel/kernel")

Of course, having no other information at this stage (as in, the actual root path), this fails. Now, I've tried overwriting currdev (by explicitly setting rootdev) but without success.

The manual says "currdev   Selects the default device.  Syntax for devices is odd." but I don't know whether it would be possible to pass information about both the device and a root path (for example).

All the pieces seem to be there, as you mention. So before digging deeper I thought I would ask whether this is a supported scenario or not (i.e should it "just work"), or whether I'm doing something obviously silly.

in iPXE I'm currently doing:

chain nfs://{path/to/loader.efi} root-path={NFS-server-IP}:path/to/freebsd/root dhcp.root-path={same as root-path}

I'm passing root-path manually instead of through DHCP as I've been playing around with various options to see what might work; i've checked that when loader.efi starts it does have root-path set correctly (by executing `show root-path`)

---
Lucian

On 3/22/19 3:40 AM, Rebecca Cran wrote:
> On 3/20/19 11:21 AM, Lucian Carata wrote:
> 
>> Looking through the source code (stand/efi/loader/main.c) I see that there is an attempt to list devices, with a comment saying "this handle list is only for netboot" -- which shows that at least netbooting on UEFI has been considered, but I'm not sure how to pass the path of the NFS root so that the boot continues.
>>
>> Any ideas on how to do this (or something equivalent) would be greatly appreciated.
> 
> 
> stand/efi/conf.c does have nfs_fsops, so it should be supported. Maybe an obvious question, but have you tried setting the DHCP option 'root-path' ?
> 
> 
> -- 
> 
> Rebecca Cran
> 


More information about the freebsd-hackers mailing list