Re: nanobsd [was Re: Cross compiling user applications for armv7]

From: Sulev-Madis Silber <freebsd-arm-freebsd-org097_at_ketas.si.pri.ee>
Date: Sat, 20 Sep 2025 23:19:26 UTC

On September 20, 2025 2:34:06 PM GMT+03:00, Karl Denninger <karl@denninger.net> wrote:
...
>There are ways to have that also be two-root-partition allowing "near-line" updates (update the other partition with the new OS code then reboot to activate it) provided you have a deterministic way to know which device the loader will boot from.  On EFI boot machines this can be problematic to obtain deterministically once the system is running.
>

there was some discussion somewhere about boot switching troubles

unsure if even gpt helps here with it's dual part tables

in my case i replace env files in efi part to control boot switch. it's a bad hack. i use cp, sync, mv, sync, etc magic to make it more power fail resistant

i wish there's some sane way to do that. maybe loader could have changes. so you don't need to muck around with currdev & rootdev and what else. perhaps boot by ufs label?

in my case i finally settled on ufs label of rootfs-<unixtimestamp>. my approach writes full raw fs images which stay unmodified

and what about zfs? i might also need to have double pool system for resiliance

i battled with this before efi too, 10y ago, in embedded. then it was fun if somewhere between uboot stages and fbsd loader / kernel, the boot order magically changes

unsure if zfs be could be used here and is it enough. is it better in embedded? zfs also has benefits like copies=3 and compression. and ability to withstand power failures. unsure about which extent but on ufs i was once cursing on 0b file. but at least on zfs the bootfs is a metadata and that's much better than file on fs

any opinions here?

it doesn't need to be so "embedded" always either. i can imagine it being useful in servers

i just wonder if zfs could fail

or if you could write into zfs after imaging it to device to set it booting and then remove it from other pool? what boots of both have it? i haven't looked into efi loader logic on that

i even wondered about patching efi loader so it could read multiple env files

hmm,

https://klarasystems.com/articles/the-freebsd-boot-process/

anyway, what to do?