FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol ‘flush_workqueue’


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,

  1. because you get a Kernel unmeddled with by any distributor
  2. you have to compile it manually anyways (because genkernel sucks)
  3. 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

EXPORT_SYMBOL_GPL(flush_workqueue);

(in my Kernel sources it’s the linke 2617).

The extra _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:

EXPORT_SYMBOL(flush_workqueue);

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:

Continue reading

Mercurial style aliases in git – and far more!


A cool thing that I really liked on mercurial and that I miss in git is the possibility of using shortcuts. Mercurial has them hard-wired. For instance, instead of typing hg status you could also type hg st or if you want to commit something: hg ci -m "Commit Message", which comes far handier than using hg commit and then waiting for the editor to start up and save the commit message file. There is also su for summary, and co for checkout. And this really saves you a lot of typing time, as these are the common tasks you want to use.

Git doesn’t come with that possibility, and while I wasn’t using it more often than Mercurial I didn’t bother to figure out how I could make git use some shortcuts. That’s of course possible, as Git is highly configurable. Now, I looked it up and I found out that there’s a highly sophisticated way of doing so.

Just open up your ~/.gitconfig. In it you will already find something like this. You’ve set this up for your first git usage – if you haven’t used git you’ll need to do it, otherwise git won’t work:

[user]
   name = Your Name
   email = youraddy@yourprovider.tld

What we’ll add is a new section, starting with [alias]

Now for each alias we want to set up, we write “alias = command”. So, this is basically exactly the way you would do your custom aliases in Mercurial if you ever did any. If you haven’t, for instance let’s get a shortcut for status:

[alias]
  st = status
[user]
  name = Your Name
  email = youraddy@yourprovider.tld

We can even add flags, if we want. So if status is too chatty for you, try using the short flag:

[alias]
  st = status -s

Now when calling git st you get something like:

D README.md
A cli_ruby.bibtex
M notes.md
?? code/01_have_a_purpose/todo/

with A being a file added, D a file deleted, M for a modified file and ?? for untracked files. If you at any time prefer the chatty version for just this time, telling you how many commits your local HEAD is away from origin, and how to reverse changes, just use git status again.

Of course, the power comes, when using highly sophisticated commands that you cannot possibly type every time you want to use them. For instance, here’s a shortcut that not only sets the graph, abbrev-commit flags, but also sets date to relative and formats the message in a short and neat way and presents them in custom colors:

[alias]
  st = status -s
  lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %Cblue<%an>%Creset' --abbrev-commit --date=relative

The above I found at Shawn Biddles git config. He’s really a great guy, you should visit his site and YouTube channel, as well as his dotfiles on GitHub – there’s a lot to learn. One great additional feature of aliases is that you can even execute shell scripts or use other aliases. One example:

You work with a team on a project and you only want to display your own commits in the log. One can achieve this by hardcoding the name into the alias:

  my = log --author='Your Name'

That’s handy, but if you want to share your config with friends, they will have to alter the config. And even you might have different users and want to keep it flexible. So instead you could use the git function to get certain lines of your config, and execute it inside your alias

  my = log --author="$(git config user.name)"

So that’s already neat, but let’s go further: Say you have different aliases that all need to use the current username, for instance you might want to get all the commits done by you today. Now you know a good programmer is a lazy programmer, so rather than retype “config user.name” so many times, let’s use an alias for it:

  me = config user.name

And now we can do:

  me = config user.name
  my = log --author="`git me`"
  today = log --since=midnight --author="`git me`"
  yesterday = log --since=day.before.yesterday.midnight --until=midnight --author=`git me`

Pretty neat, huh?

Branching in Mercurial


Branching is a great feature and is used extensively when you work with modern DVCS (as in those, merging simply works). When I still used to use SVN in our small teams (3-5 people) we never branched as that would just mean too much work-overhead with the merging process. Instead we all worked together in an office, each one of us had his files he was responsible for, and if someone else needed to change something in them, we communicated! Manually merging conflicts was hell, and in SVN merging mostly boiled down to manually merging conflicts.

Then I met Mercurial and I deeply fell in love with it. It could have as well been Git, Mercurial was just lucky there to meet me first (though after having worked a lot with Git as well as Mercurial now, I’d say, Mercurial has a leaner approach, simpler and shorter commands and is therefore nicer to work with). I really had to use Git when I started working as Ruby/Rails developer in 2011 and with that work branching came naturally along. Git has a sophisticated branching feature allowing you to have your own local branches alongside global branches (called remote branches), or to just pull branches you are interested in, showing you wich branches are merged into other branches, saving you from deleting branches that haven’t been merged yet, rebasing instead of merging to get a cleaner log, etc.

And Mercurial? Well I know that branching does exist, and I also know that there’s even another funny way, with bookmarks. You always read about them, when looking into books and tutorials about Mercurial. I also remembered reading something strange on the official docs of Mercurial (I guess, but I cannot really find it now), which suggests to use clones instead of branches. On my first day with Git I considered this a good practice – then I was shown what branches are 😉

Continue reading

Markdown and vim


Just recently a fellow student asked me, if I’d ever used Markdown before. Of course I had. As fan of DVCS and their web sharing platforms (of course I talk about Bitbucket and GitHub), one is bound to stumble upon them, especially when one also uses rails for development. Every new rails project is set up with a generic Readme.markdown.

And Markdown itself is great. It’s kept as simple as possible but still is pretty powerful when it comes to formating easy text. The formating is done by a parser that parses Markdown into well formated XHTML and there you have a neat layout for all kind of lists, and type settings, Headings, etc. using nothing more than simple ASCII symbols that even make perfect sense when reading it unparsed. Just have a look at an example:

An Example
==========

See how a simple text file is turned into a beautiful *XHTML* file using
nothing more than **simple** ASCII methods. On can also use `inline code` or
even Codeblocks:

    public static void main(String args[]) {
        System.out.println("Somehow I always use Java examples");
    }

Of course, my all time favorite:

> Quoteblocks
> Nice for quoting clever people

Then there are (this is worth a subsection)

Lists
-----

1. Numbered
1. Lists
1. And I hate keeping track of counts
1. And why should I
1. It is done for me!

and

* Plain
* Old
* Bulletin Lists
* All of them with
* nesting capabilities!

Oh, and did you ever [Visit my blog?](http://pygospa.wordpress.com).

### There is so much more

e.g. yet a deeper subsection. And it won't stop there. Try your luck with four
hashtags 😉

I could just paste the parsed code for comparison, but instead I’d rather like to give you an example rendered HTML page with proper CSS styling. Isn’t this beautiful?

Parsed Markdown in Bitbucket

Screenshot of parsed Markdown in Bitbucket

Continue reading

Ruby Version Manager und Vim


Und noch einer. Wenn man mehr als eine Ruby-Umgebung braucht, führt kein Weg am RVM vorbei. Wozu man mehr als eine Ruby-Umgebung brauchen sollte?

Fluch und Segen in Ruby ist es meiner Ansicht nach, dass sich alles so rasend schnell weiter entwickelt (und nicht nur meiner Ansicht nach, wie ich heute in einem Gespräch mit einem Kommilitonen erfahren habe, bei dessen Arbeitsplatz man aus diesem Grunde wieder von Ruby weg möchte). Gerade über das Pakete-System RubyGems gibt es viele Plugins und Libraries, die von so vielen unterschiedlichen Teams und so sind schier unendliche Kombinationen von Gems und Versionen möglich. Dabei sind folgende Punkte problematisch:

  1. Gems für verschiedene Projekte können in unterschiedliche Versionen haben, und Kombinationen unterschiedlicher Gems in unterschiedlichen Versionen können zu Konflikten führen.
  2. Ruby ist nicht Abwärtskompatibel. Ein Upgrade des von Ruby führt meist ein erzwungenes Upgrad der Applikationen mit sich (ungünstig).
  3. Besonders stark ist Rails von der Ruby-Version abhängig und ebenfalls nicht abwärtskompatibel (ebenfalls ungünstig).

Was also tun, wenn man an zwei oder mehr unterschiedlichen Projekten mitarbeitet, die auf unterschiedliche Versionen setzten? Für OS X kommt noch eine weitere Schwierigkeit hinzu – hier ist Ruby standardmäßig installiert, da OS X selbst an einigen stellen Ruby-Code einsetzt – das kann nicht einfach auf eine neue Version gehoben werden.

Hier kommt RVM ins Spiel. Ich weiß übrigens leider nicht, wie das mit einer Windows-Version/Kompatibilität aussieht, aber ich kann mir nicht vorstellen, dass es sie gibt, da schon der Installationsprozess über die Konsole läuft. Eventuell mit Cygwin. Ansonsten: Wechselt halt auf ein besseres Betriebssystem 😛.

Continue reading

LiveReload – The Web Developer Wonderland


Der ein oder andere hat es ja schon mitbekommen. Ich stecke mal wieder ein wenig stärker in der Webprogrammierung und versuche gerade ein eigenes Projekt aufzuziehen. D.h. man muss sich auch um die weniger schönen Sachen kümmern – bei mir betrifft das vor allem das Webdesign. Ich gebe es gerne zu, so schön CSS auch ist, es ist keines meiner dicksten Freunde – die Zeiten, als man noch Frames benutzt hat und sich niemand über Tabellen-Designte Webseiten aufgeregt hat, waren mir – trotz aller berechtigter Kritik – doch irgendwie noch am Liebsten.

Aber es ist, wie es ist, und ich kann ja auch nicht ewig auf dem Stand von vorgestern Sitzen, also wird es mal wieder Zeit, wissen aufzufrischen, meine HTML4.0 Kenntnisse zu modernem HTML5 upzugraden, und schön säuberlich mit CSS und HTML zu arbeiten. Daher CSS Datei im Editor, und von dort dann immer regelmäßig zwischen Konsole und Browserfenster gewechselt, cmd-r, für’s refreshen, einmal im Firefox, im Safari und in Chrome – es soll ja überall schick aussehen; einen Internet Explorer habe ich leider mangels Windows nicht zur Verfügung, aber nachdem ich dort schon etliche Work-arounds eingebaut habe, damit die wenigen neuen HTML5-Tags überhaupt angezeigt werden können, graust es mich eh davor, wie das dort alles aussehen wird (Stichworte sind hier Microsofts sehr eigenartigen Conditional Comments und das HTML5 Shiv).

Aber ich komme vom eigentlichen Thema ab. Regelmäßig nach einer Änderung in der Konsole drei unterschiedliche Browser in den Fokus holen und refreshen nervt. Besonders wenn man so CSS-Unerfahren wie ich bin, und viel mit den Werten herum probieren muss, bis sie das tun, was sie sollen.

Continue reading

Lustige Sachen mit git


In der Tat schreibe ich hier, als bekennender Mercurial-Fan auch mal über git 😉

Ich bin nämlich gerade gezwungne git zu nutzen, da ich heroku für mich entdeckt habe. Und als ebenfalls bekennender Web-Design-Analphabet bin ich ein Freund von fertigen CSS-Dateien, die man für seine Applikationen benutzen kann. Ein solches, ganzes Framework stellt blueprint da. Dahinter steckt die Open Source Gemeinde, und deshalb gibt es den gesamten Code auch auf github – offiziell unter dem Repository von Joshua Clayton.

Jetzt hab ich gleich zwei Probleme:

  1. Es wäre schön, das Repository einfach in dem Verzeichnisbaum meines Projekts unter zu bekommen. Dieses steht aber ebenfalls bei git unter Versionskontrolle.
  2. Das Repository beinhaltet allerlei Files. Mich interessieren tun jedoch nur die Sachen im Unterverzeichnis “blueprint” – ich bin weder interessiert an Tests, noch an Mockup-Templates, o.Ä., lediglich die CSS Dateien möchte ich haben.

Klar, ich kann mir das Projekt herunter laden, die drei CSS-Dateien in meinen stylesheets-Verzeichnis kopieren und fertig. Aber es ist schon irgendwie doof, wenn man die Möglichkeit hat, per “git pull” immer auf den aktuellsten Stand zu sein, und dann darauf verzichten zu müssen, oder nicht?

Aber git ist ja in vielen Belangen sehr umfangreich und flexibel einsetzbar – und so geht auch das.

Continue reading