Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Apr 2014 20:40:25 -0400 (GMT-04:00)
From:      John <aqqa11@earthlink.net>
To:        FreeBSD questions <freebsd-questions@freebsd.org>
Subject:   Re: where does uname get version number?
Message-ID:  <6906853.1398040825953.JavaMail.root@mswamui-backed.atl.sa.earthlink.net>

next in thread | raw e-mail | index | archive | help



-----Original Message-----
>From: John <aqqa11@earthlink.net>
>Sent: Apr 19, 2014 6:49 PM
>To: FreeBSD questions <freebsd-questions@freebsd.org>
>Subject: Re: where does uname get version number?
>
>So the question is back to the beginning: I installed 9.1-RELEASE, then binary upgraded to 9.2-RELEASE using freebsd-update.  Now all files I checked are correctly in 9.2-RELEASE-p4.  For example:
>
>1. the kernel contains the new version:
> 
># strings /boot/kernel/kernel | grep RELEASE|grep 9
>@(#)FreeBSD 9.2-RELEASE-p4 #0: Tue Apr  8 18:08:22 UTC 2014
>FreeBSD 9.2-RELEASE-p4 #0: Tue Apr  8 18:08:22 UTC 2014
>9.2-RELEASE-p4
>
>2. /etc/hosts contains 9.2:
>
># $FreeBSD: release/9.2.0/etc/hosts 109997 2003-01-28 21:29:23Z dbaker $
>
>We have verified that:
>
>1. I never compiled kernel, and do not have /usr/src and /usr/obj folders now.
>
>2. the default /etc/profile is unchanged, in particular I never defined UNAME_* vars .
>
>3. I also tried "unsetenv UNAME_r"
>
>However, uname somehow shows the wrong version 9.1:
>
># uname -a
>FreeBSD localhost.localdomain 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>
>So where does uname get the version number from?  Which file(s) might not have been upgraded?  Thank you!

I found the source code of uname at

http://svnweb.freebsd.org/base/release/9.2.0/usr.bin/uname/uname.c?revision=255898&view=markup

it appears that "uname -v" does get version number from the environment variable "UNAME_v".  However it's beyond me to find out where there variables are obtained - on a stock RELEASE system without /usr/src and /usr/obj.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6906853.1398040825953.JavaMail.root>