Difference between revisions of "FreeBSD kernel with Fibre Channel target mode support for QLogic cards"
(→Make a copy of GENERIC kernel) |
|||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:FreeBSD]] | ||
+ | |||
== Introduction == | == Introduction == | ||
Line 16: | Line 18: | ||
cat <<EOF >/tmp/make.conf | cat <<EOF >/tmp/make.conf | ||
− | # Build and install | + | # Build and install FCTARGET and GENERIC kernels |
− | # | + | # FCTARGET will be installed by default. |
− | KERNCONF=FCTARGET | + | KERNCONF=FCTARGET GENERIC |
+ | EOF | ||
sudo install -g staff -o aram /tmp/make.conf /etc | sudo install -g staff -o aram /tmp/make.conf /etc | ||
− | == | + | == Exclude the kernels from freebsd-update(8) == |
− | + | Make sure /etc/freebsd-update.conf doesn't list the kernels: | |
− | sudo zfs create zroot/usr/obj | + | Components src world |
+ | |||
+ | == Set permissions to build as user == | ||
+ | |||
+ | sudo zfs create zroot/usr/obj # assuming you have ZFS | ||
sudo chown aram:staff /usr/obj | sudo chown aram:staff /usr/obj | ||
== Build and install the kernels == | == Build and install the kernels == | ||
− | Build the | + | Build the kernels: |
cd /usr/src | cd /usr/src | ||
− | # builds FCTARGET | + | # builds FCTARGET and GENERIC |
make buildkernel -j24 | make buildkernel -j24 | ||
− | Install the | + | Install the kernels: |
− | # | + | # 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 | ||
− | == Load isp(4) driver in /etc/loader.conf == | + | == Load isp(4) driver firmware in /etc/loader.conf == |
As root: | As root: | ||
sudo su - | sudo su - | ||
− | |||
echo ispfw_load="YES" >> /boot/loader.conf | echo ispfw_load="YES" >> /boot/loader.conf | ||
+ | |||
+ | isp(4) is already compiled into the kernel, no need to load it. | ||
== Reboot and test == | == Reboot and test == | ||
sudo reboot | sudo reboot | ||
+ | |||
+ | == Update == | ||
+ | |||
+ | When updating to the same RELEASE, run freebsd-update(8) to get new source and binaries, then recompile the kernels and reboot. | ||
+ | |||
+ | You can't upgrade to a newer RELEASE without rebuilding the newer kernel first. | ||
== References == | == References == | ||
Line 65: | Line 75: | ||
* [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+ | + | * [https://www.freebsd.org/cgi/man.cgi?query=isp&apropos=0&sektion=4&manpath=FreeBSD+11.2-RELEASE&arch=default&format=html isp(4)] |
Latest revision as of 10:25, 22 February 2019
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 FCTARGET and GENERIC kernels # FCTARGET will be installed by default. KERNCONF=FCTARGET GENERIC EOF sudo install -g staff -o aram /tmp/make.conf /etc
Exclude the kernels from freebsd-update(8)
Make sure /etc/freebsd-update.conf doesn't list the kernels:
Components src world
Set permissions to build as user
sudo zfs create zroot/usr/obj # assuming you have ZFS 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
Update
When updating to the same RELEASE, run freebsd-update(8) to get new source and binaries, then recompile the kernels and reboot.
You can't upgrade to a newer RELEASE without rebuilding the newer kernel first.