Where to find release version?

Hi all,

I'm looking for a way to determine which version of FreeBSD is installed on a mounted partition by reading the filesystem (under Linux). I haven't found a file which does provide this info - such as for example /etc/release (in NetBSD). I don't mind parsing a binary file, like a kernel module - if there is no better choice, but I don't know where to look. Would be great if it where on slice a somewhere.

The "$FreeBSD: ..." line of comment that is present in many files is not reliable, as it doesn't necessarily contain the version number but just a path.
 
DutchDaemon said:
See if you have /usr/src/sys/conf/newvers.sh.

Hi,
I do on some systems, but not on a minimal install for example. The info would work though if the file is there. However /usr/src is not a very good place, since /usr will be most likely in a different slice and /usr/src even on a different computer.

In the meantime I looked in the kernel and found what I was looking for:

Code:
$ strings /freebsd/boot/kernel/kernel | sed -n 's|^\(FreeBSD [0-9][0-9.]*-*[^ ]*\).*|\1|p'
FreeBSD 9.0-RELEASE

and on another machine:

Code:
$ strings /freebsd/boot/kernel/kernel | sed -n 's|^\(FreeBSD [0-9][0-9.]*-*[^ ]*\).*|\1|p'
FreeBSD 8.1-RELEASE

Problem solved.
But I think that /etc/release or something similar would be useful.

Thanks.
 
Back
Top