Stop the kernel from tripping over module dependency cycles during early boot

Kernel News & Module Management

Stop the kernel from tripping over module dependency cycles during early boot

Technical Briefing | 8/20/2026

We have all been there. You patch a kernel, update your initramfs, and then watch the console scroll by with terrifying speed while you pray the system actually comes back up. Most of the time it is fine, but occasionally the kernel encounters a circular dependency in your module tree that it just cannot resolve on its own. The boot process hangs, the root filesystem never mounts, and you are left staring at a blank screen wondering which driver decided to play hard to get.

When depmod loses the thread

The standard approach relies on depmod to generate modules.dep, which tells the kernel exactly which modules need to be loaded before others. But in complex environments—especially if you are carrying custom out-of-tree drivers—depmod can sometimes get confused by symbol conflicts. I have seen this happen when two versions of a driver provide the same symbol, leading the kernel to attempt a load order that results in a hard lockup.

depmod -ae -F /boot/System.map-$(uname -r) $(uname -r)

  • The -a flag forces a full check of all module dependencies instead of just looking at the directory metadata
  • The -e flag prints unresolved symbols, which is often where the real culprit is hiding
  • The -F flag points to your specific System.map to ensure the symbol lookup matches the running kernel binary

If your logs show a module failing to load despite the dependencies looking perfectly healthy on paper, start by running that depmod check manually against your specific System.map. It is usually much faster than rebooting to test theories. And if you find a circular reference, don’t just force it—you need to look at your /etc/modules-load.d/ files and prune the duplicates that are causing the noise.

The kernel is surprisingly good at managing hardware, but it is not psychic. If you keep your module directory clean and verify your dependency tree before you trigger a reboot, you will spend significantly less time chasing ghost errors at three in the morning. Keep an eye on your symbol exports; if you are not sure what a module is exposing, run modinfo on it before you add it to your initramfs configuration.

Linux Admin Automation  |  © www.ngelinux.com  |  8/20/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted