Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: dinitctl can't start 'modules' and 'early-modules.target' (Read 1625 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

dinitctl can't start 'modules' and 'early-modules.target'

Hi, for some reason I cannot start services 'modules' and 'early-modules.target'. I get errors like in the attachment below. How can I fix this? What should I check?
I did check if i have system up to date and rebooted few times with no luck. I managed to bypass dependencies for these services here, but these services themselves - I have no idea how to resolve this issue.

Edit: typo

Re: dinitctl can't start 'modules' and 'early-modules.target'

Reply #1
I can't give you a definitive answer but whenever i have had problems like this (and i have had a few lately) i've found that it's worth looking at the service files and what the dependencies of each one is, then trace it back and see if you can spot anything that's out of order or that shouldn''t be there etc?  The early-modules service file (which in turn depends on "modules") is (are) in the /usr/lib/dinit.d directory. It's rather annoying when this happens (when you're unsure about what's causing what, and i'm mostly unsure about most of the problems)... BUT, the payoff is when you finally find out what it is and then get it all working!! :)

Also, if you haven't used it yet, dinitcheck is an excellent tool to run (it's part of the dinit suite) to give you an idea of any potential problems and things that may make a service file "fail".... so

Code: [Select]
sudo dinitcheck service_file_name

will run a quick check and list any problems or give it a potential clean bill of health.

Re: dinitctl can't start 'modules' and 'early-modules.target'

Reply #2
It's like in some kind of mad house xD - dinitcheck says it's all good:
Code: [Select]
❯ sudo dinitcheck modules
Checking service: modules...
Checking service: kmod-static-nodes...
Checking service: early-prepare.target...
Checking service: root-ro...
Checking service: pseudofs...
Checking service: cgroups...
Checking service: tmpfs...
Performing secondary checks...
Secondary checks complete.
No problems found.
but running the command that is responsible for starting this service
Code: [Select]
❯ sudo cat /usr/lib/dinit.d/modules
type       = scripted
command    = /usr/lib/dinit/modules-load
restart    = false
depends-ms = kmod-static-nodes
returns:
Code: [Select]
❯ sudo /usr/lib/dinit/modules-load
modprobe: WARNING: Module nvidia-uvm not found in directory /lib/modules/6.16.1-artix1-1
I tried to blacklist it from modprobe in GRUB config and in /etc/modprobe.d but still no luck (I have AMD GPU btw, but this nvidia package is required by mpv and steam for some reason)

I have a little experience with bash scripting but maybe somebody will be able to get some idea from the script that loads the modprobes:
Code: [Select]
❯ sudo cat /usr/lib/dinit/modules-load
#!/bin/sh
# modules-load [-n] [-v] - modules-load.d(5) compatible kernel module loader

export PATH=/bin:/sbin

{
# Parameters passed as modules-load= or rd.modules-load= in kernel command line.
sed -nr 's/,/\n/;s/(.* |^)(rd\.)?modules-load=([^ ]*).*/\3/p' /proc/cmdline

# Find files /{etc,run,usr/lib}/modules-load.d/*.conf in that order.
find -L /etc/modules-load.d /run/modules-load.d /usr/lib/modules-load.d \
        -maxdepth 1 -name '*.conf' -printf '%p %P\n' 2>/dev/null |
# Load each basename only once.
        sort -k2 -s | uniq -f1 | cut -d' ' -f1 |
# Read the files, output all non-empty, non-comment lines.
        tr '\012' '\0' | xargs -0 -r grep -h -v -e '^[#;]' -e '^$'
} |
# Call modprobe on the list of modules
tr '\012' '\0' | xargs -0 -r modprobe -ab "$@"

Re: dinitctl can't start 'modules' and 'early-modules.target'

Reply #3
With some help from AI I got it all working. I had to edit the /usr/lib/dinit/modules-load file like so:
Code: [Select]
#!/bin/sh
# modules-load [-n] [-v] - modules-load.d(5) compatible kernel module loader

export PATH=/bin:/sbin

{
# Parameters passed as modules-load= or rd.modules-load= in kernel command line.
sed -nr 's/,/\n/;s/(.* |^)(rd\.)?modules-load=([^ ]*).*/\3/p' /proc/cmdline

# Find files /{etc,run,usr.lib}/modules-load.d/*.conf in that order.
find -L /etc/modules-load.d /run/modules-load.d /usr/lib/modules-load.d \
        -maxdepth 1 -name '*.conf' -printf '%p %P\n' 2>/dev/null |
# Load each basename only once.
        sort -k2 -s | uniq -f1 | cut -d' ' -f1 |
# Read the files, output all non-empty, non-comment lines.
        tr '\012' '\0' | xargs -0 -r grep -h -v -e '^[#;]' -e '^$'
} |
# Exclude the module 'nvidia-uvm' from the list before calling modprobe
grep -vz 'nvidia-uvm' |
tr '\012' '\0' | xargs -0 -r modprobe -ab "$@"

After that all my services are  [{+}     ]

Re: dinitctl can't start 'modules' and 'early-modules.target'

Reply #4
With some help from AI I got it all working. I had to edit the /usr/lib/dinit/modules-load file like so:

After that all my services are  [{+}     ]

Excellent!! I use AI quite a lot (although it does send you in circles sometimes and the quality of the output is at least somewhat dependant upon the quality of the input!) .... But i've learnt a lot in a short space of time having to troublesgoot and utilising AI, at least a little. Really glad you have it working now though.... there's the payoff!! Cool! :)

Re: dinitctl can't start 'modules' and 'early-modules.target'

Reply #5
I saw the same error but today I updated to the kernel version 6.16.1-artix1-1 and in  my case some virtualbox modules are not available yet for this kernel version.

Code: [Select]
➜ sudo sh /usr/lib/dinit/modules-load
modprobe: WARNING: Module vboxdrv not found in directory /lib/modules/6.16.1-artix1-1
modprobe: WARNING: Module vboxnetadp not found in directory /lib/modules/6.16.1-artix1-1
modprobe: WARNING: Module vboxnetflt not found in directory /lib/modules/6.16.1-artix1-1
modprobe: WARNING: Module  not found in directory /lib/modules/6.16.1-artix1-1

➜ ls /lib/modules/6.15.9-artix1-1/extramodules/
 vboxdrv.ko.zst   vboxnetadp.ko.zst   vboxnetflt.ko.zst

 

Re: dinitctl can't start 'modules' and 'early-modules.target'

Reply #6
@wolfheart you can temporarily use the same workaround, but for your services it would be
Code: [Select]
grep -vE 'vboxdrv|vboxnetadp|vboxnetflt' |
and the last one can be tricky, because it looks like the name is blank. You would have to test it for yourself or wait for these modules to be available.