Reputation: 18009
I have developed a Linux device driver (ASoC). Now I would like to release it as a DKMS package. The target machine is a Raspberry Pi with Raspbian.
My source code depends on a header file from the Linux /sound/soc/codecs/
directory. This file does not exist on the target machine.
I could add the required header file to my DKMS package. But it doesn't feel right, because I think that I should use the header file from the kernel source that the module is being built for (eg. 4.6, 4.7 ...).
I could tell the end-user to download the whole kernel source (apt-get source ...
) before building the module. But installing more than 700MB just because of a single header file does not feel right as well. The package kernel-headers-
does not contain the file that I need.
Is there a better solution than the two workarounds? What would you suggest?
Upvotes: 4
Views: 1110
Reputation: 66118
As the header provides declarations, which doesn't correlate with kernel internals, you may safely take the header from one kernel version, copy it into your package and use it for build against any kernel version. No needs for additional requirement from user to have this header on his machine.
Of course, it is better to retain attributions for this header, but since you use DKMS, your project is likely compatible with Linux kernel's license (GPL).
The other approach - use header from the kernel you build for - is more complex from the view of the user. So it should be used only when it is really needed. E.g., when the header in the question describes some kernel internals which you use in your module. In that case you cannot use single(pre-copied) file for all target kernels.
Upvotes: 1