Creating a custom mfsbsd to get additional programs & drivers
Table of content
- Creating a custom mfsbsd to get additional programs & drivers
- Table of content
- Generation of
You can generate your own mfsbsd image (see below) or just get one of the Testing/Beta ones from MFSBSD8. In the latter case, you will need to also download the original
kernel.txz from a FreeBSD mirror site because by default
mfsbsd does not include the
geom_eli module and its dependencies (
crypto). The generic image will just use DHCP to get all its network related data and start sshd. Just connect with the
kernel.tgz can be taken from
ftp://ftp.fr.freebsd.org/pub/FreeBSD/releases/amd64/amd64/9.2-RELEASE. Note that the
kernel.tgz version needs to be the same one as the one inside mfsbsd, else you will not be able to load the modules.
NOTE: I have submitted patches to add the missing modules, for now, the method above with
kernel.txz works fine.
buildworld & buildkernel
make buildworld make buildkernel KERNCONF=GENERIC
Please add any option you want like
-j8 and define options as you see fit like
mfsbsd Makefile can do that for you if you specify
CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1.
You need to modify and customize the various configuration files located in
authorized_keys interfaces.conf loader.conf rc.conf resolv.conf
The main things to change are IP addresses of the server, DNS servers, defaultroute and all that. Most of these informations are on the page describing your server in the console. Recent versions of mfsbsd (around 2.0) allow to specify
DHCP making thinsg much easier (and the images more generic).
loader.conf is important because that where you specify the tunables for the kernel. As we are installing a ZFS system, you will need at least to specify
vm.kmem_size. I’d advise you to use 2xRAM here.
There also on file we need to modify:
Makefile. By default, only some kernel modules are loaded in, a few more are put as loadable modules and there are some missing (in the context of the current article):
aesni and its dependencies (
zlib). ZFS and
opensolaris are included though.
If you use the source to generate a release/snapshot, use the following to create the mfsbsd image:
make BASE=/data/work/freebsd/9 SRC_DIR=/data/work/freebsd/9 CUSTOM=1
If you use the files from a given distribution,
SRC_DIR is not needed and
BASE should point to the directory with
Copy the newly created
mfsboot.img somewhere you can reach over the Internet. Any FTP or HTTP server will do.