#!/bin/bash

#This is a startup script that brings up the instrumentation
#on a Dell server.

#These two directories need to be read-write.
#clean up the ipc directories and device files
rm -rf /opt/dell/srvadmin/shared/.ipc
rm -rf /opt/dell/srvadmin/hapi/bin/.ipc

#create .ipc directories
mkdir -p /opt/dell/srvadmin/shared/.ipc
mkdir -p /opt/dell/srvadmin/hapi/bin/.ipc

#Overwrite the default kernel driver
#with the latest openipmi driver by bind mounting.
#mkdir /tmp/modules/ipmi/
#mv /tmp/modules/ipmi_* /tmp/modules/ipmi/
#mount --bind /tmp/modules/ipmi/ /lib/modules/`uname -r`/kernel/drivers/char/ipmi/
/sbin/depmod -ae

#load all openipmi modules
modprobe ipmi_msghandler
modprobe ipmi_devintf
#On RHEL 3 replace ipmi_si with ipmi_si_drv
modprobe ipmi_si
modprobe ipmi_poweroff
modprobe ipmi_watchdog

#install dell_rbu module this is only for bios update dups to work
#Note this is an optional module, it may not be required for
#the dtk tools to work.
#insmod /tmp/modules/dell_rbu.o 
#kernel 2.4.21-40 has dell_rbu in the kernel,so need to compile seperately and load,thus commenting above line
modprobe dell_rbu    # Added for 2.6 kernel
#instrumentation is all good to go now, if kernel modules loaded properly.

