Kernel build failure on upgrade

Whenever I upgrade, kernel builds fail for each version. This has been happening for a while now, how would I go about solving this?

==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: ‘default’
→ -k /boot/vmlinuz-5.4-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.4-x86_64.img
==> Starting build: 5.4.116-1-MANJARO
→ Running build hook: [base]
→ Running build hook: [udev]
→ Running build hook: [autodetect]
→ Running build hook: [modconf]
→ Running build hook: [block]
→ Running build hook: [keyboard]
→ Running build hook: [keymap]
→ Running build hook: [filesystems]
==> ERROR: module not found: ...' ==> ERROR: module not found: …’
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.4-x86_64.img
==> WARNING: errors were encountered during the build. The image may not be complete.

That’s not a kernel build ─ the kernel is installed as a precompiled binary package ─ but an error from mkinitcpio that it cannot load one of the specified modules for building the initramfs.

What this missing module may be is not clear from the error message, but there has been at least one change to the mkinitcpio configuration in the last two years that I remember, and in the case of such changes, you are always required to merge the suggested modifications from the .pacnew file into the existing configuration file.

This merging needs to be done manually, so as to not undo any customizations that you’ve made to your configuration, and the error you’re getting may be the result of your failure to have done so.

I would suggest that you check your system for a file named /etc/mkinitcpio.conf.pacnew, and if it exists, that you compare it to your existing /etc/mkinitcpio.conf and merge them. In addition to that, the output of… :arrow_down:

sudo dmesg | less

… right after the machine has booted may also provide for a clue on what the missing module could be.

On the other hand, if the machine runs normally and you’re not experiencing any significant problems, then I wouldn’t worry about it, even though it is worthy of getting fixed. :wink:

1 Like

mkinitcpio.conf has “keymap” while mkinitcpio.conf.pacnew has “fsck”. I suppose here I should just merge but for with other vars, I’m not sure how to go:
MODULES=(… i915 …) / MODULES=()
FILES="" / FILES=()

The new syntax uses the (...) notation instead of "...".

On my system ─ I have an i915 too ─ there is nothing between the brackets for FILES, MODULES and BINARIES.