You are not logged in.

#1 2008-02-23 12:39:36

fiod
Member
Registered: 2007-04-02
Posts: 205

Automating kernel upgrade procedure?

Hey,

I got several specific commands to run each time I do a kernel upgrade (such as recompiling VMWare and VirtualBox modules, etc).

Is there a way (writing sort of a script, obviously) to automate these tasks?
Meaning, after a pacman -Syu command, if the script (?) detects that the kernel has been updated,
it will automatically run the wanted post-upgrade commands.

Thanks
Fiod

Offline

#2 2008-02-23 14:11:45

brebs
Member
Registered: 2007-04-03
Posts: 3,066

Re: Automating kernel upgrade procedure?

See compilekernel.

Could use /etc/rc.local to check if the module is missing, or check the datestamp of the module vs the date of /boot/config, but that's just overkill.

Offline

#3 2008-02-23 14:43:36

raeven
Member
From: the Herts of Crunchy Nut Land
Registered: 2008-02-19
Posts: 31
Website

Re: Automating kernel upgrade procedure?

you could create a new scrip to do the upgrade
syu.sh

#!/bin/sh
alias get_kver="pacman -Q kernel26 | cut -d' ' -f2"
kver=$(get_kver)
pacman -Syu || exit 1
if [ $kver != $(get_kver) ]; then
      #~ do something
fi

or if you prefer to use the pacman command

pacman

#!/bin/sh
alias get_kver="/usr/bin/pacman -Q kernel26 | cut -d' ' -f2"
kver=$(get_kver)
/usr/bin/pacman $@ || exit 1
if [ $kver != $(get_kver) ]; then
      do something
fi

placing the pacman script somewhere that appears in the $PATH ahead of /usr/bin

Last edited by raeven (2008-02-23 14:43:54)

Offline

#4 2008-02-23 21:39:43

fiod
Member
Registered: 2007-04-02
Posts: 205

Re: Automating kernel upgrade procedure?

That is exactly what I need.

Thanks a lot!

Offline

Board footer

Powered by FluxBB