OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
boot-kernel high rare DISPUTE

UKI rebuild fails with 'module not found' for every module and 'No modules were added to the image' (missing modules.dep)

omarchyarchmkinitcpiolimineuki
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy omarchy 4.0.4-1 on 2026-10-05
AUDIT NOTE

#11399 supports the symptom, the module directory listing, the depmod repair and the safe failure. The error strings are exact: /usr/lib/initcpio/functions lines 740 and 1308 and /usr/bin/mkinitcpio line 409. /usr/share/libalpm/scripts/limine-mkinitcpio-install prints 'mkinitcpio failed for kernel ..., skipping.' and moves on, which matches the claim that the existing UKI is kept. /usr/share/libalpm/scripts/depmod from kmod 34.2-1 runs depmod $(basename "$f") for each target, so the cause is right to reject the reporter's uname -r guess and to call the mechanism unconfirmed. On this workstation both installed kernels (7.2.3-arch1-3, 7.2.5-3-omarchy) have modules.dep, though later updates may have regenerated them. The fix loop and both rebuild branches are correct. The only change is frequency. The evidence is one issue with no comments and no confirmed mechanism, which does not support 'occasional', so it is set to rare. Not exercised: depmod was not run, and the test VMs were shut off so their install-time module trees were not checked.

The cause above was rewritten on 2026-10-04 to match this note; the fix was corrected by the audit itself.

Symptom

The first time anything rebuilds the initramfs or UKI on a fresh install (a kernel update, a new kernel parameter, enabling hibernation), mkinitcpio reports every module as missing, even core ones:


==> ERROR: module not found: 'nvme_core'
==> ERROR: module not found: 'dm_crypt'
==> WARNING: No modules were added to the image. This is probably not what you want.
==> WARNING: errors were encountered during the build. The image may not be complete.

Cause

/usr/lib/modules/<version>/modules.dep and the other depmod outputs were never generated for the installed kernel. In the report, the module directory held only kernel/, modules.builtin, modules.builtin.modinfo, modules.order, pkgbase and vmlinuz after an install bootstrapped with pacman -r /mnt. The reporter guessed that depmod used the live ISO's uname -r, but kmod's alpm script (/usr/share/libalpm/scripts/depmod) passes each target's version explicitly, so that is not the mechanism. Why the hook left nothing behind is not confirmed. Without modules.dep, mkinitcpio cannot resolve any module name. limine-mkinitcpio-install detects the failed build and keeps the existing UKI, so the machine still boots its current kernel.

Fix

Generate the missing depmod files for every installed kernel that lacks them, then rebuild:


ls /usr/lib/modules/
for d in /usr/lib/modules/*/; do
  v=$(basename "$d")
  [[ -f "$d/kernel" || -d "$d/kernel" ]] || continue
  [[ -f "$d/modules.dep" ]] || sudo depmod -a "$v"
done

Omarchy 4:


sudo limine-mkinitcpio

Plain Arch:


sudo mkinitcpio -P

Verify

ls /usr/lib/modules/$(uname -r)/modules.dep exists, and the rebuild finishes without module not found or No modules were added to the image.

Sources

missing-modules-dep-no-modules-added