      Build a Custom kernel with  QLogic Fibre Channel Driver
      
1.0  Building a Custom Kernel to Load the Driver
-------------------------------------------------

Since it is not feasible to construct a single set of kernel build
instructions for every possible hardware or software configuration,
the following instructions are provided as an example of how to compile
the driver into the Linux kernel.  The user may be required to make
some adjustments in the procedure for their particular system hardware
or software configuration. The kernel source tree is referenced below
as /usr/src/linux.


This process is only supported on RedHat 7.1/7.2 and SuSE 7.3/
Enterprise 7.  The kernel source tree is referenced below 
as /usr/src/linux.  Under the RedHat distribution, the normal
directory path is /usr/src/linux-2.4.  For SuSE distributions,
the kernel source is usually located in /usr/src/linux.

Prerequisites:

	a) Verify that both kernel-headers and kernel-source 
		RPMS are already installed.

		# rpm -qa | grep kernel

	   If the kernel-headers and kernel-source RPMs are 
	   not installed, install from the distribution's CD
	   with the following commands:

		# rpm -i kernel-sources*
		# rpm -i kernel-headers*

1. Make a special QLogic Directory under kernel source tree

	# mkdir /usr/src/linux/drivers/scsi/qla2xxx/
	# cd /usr/src/linux/drivers/scsi/qla2xxx/
	# tar xvzf qla2x00src-v6.0.X.tgz
	# rm -f makefile
	# cp -f Makefile.kernel Makefile

2. Edit the Makefile under the kernel scsi directory

	# cd /usr/src/linux/drivers/scsi
	# vi Makefile

	Look for the following line:

		subdir-$(CONFIG_SCSI_AIC7XXX)   += aic7xxx

	And add the following lines: 

		subdir-$(CONFIG_SCSI_QLOGIC_QLA2XXX)   += qla2xxx       	
		ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2200),y)
			SUB_DIRS += qla2xxx
			MOD_IN_SUB_DIRS += qla2xxx
		else
			ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2200),m)
			        MOD_IN_SUB_DIRS += qla2xxx
			endif
		endif
		ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2300),y)
			SUB_DIRS += qla2xxx
			MOD_IN_SUB_DIRS += qla2xxx
		else
			ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2300),m)
				MOD_IN_SUB_DIRS += qla2xxx
			endif
		endif

	The edited lines should read as:

		subdir-$(CONFIG_SCSI_AIC7XXX)   += aic7xxx
		subdir-$(CONFIG_SCSI_QLOGIC_QLA2XXX)   += qla2xxx
		ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2200),y)
			SUB_DIRS += qla2xxx
			MOD_IN_SUB_DIRS += qla2xxx
		else
			ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2200),m)
			        MOD_IN_SUB_DIRS += qla2xxx
			endif
		endif
		ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2300),y)
			SUB_DIRS += qla2xxx
			MOD_IN_SUB_DIRS += qla2xxx
		else
			ifeq ($(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2300),m)
				MOD_IN_SUB_DIRS += qla2xxx
			endif
		endif

	NOTE: For Redhat Distributions (7.1 and 7.2) :-

	Locate the following line: 

		obj-$(CONFIG_SCSI_QLOGIC_QLA2100) += qla2x00.o

	Add the following lines below that:
	
		obj-$(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2200) += qla2xxx/qla2200.o
                obj-$(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2300) += qla2xxx/qla2300.o

	Append the following lines to the end of the Makefile:

		qla2xxx/qla2200.o:
		        cd qla2xxx; make qla2200.o

		qla2xxx/qla2300.o:
			cd qla2xxx; make qla2300.o

	NOTE: For SuSE Distributions (7.2 and 7.3) :-

	Locate the following line: 

		obj-$(CONFIG_SCSI_QLOGIC_QLA2200) += qla2200.o
		obj-$(CONFIG_SCSI_QLOGIC_QLA2300) += qla2300.o

	Add the following lines below that:
	
		obj-$(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2200) += qla2xxx/qla2200.o
                obj-$(CONFIG_SCSI_QLOGIC_QLA2XXX_QLA2300) += qla2xxx/qla2300.o
	
	Append the following lines to the end of the Makefile:

		qla2xxx/qla2200.o:
		        cd qla2xxx; make qla2200.o

		qla2xxx/qla2300.o:
			cd qla2xxx; make qla2300.o

4. Edit the Config.in file under the kernel scsi directory

	# cd /usr/src/linux/drivers/scsi
	# vi Config.in

	NOTE: For Redhat Distributions (7.1 and 7.2) :-

	Locate the following lines:

		dep_tristate 'Qlogic QLA 2100 FC SCSI support' CONFIG_SCSI_QLOGIC_QLA2100 $CONFIG_SCSI
		dep_tristate 'Qlogic QLA 2200 FC SCSI support' CONFIG_SCSI_QLOGIC_QLA2200 $CONFIG_SCSI

	Add the following line below that:

		source drivers/scsi/qla2xxx/Config.in

	NOTE: For SuSE Distributions (7.2 and 7.3) :-

	Locate the following lines:

		dep_tristate 'Qlogic QLA2200 SCSI support' CONFIG_SCSI_QLOGIC_QLA2200 $CONFIG_SCSI
		dep_tristate 'Qlogic QLA2300 SCSI support' CONFIG_SCSI_QLOGIC_QLA2300 $CONFIG_SCSI

	Add the following lines below that:

		source drivers/scsi/qla2xxx/Config.in
	
5. Remove any reference to older QLogic FC drivers

	NOTE: To ensure that the older driver binary included in the original
	      distribution does not interfere with the updated version, please
	      rename the old driver binary as follows:

	For Redhat Distributions (7.2 with 2.4.9-21 or above) :-

		# cd /usr/src/linux/drivers/addon/qla2200
		# mv qla2200.o qla2200_rh.o
		# mv qla2300.o qla2300_rh.o
		# cd /lib/modules/<kernel_version>/kernel/drivers/addon/qla2200
		# mv qla2200.o qla2200_rh.o
		# mv qla2300.o qla2300_rh.o

	For SuSE Distributions (Enterprise 7 and above, 7.3 and above) :-

		# cd /usr/src/linux/drivers/scsi
		# mv qla2200.o qla2200_su.o
		# mv qla2300.o qla2300_su.o
		# cd /lib/modules/<kernel_version>/kernel/drivers/scsi
		# mv qla2200.o qla2200_su.o
		# mv qla2300.o qla2300_su.o

6. Configure the kernel to load the new QLogic driver.

	# cd /usr/src/linux
	# make menuconfig

	- Select "SCSI Support" <Enter>

	- Select "SCSI Generic Support" <Space bar> <Space bar>

	- Select "SCSI low-level drivers" <Enter>
	
	- Select "Qlogic QLA 2XXX v6 FC SCSI support" <Enter>

	- Select "Qlogic QLA 2200 v6 FC SCSI support" <Space bar> <Space bar>

	OR

	- Select "Qlogic QLA 2300 v6 FC SCSI support" <Space bar> <Space bar>
	
	- Select Exit to go back to the SCSI Support menu.

	- Select Exit to go back to the Main Menu.

	- Select Exit to exit the Main Menu.

	The system prompts: "Do you wish to save your new kernel 
	configuration?"  Select "Yes." The system saves a new config 
	file called ".config" in the current directory.

7. Build Kernel 

       # make dep bzImage modules modules_install


