Git, The Kernel And Extenral Drivers: Look Ma I Can Version Magic

I was just compiling a module I’ve been given outside the kernel source tree
got an error trying to load it:

version magic '2.6.x.y-7aac9b1d2 mod_unload' should be '2.6.x.y mod_unload'

Weird — as I’m compiling it against the same source tree that the kernel was built from
And then I realized: the appended string is a lot like a git hash! (hey not all hexadecimal strings are alike!)

turns out that if you have CONFIG_LOCALVERSION_AUTO turned on in your .config and if the kernel you’re compiling is detected to be git controlled the resulting binary will have it’s version magic string appended with the git current hash.

and now I know that this also applies to modules you compile against a kernel tree like this which are governed by a git repo.

good to know.

This entry was posted in "software enginerring", Drivers, Kernel, source control and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s