Skip to content

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?

9 points16 comments
Open on Reddit
About this post
Posted
Archived
Score
9 · 100% up
Kind
Text
ID
pl2aa

Author

14
posts
418
comments
0
media
View profile

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:

7 post_install () {

8 # updating module dependencies

9 echo ">>> Updating module dependencies. Please wait ..."

10 depmod ${KERNEL_VERSION}

11 echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."

12 mkinitcpio -p linux${KERNEL_NAME} [...]

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)

17 points

For rebuilding your own mkinitcpio image, edit /etc/mkinitcpio.d/linux.preset.

1 points

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.

1 points

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.

2 points

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.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.