Where should I put the source files?

2

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?

user83293

Posted 2011-09-22T07:19:58.210

Reputation:

Answers

5

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.

thiton

Posted 2011-09-22T07:19:58.210

Reputation: 826

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? – None – 2011-09-22T08:15:45.990

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 – 2011-09-22T09:01:59.177

1I don't think anything is wrong with ~/workspace – Rob – 2011-09-22T19:09:25.573