************************************************************************
**   O.S   	    : Linux
**   Driver	    : AACRAID
**   Description: Linux Driver for Adaptec RAID Array Controller
************************************************************************
/*
 *  Adaptec AAC series RAID controller driver
 *  (c) Copyright 2001 Red Hat Inc. <alan@redhat.com>
 *
 * based on the old aacraid driver that is..
 * Adaptec aacraid device driver for Linux.
 *
 * Copyright (c) 2000-2009 Adaptec, Inc. (aacraid@adaptec.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file COPYING.  If not, write to
 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * Abstract: AACRAID Driver Build (Linux Kernel In-tree and Out-of-tree Build)
 */

There are two ways to build the AACRAID driver.

1. In-tree build
================
Download Kernel source from http://www.kernel.org/pub/linux/kernel/v2.6/, Unzip it in /usr/src path.
Create Symbolic link,
	eg: /usr/src/linux -> /usr/src/linux-x.y.z

Extract 'aacraid' driver source RPM

#rpm2cpio aacraid-1.1.7-XXXX.src.rpm | cpio -iuvd
#mkdir aacraid
#mv aacraid_source.tgz aacraid
#cd aacraid
#gunzip -f aacraid_source.tgz
#tar -xvf aacraid_source.tar
#rm -rf aacraid_source.tar
# cd ../

Copy the complete "aacraid" source directory to $KSRC/drivers/scsi.

#cp -R aacraid $KSRC/drivers/scsi

#cd /usr/src/linux
#make mrproper
#make menuconfig
----------------------------------------------------------------------------------------------------
Now configure and build your kernel as you usually do, paying attention to
select the Device Drivers -> SCSI device support -> SCSI low-level drivers -> Adaptec AACRAID support
-----------------------------------------------------------------------------------------------------
#make bzImage
#make modules
#make modules_install
#make install

Make sure that 'grub.conf/menu.lst' (these files available in '/boot/grub' directory) updated with the newly built kernel entries.

You should reboot the system, Make sure that you are booing with Built kernel.

2. Out-of-tree build
====================

You should build Kernel atleast once, then you can compile "aacraid" source any number of times.

This option is particularly useful if you are running a stock kernel supplied
by your Linux distributor, or if you do not want to perform a full
kernel build every time. 

Please note that this way you will only be able to build a module version of the aacraid driver; 
Also note that you will need at least the headers and configuration file your target kernel was built with.

Download Kernel source from http://www.kernel.org/pub/linux/kernel/v2.6/, Unzip it in /usr/src path.
Create Symbolic link,
	eg: /usr/src/linux -> /usr/src/linux-x.y.z

#cd /usr/src/linux
#make mrproper
#make menuconfig
----------------------------------------------------------------------------------------------------
Now configure and build your kernel as you usually do, paying attention to select the 
Device Drivers -> SCSI device support -> SCSI low-level drivers -> Adaptec AACRAID support(Unselect this option)
-----------------------------------------------------------------------------------------------------
#make bzImage
#make modules
#make modules_install
#make install

Make sure that 'grub.conf/menu.lst' (these files available in '/boot/grub' directory) is updated with the newly built kernel entries.

You should reboot the system, Make sure that you are booing with newly Built kernel.

Extract 'aacraid' driver source RPM

#rpm2cpio aacraid-1.1.7-XXXX.src.rpm | cpio -iuvd
#mkdir aacraid
#mv aacraid_source.tgz aacraid
#cd aacraid
#gunzip -f aacraid_source.tgz
#tar -xvf aacraid_source.tar
#rm -rf aacraid_source.tar

Provided that you meet all the above prerequisites, building the aacraid driver
module is done with the following command:

Build 'aacraid' driver module
# make -C /lib/modules/`uname -r`/build M=$PWD modules

Load 'aacraid' driver
# insmod ./aacraid.ko

Clean 'aacraid' driver
# make -C /lib/modules/`uname -r`/build M=$PWD clean

Unload 'aacraid' driver
# rmmod aacraid