Greetings!
I was not entirely sure whether to post this under general or development; if it warrants a move to the development section please let me know.
I am trying to better understand how to differentiate versions of FreeBSD while working with a configuration management system, Chef in particular. Besides the major, minor and patch levels of a FreeBSD release (e.g. 8.2-RELEASE-p2) there is __FreeBSD_version. As far as I can currently tell, you can read this value off the header file /usr/src/sys/sys/param.h.
In practice a machine may or may not have sources on it. And of course even when a machine has sources there is still the caveat of when sources have been updated and the system has not been rebuilt yet; reading off file here may give an incorrect value if __FreeBSD_version has changed. uname unfortunately does not provide this value although it does provide the repository commit/revision number.
Is there a way of consistently and correctly detecting __FreeBSD_version on a running FreeBSD system whether or not sources are available on the machine?
I was not entirely sure whether to post this under general or development; if it warrants a move to the development section please let me know.
I am trying to better understand how to differentiate versions of FreeBSD while working with a configuration management system, Chef in particular. Besides the major, minor and patch levels of a FreeBSD release (e.g. 8.2-RELEASE-p2) there is __FreeBSD_version. As far as I can currently tell, you can read this value off the header file /usr/src/sys/sys/param.h.
In practice a machine may or may not have sources on it. And of course even when a machine has sources there is still the caveat of when sources have been updated and the system has not been rebuilt yet; reading off file here may give an incorrect value if __FreeBSD_version has changed. uname unfortunately does not provide this value although it does provide the repository commit/revision number.
Is there a way of consistently and correctly detecting __FreeBSD_version on a running FreeBSD system whether or not sources are available on the machine?