Re: Getting boottime early in booting

From: Rick Macklem <rick.macklem_at_gmail.com>
Date: Sun, 05 Apr 2026 02:31:21 UTC
On Sat, Apr 4, 2026 at 5:53 PM Rick Macklem <rick.macklem@gmail.com> wrote:
>
> On Fri, Apr 3, 2026 at 6:05 PM Rick Macklem <rick.macklem@gmail.com> wrote:
> >
> > Hi,
> >
> > I'm fiddling with a NFSv4 diskless root fs setup and I've run
> > into a couple of challenges.
> >
> > 1 - I need a value that will be different each time the machine boots.
> >      I would normally use getboottime(), but for the NFS root fs mount,
> >      it just returns 0.
> >      Any ideas w.r.t. something I can acquire early in booting that will
> >      change each time the system is booted?
> >
> > 2 - Does anyone know how to fix "could not determine audit condition"
> >      which I get whenever I try and login when it is multiuser?
> >      (I can run single user, but since I can't login once it's multiuser??)
> Btw, in case anyone is interested, #2 was caused by the conf/base/var.cpio.gz
> file (used to create the md fs for /var) was too big for a 5Mbyte md.
> (Getting rid of some stuff in it fixed the problem.)
>
> I now have a NFSv4.2 root fs working ok, thanks to some help here
> w.r.t. getting a new value upon each boot.
>
> https://docs-archive.freebsd.org/doc/8.4-RELEASE/usr/share/doc/freebsd/handbook/network-pxe-nfs.html
> is pretty good, but does miss a couple of things. There's making sure the
> files for the md file systems aren't too big (or configuring the md's
> to be larger)
> and there's /tmp, which isn't mentioned.
> --> There is also dealing with setting up hostuuid when there are multiple
>      clients using the read-only root fs.
>       I'm not quite sure what is appropriate here?
>       - Maybe making /etc/hostid a symlink to a file in /var and then
>         having /etc/rc.d/hostid create the file when it doesn't exist, or
>         something like that. (For systems that don't have smbios.system.uuid
>         this would result in a different setting each boot, but the
> only alternative
>         I can think of would be a site local DHCPD option to specify it.
>         (This isn't a NFSv4 problem, but a shared read-only root fs problem.)
Actually, unless the file is needed, just deleting /etc/hostid from
the read-only
root fs works (the kernel sysctls get set).

Oh, and the current version of the Handbook section (I just noticed that
the google ai found an old version) does mention the 5Mbyte limit for
/etc and /var.

I did find that the recommended setings for the dhcpd.conf aren't that
great. I think it is better to specify fixed addresses based on the MACs.
A good example is in this wiki.
https://wiki.freebsd.org/MateuszPiotrowski/BootFreebsdFromNfs

rick

>
> Anyhow, if someone on the doc side feels like improving the above a little,
> that would be nice, rick
>
> >
> > Thanks for any help with these, rick