`freebsd-update upgrade` looks at `uname -r` instead of `freebsd-version`. When running in a jail, this results in the error "freebsd-update: Cannot upgrade from 10.3-RELEASE to itself". This can be worked around by setting UNAME_r=`freebsd-version`. However, this is an unnecessary complication, and there's no clear path to discover this since one must look in the uname man page for problems with freebsd-update.
The "--currently-running" also exists so one could do "freebsd-update --currently-running `freebsd-version`" which is decently documented.
(In reply to Gerald Aryeetey from comment #1) True, thanks, that's a better work-around. Still, it seems obvious that it should default to what's actually installed, which is easily determined by `freebsd-version`. `uname` is often not what's actually installed.
I believe that the workaround is ugly. freebsd-update can detect whether it runs inside a jail and derive the version automatically.
This could be used, I guess: root@deblndw013x4v1j:~ # sysctl -a | grep jail ... security.jail.jailed: 1
I guess I don't see the point of examining sysctl or branching differently when in a jail. There's actually no need for `freebsd-update` to be aware of jails at all, nor be aware of the currently running kernel. The whole point of `freebsd-version` is to indicate what is currently installed, be it in a jail or not, which is exactly what `freebsd-update` needs. The command `UNAME_r=$(freebsd-version) freebsd-update` works in all cases I'm aware of. `freebsd-update` just needs to be changed to default to it.
(In reply to Leif Pedersen from comment #5) Agree, no reason to use uname here. freebsd-version everywhere.