You are not logged in.

#1 2021-11-05 22:04:08

AlphaJack
Member
Registered: 2019-05-23
Posts: 3

[SOLVED] Mkinitcpio uses current kernel instead of the installed one

Linux 5.14.15 was the first kernel I installed with pacstrap from the installation medium, Mkinitcpio and systemd-boot works fine with that version. 
When I updated Linux to 5.14.16 I noticed some warnings after the installation process:

[...]
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating module dependencies...
(3/3) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /efi/vmlinuz-linux -c /etc/mkinitcpio.conf -g /efi/initramfs-linux.img
==> ERROR: '/lib/modules/5.14.15-arch1-1' is not a valid kernel module directory
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /efi/vmlinuz-linux -c /etc/mkinitcpio.conf -g /efi/initramfs-linux-fallback.img -S autodetect
==> ERROR: '/lib/modules/5.14.15-arch1-1' is not a valid kernel module directory
error: command failed to execute correctly

The problem is that Mkinitcpio is trying to build the initramfs with Linux 5.14.15, which has been uninstalled and replaced by Linux 5.14.16.
How can I make it point to the recently installed Linux version?
Regenerating initramfs on the computer drive from the installation medium (Linux 5.14.8) works fine.

Command output:

uname -r

5.14.15-arch1-1

ls -la /usr/lib/modules

drwxr-xr-x   4 root root   4096  5 nov 22.23 .
drwxr-xr-x 150 root root 155648  5 nov 22.21 ..
drwxr-xr-x   3 root root   4096  5 nov 22.23 5.14.16-arch1-1

File output:

/etc/mkinitcpio.d/linux.preset (just replaced "/boot/" with "/efi/"

# mkinitcpio preset file for the 'linux' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/efi/vmlinuz-linux"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/efi/initramfs-linux.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/efi/initramfs-linux-fallback.img"
fallback_options="-S autodetect"

/etc/mkinitcpio.conf (heavily customized)

MODULES=(i915)
BINARIES=()
FILES=()
HOOKS=(base systemd sd-plymouth keyboard autodetect sd-vconsole modconf block sd-encrypt filesystems fsck)
COMPRESSION="cat"

/efi/loader/loader.conf (heavily customized)

default arch
timeout 0
editor 0
console-mode max

/efi/loader/entries/arch.conf (heavily customized)

title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options luks.name=XXXXXX=cryptroot root=/dev/mapper/cryptroot luks.options=discard rw quiet splash vt.global_cursor_default=0 fbcon=nodefer

Last edited by AlphaJack (2021-11-05 23:14:57)

Offline

#2 2021-11-05 22:10:35

loqs
Member
Registered: 2014-03-06
Posts: 14,282

Re: [SOLVED] Mkinitcpio uses current kernel instead of the installed one

When the new kernel package is installed what is responsible for copying/moving /boot/vmlinuz-linux to /efi/vmlinuz-linux?
EFI_system_partition#Alternative_mount_points

Last edited by loqs (2021-11-05 22:26:39)

Offline

#3 2021-11-05 23:13:50

AlphaJack
Member
Registered: 2019-05-23
Posts: 3

Re: [SOLVED] Mkinitcpio uses current kernel instead of the installed one

No one, that's the point. Thank you for pointing me the issue.
Ended up moving the files by modifying /etc/mkinicpio.conf:

# mkinitcpio preset file for the 'linux' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/efi/vmlinuz-linux"

[[ -e /boot/vmlinuz-linux ]] && cp -af /boot/vmlinuz-linux /efi
[[ -e /boot/intel-ucode.img ]] && cp -af /boot/intel-ucode.img /efi

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/efi/initramfs-linux.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/efi/initramfs-linux-fallback.img"
fallback_options="-S autodetect"

Offline

Board footer

Powered by FluxBB