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?

1 Answer 1

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.

3
  • 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
    Commented Sep 22, 2011 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
    Commented Sep 22, 2011 at 9:01
  • 1
    I don't think anything is wrong with ~/workspace
    – Rob
    Commented Sep 22, 2011 at 19:09

You must log in to answer this question.