Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#78499 - mkinitcpio and kernel changes

Attached to Project: Arch Linux
Opened by David Summers (summers) - Friday, 12 May 2023, 13:31 GMT
Last edited by Toolybird (Toolybird) - Saturday, 13 May 2023, 21:13 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: mkinitpio -p linux on old systems fails with looking for modules in /lib


Additional info:
* package version(s) : mkinitcpio-35.2-1
* config and/or log files etc. : /etc/mkintcpio.d/linux.preset
* link to upstream bug report, if any

Steps to reproduce:

On my ten year old system, on update (first in 4 months or so) and mkinitcpio -p linux fails as it looks for modules in /lib/modules.

passing "-r /usr/lib" and same error.

The wiki pages don't help, it does say what the prefered linux.preset is. nowhere does it say where to change the kernel module location.

This has made two of my machines unbootable.

It seems connected to changes in where the kernel lives in the kernel package, as thats moved from /boot.
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 13 May 2023, 21:13 GMT
Reason for closing:  Not a bug
Additional comments about closing:  See comments
Comment by Doug Newgard (Scimmia) - Friday, 12 May 2023, 15:30 GMT
Actual errors?
Comment by David Summers (summers) - Friday, 12 May 2023, 19:03 GMT
it looks for kernel modules in /lib/modules - but the modules are in /usr/lib/modules
Comment by Doug Newgard (Scimmia) - Friday, 12 May 2023, 19:07 GMT
And /lib is a symlink, so that doesn't matter.

Actual errors, and actual changes you made to linux.preset, or this is useless.
Comment by Toolybird (Toolybird) - Friday, 12 May 2023, 23:31 GMT
Something definitely seems fishy here. Your "modules location" theory sounds way off. There must be something amiss with your system as this doesn't sound like a bug in either mkinitcpio or the kernel. In general, you are expected to update your Arch system regularly [1]. If you don't, trouble is bound to happen. Please visit the proper Arch support channels (Forum/IRC/Mailing Lists/Reddit/etc) to see if anyone can help troubleshoot your issue.

[1] https://wiki.archlinux.org/title/System_maintenance#Upgrading_the_system
Comment by Doug Newgard (Scimmia) - Friday, 12 May 2023, 23:47 GMT
I've actually seen something similar to this with a really weird .preset file. It was moving things around when it shouldn't be. If that's what's going on here, it's a configuration issue, not a bug, but without errors, it's a shot in the dark.
Comment by David Summers (summers) - Saturday, 13 May 2023, 06:08 GMT
ok - I have to type this - as I'm in single boot on the computer that died, and can't bring it up further - that the computer I typing in, and I can't copy a files to here ..

cat /etc/mkinitcpio.d/linux.preset
# mkinitcpio preset file for the 'linux' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
ALL_microcode=(/boot/*-ucode.img)

PRESETS=('default' 'fallback')

default_image="/boot/initramfs-linux.img"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"
-----------------------------
mkinitcpio -p linux
==> Building image from present: /etc/mkinitcpio/linux.preset: 'default'
-> -k /boot/linuz-linux -c /etc/mkinicpio.conf -g /boot/initramfs-linux.img --microcode /boot/*-ucode.img
==> ERROR: '/lib/modules/6.3.1-arch2-1' in not a valid kernel module directory

and the same for fall back
and the same for mkinitcpio -r /usr -p linux

Now I'm made no changes here from how it was set up it was installed.

I don't agree that /lib should be a link to /usr/lib - or rather that that should solve why mkinitcpio is looking in /lib
This computer is on 24/7 - I update when I can, and fix changes when I can, so you are saying that arch isn't what I should be using, I disagree.
Comment by David Summers (summers) - Saturday, 13 May 2023, 06:44 GMT
OK the problem in /usr/bin/mkinitcpio seems to be the line:

_d_kmoduledir="$_optmoduleroot/lib/modules/$KERNELVERSION"

_optmoduleroot doesnt seem to be set by -r, and the default maybe should be /usr
Comment by loqs (loqs) - Saturday, 13 May 2023, 08:06 GMT
The package filesystem provides the symlink /lib -> usr/lib so it can be relied upon to be present on Arch installations.
Is that symlink not present on your system? What is the output `pacman -Qikk filesystem`?
Comment by Doug Newgard (Scimmia) - Saturday, 13 May 2023, 13:37 GMT
This was a change made over 10 years ago. https://archlinux.org/news/the-lib-directory-becomes-a-symlink/
You can disagree all you want, but without that symlink, a lot of things will fail.
Comment by David Summers (summers) - Saturday, 13 May 2023, 19:39 GMT
So to my mind, if 10 years ago the default library moved to /usr/lib - why does mkinitcpio look in /lib - it is doing what used to be done 10 years ago. If the default library is in /usr/lib, the arch software in the base image should use that. Hmm, maybe I should check what the linux kernel uses

Loading...