Difference between revisions of "FreeBSD kernel with Fibre Channel target mode support for QLogic cards"

From Aram's Wiki
Jump to: navigation, search
(Create /etc/make.conf)
(Build and install the kernels)
Line 39: Line 39:
 
Install the kernels:
 
Install the kernels:
  
  # installs FCTARGET
+
  # install FCTARGET into /boot/kernel (default) and GENERIC into /boot/GENERIC
 
  sudo make -j24 installkernel
 
  sudo make -j24 installkernel
 
  sudo make -j24 installkernel KERNCONF=GENERIC INSTKERNNAME=GENERIC
 
  sudo make -j24 installkernel KERNCONF=GENERIC INSTKERNNAME=GENERIC

Revision as of 17:55, 6 November 2018

Introduction

FreeBSD doesn't enable target mode support for QLogic cards, so we need to compile a custom kernel. We'll assume we have installed a release and we have a populated /usr/src.

Create the kernel configuration file

cat <<EOF >/tmp/FCTARGET
include GENERIC
ident FCTARGET

options ISP_TARGET_MODE
EOF
sudo install -g staff -o aram /tmp/FCTARGET /usr/src/sys/amd64/conf

Create /etc/make.conf

cat <<EOF >/tmp/make.conf
# Build and install FCTARGET and GENERIC kernels
# FCTARGET will be installed by default.
KERNCONF=FCTARGET GENERIC
EOF
sudo install -g staff -o aram /tmp/make.conf /etc

Create /usr/obj

Assuming you have ZFS:

sudo zfs create zroot/usr/obj
sudo chown aram:staff /usr/obj

Build and install the kernels

Build the kernels:

cd /usr/src
# builds FCTARGET and GENERIC
make buildkernel -j24

Install the kernels:

# install FCTARGET into /boot/kernel (default) and GENERIC into /boot/GENERIC
sudo make -j24 installkernel
sudo make -j24 installkernel KERNCONF=GENERIC INSTKERNNAME=GENERIC

Load isp(4) driver firmware in /etc/loader.conf

As root:

sudo su -
echo ispfw_load="YES" >> /boot/loader.conf

isp(4) is already compiled into the kernel, no need to load it.

Reboot and test

sudo reboot

References