beautypg.com

Section 6.6.2, compiling, Kldload (dynamically loadable module) – Avago Technologies MegaRAID SAS 9240-4i User Manual

Page 32

background image

LSI Corporation

- 32 -

MegaRAID SAS Device Driver Installation User Guide

December 2012

Chapter 6: FreeBSD Driver Installation

Updating Drivers in the FreeBSD System

e.

In the /usr/src/sys/conf/ file, perform the following steps for the mfi driver or the mrsas driver,
depending on which driver you use:

For the mfi driver, add the following entries after the entry for dev/mfi/mfi_cam.c:

dev/mfi/mfi_syspd.c optional mfi

With LSI 2208-based RAID controller support, if your mfi driver is older than 4.408.xx.xx, and you do not
have mrsas.ko driver in your system, also add the following:

dev/mfi/mfi_fp.c optional mfi

dev/mfi/mfi_tbolt.c optional mfi

For the mrsas driver, make sure the following entries are present:

dev/mrsas/mrsas.c optional mrsas

dev/mrsas/mrsas_cam.c optional mrsas

dev/mrsas/mrsas_ioctl.c optional mrsas

f.

Save your changes.

g.

To compile the kernel, go to the /usr/src directory, type the following commands, and press Enter.

# cd /usr/src

# make buildkernel KERNCONF=MYKERNEL

h.

To install the new kernel, type the following commands, and press Enter.

# make installkernel KERNCONF=MYKERNEL

The new kernel is copied to the /boot/kernel directory.

The old kernel is moved to the /boot/kernel.old directory.

6.

Reboot your system to use the new kernel.

When the system reboots, the new kernel driver module loads automatically.

6.6.2

Compiling and Loading the Driver as a Module by Using kldload (Dynamically Loadable
Module)

To use a driver module in case LSI does not supply a driver module for your version of the FreeBSD OS, use the
procedures in this section. If you want to install only an LSI-supplied module, see

Section 6.6.3, Updating the

MegaRAID Kernel Driver Module in the FreeBSD OS

.

Perform the following steps to compile the driver as a module:

1.

Boot to the FreeBSD OS.

2.

Obtain driver source files, see

Section 6.2, Obtaining LSI FreeBSD Drivers

.

3.

Make sure your kernel is prepared for dynamically loadable module described in

Section 6.6.1, Updating the

Kernel with the New Driver Source

.

4.

To build the driver module, type the following command, depending on which driver you use, and press Enter.

a.

For the mfi driver, type the following commands and press Enter.

# cd /usr/src/sys/modules/mfi

# make

NOTE You can use only kldload to load the driver as a module if your boot drive is attached to the mother
board and is not managed by the MegaRAID controller.