If I understand well, mkinitcpio tries to build images for linux kernels that are not installed (have been uninstalled).
These warnings are shown basically every time a kernel update is insalled through pacman
$ sudo mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'default'
-> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64.img
==> Starting build: 5.10.15-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]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'fallback'
-> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64-fallback.img -S autodetect
==> Starting build: 5.10.15-1-MANJARO
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [keyboard]
-> Running build hook: [keymap]
-> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64-fallback.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux57.preset: 'default'
-> -k /boot/vmlinuz-5.7-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.7-x86_64.img
==> ERROR: '/lib/modules/5.7.19-2-MANJARO' is not a valid kernel module directory
==> Building image from preset: /etc/mkinitcpio.d/linux57.preset: 'fallback'
-> -k /boot/vmlinuz-5.7-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.7-x86_64-fallback.img -S autodetect
==> ERROR: '/lib/modules/5.7.19-2-MANJARO' is not a valid kernel module directory
==> Building image from preset: /etc/mkinitcpio.d/linux58.preset: 'default'
-> -k /boot/vmlinuz-5.8-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.8-x86_64.img
==> ERROR: '/lib/modules/5.8.18-1-MANJARO' is not a valid kernel module directory
==> Building image from preset: /etc/mkinitcpio.d/linux58.preset: 'fallback'
-> -k /boot/vmlinuz-5.8-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.8-x86_64-fallback.img -S autodetect
==> ERROR: '/lib/modules/5.8.18-1-MANJARO' is not a valid kernel module directory
==> Building image from preset: /etc/mkinitcpio.d/linux59.preset: 'default'
-> -k /boot/vmlinuz-5.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.9-x86_64.img
==> Starting build: 5.9.16-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]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.9-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux59.preset: 'fallback'
-> -k /boot/vmlinuz-5.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.9-x86_64-fallback.img -S autodetect
==> Starting build: 5.9.16-1-MANJARO
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [keyboard]
-> Running build hook: [keymap]
-> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.9-x86_64-fallback.img
==> Image generation successful
As far as I’m concerned, I only did defaults regarding linux-latest
changes and always run default kernel version (5.10 now).
This may be useful
$ mhwd-kernel -li
Currently running: 5.10.15-1-MANJARO (linux510)
The following kernels are installed in your system:
* linux510
* linux59
$ ls -l /boot
total 183456
-rw-r--r-- 1 root root 40960 8 févr. 15:52 amd-ucode.img
drwx------ 4 root root 4096 1 janv. 1970 efi
drwxr-xr-x 6 root root 4096 19 févr. 17:09 grub
-rw-r--r-- 1 root root 28343495 19 févr. 17:10 initramfs-5.10-x86_64-fallback.img
-rw-r--r-- 1 root root 7257722 19 févr. 17:10 initramfs-5.10-x86_64.img
-rw-r--r-- 1 root root 31537473 15 sept. 16:04 initramfs-5.7-x86_64-fallback.img
-rw-r--r-- 1 root root 9456783 15 sept. 16:04 initramfs-5.7-x86_64.img
-rw-r--r-- 1 root root 31250422 1 nov. 21:18 initramfs-5.8-x86_64-fallback.img
-rw-r--r-- 1 root root 9701360 1 nov. 21:18 initramfs-5.8-x86_64.img
-rw-r--r-- 1 root root 29145780 19 févr. 17:10 initramfs-5.9-x86_64-fallback.img
-rw-r--r-- 1 root root 7497903 19 févr. 17:10 initramfs-5.9-x86_64.img
-rw-r--r-- 1 root root 3621888 19 nov. 08:58 intel-ucode.img
-rw-r--r-- 1 root root 22 10 févr. 11:42 linux510-x86_64.kver
-rw-r--r-- 1 root root 21 21 déc. 22:59 linux59-x86_64.kver
drwxr-xr-x 2 root root 4096 6 juin 2020 memtest86+
-rw-r--r-- 1 root root 8332704 10 févr. 22:17 vmlinuz-5.10-x86_64
-rw-r--r-- 1 root root 6681472 11 sept. 15:11 vmlinuz-5.7-x86_64
-rw-r--r-- 1 root root 6804736 1 nov. 21:18 vmlinuz-5.8-x86_64
-rw-r--r-- 1 root root 8141120 9 févr. 17:49 vmlinuz-5.9-x86_64
For the questions:
- is it normal that this happens or did I do something wrong?
- how do I remove these warnings? Simply removing the files with 5.7/5.8 in /boot or is some command better suited?