Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am starting to develop a custom kernel modules, so I have the two related organizational questions:

  1. Where should I put all my source files? I keep the sources in home directory now /home/my-name/workspace and I think it is not a best practice.

  2. What path should I deploy my compiled *.ko files to work correctly?

share|improve this question
up vote 4 down vote accepted

You should definitely consider putting the source files into a version control system, that's first priority. Where you put them on your disk is your choice, and the home directory is a good and established position for the files you work with.

The built kernel modules belong into the module path, /lib/modules/${KERNEL_VERSION}. I can't give you much info where exactly there, but they should be loaded in any case.

share|improve this answer
I mean where should I put the source files on the disk exactly. I am using git as VCS :) For what purposes the /usr/src exists? – user83293 Sep 22 '11 at 8:15
This question can be answered by the File System Hierarchy Standard: /usr/src : Source code (optional); Purpose: Source code may be place placed in this subdirectory, only for reference purposes. So basically it's for source code your distro installed and you can have a look at. It's NOT meant for changing. – thiton Sep 22 '11 at 9:01
I don't think anything is wrong with ~/workspace – Rob Sep 22 '11 at 19:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.