I don't know how many times you have to do something before you decide that enough is enough. I wrote a service to autorecompile kernel modules. It checks in a config file (/etc/modautocompile.conf) which modules to autorecompile and if they are not found in the /lib/modules directory of the current kernel runs the command associated with the module to recompile it. I bet such a service already exists hundred times under different names ... but it's going to save me time and probably explanations (as the ATI fglrx module should be the first of your list!)
Here's a sample config file (adding modules to that list and comment them out would be a good idea).
And here's the script:Code:# kernel modules to autocompile after kernel update # name command vboxdrv service vboxdrv setup fglrx /usr/bin/fglrx-kernel-build.sh
copy/paste the script into a file, name it modautocompile, put it in /etc/rc.d, chmod to 755, enable with insserv.Code:#! /bin/sh # Linux kernel module init script #: Title : modautocompile #: Date Created: Sat Oct 16 06:00:29 PDT 2010 #: Last Edit : Sat Oct 16 06:00:29 PDT 2010 #: Author : please_try_again #: Version : 1.0 #: Description : Automatically recompile modules after kernel update # chkconfig: 35 30 70 # description: recompile modules # ### BEGIN INIT INFO # Provides: modautocompile # Required-Start: $syslog # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: recomppile kernel modules ### END INIT INFO # Define the modules you want to autorecompile in the file /etc/modautocompile.conf # or in the file specified by the variable CFG below CFG=/etc/modautocompile.conf # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # /etc/modautocompile.conf example # kernel modules to autocompile after kernel update # module command # vboxdrv service vboxdrv setup # fglrx /usr/bin/fglrx-kernel-build.sh # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH start() { # check if $CFG exist if [ ! -e $CFG ] ; then echo $CFG not found exit 1 fi # parse /etc/modautocompile.conf eval `awk 'BEGIN { I=-1 } ; !/^#/ { if ( NF ) { MOD=$1 ; I++ ; $1="" ; sub(/ /, "", $0) ; printf "MOD[%i]=%s; CMD[%i]=\"%s\";", I, MOD, I, $0 } }' $CFG` # exit if no modules defined in /etc/modautocompile.conf if [ ${#MOD[*]} -eq 0 ] ; then exit 2 fi # kernel modules dir MDIR=/lib/modules/$(uname -r) i=0 while [ $i -lt ${#MOD[*]} ] ; do mod=${MOD[$i]} cmd=${CMD[$i]} unset mof if [ "x$mod"!="x" -a "x$cmd"!="x" ] ; then mod=${mod}.ko mof=`find $MDIR -name $mod` if [ "$mof" == "" ] ; then echo " - compiling module $mod" $cmd fi fi let i++ done } case "$1" in start) start ;; esac exit 0


Reply With Quote


Its James again from Austin, Texas

Bookmarks