public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Renzmann <mrenzmann@web.de>
To: linux-kernel@vger.kernel.org
Subject: How to retrieve version from kernel source (the right way)?
Date: Wed, 09 Feb 2005 09:17:35 +0100	[thread overview]
Message-ID: <4209C71F.9040102@web.de> (raw)

Hi all.

(Please CC: me, I'm not subscribed - although I'm following the list 
through gmane.org)

I'm working on Madwifi (a driver for wireless lan cards with Atheros 
chipset), which isn't part of the kernel (and probably won't ever be due 
to the binary-only HAL). As every third-party device driver madwifi 
needs to know which kernel version it is compiled for, at least for 
determining the proper location to install itself after compilation. 
But... what is the right way to do this?

We used to get the kernel version via "uname -r", but dropped that 
behaviour. Chances are good that one wants to build the driver for a 
kernel version other than the currently running kernel.

Then we started to grep VERSION, PATCHLEVEL, SUBLEVEL and EXTRAVERSION 
from the kernel's Makefile. This failed, since some distributors seem to 
use shell commands for at least one of those. Example from SuSE 9.1:
=== cut ===
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 5
EXTRAVERSION = -$(shell echo $(CONFIG_RELEASE)-$(CONFIG_CFGNAME))
=== cut ===

Newer kernels also allow to set CONFIG_LOCALVERSION in .config.

It seems that include/linux/version.h holds the complete version 
information in UTS_RELEASE. Is it reliable to get the information from 
version.h? Or is there any other preferred method for this?

Bye, Mike

             reply	other threads:[~2005-02-09  8:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09  8:17 Michael Renzmann [this message]
2005-02-09  8:22 ` How to retrieve version from kernel source (the right way)? Brice Goglin
2005-02-09  9:14 ` Christoph Hellwig
2005-02-09 21:44 ` Sam Ravnborg
2005-02-10  7:06   ` Michael Renzmann
     [not found]     ` <200502100854.37606.agruen@suse.de>
2005-02-10  8:29       ` Michael Renzmann
2005-02-10 18:42     ` Sam Ravnborg
2005-02-10 19:07       ` Michael Renzmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4209C71F.9040102@web.de \
    --to=mrenzmann@web.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox