Do you have any suggestions with how to get one that is "pretty close" using apt-get ?
I don't know if there's a proper source package distributed through Raspbian -- but even if there were, 3.10 is way out of date now, so almost certainly you are out of luck that way.
Presuming you are using that kernel because it was from an image distributed to support some special piece of hardware (e.g., various touchscreen manufacturers do this), you likely cannot get their source from anywhere, but the upstream version (i.e., the official one) may be close enough to work.
I believe you will have to compile the kernel before you can compile the module against it. Have a look in
/proc to see if there's a
config.gz file there; if not, try
sudo modprobe configs. If that works, check
/proc again. Copy that out, unzip it, rename the file
.config, copy that into the top level of the tree, and you can run a make. This will take quite a while on any model of pi. You can also cross compile it on a bigger system; there are explanations of how to do that around online, just beware you want to do the ARMv6 version, which means stock ARM cross compilers will not work (they are generally ARMv7+); there are some pre-built tool chains here in the
If your kernel is from a special source, likely the .config won't work as is, but either that will show up right away, or the build system can adjust it automatically. If it doesn't work, or there isn't one to start with, use:
To create a default one.
How closely this all has to match for the module to work I'm not sure, except to the extent that it definitely does have to be from the same version tuple (3.10.25). If it's rejected as having mismatched symbols or something to that effect, you're out of luck.