Re: Getting boottime early in booting

Rick Macklem <[email protected]>
Newsgroups gmane.os.freebsd.current
Message-ID <CAM5tNy6ewm69xtkfr=nvMSZA3-cb57mpkqJ644y442Tx2XQSmg@mail.gmail.com>
On Sat, Apr 4, 2026 at 1:52 AM Dag-Erling Smørgrav <[email protected]> wrote:
>
> Rick Macklem <[email protected]> writes:
> > 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?
>
> Just use arc4random(9).
Yes, that does seem to work now. (It didn't seem to be working when I
tried before posting? For the very old i386 system I am testing on,
arc4random() works for me, if I wait until I really need the value, which
is when the RPC is being done to the NFS server. Before testing, I was
trying arc4random() much earlier in the boot.)

For a UEFI laptop, it looks like arc4random() works quite early in the
boot. (It has the entropy_efi_seed=YES in it's boot variables.)

Anyhow, thanks everyone, for the useful hints, rick

>
> DES
> --
> Dag-Erling Smørgrav - [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.