Arch Linux

Please read this before reporting a bug:

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!

FS#5208 - Multiple kernel confusion with mkinitcpio

Attached to Project: Arch Linux
Opened by Aaron Griffin (phrakture) - Friday, 11 August 2006, 15:49 GMT
Task Type Bug Report
Category Packages: Current
Status Closed
Assigned To Aaron Griffin (phrakture)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I'm adding this for myself as a reference, and a "TODO" item.

Many users are confused when using mkinitcpio to build an image for additional kernels. Many expect:
mkinitcpio -c /etc/mkinitcpio-beyond.conf -g /boot/kernel26beyond.img
to automatically detect/use the beyond kernel. This is not true, as it still requires the -k option passed.

A possible solution is to add a KERNEL_VERSION="foo" setting into the conf file. The problem is that this requires changes to the config upon each kernel release. That's not a good idea.

Another idea would be to add some sort of EXTRA_VERSION="ARCH"/EXTRA_VERSION="beyond" type configuration setting, and then attempt to detect the installed kernel. Alternatively, this can be used to simply warn the user "Hey, this config file is for -beyond, and you're not running it. Make sure to pass the -k option".

I need to mill over these ideas, and figure out one which is most intuitive *and* least intrusive...

Perhaps something like:
:: ERROR: This config file requires the beyond kernel, which is not the current kernel. Please specify the -k command line option.

As a side note, the config files for the fallback images should maybe be moved out of /boot, and renamed to make it more apparent they are not to be edited, but are for fallback images. I've seen a few users edit those config files...
It might be ideal to use /etc/mkinitcpio/{default,ARCH,beyond}.conf along with /etc/mkinitcpio/{default,ARCH,beyond}-fallback.conf, but again, this is something I need to think about.
This task depends upon

Closed by  James Rayner (iphitus)
Saturday, 16 December 2006, 13:14 GMT
Reason for closing:  Fixed
Additional comments about closing:  presets implemented.
Comment by Tobias Powalowski (tpowa) - Saturday, 12 August 2006, 06:25 GMT
we had some detection routines of installed kernels in mkinitrd, though james didn't liked it as far as i remember, you know the mkinitrd -auto switch.
It's possible to scan /boot for configs and then detect from there the kernel version.
the fallback configs are for editing, at least if you use crypt and lvm and such stuff, so i wouldn't mark them as non editable.
Comment by Thomas B├Ąchler (brain0) - Monday, 16 October 2006, 23:01 GMT
mkinitcpio svn rev. 178 has a suggestion that would work this way:

You add a file to each kernel package, as an example see /etc/mkinitcpio.d/kernel26.preset:


You can now rebuild all images for kernel26 using the command "mkinitcpio -p kernel26"