If /var is a tmpfs, using a simple "freebsd-update -r X.Y upgrade" will fails.
It will correctly fetch and install the kernel, then ask for reboot and entering "freebsd-update install", but after the reboot, the "freebsd-update install" will say "No updates are available to install" and stuck user with a new kernel but old userland.
=> There should have a check to be added for checking if the temporary directory used by freebsd-update is on a RAM disk (tmpfs, md, etc…)
I put up an attempt at solving this, but have no idea if anyone really wants to attempt this protection:
A commit references this bug:
Date: Mon Nov 17 15:12:47 UTC 2014
New revision: 274630
Add logic for detecting non-persistent filesystems being utilized by
workdir which would break the upgrade process upon reboot.
Currently we check for tmpfs and mdmfs.
Differential Revision: https://reviews.freebsd.org/D1163
Approved by: cperciva