Hook into pacman somehow?
I know that pacman does not support triggers/hooks, but how does mkinitcpio launch after every kernel update?
The reason I'm asking, is because I'd like to have my own initcpio image rebuilt, and a package recompiled (acpi_call, for turning off the nvidia gpu in my laptop), after every kernel update.
Is that possible?
About this post
- Posted
- Archived
- Score
- 9 · 100% up
- Kind
- Text
- ID
- pl2aa
16 comments
Not the way you want.
mkinitcpio launches after every kernel because the package "linux" (the kernel) has a file called "linux.install" that is distributed in the package and contains:
pacman launches a "$pkg.install" after every package installation if present.
Your best bet is to install "dkms-acpi_call" (or even better "dkms_bbswitch" since acpi_call is dead since bumblebee 3) and launch "dkms autoinstall" after the first reboot after the kernel upgrade (since launching it directly after a kernel upgrade can fail because the dkms script/makefile might include "uname -r" so it gets the wrong kernel version).
You can also do that with nvidia ("dkms-nvidia" in the aur)
Did not know that pacman looks for $pkg.install, good to know. Also thanks on the info about bbswitch, will switch to that. TIL, thank you very much.
https://github.com/Bumblebee-Project/Bumblebee
https://github.com/Bumblebee-Project/bbswitch
For rebuilding your own mkinitcpio image, edit
/etc/mkinitcpio.d/linux.preset.Problem is, I don't want to edit the default one, I have my own at /etc/mkinitcpio.d/myown.preset, and that is what I want to rebuild at each kernel update.
Whats wrong with making your changes to the linux.preset file? Thats kind of the intnet
If you want initramfs rebuilt on kernel updates, you edit the correct preset. That is how it is supposed to work. If you choose to ignore that, nobody can help you.
I've got the same problem, and it's a pain in the ass to rebuild the damn package every 3 days. Maybe someone would be willing to write a DKMS module? That's how I take care of everything else.
Maybe you could script a pacman wrapper to reclone it every time kernel gets updated?
EDIT: Adduuuuuur. There's a DKMS module.