Would it be possible to report Debian kernel version in uname output? Maybe it can be added to "kernel version" string, uname -v (now it's "#1 SMP Wed Aug 17 05:07:22 UTC 2011".
This information is present in /proc/version and could be in uname too.
-- Package-specific info:
** Version:
Linux version 3.0.0-1-amd64 (Debian 3.0.0-2) (ben@decadent.org.uk) (gcc version 4.5.3 (Debian 4.5.3-5) ) #1 SMP Wed Aug 17 05:07:22 UTC 2011
** Model information
sys_vendor: ASUSTeK Computer INC.
product_name: 1215B
product_version: x.x
chassis_vendor: ASUSTeK Computer INC.
chassis_version: x.x
bios_vendor: American Megatrends Inc.
bios_version: 0401
board_vendor: ASUSTeK Computer INC.
board_name: 1215B
board_version: x.xx
06:00.0 USB Controller [0c03]: Device [1b21:1042] (prog-if 30)
Subsystem: ASUSTeK Computer Inc. Device [1043:8488]
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 18
Region 0: Memory at fe900000 (64-bit, non-prefetchable) [size=32K]
Capabilities: <access denied>
Kernel driver in use: xhci_hcd
** USB devices:
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 13d3:5711 IMC Networks
Bus 002 Device 002: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages linux-image-3.0.0-1-amd64 depends on:
ii debconf [debconf-2.0] 1.5.36.1 Debian configuration management sy
ii initramfs-tools [linux-initra 0.99 tools for generating an initramfs
ii linux-base 3.3 Linux image base package
ii module-init-tools 3.12-1 tools for managing Linux kernel mo
Versions of packages linux-image-3.0.0-1-amd64 recommends:
ii firmware-linux-free 3 Binary firmware for various driver
ii libc6-i686 2.11.2-10 Embedded GNU C Library: Shared lib
Versions of packages linux-image-3.0.0-1-amd64 suggests:
ii grub-pc 1.98+20100804-14 GRand Unified Bootloader, version
pn linux-doc-3.0.0 <none> (no description available)
Versions of packages linux-image-3.0.0-1-amd64 is related to:
pn firmware-bnx2 <none> (no description available)
pn firmware-bnx2x <none> (no description available)
pn firmware-ipw2x00 <none> (no description available)
pn firmware-ivtv <none> (no description available)
pn firmware-iwlwifi <none> (no description available)
ii firmware-linux 0.33 Binary firmware for various driver
ii firmware-linux-nonfree 0.33 Binary firmware for various driver
pn firmware-qlogic <none> (no description available)
pn firmware-ralink <none> (no description available)
pn xen-hypervisor <none> (no description available)
-- debconf information excluded
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110822163533.4978.87865.reportbug@lisko">http://lists.debian.org/20110822163533.4978.87865.reportbug@lisko
08-22-2011, 04:54 PM
Jonathan Nieder
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
reassign 638878 coreutils 8.5-1
quit
Hi Touko,
Touko Korpela wrote:
> Would it be possible to report Debian kernel version in uname
> output? Maybe it can be added to "kernel version" string, uname -v
> (now it's "#1 SMP Wed Aug 17 05:07:22 UTC 2011".
> This information is present in /proc/version and could be in uname too.
The uname utility is provided by coreutils, which could read this
information from /proc/version if it's desirable (no opinion on
that personally).
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110822165449.GA11875@elie.gateway.2wire.net">htt p://lists.debian.org/20110822165449.GA11875@elie.gateway.2wire.net
08-22-2011, 06:44 PM
Jonathan Nieder
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
Ben Hutchings wrote:
>> Touko Korpela wrote:
>>> Would it be possible to report Debian kernel version in uname
>>> output? Maybe it can be added to "kernel version" string, uname -v
>>> (now it's "#1 SMP Wed Aug 17 05:07:22 UTC 2011".
>>> This information is present in /proc/version and could be in uname too.
[...]
> I don't think uname(1) should be changed; it is supposed to report
> just what uname(2) does. We should change the behaviour of the
> latter, if anything.
Ah, ok. I admit my bias is towards not passing this information back
from uname(2), since application authors could be tempted to parse it
to provide Debian-specific behavior changes (for example, to work
around bugs using the Debian kernel version number instead of finding
some robust way to work around them that applies to other distros,
too). On the other hand, as a human-readable version identifier,
"linux-2.6 3.0.0-2 as compiled by Ben Hutchings on 2011-08-17
04:08:52" is more convenient than
Linux 3.0.0-1-amd64 #1 SMP Wed Aug 17 04:08:52 UTC 2011 x86_64 GNU/Linux
What is the underlying problem being solved? Is it that it is hard
when reporting bugs to tell the difference between the package version
and ABI version in order to provide the former?
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110822184402.GF11875@elie.gateway.2wire.net">htt p://lists.debian.org/20110822184402.GF11875@elie.gateway.2wire.net
08-22-2011, 07:10 PM
Ben Hutchings
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
On Mon, Aug 22, 2011 at 01:44:03PM -0500, Jonathan Nieder wrote:
> Ben Hutchings wrote:
> >> Touko Korpela wrote:
>
> >>> Would it be possible to report Debian kernel version in uname
> >>> output? Maybe it can be added to "kernel version" string, uname -v
> >>> (now it's "#1 SMP Wed Aug 17 05:07:22 UTC 2011".
> >>> This information is present in /proc/version and could be in uname too.
> [...]
> > I don't think uname(1) should be changed; it is supposed to report
> > just what uname(2) does. We should change the behaviour of the
> > latter, if anything.
>
> Ah, ok. I admit my bias is towards not passing this information back
> from uname(2), since application authors could be tempted to parse it
> to provide Debian-specific behavior changes (for example, to work
> around bugs using the Debian kernel version number instead of finding
> some robust way to work around them that applies to other distros,
> too). On the other hand, as a human-readable version identifier,
> "linux-2.6 3.0.0-2 as compiled by Ben Hutchings on 2011-08-17
> 04:08:52" is more convenient than
>
> Linux 3.0.0-1-amd64 #1 SMP Wed Aug 17 04:08:52 UTC 2011 x86_64 GNU/Linux
>
> What is the underlying problem being solved? Is it that it is hard
> when reporting bugs to tell the difference between the package version
> and ABI version in order to provide the former?
I think the problem is that many generic scripts that attempt to
capture the kernel version will not use 'uname -a', 'uname -rv', or
similar. If they were to use /proc/version, that would be sufficient,
but then the uname commands probably work for almost every other
distribution. A generic script won't check package status (which
in any case doesn't necessarily match the running kernel version).
(We have an even worse problem with kernel tracebacks; they only show
the release e.g. '2.6.32-5-amd64'. But we could change that too.)
Ben.
--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110822191041.GB29924@decadent.org.uk">http://lists.debian.org/20110822191041.GB29924@decadent.org.uk
08-22-2011, 07:15 PM
Touko Korpela
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
On Mon, Aug 22, 2011 at 01:44:03PM -0500, Jonathan Nieder wrote:
> Ben Hutchings wrote:
> >> Touko Korpela wrote:
>
> >>> Would it be possible to report Debian kernel version in uname
> >>> output? Maybe it can be added to "kernel version" string, uname -v
> >>> (now it's "#1 SMP Wed Aug 17 05:07:22 UTC 2011".
> >>> This information is present in /proc/version and could be in uname too.
> [...]
> > I don't think uname(1) should be changed; it is supposed to report
> > just what uname(2) does. We should change the behaviour of the
> > latter, if anything.
>
> Ah, ok. I admit my bias is towards not passing this information back
> from uname(2), since application authors could be tempted to parse it
> to provide Debian-specific behavior changes (for example, to work
> around bugs using the Debian kernel version number instead of finding
> some robust way to work around them that applies to other distros,
> too). On the other hand, as a human-readable version identifier,
> "linux-2.6 3.0.0-2 as compiled by Ben Hutchings on 2011-08-17
> 04:08:52" is more convenient than
>
> Linux 3.0.0-1-amd64 #1 SMP Wed Aug 17 04:08:52 UTC 2011 x86_64 GNU/Linux
>
> What is the underlying problem being solved? Is it that it is hard
> when reporting bugs to tell the difference between the package version
> and ABI version in order to provide the former?
For example when reporting bugs upstream and using their scripts. It's true
that you can sometimes guess Debian version number from the compile time (that shows
in uname) but if Debian version can be added there I say go for it.
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110822191533.GA31021@tiikeri.vuoristo.local">htt p://lists.debian.org/20110822191533.GA31021@tiikeri.vuoristo.local
08-22-2011, 07:23 PM
Michael Stone
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
On Mon, Aug 22, 2011 at 08:10:41PM +0100, Ben Hutchings wrote:
I think the problem is that many generic scripts that attempt to
capture the kernel version will not use 'uname -a', 'uname -rv', or
similar. If they were to use /proc/version, that would be sufficient,
but then the uname commands probably work for almost every other
distribution. A generic script won't check package status (which
in any case doesn't necessarily match the running kernel version).
I'd call it a simple expectation problem; people would like uname to say
something like 2.6.32-34squeeze1 rather than "#1 SMP Wed May 18 07:08:50
UTC 2011" when they ask about the kernel version.
Mike Stone
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: b4aaaf12-ccf3-11e0-a18f-001cc0cda50c@msgid.mathom.us">http://lists.debian.org/b4aaaf12-ccf3-11e0-a18f-001cc0cda50c@msgid.mathom.us
08-22-2011, 07:44 PM
Touko Korpela
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
On Mon, Aug 22, 2011 at 11:27:10AM -0600, Bob Proulx wrote:
> tags 638878 + moreinfo
> thanks
>
> Touko Korpela wrote:
> > Would it be possible to report Debian kernel version in uname
> > output? Maybe it can be added to "kernel version" string, uname -v
> > (now it's "#1 SMP Wed Aug 17 05:07:22 UTC 2011".
> > This information is present in /proc/version and could be in uname too.
>
> Exactly what information is it precisely that you wish included in
> 'uname' output? Because uname already includes the kernel version
> information.
>
> $ uname -a
> Linux example 3.0.0-1-amd64 #1 SMP Sun Jul 24 02:24:44 UTC 2011 x86_64 GNU/Linux
It shows now only Debian package name (3.0.0-1-amd64 part), not version
(3.0.0-2).
>
> I don't yet know what information you want to access from
> /proc/version but since accessing specific information from
> /proc/version is intrinsically non-portable it seems bad to hack it
> into 'uname' making it more non-portable. And since it is trivial to
> read it from /proc/version directly there doesn't seem to be any need
> to hack this into 'uname'. Why not read it from /proc/version directly?
It's simpler if you don't need to find data from many places.
I think "uname -a" should tell version of kernel package used if that information
is available.
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110822194408.GB31021@tiikeri.vuoristo.local">htt p://lists.debian.org/20110822194408.GB31021@tiikeri.vuoristo.local
08-22-2011, 07:54 PM
Jonathan Nieder
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
Ben Hutchings wrote:
> I think the problem is that many generic scripts that attempt to
> capture the kernel version will not use 'uname -a', 'uname -rv', or
> similar. If they were to use /proc/version, that would be sufficient,
> but then the uname commands probably work for almost every other
> distribution. A generic script won't check package status (which
> in any case doesn't necessarily match the running kernel version).
>
> (We have an even worse problem with kernel tracebacks; they only show
> the release e.g. '2.6.32-5-amd64'. But we could change that too.)
Thanks for explaining. I fear this gets into thorny territory quickly
--- the ideal behavior would be
$ uname -r
3.0.0-2
but it is not uncommon to want to examine the linux-image-$(uname -r)
package and various scripts assume that modules live in
/lib/modules/$(uname -r). Thus a proper fix involves finding a way
for (out-of-tree) modules to be shared between kernels with different
ABI as long as they are compatible with the module, so the ABI version
could be bumped for every stable update. Which is something that was
wanted anyway.
In the short term, though, some hack like the following could help, to
tweak "uname -v" output. (And maybe including UTS_VERSION in
tracebacks as an additional patch, as you mentioned.)
---
diff --git i/scripts/mkcompile_h w/scripts/mkcompile_h
index f221ddf69080..2147f577e6f9 100755
--- i/scripts/mkcompile_h
+++ w/scripts/mkcompile_h
@@ -53,7 +53,11 @@ else
LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
fi
-UTS_VERSION="#$VERSION"
+if test -z "$UTS_VERSION_OVERRIDE"; then
+ UTS_VERSION="#$VERSION"
+else
+ UTS_VERSION=$UTS_VERSION_OVERRIDE
+fi
CONFIG_FLAGS=""
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
--
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110822195446.GG11875@elie.gateway.2wire.net">htt p://lists.debian.org/20110822195446.GG11875@elie.gateway.2wire.net
08-23-2011, 04:52 AM
Ben Hutchings
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
On Mon, 2011-08-22 at 14:54 -0500, Jonathan Nieder wrote:
> Ben Hutchings wrote:
>
> > I think the problem is that many generic scripts that attempt to
> > capture the kernel version will not use 'uname -a', 'uname -rv', or
> > similar. If they were to use /proc/version, that would be sufficient,
> > but then the uname commands probably work for almost every other
> > distribution. A generic script won't check package status (which
> > in any case doesn't necessarily match the running kernel version).
> >
> > (We have an even worse problem with kernel tracebacks; they only show
> > the release e.g. '2.6.32-5-amd64'. But we could change that too.)
>
> Thanks for explaining. I fear this gets into thorny territory quickly
> --- the ideal behavior would be
>
> $ uname -r
> 3.0.0-2
>
> but it is not uncommon to want to examine the linux-image-$(uname -r)
> package and various scripts assume that modules live in
> /lib/modules/$(uname -r). Thus a proper fix involves finding a way
> for (out-of-tree) modules to be shared between kernels with different
> ABI as long as they are compatible with the module, so the ABI version
> could be bumped for every stable update. Which is something that was
> wanted anyway.
Right.
> In the short term, though, some hack like the following could help, to
> tweak "uname -v" output. (And maybe including UTS_VERSION in
> tracebacks as an additional patch, as you mentioned.)
[...]
We already patch scripts/mkcompile_h to add the Debian-specific
information to /proc/version (see debian/patches/debian/version.patch).
We definitely shouldn't replace any information in custom builds from
linux-source-*, but there isn't generally enough space to append the
full Debian version. So I would suggest something like:
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -58,6 +58,13 @@
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
+
+DISTRIBUTION=$(lsb_release -is 2>/dev/null)
+DISTRIBUTION=${DISTRIBUTION:-Debian}
+
+if [ "$DISTRIBUTION_OFFICIAL_BUILD" ]; then
+ UTS_VERSION="#0 $DISTRIBUTION $DISTRIBUTION_VERSION"
+fi
# Truncate to maximum length
--- END ---
Ben.
08-23-2011, 06:13 AM
Jonathan Nieder
Bug#638878: linux-image-3.0.0-1-amd64: Maybe report Debian kernel version with uname
Ben Hutchings wrote:
> --- a/scripts/mkcompile_h
> +++ b/scripts/mkcompile_h
> @@ -58,6 +58,13 @@
> if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
> if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
> UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
> +
> +DISTRIBUTION=$(lsb_release -is 2>/dev/null)
> +DISTRIBUTION=${DISTRIBUTION:-Debian}
> +
> +if [ "$DISTRIBUTION_OFFICIAL_BUILD" ]; then
> + UTS_VERSION="#0 $DISTRIBUTION $DISTRIBUTION_VERSION"
> +fi
>
> # Truncate to maximum length
Thanks. Looks good to me, for what it's worth.
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110823061317.GF4623@elie.gateway.2wire.net">http ://lists.debian.org/20110823061317.GF4623@elie.gateway.2wire.net