You are not logged in.

#1 2009-09-11 13:09:06

taligent
Member
Registered: 2009-02-22
Posts: 8

Execute Script On Kernel Update

I can't find a current thread on this topic, but have to believe it has been asked before...

What I want to do is every time pacman updates the stock arch kernel, have pacman run a script after the upgrade.  Is there a hook in pacman to do this, but only after a new kernel?

It seems that it should be possible to set up a monitor within pacman that says, "if package X is updated, then run script xxx".  This would be great as then when the kernel is updated my VBox Additions could be upgraded or any one a 100 other scenario's.

Thanks.

Offline

#2 2009-09-11 13:10:44

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Execute Script On Kernel Update

This is currently being discussed on the pacman-dev list.  A draft proposal is available here: http://wiki.archlinux.org/index.php/Use … cman_Hooks

Offline

#3 2009-09-11 13:23:26

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Execute Script On Kernel Update

pretty sure there's no default pacman functionality for this.  just thinking real quick, you could do something like this as a workaround:

pacup() {
  sudo pacman -Syu | tee /tmp/updates.$$

  if grep -q "upgraded kernel26" /tmp/updates.$$; then
    echo "kernel was upgraded, doing... whatever"
    # do whatever here...
  fi

  rm /tmp/updates.$$
}

add that as a bash function, it'll be normal -Syu if kernels not upgraded and it'll run your stuff if it is.  i don't really see any issues with doing this... but wouldn't be surprised if there were, and i'm sure someone here will correct me. smile

Offline

Board footer

Powered by FluxBB