By calling personality(2) with PER_LINUX | UNAME26, uname(2) will from then on pretend that you're actually running linux 2.6.something.
This is meant as a workaround for software you don't have the source code to and which does some crazy checks for the version, assuming it doesn't support anything but 2.6.
Here's the source of a little wrapper utility you can use to invoke such broken software with:
http://mirror.linux.org.au/linux/kernel/people/ak/uname26/un...
if kernel_version.startswith('2.4.'): DO_A else: DO_B
On the other hand, if you check for 2.6 instead of checking for 2.4... Well when it encounters 3.0 the code falls back to 2.4 behavior.
if kernel_version.startswith('2.6.'): DO_B else: DO_A
Sadly a number of binary only RAID tools don't really get updated much and have these problems. There is a program in util-linux named uname26 that you can run these tools under which gives them the 2.6.40+ version numbers.
This is just one of those tricks operating systems have to resort to from time to time, its like how Microsoft is skipping Windows 9 because of how many programs execute version.startswith('Windows 9') and assuming that means Win95/Win98.
> like how Microsoft is skipping Windows 9 because of how many programs execute version.startswith('Windows 9') and assuming that means Win95/Win98.
Has this been confirmed, or is it just internet speculation?
https://searchcode.com/?q=if%28version%2Cstartswith%28%22win...
I have not seen a single case proposed that would actually break.
Basically, some programs had issues working with Linux 3.x version numbers, so the kernel can lie to these and say that its version isn't, say, 3.0, but actually 2.6.40. This was implemented by just taking the kernel minor version number and adding 40 to it and tacking that on to "2.6."
So, the problem here is that version 4.0 has that same code, so it's also going to fake-report its version as 2.6.40 when using the UNAME26 personality.
[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.g...
How much useful code there is that cant be recompiled I dont know, but I am sure people have some, and they probably dont want to run it in an old unsupported distro.