skip to Main Content

I would like to install hardware environment in a docker container. One of the installation scripts uses modinfo utility to detect ftdi_sio module, but it can’t find this particular part. There is also other error:

No FTDI driver present

I’m using centos7 image from the docker hub in this container. Is there any way this OS has not all necessary drivers and if so how to install necessary components in this image?

Appreciate for any help

2

Answers


  1. You cannot install Linux kernel drivers from a Docker container, and generally one of the major design goals of Docker is to hide details of the underlying hardware from you.

    If you’re trying to use tools like modinfo to inspect the system you’re actually running on and see if some specific kernel driver or piece of hardware is available, you need to run these directly on the host, not in Docker. If you’re trying to develop a hardware driver or interface, simulating it in a virtual machine (with its own kernel) is probably better than trying to work with it in Docker.

    (In principle you can disable enough of Docker’s protections to do this, but it makes your container setup very tightly bound to your host setup and removes basically all of the isolation; you’re getting nothing but complexity from having Docker in the mix.)

    Login or Signup to reply.
  2. One of the installation scripts uses modinfo utility to detect ftdi_sio module, but it can’t find this particular part.

    Actually, you can make this work, because modinfo does not require module to be running.

    The reason modinfo can’t find it is that podman/docker is using the kernel of the host. modinfo uses uname system call to get name of the current running kernel, which then is used as part of the path to find the module. Since kernel is the host one, the path may only accidentally be correct.

    To make it work you gotta explicitly pass kernel name to modinfo call with -k. Example of how it works from my podman container:

    $ uname -a
    Linux 43d87d63879d 5.9.8-arch1-1 #1 SMP PREEMPT Tue, 10 Nov 2020 22:44:11 +0000 x86_64 x86_64 x86_64 GNU/Linux
    $ modinfo zfs
    modinfo: ERROR: Module alias zfs not found.
    $ modinfo -k 4.15.0-123-generic zfs
    filename:       /lib/modules/4.15.0-123-generic/updates/dkms/zfs.ko
    version:        0.7.5-1ubuntu16.10
    license:        CDDL
    author:         OpenZFS on Linux
    description:    ZFS
    srcversion:     EAC384B1885CDDD467439E9
    […]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search