Difference between revisions of "FreeBSD kernel with Fibre Channel target mode support for QLogic cards"
(→Build and install the kernels) |
(→References) |
||
Line 67: | Line 67: | ||
* [https://www.freebsd.org/doc/handbook/kernelconfig-building.html FreeBSD Handbook: Building and Installing a Custom Kernel] | * [https://www.freebsd.org/doc/handbook/kernelconfig-building.html FreeBSD Handbook: Building and Installing a Custom Kernel] | ||
+ | * [https://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html#freebsd-update-custom-kernel-9x FreeBSD Handbook: 23.2.3.1. Custom Kernels with FreeBSD 9.X and Later] | ||
* [https://www.freebsd.org/cgi/man.cgi?query=make.conf&sektion=5&apropos=0&manpath=FreeBSD+11.2-RELEASE+and+Ports make.conf(5)] | * [https://www.freebsd.org/cgi/man.cgi?query=make.conf&sektion=5&apropos=0&manpath=FreeBSD+11.2-RELEASE+and+Ports make.conf(5)] | ||
* [https://www.freebsd.org/cgi/man.cgi?query=src.conf&sektion=5&apropos=0&manpath=FreeBSD+11.2-RELEASE+and+Ports src.conf(5)] | * [https://www.freebsd.org/cgi/man.cgi?query=src.conf&sektion=5&apropos=0&manpath=FreeBSD+11.2-RELEASE+and+Ports src.conf(5)] | ||
* [https://www.freebsd.org/cgi/man.cgi?build(7) build(7)] | * [https://www.freebsd.org/cgi/man.cgi?build(7) build(7)] | ||
* [https://www.freebsd.org/cgi/man.cgi?query=isp&sektion=4&manpath=FreeBSD+8.1-RELEASE isp(4)] | * [https://www.freebsd.org/cgi/man.cgi?query=isp&sektion=4&manpath=FreeBSD+8.1-RELEASE isp(4)] |
Revision as of 15:09, 6 November 2018
Contents
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 only FCTARGET kernel. # /boot/GENERIC will be updated by freebsd-update(8). KERNCONF=FCTARGET 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
Make a copy of GENERIC kernel
sudo cp -pr /boot/kernel /boot/GENERIC
From now on freebsd-update(8) will update this kernel.
Build and install the kernels
Build the kernel:
cd /usr/src # builds FCTARGET make buildkernel -j24
Install the kernel:
# installs FCTARGET sudo make -j24 installkernel
If you need to rebuild GENERIC for whatever reason:
make buildkernel -j24 KERNCONF=GENERIC sudo make -j24 installkernel KERNCONF=GENERIC INSTKERNNAME=GENERIC
Load isp(4) driver in /etc/loader.conf
As root:
sudo su - echo isp_load="YES" >> /boot/loader.conf echo ispfw_load="YES" >> /boot/loader.conf
Reboot and test
sudo reboot