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?

link|improve this question

feedback

1 Answer

up vote 5 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.

link|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? – Ivan Teterevkov 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
1  
I don't think anything is wrong with ~/workspace – Rob Sep 22 '11 at 19:09
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.