ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

catkin does not provide any direct tools for distributing kernel modules.

The technical details of kernel modules is generally outside the scope of this forum, so I'll just touch on the places where the process would intersect with the ROS ecosystem. Expect to do lots of additional research.

Distributing kernel modules is generally difficult, and it gets more difficult if you want to install binary kernel modules without user intervention. Each Linux distribution (Ubuntu, fedora, gentoo, arch, etc) distribute kernels and modules differently, and sometimes different versions of the kernel will have different APIs.

Therefore, you should start by determining which versions of the linux kernel you want to support, and which distributions. If you're releasing packages through bloom for a specific version of ROS, this should include the versions of Fedora and Ubuntu that are supported for that version of ROS, and the kernel versions used by those distributions.

It's quite reasonable to include the source for your kernel module inside of a ROS package, and to include additional instructions for users to build the module from source and install it. You can make this a little easier by having your ROS package depend on the kernel header packages, so that they're installed automatically, and by adding catkin install rules for the full source of your kernel module, so that the module source is included in binary distributions.

This is about as far as you can go without doing anything specific to a Linux distribution.

Whatever you do, DO NOT distribute a binary kernel module. Distribute the source code. Binary kernel modules usually do not work for any kernel other than the one they were compiled for.

If you really want to have a binary package which installs kernel modules for your users, most distributions build the new kernel modules against the running kernel during package installation. On Ubuntu, for example, this is done through DKMS. (A quick search suggests Fedora users dkms as well, but I haven't used it and can't confirm)

If you want to do a kernel module install through DKMS, you should install the module source code as part of your catkin install step (as described above). You'll also want to read the DKMS documentation about how to add the appropriate package install hooks to run DKMS during your package install, and then you'll want to add patches to your bloom release repository to add those commands to the generated debian package scripts.