[arch-general] [arch-announce] New kernel packages and mkinitcpio hooks

Amish anon.amish at gmail.com
Wed Nov 13 17:30:48 UTC 2019

On 11/11/19 3:11 am, Arch Linux: Recent news updates: Giancarlo 
Razzolini wrote:
> All our official kernels: linux, linux-lts, linux-zen and linux-hardened, do not install the actual kernel to /boot anymore.

I would like to report an issue I faced due to this. Not an issue for 
everyone but can be an issue in a certain special cases.

I have a custom package (in my custom repo) which modifies grub UI / 
menus (cosmetic change only) by putting some files in /etc/grub.d/ and 
regenerates /boot/grub/grub.cfg (by calling grub-mkconfig in package's 
post install script). This has been working fine from 2 years or so.

Recently I released an update to that custom package but at the same 
time, upgrades to linux as well as linux-lts packages were also 
available in arch repository.

And after upgrade, grub.cfg lost linux and linux-lts menu entries 

What happened is:

 1. mkinitcpio hook first removed vmlinuz-linux, vmlinuz-linux-lts and
    initrd files from /boot
 2. My package got updated along with new versions of linux and linux-lts
 3. My package's post install script ran grub-mkconfig but new vmlinuz
    files did not exist yet in /boot. So grub entries were not created
    for them.
 4. mkinitcpio-install post transaction hook runs and copies kernel to
    /boot (but its too late for my post install scripts)

So effectively this created an un-bootable system requiring manual booting.

This is going to happen every time my package plus linux / linux-lts 
package get upgraded in the same pacman run. (i.e. this will not happen 
always but only in certain conditions)

I know my issue is not common and I will also change my script to post 
transaction hook.

But this is to warn anyone who has a custom package with post install 
script which looks for / expects kernel files in /boot. (like 
grub-mkconfig). Those scripts are going to break with the recent changes 
to kernel package and it would be advisable to put them in post 
transaction hook and that too after mkinitcpio-install scripts run.



More information about the arch-general mailing list