Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Apr 2014 15:38:29 +0200 (CEST)
From:      =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no>
To:        John <aqqa11@earthlink.net>
Cc:        FreeBSD questions <freebsd-questions@freebsd.org>
Subject:   Re: where does uname get version number?
Message-ID:  <alpine.BSF.2.00.1404181514560.9102@mail.fig.ol.no>
In-Reply-To: <30564000.1397796531648.JavaMail.root@elwamui-darkeyed.atl.sa.earthlink.net>
References:  <30564000.1397796531648.JavaMail.root@elwamui-darkeyed.atl.sa.earthlink.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 18 Apr 2014 00:48-0400, John wrote:

> -----Original Message-----
> >From: Eduardo Morras <emorrasg@yahoo.es>
> >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?

If I understand this at all, freebsd-update simply downloads and 
installs precompiled bits and pieces of the base system, including the 
kernel. The system needs to be rebooted manually to be able to use an 
updated kernel and other long running pieces like init(8).

Checking out a new working copy of the source tree using svn is only 
the first step of a multi-step approach of updating the base system 
using the source tree; the remaining steps being compiling the world 
and the kernel, installing the kernel, rebooting the system, and if 
all goes well, install world, merge any changes to the config files, 
and optionally delete obsolete stuff, before doing the final reboot. 

Yes, always perform the final reboot to verify that the system is able 
to reboot in case of a panic at a later stage.

If the new kernel didn't load well, simply reboot, interrupt the boot 
loader, unload the bad kernel, load the old kernel 
(/boot/kernel.old/kernel), and boot the system, followed by 
mv /boot/kernel /boot/kernel.bad, and 
mv /boot/kernel.old /boot/kernel.

Next time, it's sufficient to update the working copy (svn up 
/usr/src), rather than erasing /usr/src and do a complete checkout, 
before performing the remaining steps as outlined above.

I haven't tried freebsd-update at all, I've always done my upgrades 
using the source, I do find it strange that the new kernel doesn't 
identify itself as being newer than the previous kernel.

And why must freebsd-update fiddle with the UNAME_* env vars?

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+
From owner-freebsd-questions@FreeBSD.ORG  Fri Apr 18 13:39:43 2014
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
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 134285F1
 for <freebsd-questions@freebsd.org>; Fri, 18 Apr 2014 13:39:43 +0000 (UTC)
Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 814B31178
 for <freebsd-questions@freebsd.org>; Fri, 18 Apr 2014 13:39:41 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id s3IDGO0F058789;
 Fri, 18 Apr 2014 23:16:25 +1000 (EST)
 (envelope-from smithi@nimnet.asn.au)
Date: Fri, 18 Apr 2014 23:16:24 +1000 (EST)
From: Ian Smith <smithi@nimnet.asn.au>
To: kpneal@pobox.com
Subject: Re: The source code of *BSD contains the comment ?Does this belong
 here??
In-Reply-To: <mailman.83.1397822403.25401.freebsd-questions@freebsd.org>
Message-ID: <20140418230031.G11168@sola.nimnet.asn.au>
References: <mailman.83.1397822403.25401.freebsd-questions@freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Cc: Paul Schmehl <pschmehl_lists@tx.rr.com>, freebsd-questions@freebsd.org
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>;
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 18 Apr 2014 13:39:43 -0000

In freebsd-questions Digest, Vol 515, Issue 9, Message: 11
On Fri, 18 Apr 2014 07:51:08 -0400 kpneal@pobox.com wrote:
 > On Wed, Apr 16, 2014 at 04:44:48PM -0500, Paul Schmehl wrote:
[..]
 > > # grep -r "doesn't belong" /usr/src/*

Or any other commentary along the lines of "this is broken" or "is this 
right?" or "XXX dirty code alert" or whatever you can imagine; it's all 
in there somewhere.  Maybe $someone could design an AI machine to churn 
through the comments looking for derogatory, self-deprecating, admission 
of non-omniscience or otherwise unseemly comments and ROOT THEM OUT! :-)

[..]

 > > /usr/src/games/fortune/datfiles/fortunes-o.real:Which of the following 
 > > doesn't belong?
 > > /usr/src/games/fortune/datfiles/fortunes:	chute doesn't belong to anyone, 
 > > ever.
 > 
 > Oh come on. The fortune utility is a cute toy that serves no practical
 > use. Comments in the messages it can print say _nothing_ about the quality
 > of the source base.

In over 15 years, I've never seen a fortune.core  Rock solid, here :-)

cheers, Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1404181514560.9102>