Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] mkinitcpio builds for wrong kernel version on upgrade (Read 2342 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] mkinitcpio builds for wrong kernel version on upgrade

Today I updated by pacman -Syu and rebooted to an unbootable system. After booting from Live USB, I could see that the error is in mkinitcpio, which fails due to being unable to find usbhid module. Upon further investigation, I could see that usbhid wasn't packaged as a module before (search in /lib/modules). Also, "depmod" line in the output is stating it is for 5.12.4-artix1-1, but "Starting build:" line lists 5.12.2-artix1-1.

Update: I managed to recover by running (from Live USB, then chroot to installed partition):
Code: [Select]
# mkinitcpio -k 5.12.4-artix1-1 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
# mkinitcpio -k 5.12.4-artix1-1 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
This works, unlike when using the preset with -p linux, which builds using the old kernel.

Re: mkinitcpio builds for 5.12.2-artix1-1 instead of 5.12.4-artix1-1 on upgrade

Reply #1
That sounds weird. On my main system, I upgraded to 5.12.4 just fine (when it was in gremlins) with the usual mkinitcpio hook and just now I did an upgrade on a VM with no problems. Not sure what happened here.

Re: mkinitcpio builds for 5.12.2-artix1-1 instead of 5.12.4-artix1-1 on upgrade

Reply #2
Well, here's the relevant part of my /var/log/pacman.log:
Code: [Select]
[2021-05-17T11:45:24+0200] [PACMAN] Running 'pacman --color=always --sync --refresh'
[2021-05-17T11:45:24+0200] [PACMAN] synchronizing package lists
[2021-05-17T11:46:53+0200] [PACMAN] Running 'pacman --color=always --sync --sysupgrade'
[2021-05-17T11:46:53+0200] [PACMAN] starting full system upgrade
[2021-05-17T11:47:27+0200] [ALPM] running '60-mkinitcpio-remove.hook'...
[2021-05-17T11:47:27+0200] [ALPM] running '71-dkms-remove.hook'...
[2021-05-17T11:47:28+0200] [ALPM-SCRIPTLET] ==> dkms remove --no-depmod -m nvidia -v 465.27 -k 5.12.2-artix1-1
[2021-05-17T11:47:28+0200] [ALPM-SCRIPTLET] rmdir: failed to remove '': No such file or directory
[2021-05-17T11:47:28+0200] [ALPM-SCRIPTLET] rmdir: failed to remove '': No such file or directory
[2021-05-17T11:47:28+0200] [ALPM-SCRIPTLET] rmdir: failed to remove '': No such file or directory
[2021-05-17T11:47:28+0200] [ALPM-SCRIPTLET] ==> depmod 5.12.2-artix1-1
[2021-05-17T11:47:43+0200] [ALPM] transaction started
[2021-05-17T11:47:48+0200] [ALPM] upgraded linux-api-headers (5.10.13-1 -> 5.12.3-1)
[2021-05-17T11:47:48+0200] [ALPM] upgraded glibc (2.33-4 -> 2.33-5)
[2021-05-17T11:47:48+0200] [ALPM-SCRIPTLET] Generating locales...
[2021-05-17T11:47:50+0200] [ALPM-SCRIPTLET]   en_US.UTF-8... done
[2021-05-17T11:47:51+0200] [ALPM-SCRIPTLET]   sr_RS.UTF-8... done
[2021-05-17T11:47:51+0200] [ALPM-SCRIPTLET] Generation complete.
[2021-05-17T11:47:52+0200] [ALPM] upgraded gcc-libs (10.2.0-6 -> 11.1.0-1)
[2021-05-17T11:47:52+0200] [ALPM] upgraded libidn2 (2.3.0-1 -> 2.3.1-1)
[2021-05-17T11:47:52+0200] [ALPM] upgraded base (2-2.7 -> 2-2.8)
[2021-05-17T11:47:52+0200] [ALPM] upgraded binutils (2.36.1-2 -> 2.36.1-3)
[2021-05-17T11:47:52+0200] [ALPM] upgraded dav1d (0.8.2-1 -> 0.9.0-1)
[2021-05-17T11:47:52+0200] [ALPM] upgraded libtool (2.4.6+42+gb88cebd5-15 -> 2.4.6+42+gb88cebd5-16)
[2021-05-17T11:47:52+0200] [ALPM] upgraded dbeaver (21.0.4-1 -> 21.0.5-1)
[2021-05-17T11:47:52+0200] [ALPM] upgraded entr (4.8-1 -> 4.9-1)
[2021-05-17T11:47:53+0200] [ALPM] upgraded gcc (10.2.0-6 -> 11.1.0-1)
[2021-05-17T11:47:54+0200] [ALPM] upgraded gcc-ada (10.2.0-6 -> 11.1.0-1)
[2021-05-17T11:47:54+0200] [ALPM] upgraded highlight (4.0-1 -> 4.1-1)
[2021-05-17T11:47:54+0200] [ALPM] upgraded highlight-gui (4.0-1 -> 4.1-1)
[2021-05-17T11:47:54+0200] [ALPM] upgraded libmfx (20.5.1-1 -> 21.1.3-1)
[2021-05-17T11:47:54+0200] [ALPM] upgraded linux (5.12.2.artix1-1 -> 5.12.4.artix1-1)
[2021-05-17T11:47:57+0200] [ALPM] upgraded linux-firmware (20210426.fa0efef-1 -> 20210511.7685cf4-1)
[2021-05-17T11:48:01+0200] [ALPM] upgraded linux-headers (5.12.2.artix1-1 -> 5.12.4.artix1-1)
[2021-05-17T11:48:01+0200] [ALPM] upgraded lpsolve (5.5.2.5-4 -> 5.5.2.11-1)
[2021-05-17T11:48:01+0200] [ALPM] upgraded nvidia (465.27-5 -> 465.27-9)
[2021-05-17T11:48:01+0200] [ALPM] upgraded perl-http-message (6.29-1 -> 6.30-1)
[2021-05-17T11:48:01+0200] [ALPM] upgraded python-click (8.0.0-1 -> 8.0.0-2)
[2021-05-17T11:48:01+0200] [ALPM] upgraded python-jinja (3.0.0-1 -> 3.0.0-2)
[2021-05-17T11:48:01+0200] [ALPM] upgraded qt5-styleplugins (5.0.0.20170311-26 -> 5.0.0.20170311-27)
[2021-05-17T11:48:01+0200] [ALPM] upgraded ruby-multi_json (1.15.0-2 -> 1.15.0-3)
[2021-05-17T11:48:01+0200] [ALPM] upgraded vim-runtime (8.2.2845-1 -> 8.2.2859-1)
[2021-05-17T11:48:01+0200] [ALPM] upgraded vim (8.2.2845-1 -> 8.2.2859-1)
[2021-05-17T11:48:01+0200] [ALPM] upgraded xdg-dbus-proxy (0.1.2-2 -> 0.1.2-3)
[2021-05-17T11:48:02+0200] [ALPM] transaction completed
[2021-05-17T11:48:03+0200] [ALPM] running '30-tmpfiles.hook'...
[2021-05-17T11:48:03+0200] [ALPM] running '50-sysvcompat.hook'...
[2021-05-17T11:48:03+0200] [ALPM-SCRIPTLET] ==> Found s6-init
[2021-05-17T11:48:03+0200] [ALPM] running '60-depmod.hook'...
[2021-05-17T11:48:12+0200] [ALPM] running '70-dkms-install.hook'...
[2021-05-17T11:48:12+0200] [ALPM-SCRIPTLET] ==> dkms install --no-depmod -m nvidia -v 465.27 -k 5.12.4-artix1-1
[2021-05-17T11:49:32+0200] [ALPM-SCRIPTLET]
[2021-05-17T11:49:32+0200] [ALPM-SCRIPTLET] Good news! Module version 465.27 for nvidia.ko.xz
[2021-05-17T11:49:32+0200] [ALPM-SCRIPTLET] exactly matches what is already found in kernel 5.12.4-artix1-1.
[2021-05-17T11:49:32+0200] [ALPM-SCRIPTLET] DKMS will not replace this module.
[2021-05-17T11:49:32+0200] [ALPM-SCRIPTLET] You may override by specifying --force.
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET]
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] Good news! Module version 465.27 for nvidia-modeset.ko.xz
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] exactly matches what is already found in kernel 5.12.4-artix1-1.
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] DKMS will not replace this module.
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] You may override by specifying --force.
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET]
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] Good news! Module version 465.27 for nvidia-drm.ko.xz
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] exactly matches what is already found in kernel 5.12.4-artix1-1.
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] DKMS will not replace this module.
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] You may override by specifying --force.
[2021-05-17T11:49:33+0200] [ALPM-SCRIPTLET] ==> depmod 5.12.4-artix1-1
[2021-05-17T11:49:41+0200] [ALPM] running '80-cronie.hook'...
[2021-05-17T11:49:41+0200] [ALPM] running '90-mkinitcpio-install.hook'...
[2021-05-17T11:49:41+0200] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
[2021-05-17T11:49:41+0200] [ALPM-SCRIPTLET]   -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
[2021-05-17T11:49:41+0200] [ALPM-SCRIPTLET] ==> Starting build: 5.12.2-artix1-1
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [base]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [udev]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [autodetect]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [modconf]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [block]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [filesystems]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [keyboard]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET] ==> ERROR: module not found: `usbhid'
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET]   -> Running build hook: [fsck]
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET] ==> WARNING: No modules were added to the image. This is probably not what you want.
[2021-05-17T11:49:42+0200] [ALPM-SCRIPTLET] ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET] ==> WARNING: errors were encountered during the build. The image may not be complete.
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET] ==> Starting build: 5.12.2-artix1-1
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> Running build hook: [base]
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> Running build hook: [udev]
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> Running build hook: [modconf]
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> Running build hook: [block]
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> Running build hook: [filesystems]
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> Running build hook: [keyboard]
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET] ==> ERROR: module not found: `usbhid'
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET]   -> Running build hook: [fsck]
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET] ==> WARNING: No modules were added to the image. This is probably not what you want.
[2021-05-17T11:49:43+0200] [ALPM-SCRIPTLET] ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
[2021-05-17T11:49:44+0200] [ALPM-SCRIPTLET] ==> WARNING: errors were encountered during the build. The image may not be complete.
[2021-05-17T11:49:44+0200] [ALPM] running 'dbeaver.hook'...
[2021-05-17T11:49:44+0200] [ALPM] running 'detect-old-perl-modules.hook'...
[2021-05-17T11:49:44+0200] [ALPM] running 'gtk-update-icon-cache.hook'...
[2021-05-17T11:49:44+0200] [ALPM] running 'texinfo-install.hook'...
[2021-05-17T11:49:46+0200] [ALPM] running 'update-desktop-database.hook'...
[2021-05-17T11:54:29+0200] [PACMAN] Running 'pacman --color=always --upgrade /home/strajder/.cache/pikaur/pkg/pass-import-3.2-1-any.pkg.tar.zst /home/strajder/.cache/pikaur/pkg/zmusic-1.1.7-1-x86_64.pkg.tar.zst'
[2021-05-17T11:54:30+0200] [ALPM] transaction started
[2021-05-17T11:54:30+0200] [ALPM] upgraded pass-import (3.1-2 -> 3.2-1)
[2021-05-17T11:54:30+0200] [ALPM] upgraded zmusic (1.1.4-1 -> 1.1.7-1)
[2021-05-17T11:54:31+0200] [ALPM] transaction completed
[2021-05-17T12:03:17+0200] [PACMAN] Running 'pacman -Sy linux'
[2021-05-17T12:03:17+0200] [PACMAN] synchronizing package lists
[2021-05-17T12:03:28+0200] [ALPM] running '70-dkms-upgrade.hook'...
[2021-05-17T12:03:28+0200] [ALPM-SCRIPTLET] ==> dkms remove --no-depmod -m nvidia -v 465.27 -k 5.12.4-artix1-1
[2021-05-17T12:03:28+0200] [ALPM-SCRIPTLET] rmdir: failed to remove '': No such file or directory
[2021-05-17T12:03:28+0200] [ALPM-SCRIPTLET] rmdir: failed to remove '': No such file or directory
[2021-05-17T12:03:28+0200] [ALPM-SCRIPTLET] rmdir: failed to remove '': No such file or directory
[2021-05-17T12:03:29+0200] [ALPM] transaction started
[2021-05-17T12:03:29+0200] [ALPM] reinstalled linux (5.12.4.artix1-1)
[2021-05-17T12:03:30+0200] [ALPM] transaction completed
[2021-05-17T12:03:30+0200] [ALPM] running '60-depmod.hook'...
[2021-05-17T12:03:39+0200] [ALPM] running '70-dkms-install.hook'...
[2021-05-17T12:03:39+0200] [ALPM-SCRIPTLET] ==> dkms install --no-depmod -m nvidia -v 465.27 -k 5.12.4-artix1-1
[2021-05-17T12:04:58+0200] [ALPM-SCRIPTLET]
[2021-05-17T12:04:58+0200] [ALPM-SCRIPTLET] Good news! Module version 465.27 for nvidia.ko.xz
[2021-05-17T12:04:58+0200] [ALPM-SCRIPTLET] exactly matches what is already found in kernel 5.12.4-artix1-1.
[2021-05-17T12:04:58+0200] [ALPM-SCRIPTLET] DKMS will not replace this module.
[2021-05-17T12:04:58+0200] [ALPM-SCRIPTLET] You may override by specifying --force.
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET]
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] Good news! Module version 465.27 for nvidia-modeset.ko.xz
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] exactly matches what is already found in kernel 5.12.4-artix1-1.
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] DKMS will not replace this module.
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] You may override by specifying --force.
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET]
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] Good news! Module version 465.27 for nvidia-drm.ko.xz
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] exactly matches what is already found in kernel 5.12.4-artix1-1.
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] DKMS will not replace this module.
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] You may override by specifying --force.
[2021-05-17T12:04:59+0200] [ALPM-SCRIPTLET] ==> depmod 5.12.4-artix1-1
[2021-05-17T12:05:08+0200] [ALPM] running '90-mkinitcpio-install.hook'...
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET] ==> Starting build: 5.12.2-artix1-1
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [base]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [udev]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [autodetect]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [modconf]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [block]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [filesystems]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [keyboard]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET] ==> ERROR: module not found: `usbhid'
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET]   -> Running build hook: [fsck]
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET] ==> WARNING: No modules were added to the image. This is probably not what you want.
[2021-05-17T12:05:08+0200] [ALPM-SCRIPTLET] ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET] ==> WARNING: errors were encountered during the build. The image may not be complete.
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET] ==> Starting build: 5.12.2-artix1-1
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> Running build hook: [base]
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> Running build hook: [udev]
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> Running build hook: [modconf]
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> Running build hook: [block]
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> Running build hook: [filesystems]
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> Running build hook: [keyboard]
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET] ==> ERROR: module not found: `usbhid'
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET]   -> Running build hook: [fsck]
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET] ==> WARNING: No modules were added to the image. This is probably not what you want.
[2021-05-17T12:05:09+0200] [ALPM-SCRIPTLET] ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
[2021-05-17T12:05:10+0200] [ALPM-SCRIPTLET] ==> WARNING: errors were encountered during the build. The image may not be complete.

Edit: Since I managed to get my system working by explicitly specifying the kernel version, if there is no error at your end you can mark this as solved.

Re: mkinitcpio builds for 5.12.2-artix1-1 instead of 5.12.4-artix1-1 on upgrade

Reply #3
Maybe you discovered an obscure bug in the mkinitcpio script. Whatever arguments mkinitpcio got, they were definitely wrong looking at that log.

Re: mkinitcpio builds for 5.12.2-artix1-1 instead of 5.12.4-artix1-1 on upgrade

Reply #4
Since this repeated again today after another kernel upgrade, I found out the source of the problem. I was booting with SYSLINUX instead of GRUB, and apparently SYSLINUX can't read files from both the ESP and another partition, in other words, SYSLINUX, kernel and initramfs* need to all be together in ESP. I solved this by uninstalling GRUB and reorganizing everything into ESP mounted at /boot instead of /boot/efi.