2

I have a device that uses Qualcomm Atheros drivers that I have reinstalled. In order to use the device properly, I need to load the modules with options:

sudo modprobe -r ath10k_pci      # remove module
sudo modprobe -r ath10k_core     # remove module
sudo modprobe ath10k_core rawmode=1 cryptmode=1
sudo modprobe ath10k_pci

I can validate that the modules have been properly loaded by using the command systool -v -m ath10k_core:

Module = "ath10k_core"

  Attributes:
    coresize            = "503808"
    initsize            = "0"
    initstate           = "live"
    refcnt              = "1"
    srcversion          = "8846560394C80047DEEC13F"
    taint               = ""
    uevent              = <store method only>

  Parameters:
    coredump_mask       = "3"
    cryptmode           = "1"
    debug_mask          = "0"
    fw_diag_log         = "N"
    rawmode             = "Y"
    skip_otp            = "N"
    uart_print          = "N"

  Sections:

Now I would like to automate this at boot time. I used this post: systemd: automate modprobe command at boot time

and I created a file /etc/modules-load.d/ath10k_core.conf with:

options ath10k_core rawmode=1 cryptmode=1

But when I boot, the result of systool -v -m ath10k_core is:

Module = "ath10k_core"

  Attributes:
    coresize            = "503808"
    initsize            = "0"
    initstate           = "live"
    refcnt              = "1"
    srcversion          = "8846560394C80047DEEC13F"
    taint               = ""
    uevent              = <store method only>

  Parameters:
    coredump_mask       = "3"
    cryptmode           = "0"
    debug_mask          = "0"
    fw_diag_log         = "N"
    rawmode             = "N"
    skip_otp            = "N"
    uart_print          = "N"

  Sections:

So the module is not loaded properly and I need to run it manually.

The result of the command journalctl -u systemd-modules-load.service is:

déc. 07 17:07:18 ubuntu-machine systemd-modules-load[263]: Failed to find module 'options ath10k_core rawmode=1 cryptmode=1'

I'm running Ubuntu 20.04. What is wrong with my configuration?

1 Answer 1

2

You are looking at the wrong configuration file. /etc/modules-load.d/ will tell the system to load kernel modules during the boot phase even if nothing immediately needs them:

systemd-modules-load.service(8) reads files from the above directories which contain kernel modules to load during boot in a static list. Each configuration file is named in the style of /etc/modules-load.d/program.conf. Note that it is usually a better idea to rely on the automatic module loading by PCI IDs, USB IDs, DMI IDs or similar triggers encoded in the kernel modules themselves instead of static configuration like this. In fact, most modern kernel modules are prepared for automatic loading already.

This is usually copied into the initramfs boot file so this happens early. Because the syntax is wrong, currently the file tells to load a kernel module called options options ath10k_core rawmode=1 cryptmode=1 which fails because there's no such module.

This part doesn't tell the system to add options to the module(s). and is actually rarely needed.

To define custom module options, there is /etc/modprobe.d/ (and other system-reserved places):

Because the modprobe command can add or remove more than one module, due to modules having dependencies, we need a method of specifying what options are to be used with those modules. All files underneath the /etc/modprobe.d directory which end with the .conf extension specify those options as required. They can also be used to create convenient aliases: alternate names for a module, or they can override the normal modprobe behavior altogether for those with special requirements (such as inserting more than one module).

modprobe is also run by the kernel as an helper program to load modules for hardware that was just detected (as described before, by PCI ID etc.).

So the content should be moved for example as /etc/modprobe.d/ath10k_core.conf:

options ath10k_core rawmode=1 cryptmode=1

I don't think you have to load it early at all (by using the simple line ath10k_core possibly followed by ath10k_pci in /etc/modules-load.d/ath10k_core.conf) but if choosing to do so, running once update-initramfs -u might be advised so the options are also copied in the initramfs or it might still fail until next kernel upgrade.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .