3
  • I have a version with a "+" in it - what does this mean?
  • How do I figure out which source I want if I am compiling a patch?
  • How do I go about finding it?

Any links are much appreciated!

Example

$ uname -r
3.10.25+

$ sudo apt-get build-dep linux-image-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to find a source package for linux-image-3.10.25+

$ sudo apt-get source linux-image-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to find a source package for linux-image-3.10.25+

Background

  • I've got a Raspberry Pi!
  • I'm trying to make a MAME machine and upgrading a joystick driver
  • however I have about 50% of an idea of what I'm doing

I'm going through the instructions at https://github.com/oscherler/linux-xinmo-driver/blob/master/docs/ubuntu.md

  • 1
    The "+" is a suffix used with the official Pi kernel source, when compiled for ARMv6: github.com/raspberrypi/linux/tree/rpi-3.10.y ...I selected 3.10.y from the drop down, but there is no guarantee it will be a perfect match for the one you have, unfortunately. – goldilocks Dec 12 '16 at 2:54
  • I see! Do you have any suggestions with how to get one that is "pretty close" using apt-get ? – MonkeyWidget Dec 12 '16 at 3:14
2

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 arm-bcm2708 directory.

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:

make bcmrpi_defconfig

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.

  • ok, I'll try that. I'll upgrade, too, to make my scenario less obscure. – MonkeyWidget Dec 12 '16 at 3:43
  • If you weren't using a kernel from a special source, then you should be able to get it to work. The latest one from the github is usually a little in advance of the current Raspbian one, so make sure to download the right version (double check the top level Makefile, the version tuple is right at the top) -- although in this case there could well be a src package appropriate for compiling modules available via apt. I'll have a quick peek... – goldilocks Dec 12 '16 at 3:48
  • :/ Well, there's a 4.4.6 -- go figure. There's also a 3.10.11 there. Have a look at apt search linux-4.4. You're probably better off just using the appropriate github download though, especially since the one post update will probably be 4.4.34. – goldilocks Dec 12 '16 at 3:53
  • - I'm not using a special source - after the upgrade the version is now 4.1.19+ - following your hints I am now doing a git clone of the repo after this I will attempt to install the patch I have, and then compile (on the pi!!) – MonkeyWidget Dec 12 '16 at 4:24
  • 1
    To clarify, lol: By "a while" I meant on a single core model some multiple of hours...like probably more than 2, less than 10... However at least you can leave it unattended. Unless you are doing it regularly (or are comfy with cross compiling) that is probably smarter than cross compiling, which may "a while" of you being attentive, and is prone to claw-out-eyes level fun the first time. – goldilocks Dec 12 '16 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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