#! /bin/sh # if the module is not already built for this kernel version # and if the source tree for this kernel version is available, # build, save, and load the module; PFX="hpilo_try_build" REV=`uname -r` if [ -f /usr/builds/hpilof-modules/$REV/hpilof.ko ]; then echo "$PFX: already have hpilof.ko for kernel version $REV" exit 0 fi if [ ! -d /usr/builds/linsrc/linux-$REV/ ]; then echo "$PFX: cannot build hpilof.ko, no kernel source tree version $REV" exit 1 fi if [ ! -d /usr/builds/hpilof-8.0.0-144.OB ]; then echo "$PFX: missing hpilof source tree" exit 2 fi cd /usr/builds/hpilof-8.0.0-144.OB rm -f *.o *.ko make -C /usr/builds/linsrc/linux-$REV M=$PWD if [ -f hpilof.ko ]; then mkdir /usr/builds/hpilof-modules/$REV/ cp -a hpilof.ko /usr/builds/hpilof-modules/$REV/ insmod ./hpilof.ko fi