/lib/modules/2.6.39.1-linode34/build: No such file or direct

Hi all,

I am trying to follow the Linux Kernel Module Programming Guide here: http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf

In the process of compiling the first Hello World kernel module (section 2.2 in the guide), I am running into the following error when calling make:

make: *** /lib/modules/2.6.39.1-linode34/build: No such file or directory. Stop.

I'm wondering what I should do to have it compile correctly. Please if you could provide a beginner's explanation, that would be great. I'm new at this and kind of have no idea what I'm doing… Thank you!

Edit: I forgot to say, I checked the path, and it is true that the /lib/modules/2.6.39.1-linode34/build file is not present. Should I look for it in another location? Or is this something that differs between the kernel running on linode and the one specified in the guide? Googling did not turn up anything particularly useful.

1 Reply

It's possible to build kernel modules against a Linode kernel (just grab the source tree from kernel.org and put it in the right place, etc), but it's often easier to either use your own kernel or use your distribution's kernel. That way, you've got the build environment for kernel modules in the right place.

By the way, you're running a rather old kernel from nearly 4 years ago… if you don't go for either of the custom kernel options, you'll want to make sure your configuration profile is set to boot the "Latest 32-bit" or "Latest 64-bit" kernel (as appropriate), since your current kernel is deprecated.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct