How much Linux Kernel code is GPL 2 only? At most 60%
Linus and other Linux kernel developers have made it very clear that the kernel will continue to use the GNU GPL version 2, and not move to the GPL 3. But the fact that the kernel is 'effectively' GPL 2 does not mean that all of its code is GPL 2 only - by this I mean that some of the code may be dual-licensed. To get a working Linux system, you must of course use the GPL 2 license. But with dual-licensed code you can use another license when you use it somewhere else, say if you want to use the code in another kernel (perhaps OpenSolaris). But how much of the Linux kernel code is dual-licensed? That is what I tried to find out.
I am not a lawyer. But I do meddle with code. So, to investigate this, I wrote a short program to scan the Linux kernel code (version 2.6.20) and check what licenses appear in it. The code is in Python. If anyone is interested, I am willing to release it. Update: Following requests, the source code is available here.
You may be tempted to skip to the results, but you should probably read the following explanations of what exactly I did first.
Basically, the program I wrote reads the license statements at the beginning of each file, and tries to match them against patterns. This is extremely 'hackish'; I just randomly sampled large amounts of files and kept patching my code until it worked well. Given this method, please note that the results are only an estimate. I did not read each file myself, and while I manually checked a large amount of samples, there is room for some statistical error. However, I do believe that the results are more or less indicative of the true numbers.
I scanned only source files, not headers (hopefully I am not mistaken in doing so). I decided to measure the 'amount' of code under each license by, well, the amount of code - measured in file sizes. So, the total sum of file sizes is what counts, not the number of files or the number of lines in them.
I separated the files into 4 categories:
- GPL 2 only. These are files that say that only the GPL 2 may be used.
- GPL 2 or above. These files say explicitly that the GPL 2 may be used, or any later version. I included GPL/BSD dual-licensed code here, since it is (I presume) going to be compatible with the GPL 3.
- GPL, unspecified. These files just say "licensed under the GPL", or such (see examples below), without specifying any version number. There is some debate about what this means. Some believe that such code can use any GPL license (2, 3, etc.), while others believe otherwise, particularly since Linus has a general statement (in the COPYING file), saying that
"Also note that the only valid version of the GPL as far as the kernel is concerned is _this_ particular version of the license (ie v2, not v2.2 or v3.x or whatever), unless explicitly otherwise stated."
(Interestingly, Linus deliberately makes room for dual-licensing.) Now, as mentioned before, I am not a lawyer, so I do not know the status of this issue. However, when a source file said "GPL, see the file COPYING" (or such), I treated this as "GPL 2 only". So things fall under "unspecified" only when all a file says is "GPL'ed", with no further explanation. - Other. Some files didn't mention a license at all, those fall into this category (perhaps they fall under the GPL 2, due to the COPYING file?). Esoteric license phrasings may also fall in here (of which there are few; I worked to get my code working with the vast majority of files).
| GPL 2 only: | 32,215,150 bytes |
| GPL 2 or above: | 60,637,907 bytes |
| GPL, unspecified: | 19,773,264 bytes |
| Other: | 43,762,840 bytes |
A first remark must acknowledge the total size of all of these numbers: the Linux kernel is enormous (as I guess we would expect for the operating system that supports the most hardware out of the box). Now, as for the various licenses: there seems to be quite a lot of "GPL 2 or above" code, even if we do assume that the 'unspecified' and 'other' sections are "GPL 2 only" - almost 40% of the kernel code is explicitly GPL 2 or above.
So, it seems that a GPL 3 operating system should be able to use a large part of the Linux kernel code. I am of course thinking mainly of OpenSolaris here (which would be interested mainly in device driver code, and not the rest; perhaps later I'll run the program just on the drivers). The implications of OpenSolaris using the GPL 3 were discussed in my previous post, but I didn't have any figures to talk about back then. But now, the picture is somewhat clearer. We may have interesting times ahead.
Notes:
When sifting through the kernel code, I noticed several things that caught my eye. Here are a few. Emphasis is always my own (but how would text files be emphasized, anyhow). I admit that these notes are mostly boring, except for the final one, which is amusing. You may want to skip ahead.
Let's get started. Some licenses are, well, confused. For example, /arch/arm/mach-integrator/integrator_cp.c contains
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License.- and that is where the license ends. Either version 2, or what, I asked myself. Perhaps this is the result of some copy&pasting gone wrong. In any case I counted these as "GPL 2 only".
Some files are extremely brief in their licensing. For example, /Documentation/pcmcia/crc32hash.c states
crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2Pretty concise. Of course, I counted this as GPL 2 only. Other phrasings are brief but specify no license: /Documentation/networking/ifenslave.c has
This file is under the GPL.More extreme examples write only "GPL'd". These fell under "GPL, unspecified".
Some files are extremely specific in their licenses, e.g. /drivers/net/atp.c writes
This software may be used and distributed according to the terms of the GNU General Public License (GPL), incorporated herein by reference. Drivers based on or derived from this code fall under the GPL and must retain the authorship, copyright and license notice. This file is not a complete program and may only be used when the entire operating system is licensed under the GPL.Very detailed - but no GPL version is given. So this is 'GPL, unspecified'.
Worthy of note are other dual-licensing schemes. I saw code that was both BSD and GPL, and code that was both GPL and MIT/XFree86. However, the vast majority is GPL, of one sort or another. Yet, there was one amusing exception: /drivers/md/dm-log.c has the following license:
/*LGPL, and not GPL. Are there no legal issues with that? Turns out that there aren't, since LGPL code can be converted to GPL as needed.
* Copyright (C) 2003 Sistina Software
*
* This file is released under the LGPL.
*/

24 Comments:
This is a really cool thing to see. Nice work and I am glad you were able to get some interesting results.
I do, however, wonder about white space. Obviously 60% of the kernel from these scripts is GPL 2, but this percentage could go either way depending on how you count byte size. Is white space factored in? Anything you are leaving out?
I would say after termination of code with ; check for tabs, useless whitespace, return characters.
Maybe you are only counting pure characters, so if so, just disregard. Either way, something good to think about.
As it is early Sunday, I'll be curious what everybody else has to say.
Cheers!
Greg,
I made no special effort to get 'pure' results. I just add up the size of the files (as reported by the OS). So this includes tabs, spaces, etc.
Obviously this could be improved a lot. I am open to suggestions as to how. What is the best measure here - number of lines? Number of 'informative' characters (no tabs or spaces)? Size after gzip, perhaps?
"either version 2 of the License."
This can also mean that every incarnation of a version 2 license (2.1, 2.2, 2.3) is applicable. However, my brief checking resulted in no such minor version 2's of the GPL and only some confusion about a possibly existing 2.2.
Anyway.
there is no file by file basis in GPL. The collective work is licensed under GPL v2 only. You can even take BSD licensed code and relicense it under GPL.
"there is no file by file basis in GPL. The collective work is licensed under GPL v2 only."
That is true, in general. But Linux doesn't require copyright assignment. So if the copyright owner of a file wrote "GPL 2 or above", then what the copyright holder wrote is what counts, I think - and not the "GPL 2" statement by Linus in the COPYING file. Notice the quote of Linus in my post - he explicitly affirms the possibility of code being dual-licensed in this way.
That's a quite interesting post.
I think that a lot of developers and kernel developper are not aware about the behaviour of GPL in all country.
And that's also a troubles.
GPL v3 is only a draft, maybe we have to wait :)
There is no way opensolaris can use any of this code unless they drop the CDDL (unlikelly) or convince the developers to dual license this code (if they can find them).
Even if the whole linux kernel was explicitly released under GPLv3, once they incorporate this code in opensolaris, GPLv3 forces sun to release the rest of opensolaris under a GPLv3 compatible license which CDDL is not.
What could happen though is that opensolaris gets forked under an GPLv3 only license, said fork can take code from any GPLv3 project out there or with a compatible license. Of course, the code would remain only in the fork and not mainline so this is not an ideal outcome either.
So OpenSolaris can incorporate code from Linux that is dual-licensable...
But can Linux incorporate OpenSolaris code that is released under GPLv3?
I would think that Linus could not do that without getting permission from all of his contributors.
It would not violate the OpenSolaris license (GPLv3), since GPLv2 is a "less restrictive" license when compared to GPLv3.
But if a maintainer (Linus) joins someone else's GPLv2-only code with another person's GPLv3-or-later code, he could be violating the GPLv2-only person's license. He would be creating a derivative work and using a more restrictive license on some of the code.
Am I right about this?
Paul - perhaps you've missed the news that Sun *is* considering using GPL3 for OpenSolaris.
http://slashdot.org/article.pl?sid=07/02/12/0247237
GPLv3-or-later is incompatible with GPLv2-only. The incompatibility goes both ways.
Even though 60% MAY be GPL-2 only, these results could also be interpreted the other way round:
32 MiB are GPL-2 only.
61 MiB are GPL-2 or above.
and 63 MiB are unsure.
They could be GPL-2 only as well as GPL-2 or later.
And then only 1/5th of the Kernel would explicietely be GPL-2 only, while 80% could _maybe_ be relicensed to GPLv3.
So another question can be answered:
How much of the kernel is GPLv3 relicenseable?
At most 80% and at least 40%.
I understand, that you're very careful, stating only what you know for sure, but I think these numbers shouldn't be neglected either.
It will need a lawyer to find out the truth here, or better three and majority vote ;)
Best wishes,
Arne Babenhauserheide
- http://draketo.de
Hey cool blog. Have you used squidoo yet? I've been doing product review there.
Here are just a few of them:
Burn The Fat Feed The Muscle
Fat Loss 4 Idiots
All PSP Games
PSP Blender
Satellite TV Elite
The Simple Golf Swing
Jamorama
Well hope you liked my reviews and you should check out squidoo sometime it is a lot easier than bloggin.
Greg
I thought I'd share a neat site I found when I dug deep into a search engine the other day. This is good when you really start looking around. A hidden gem really. But I digress.. here - golf school
Domin8 MySpace with myspace friend adder.
there is no file by file basis in GPL. The collective work is licensed under GPL v2 only. You can even take BSD licensed code and relicense it under GPL.
Wrong the kernel is multi licensed if an author writes a piece of code and says gpl v2 or v2 or higher then that is exactly what the licenses is for that particular code.
Linus may be they original author and designer but he is not the sole owner of
all of the code in the kernel and there for he would need permission from the original author to relicenses any piece of code that was not his own.
He can't just say everything in the kernel is now gpl 2 only that is illegal.
As far as open solaris they can have all code that is compatible with the cddl thats about 1/3 of the linux code base.
Thanks for the nice post!
Free PS3
"You can even take BSD licensed code and relicense it under GPL."
Ohh an i forgot to mention you cant do that aether.
There is only to ways of relicense open source code. And one way is actually called a sub licenses.
If you have a piece of code that is BSD licensed you aether have to get the original authors permission to relicenses the code. In the case of the original author agreeing to let you relicenses the code then you could effectively relicenses the code under what ever licenses you wish as long as the original author agreed.
They other way is to fork the code. In this case you would have to make substancel changes and what i mean by that is you would have to add enough code in order to SUB licenses the code just changing naming schemes isn't enough. Then the code would be licensed
BSD/GPL or BSD/whatever.
There is one other way and that is to wait until the code falls into the public domain. Then you could licenses the code any way you wish.
Just because a piece of code is licensed under a BSD or BSD licenses doesn't give you the right to relicenses it how ever you wish. Thats called copyright infringement.
This is really Nice Blog, Best informations and best Articles and nice design
!!!
free samples to burn your fat
free samples for Erectile Dysfunction
http://www.thecashagent.com/
http://www.thecashagent.com/yuwie/
http://www.youronlineatm.com/
http://www.youronlineatm.com/mdbp
http://www.earnonlinejobs.com/
http://www.searchengine-submitter.com/
http://muscle-building.50webs.com/
http://adult-dating-online.50webs.com/
http://earnonlinejobs.50webs.com/
http://thecashagent.50webs.com/
http://low-apr-creditcards.50webs.com/
http://consolidate-your-loans.50webs.com/
http://webtemplates-for-free.50webs.com/
http://free-signup-money.50webs.com/
http://tipstodesigns.blogspot.com/
Thanks for the nice post!
Free PS3
Hi,
This article is good and informative.
Software Development Company
Free Directory
black mold exposureblack mold symptoms of exposurewrought iron garden gatesiron garden gates find them herefine thin hair hairstylessearch hair styles for fine thin hairnight vision binocularsbuy night vision binocularslipitor reactionslipitor allergic reactionsluxury beach resort in the philippines
afordable beach resorts in the philippineshomeopathy for eczema.baby eczema.save big with great mineral makeup bargainsmineral makeup wholesalersprodam iphone Apple prodam iphone prahacect iphone manualmanual for P 168 iphonefero 52 binocularsnight vision Fero 52 binocularsThe best night vision binoculars here
night vision binoculars bargainsfree photo albums computer programsfree software to make photo albumsfree tax formsprintable tax forms for free craftmatic air bedcraftmatic air bed adjustable info hereboyd air bedboyd night air bed lowest pricefind air beds in wisconsinbest air beds in wisconsincloud air beds
best cloud inflatable air bedssealy air beds portableportables air bedsrv luggage racksaluminum made rv luggage racksair bed raisedbest form raised air bedsaircraft support equipmentsbest support equipments for aircraftsbed air informercialsbest informercials bed airmattress sized air beds
bestair bed mattress antique doorknobsantique doorknob identification tipsdvd player troubleshootingtroubleshooting with the dvd playerflat panel television lcd vs plasmaflat panel lcd television versus plasma pic the bestThe causes of economic recessionwhat are the causes of economic recessionadjustable bed air foam The best bed air foam
hoof prints antique equestrian printsantique hoof prints equestrian printsBuy air bedadjustablebuy the best adjustable air bedsair beds canadian storesCanadian stores for air beds
migraine causemigraine treatments floridaflorida headache clinicdrying dessicantair drying dessicantdessicant air dryerpediatric asthmaasthma specialistasthma children specialistcarpet cleaning dallas txcarpet cleaners dallascarpet cleaning dallas
vero beach vacationvero beach vacationsbeach vacation homes veroms beach vacationsms beach vacationms beach condosmaui beach vacationmaui beach vacationsmaui beach clubbeach vacationsyour beach vacationscheap beach vacations
bob hairstylebob haircutsbob layeredpob hairstylebobbedclassic bobCare for Curly HairTips for Curly Haircurly hair12r 22.5 best pricetires truck bustires 12r 22.5
washington new housenew house houstonnew house san antonionew house venturanew houston house houston house tx
one file can have 30% of space as comments and another only 2% and all the 2%centers could be using a certain licence ...
also anoter metric for no licence info found would help.
--> i think a better method would be to count lines there are quite a few c source line counters out there or atleast count number of ; that are not in comment or within quotes to make a simple line conter.
http://sel2in.com
One night,wow gold a Delta twin-engine puddle final fantasy gil jumper was flying somewhere world of warcraft power leveling above New Jersey.maplestory mesos There were five people on board:flyff power leveling the pilot, Michael Jordan,Bill Gates, the Dali Lama,2moons power leveling and a hippie. Suddenly,Maple Story mesos an illegal oxygen generator exploded loudly 2moons gold in the luggage compartment, age of conan power leveling and the passenger cabin began Atlantica gold to fill with smoke. The cockpit doorflyff gold opened, and the pilot burst into the compartment. Atlantica power leveling"Gentlemen,knight online power leveling he began, "I have good news knight online power leveling and bad news. World of warcraft Power Leveling The bad news is SilkRoad Power leveling that we're about to crash in New Jersey. The good news archlord power leveling is that there are archlord gold four parachutes,buy last chaos gold and I have flyff power leveling one of them
Make your own business cards Make your own business cards
Post a Comment
Subscribe to Post Comments [Atom]
<< Home