From owner-freebsd-questions@FreeBSD.ORG Thu Apr 17 03:40:59 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98C22768 for ; Thu, 17 Apr 2014 03:40:59 +0000 (UTC) Received: from elasmtp-dupuy.atl.sa.earthlink.net (elasmtp-dupuy.atl.sa.earthlink.net [209.86.89.62]) by mx1.freebsd.org (Postfix) with ESMTP id 546451BCF for ; Thu, 17 Apr 2014 03:40:59 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=XH7/un2OMPl40eelT6Qu7IZ7Bowpb99uBjSJr+5X0bcNOCU1VJ28PAe5EUU1Jc9+; h=Message-ID:Date:From:Reply-To:To:Subject:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-ELNK-Trace:X-Originating-IP; Received: from [209.86.224.36] (helo=elwamui-hybrid.atl.sa.earthlink.net) by elasmtp-dupuy.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1WadAJ-0005wZ-4D for freebsd-questions@freebsd.org; Wed, 16 Apr 2014 23:39:07 -0400 Received: from 108.50.137.40 by webmail.earthlink.net with HTTP; Wed, 16 Apr 2014 23:39:06 -0400 Message-ID: <4357625.1397705947117.JavaMail.root@elwamui-hybrid.atl.sa.earthlink.net> Date: Wed, 16 Apr 2014 23:39:06 -0400 (GMT-04:00) From: John To: freebsd-questions@freebsd.org Subject: Re: where does uname get version number? Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: EarthLink Zoo Mail 1.0 X-ELNK-Trace: 2552ff5019365d7e94f5150ab1c16ac0b4de374c5ae8ff798f434f215cd39b73627cd631698044fb350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 209.86.224.36 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: John List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 03:40:59 -0000 -----Original Message----- >From: Eduardo Morras >Sent: Apr 16, 2014 4:04 AM >To: freebsd-questions@freebsd.org >Cc: John >Subject: Re: where does uname get version number? > >On Wed, 16 Apr 2014 03:28:13 -0400 (GMT-04:00) >John wrote: > >> After a rocky upgrade from 9.1-RELEASE(-p10) to 9.2-RELEASE, all >> files I checked are now in 9.2-RELEASE-p3. For example: >> >> /usr/src/sys/conf/newvers.sh contains: >> >> TYPE="FreeBSD" >> REVISION="9.2" >> BRANCH="RELEASE-p4" >> >> /etc/hosts contains: >> >> # $FreeBSD: release/9.2.0/etc/hosts 109997 2003-01-28 21:29:23Z >> # dbaker $ >> >> and 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 >> >> However, uname somehow shows the wrong version: >> >> # 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! > >There was a thread about it last october. I c&p part of my answer here: > >-- >From uname and uname(3) man pages, > >"An environment variable composed of the string UNAME_ followed by any > flag to the uname utility (except for -a) will allow the corresponding > data to be set to the contents of the environment variable." > >The -a flag behave as though the options -m, -n, -r, -s, and -v were specified. Freebsd-update can modify /root/.profile or better, /etc/profile, adding those environment variables with correct and update values. >-- > Thank you! My current /etc/profile is the default one, its content is: # $FreeBSD: release/9.2.0/etc/profile 208116 2010-05-15 17:49:56Z jilles $ ... comments omitted here. # mesg y LANG=en_US.UTF-8; export LANG GDM_LANG=en_US.UTF-8; export GDM_LANG My /root/.profile is also the default one, its content is: # $FreeBSD: release/9.2.0/etc/root/dot.profile 199243 2009-11-13 05:54:55Z ed $ # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin export PATH HOME=/root export HOME TERM=${TERM:-xterm} export TERM PAGER=more export PAGER Do you want me to add the following to /etc/profile ? UNAME_v="FreeBSD 9.2-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC" export UNAME_v UNAME_r="9.2-RELEASE" export UNAME_r But, then do I have to manually change this version number in /etc/profile for each upgrade in the future? That would be quite a hassle for each upgrade to -p5, -p6, ... etc. Is that the way to go? I also tried: # unsetenv UNAME_r but "uname -r" still shows the incorrect "9.1-RELEASE" even though all other files mentioned above are in "9.2-RELEASE". So still, where did uname get that incorrect version number?