Bug 3847 - linux kernel 3.0 will use two digit in uname instead of three digit
Summary: linux kernel 3.0 will use two digit in uname instead of three digit
Status: RESOLVED WORKSFORME
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-10 07:06 UTC by Arkadiusz Miskiewicz
Modified: 2011-09-16 11:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
proposed fix for the issue (609 bytes, patch)
2011-07-12 17:58 UTC, Michael Tokarev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arkadiusz Miskiewicz 2011-06-10 07:06:45 UTC
linux kernel 3.0 will use two digit in uname instead of three digit thus modutils/depmod.c check becomes invalid:

    if (*argv && sscanf(*argv, "%u.%u.%u", &tmp, &tmp, &tmp) == 3) {
        version = *argv++;
    } else {


Solution is to use:
   if (*argv && sscanf(*argv, "%u.%u", &tmp, &tmp) == 2) {
which should work for 2 and 3 digit versions.

Same fix was commited to module-init-tools.
Comment 1 Denys Vlasenko 2011-06-12 15:06:03 UTC
> linux kernel 3.0 will use two digit in uname

Considering that this is a PITA for many similar code parts, I expect Linux kernel to return to three-digit numbering. Let's wait and see.
Comment 2 Arkadiusz Miskiewicz 2011-06-12 15:12:58 UTC
This fix will work with both, 2 and 3 digit kernel versions.

It's unlikely Linus will return to 3 digits since he already merged few very hacky patches that workaround the problem with old depmods.
Comment 3 Denys Vlasenko 2011-06-12 19:37:37 UTC
> It's unlikely Linus will return to 3 digits since he already merged few very
> hacky patches that workaround the problem with old depmods.

So, what next versions will be? 3.1, 3.2, 3.3? I don't think so.
Comment 4 Arkadiusz Miskiewicz 2011-06-12 20:11:42 UTC
Exactly that. Linux releases 3.0, 3.1, 3.2 while stable team gets third digit - 3.0.0, 3.0.1 and so on.

https://groups.google.com/group/linux.kernel/browse_thread/thread/3d41c0c994cd5313/44cadace5bbcea34?hl=pl&ie=UTF-8&oe=utf-8&q=linux+kernel+3.0rc1+linus+torvalds+group:linux.kernel

"I decided to just bite the bullet, and call the next version 3.0. It 
 will get released close enough to the 20-year mark, which is excuse 
 enough for me, although honestly, the real reason is just that I can 
 no longe rcomfortably count as high as 40.
...
 Now, my alpha-maleness sadly does not actually extend to all the 
 scripts and Makefile rules, so the kernel is fighting back, and is 
 calling itself 3.0.0-rc1. We'll have the usual 6-7 weeks to wrestle it 
 into submission, and get scripts etc cleaned up, and the final release 
 should be just "3.0". The -stable team can use the third number for 
 their versioning."
Comment 5 Michael Tokarev 2011-07-12 17:58:47 UTC
Created attachment 3475 [details]
proposed fix for the issue

This change for libbb/kernel_version.c fixes the issue.

Signed-Off-By: Michael Tokarev <mjt@tls.msk.ru>
Comment 6 Denys Vlasenko 2011-09-16 11:31:45 UTC
I tested current code on 3.1-rc4 and it seems to work fine.
Comment 7 Arkadiusz Miskiewicz 2011-09-16 11:40:24 UTC
Only because Linus finally didn't make 2-digit version reporting in uname. Kernel 3.0 reports 3.0.0. I guess too many things broke and thus 3-digit version is reported.