4 # This is a simple wrapper for running the MegaCLI tool for Linux. It assumes
5 # that the MegaCLI binary has been installed in /compat/linux/usr/sbin/MegaCli.
6 # The binary must also have been branded appropriately, and the COMPAT_LINUX,
7 # LINPROCFS, and LINSYSFS options must be enabled. It is best to enable the
8 # COMPAT_LINUX option and compile the mfi driver into the kernel, instead of
9 # loading it as a module, to ensure that all of the required driver bits are
13 megacli=/usr/sbin/MegaCli
14 linuxdir=/compat/linux
17 devfsmount=`mount |grep $linuxdir/dev | awk '{print $3}'`
18 if [ "X$devfsmount" = "X" ]; then
19 mount -t devfs devfs $linuxdir/dev
22 procfsmount=`mount |grep $linuxdir/proc | awk '{print $3}'`
23 if [ "X$procfsmount" = "X" ]; then
24 mount -t linprocfs linprocfs $linuxdir/proc
27 sysfsmount=`mount |grep $linuxdir/sys | awk '{print $3}'`
28 if [ "X$sysfsmount" = "X" ]; then
29 mount -t linsysfs linsysfs $linuxdir/sys
32 linuxver=`sysctl -n compat.linux.osrelease | cut -d . -f 1,2`
33 if [ "X$linuxver" != "X2.6" ]; then
34 sysctl compat.linux.osrelease=$osrelease
37 chroot $linuxdir $megacli $@