Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351704 - get_running_version() in linux-info.eclass (1.87) doesn't support four-component kernel versions
Summary: get_running_version() in linux-info.eclass (1.87) doesn't support four-compon...
Status: RESOLVED DUPLICATE of bug 327417
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Low trivial (vote)
Assignee: Gentoo Kernel Miscellaneous
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-14 21:37 UTC by Mike Nerone
Modified: 2011-01-30 20:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix get_running_version to work with four-part kernel version numbers. (four-part-kernelver.patch,904 bytes, patch)
2011-01-14 21:43 UTC, Mike Nerone
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Nerone 2011-01-14 21:37:31 UTC
While I noticed this when using a private kernel ebuild, I don't see why it wouldn't affect any kernel ebuild with four numeric components in the version, which includes:

  mips-sources
  openvz-sources
  vanilla-sources (!)
  xbox-sources

What happens is that for a kernel with a version such as 2.6.35.4, get_running_version fills the kernel vars like this:

  KV_MAJOR=2
  KV_MINOR=6
  KV_PATCH=35.4

I've looked at all ebuilds in the tree I could find that test KV_PATCH, and they all assume it to be an integer (or call kernel_is to test it, which makes the same assumption).

Actually, the fact is there are only two packages this is likely to affect in practice: sys-fs/evms and sys-fs/udev. Those are the only ones in the tree that use get_running_version (they both do, indeed, attempt integer tests on KV_PATCH). Therefore, fixing the problem would seem to pose very little risk. There may also be rare, user-specific situations where linux-info_get_any_version falls through to get_running_version, but certainly those are broken right now, anyway.

Trivial patch follows.
Comment 1 Mike Nerone 2011-01-14 21:43:52 UTC
Created attachment 259891 [details, diff]
Fix get_running_version to work with four-part kernel version numbers.

I realize this doesn't preserve the version sublevel, but it wasn't being preserved in any useful way anyway. If there's a future need for it, it should be parsed into a new, separate variable.
Comment 2 Mike Nerone 2011-01-14 21:58:17 UTC
Oh, I forgot to point out the practical results of the bug:

1. The udev ebuild (after spitting out the "integer expression expected" error) refuses to restart udev because it doesn't recognize that the kernel is new enough.
2. The evms ebuildspits out the error, but it's not fatal.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2011-01-30 20:27:50 UTC

*** This bug has been marked as a duplicate of bug 327417 ***