From owner-freebsd-questions@FreeBSD.ORG Fri Apr 18 16:59:32 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 4FAC94D8 for ; Fri, 18 Apr 2014 16:59:32 +0000 (UTC) Received: from elasmtp-spurfowl.atl.sa.earthlink.net (elasmtp-spurfowl.atl.sa.earthlink.net [209.86.89.66]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0F11600 for ; Fri, 18 Apr 2014 16:59:31 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=lTYRfjKZmOMn3tGbUfKEbJbTFXzPm8puELq4IurOLW2VG30V10uWdXFTRYQfhbdS; 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.25] (helo=mswamui-backed.atl.sa.earthlink.net) by elasmtp-spurfowl.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1WbC8K-0002U6-MP for freebsd-questions@freebsd.org; Fri, 18 Apr 2014 12:59:24 -0400 Received: from 108.50.137.40 by webmail.earthlink.net with HTTP; Fri, 18 Apr 2014 12:59:24 -0400 Message-ID: <9530580.1397840364718.JavaMail.root@mswamui-backed.atl.sa.earthlink.net> Date: Fri, 18 Apr 2014 12:59:24 -0400 (GMT-04:00) From: John To: FreeBSD questions Subject: Re: where does uname get version number? Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: EarthLink Zoo Mail 1.0 X-ELNK-Trace: 2552ff5019365d7e94f5150ab1c16ac0b4de374c5ae8ff79e5571926a89d01587c3610b3f6c88fc3350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 209.86.224.25 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 16:59:32 -0000 -----Original Message----- >From: John >Sent: Apr 18, 2014 12:51 PM >To: FreeBSD questions >Subject: Re: where does uname get version number? > > > > >-----Original Message----- >>From: Trond Endrest=C3=B8l >>Sent: Apr 18, 2014 9:38 AM >>To: John >>Cc: FreeBSD questions >>Subject: Re: where does uname get version number? >> >>On Fri, 18 Apr 2014 00:48-0400, John wrote: >> >>> -----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 ? >>> >>=20 >>> >> UNAME_v=3D"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=3D"9.2-RELEASE" >>> >> export UNAME_r >>> >>=20 >>> >> 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. >>> > >>> >>=20 >>> >> I also tried: >>> >>=20 >>> >> # unsetenv UNAME_r=20 >>> >>=20 >>> >> but "uname -r" still shows the incorrect "9.1-RELEASE" even though >>> >> all other files mentioned above are in "9.2-RELEASE". >>> >>=20 >>> >> 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 sugg= est to delete them before rebuilding, so they get updated too, nice suggest= ion. Mine sets different information in UNAME_* and vers{ion,.c} files. Thi= s discrepancy should be avoided. >>> > >>> >--- --- >>>=20 >>> Thanks. I don't have the folder /usr/obj/usr/src/sys/ . Under /usr/ob= j/usr/src/ I only see two folders: lib32 and tmp. >>>=20 >>> I did find a file /usr/obj/lib32/usr/src/include/vers.c , that contains= the incorrect version: >>>=20 >>> #define SCCSSTR "@(#)FreeBSD 9.1-RELEASE #0: Mon Jan 21 15:45:14 UTC 20= 13" >>> #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" >>>=20 >>> That's closer now! However, I never compiled the kernel, I only=20 >>> installed 9.0-RELEASE and ran freebsd-update to upgrade to=20 >>> 9.2-RELEASE, so don't know how these /usr/obj files were produced. =20 >>> I installed virtualbox before, maybe that produced /usr/obj ? >>>=20 >>> Anyway, I have deleted these folders /usr/src/ and /usr/obj/ , then=20 >>> ran svn to install /usr/src/ , and then rebooted. Yet "uname -a"=20 >>> still says the incorrect 9.1-RELEASE. Now I don't even have=20 >>> /usr/obj , where does uname get that incorrect version now? >> >>If I understand this at all, freebsd-update simply downloads and=20 >>installs precompiled bits and pieces of the base system, including the=20 >>kernel. The system needs to be rebooted manually to be able to use an=20 >>updated kernel and other long running pieces like init(8). >> >>Checking out a new working copy of the source tree using svn is only=20 >>the first step of a multi-step approach of updating the base system=20 >>using the source tree; the remaining steps being compiling the world=20 >>and the kernel, installing the kernel, rebooting the system, and if=20 >>all goes well, install world, merge any changes to the config files,=20 >>and optionally delete obsolete stuff, before doing the final reboot.=20 >> >>Yes, always perform the final reboot to verify that the system is able=20 >>to reboot in case of a panic at a later stage. >> >>If the new kernel didn't load well, simply reboot, interrupt the boot=20 >>loader, unload the bad kernel, load the old kernel=20 >>(/boot/kernel.old/kernel), and boot the system, followed by=20 >>mv /boot/kernel /boot/kernel.bad, and=20 >>mv /boot/kernel.old /boot/kernel. >> >>Next time, it's sufficient to update the working copy (svn up=20 >>/usr/src), rather than erasing /usr/src and do a complete checkout,=20 >>before performing the remaining steps as outlined above. >> >>I haven't tried freebsd-update at all, I've always done my upgrades=20 >>using the source, I do find it strange that the new kernel doesn't=20 >>identify itself as being newer than the previous kernel. >> >>And why must freebsd-update fiddle with the UNAME_* env vars? >> >>--=20 > >Thanks for the clarification! I don't compile kernel, I only installed 9.= 1-RELEASE and binary upgraded to 9.2-RELEASE using freebsd-update. (I'm wo= rried about the lifetime of the SSD in my laptop so am trying to avoid comp= iling, but that's a side topic.) > >I now totally deleted /usr/src (and /usr/obj), because I don't need them n= ow as I now install virtualbox from pkg. > >But after rebooting, "uname -a" still shows 9.1-RELEASE. As mentioned bef= ore, all files such as kernel etc are in 9.2, where does uname get that inc= orrect version now? >>And why must freebsd-update fiddle with the UNAME_* env vars? Sorry forgot to answer your question, someone kindly suggested I might have= defined the UNAME_* vars incorrectly in /etc/profile etc, that will lead u= name to report incorrect version, so asked me to look into that. Turned ou= t I never defined that. So it's still a mystery where does uname get the i= ncorrect version 9.1, while all files such as kernel etc contains 9.2.