Installing a third-party kernel module

525 views
Skip to first unread message

alex...@metaswitch.com

unread,
Dec 4, 2015, 11:59:11 AM12/4/15
to CoreOS User
I'm trying to build and install a third-party kernel module on CoreOS, but I'm having a bit of trouble with the installation step.

I'm able to use an Ubuntu container to download the source code and build the module (similar to the guide at http://tleyden.github.io/blog/2014/11/04/coreos-with-nvidia-cuda-gpu-drivers/), but once I have the *.ko file, trying to install it to the correct place on the host throws an error:

    core@core-01 ~ $ mv mymodule.ko /lib/modules/.
    mv: inter-device move failed: 'mymodule.ko' to /lib/modules/./mymodule.ko'; unable to remove target: Read-only file system

On other Linuxes, I install the kernel module in /lib/modules, and then I can load it using modprobe. That won't work here. I had a look at using something like cloud-config to install the module in the right place upon boot, but it seems like a kernel module is a bit big to be putting in the YAML file. I briefly looked at making the file system writable, but that seems like the wrong approach.

Is there somewhere I should be installing kernel modules other than /lib/modules?

Thanks,

-- Alex

Alex Crawford

unread,
Dec 7, 2015, 4:18:17 PM12/7/15
to alex...@metaswitch.com, CoreOS User
On 12/04, alex...@metaswitch.com wrote:
> Is there somewhere I should be installing kernel modules other than
> /lib/modules?

You can see from the directory listing that /lib/ is ultimately symlinked to
/usr/lib64:

$ ls -la /
...
lrwxrwxrwx 1 root root 5 Dec 10 2014 lib -> lib64
lrwxrwxrwx 1 root root 9 Dec 10 2014 lib64 -> usr/lib64
...
drwxr-xr-x 10 root root 4096 Dec 2 18:50 usr
...

/usr is read-only on CoreOS with the promise that we won't screw with anything
outside of /usr as long as the operator doesn't screw with anything inside of
/usr.

Kernel modules can be installed under `/opt/lib/modules/$(uname -r)/` as long as
you use `--dirname /opt` when calling modprobe.

-Alex
signature.asc
Reply all
Reply to author
Forward
0 new messages