I got the above error message after reinstalling my Gentoo Linux on a new harddrive. Untypical for a Gentoo distribution user I still fetch my Linux Kernel from the official website and compile it,
- because you get a Kernel unmeddled with by any distributor
- you have to compile it manually anyways (because genkernel sucks)
- because back in the old days, the Kernel sources where not in portage and therefore I am used to fetching it by hand
So my last Kernel was still a 4.0, while the new one now is a 4.2. I love Linux and distributions like Gentoo because they are text-based – I just copy and paste my configs and everything runs smoothly. Well – in theory.
The reallity of course often looks different. And this error is one example. It occurs for instance when you try to get the nVidia drivers on Gentoo with the current Kernel 4.2 – distribution independantly (as you can see here for instance).
So, when you look into the error and what’s causing it, it seems that in version 4.2 the Kernel developers assigned a different copyright license to the
flush_workqueue function, i.e. usage allowed for GPL software only. And as the nVidia drivers are closed source…
Now there is an easy way to surpass this problem (see below), which would allow you to install the nVidia drivers anyway. However this would be a deliberate breach of the copyright license and would be at least rude to the developers.
Yet it seems like even the developers are not sure if that was a good idea – it rather looks like a refactoring error, that is probably being reversed any time from now. There is at least a message patching it for the unstable 4.3, and it was suggested as patch for 4.2-r5, but even in 4.2-rc8 this patch has not been included yet. So it’s now at least two months that neither nVidia nor the Linux Kernel have reacted to the problem; so either you downgrade the Kernel (which is a bunch of work), or simply patch it yourselfe 🙂 Even though one might argue that it is a license breech, I do not believe that it is the intention of Linux to render your machine useless (or give you extra work by downgrading) and it probably will be reversed soon – and if not, nVidia will react with a new driver version. Until then this workaround will allow you to use your nVidia graphics card with the Linux Kernel 4.2
You just need to open the file
/usr/src/linux/kernel/workqueue.c in your favorite editor and search for the line
(in my Kernel sources it’s the linke 2617).
_GPL part is responsible that the compilation crashes when the function is used in code that is not GPL licensed. So just delete it, so the line looks like this:
Now just recompile your Kernel. If you haven’t changed anything else, it should be suffice to call:
/usr/src/linux $ make clean && make && make install
and reboot your system. If you however have problems with modules afterwards (e.g. because you activated hashes for your modules so they don’t work with other Kernel builds), then do a
/usr/src/linux $ make modules_install
And there you go. Now your nVidia drivers should install and run smoothly.
On a side note:
I am a huge fan of Open Source Software and I used to be a huge fan of GPL. However, situations as the above have made me question the GPL in the past, and with every instance I am further away of liking the GPL. Yes, free software is good and we should all strive to use free software, participate in improving free software and write our own free software. And yes, free software should stay free and should be protected. However, this should neither happen at the expense of the user nor should the bar for participating in supporting free software with non-free modules be artificially raised. Of course we would all love for nVidia to open their source, but this will never be achieved by force and it will also never be achieved by angering the developers that try to support your open source software. I mean, cut nVidia some slack, they are not like 80% of developers who just don’t care about Linux and just produce their software for Windows or Mac. They actually, officially support Linux, with a driver that works fast and efficient and allows Linux users to jauntly grab a high end graphics card with out needing to worry about driver support. In the past I’ve been struggling with other video cards (like the no-name card in one of my consumer PCs), TV/Radio tuner cards, lightscribe CD burners, etc. spending days and finally giving up, because there is just no driver support for certain features of the hardware. I would have loved it, if they had closed source kernel modules as nVidia does, even thoug I prefer open source.
But as long as the GPL insists on such petty arguments (take the Linux vs GNU Linux discussion for example), I’d rather use BSD licensed software…