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#64893 - [mkinitcpio] script mkinitcpio-install only works with linux.preset

Attached to Project: Arch Linux
Opened by Ariel Cabello (_) - Thursday, 19 December 2019, 17:54 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Friday, 21 February 2020, 16:44 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version 5.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Summary and Info:
/usr/share/libalpm/scripts/mkinitcpio-install script, always uses the linux.preset, even if you have more than 1 preset. I suspect its line 37:

if (( all )) && compgen -G /etc/mkinitcpio.d/"*.preset" > /dev/null; then
# change to use all presets
args=(-P)
fi

The (( all )) always evaluates to false, even with more than one preset, so the final result is false.

Steps to Reproduce:

1. Create more than one mkinitcpio presets in /etc/mkinitcpio.d/WHATEVER.preset
2. Verify that "mkinitcpio -P" builds all your initramfs presets
3. Install a package that needs to use the mkinitcpio hook, for example "linux"
4. Verify that only the linux.preset initramfs are built
This task depends upon

Closed by  Giancarlo Razzolini (grazzolini)
Friday, 21 February 2020, 16:44 GMT
Reason for closing:  Not a bug
Comment by Eli Schwartz (eschwartz) - Thursday, 19 December 2019, 18:11 GMT
  • Field changed: Attached to Project (Pacman → Arch Linux)
  • Field changed: Summary ([libalpm] script mkinitcpio-install only works with linux.preset → [mkinitcpio] script mkinitcpio-install only works with linux.preset)
This has nothing to do with Pacman...
Comment by Giancarlo Razzolini (grazzolini) - Friday, 21 February 2020, 15:03 GMT
I don't understand what the error is here. This seems to be the expected behavior. mkinitcpio triggers -P if it's mkinitcpio itself that's being updated and/or anything that installs to /usr/lib/initcpio. If installing just a kernel, it will trigger -p for the kernel being installed. If installing more than one kernel on the same pacman operation, it will add as many -p arguments as required to generate the initramfs for them.
Comment by Ariel Cabello (_) - Friday, 21 February 2020, 15:32 GMT
Perhaps its just an opinion, but I think pacman should trigger mkinitcpio "-P" (when it needs to rebuild initramfs) if there is more than one .preset file in mkinitcpio. If you have more than 1 preset file you probably want them to build with linux.preset

Anyways I just dont understand what ((all)) does becouse its always True
Comment by Giancarlo Razzolini (grazzolini) - Friday, 21 February 2020, 16:44 GMT
@Ariel

Let's say that you have both linux and linux-lts installed. When there's an upgrade for linux, the mkinitcpio hook, rightfully so, will only rebuild its initramfs images. The same way for when only the -lts package is upgraded. And, if by any chance both are being upgraded at the same time, it'll regenerate both kernels initramfs images, but not using -P, using -p linux -p linux-lts.

There is no need to rebuild for kernels that haven't changed. All in that hook is not always true, it's only triggered when there's an upgrade to mkinitcpio itself, or any other package that writes to /usr/lib/initcpio.

Loading...