From owner-freebsd-questions@FreeBSD.ORG Fri Apr 18 04:59:04 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 351FEC8 for ; Fri, 18 Apr 2014 04:59:04 +0000 (UTC) Received: from elasmtp-kukur.atl.sa.earthlink.net (elasmtp-kukur.atl.sa.earthlink.net [209.86.89.65]) by mx1.freebsd.org (Postfix) with ESMTP id E42751E55 for ; Fri, 18 Apr 2014 04:59:03 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=aXJ0zllmcGrloIF2wsbw5+6ZHe48pJEEt9motlw0zzF7Gj/uWUM703rAPYToKIPM; 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.33] (helo=elwamui-darkeyed.atl.sa.earthlink.net) by elasmtp-kukur.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1Wb0jL-0006PF-LV for freebsd-questions@freebsd.org; Fri, 18 Apr 2014 00:48:51 -0400 Received: from 108.50.137.40 by webmail.earthlink.net with HTTP; Fri, 18 Apr 2014 00:48:51 -0400 Message-ID: <30564000.1397796531648.JavaMail.root@elwamui-darkeyed.atl.sa.earthlink.net> Date: Fri, 18 Apr 2014 00:48:51 -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: 2552ff5019365d7e94f5150ab1c16ac0b4de374c5ae8ff79b4115e97675481b593dca98c5c359bf7350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 209.86.224.33 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: Fri, 18 Apr 2014 04:59:04 -0000 -----Original Message----- >From: Eduardo Morras >Sent: Apr 17, 2014 3:07 AM >To: freebsd-questions@freebsd.org >Subject: Re: where does uname get version number? > >On Wed, 16 Apr 2014 23:39:06 -0400 (GMT-04:00) >John wrote: > >> 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? > >No, freebsd-update should update your /etc/profile and UNAME_* system vars. > >> >> 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? > >If there's no UNAME_* defined, you undefined it with #unsetenv, uname reads them from /usr/obj/usr/src/sys/$KERNEL/vers{ion,.c} files. Trond suggest to delete them before rebuilding, so they get updated too, nice suggestion. Mine sets different information in UNAME_* and vers{ion,.c} files. This discrepancy should be avoided. > >--- --- Thanks. I don't have the folder /usr/obj/usr/src/sys/ . Under /usr/obj/usr/src/ I only see two folders: lib32 and tmp. I did find a file /usr/obj/lib32/usr/src/include/vers.c , that contains the incorrect version: #define SCCSSTR "@(#)FreeBSD 9.1-RELEASE #0: Mon Jan 21 15:45:14 UTC 2013" #define VERSTR "FreeBSD 9.1-RELEASE #0: Mon Jan 21 15:45:14 UTC 2013\n root@:/usr/obj/lib32/usr/src/include\n" #define RELSTR "9.1-RELEASE" That's closer now! However, I never compiled the kernel, I only installed 9.0-RELEASE and ran freebsd-update to upgrade to 9.2-RELEASE, so don't know how these /usr/obj files were produced. I installed virtualbox before, maybe that produced /usr/obj ? Anyway, I have deleted these folders /usr/src/ and /usr/obj/ , then ran svn to install /usr/src/ , and then rebooted. Yet "uname -a" still says the incorrect 9.1-RELEASE. Now I don't even have /usr/obj , where does uname get that incorrect version now?