Re: Custom initrd services

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> Hello!
>>
>> I have modules that need to be loaded using services because some of
>> them don't autoload their modules.

>"Modules"? do you mean kmod kernel modules with that?

Yes
>> I want the modules to load in initrd, before initrd.target. However,
>> the service is not consistently loading in initrd in the current
>> implementation.

>If you have kernel modules that to not autoload, it should typically
>suffice to add any kernel modules to a file in /etc/modules-load.d/ in
>the initrd.
The load of the modules is based on hardware presence, that's why we dont use modules-load.d.
>That said, in 2024 kernel modules that do not autoload seems quite out
>of place.

Many of these issues have been fixed in recent years, but we still haven't addressed everything.

>> To resolve this issue, I added "systemctl add-wants initrd.target
>> A.service" in the dracut configuration.

>Hmm, I don't follow? what would such a line do to kernel modules?

>> Is this sufficient for my setup, or do I need to make any further
>> changes in the systemd side to ensure the correct loading before
>> initrd.target? I'm using systemd-load-modules to load the modules.

>I am not sure I follow really. That service that needs the kernel
>modules, what kind f service is that?

We are trying to load these modules using the service:
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/lib/systemd/systemd-modules-load /etc/rdma/modules/%I.conf
TimeoutSec=90s

The service itself doesn't use the modules.
>Note that services can add the followng to their deps:

 >   Wants=modprobe@foobar.service
 >  After=modprobe@foobar.service

>To ensure the kmod "foobar" is definitely loaded before the service
>begins execution.

>Lennart

>--
>Lennart Poettering, Berlin




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux