FS#5208 - Multiple kernel confusion with mkinitcpio
Attached to Project:
Arch Linux
Opened by Aaron Griffin (phrakture) - Friday, 11 August 2006, 15:49 GMT
Opened by Aaron Griffin (phrakture) - Friday, 11 August 2006, 15:49 GMT
|
Details
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: REQUIRE_KERNEL="beyond" :: 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.
Saturday, 16 December 2006, 13:14 GMT
Reason for closing: Fixed
Additional comments about closing: presets implemented.
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.
You add a file to each kernel package, as an example see /etc/mkinitcpio.d/kernel26.preset:
PRESET_N=2
PRESET_NAME[0]="default"
PRESET_KVER[0]="2.6.18-ARCH"
PRESET_CONFIG[0]="/etc/mkinitcpio.conf"
PRESET_IMAGE[0]="/boot/kernel26.img"
PRESET_NAME[1]="fallback"
PRESET_KVER[1]="2.6.18-ARCH"
PRESET_CONFIG[1]="/boot/mkinitcpio-kernel26.conf"
PRESET_IMAGE[1]="/boot/kernel26-fallback.img"
You can now rebuild all images for kernel26 using the command "mkinitcpio -p kernel26"