5 Jumpstart installation

In this section covers how to set up a jumpstart installation. By the end of this section, you should have set up your server such that (almost) all you need to do to install FreeBSD is to connect your new machine to your network.

The jumpstart installation will load a memory disk as root device and fetch the release using ftp. We could also do this providing both root device and release files with nfs, if you want to to this, skip to the next section.

5.1 The memory disk root device

For jumpstart installation we use a memory file system as root device. The easiest way to obtain such a memory disk is to grap the one found on the installation media, mfsroot.gz, and copy it to /var/tftp/boot/jumpstart.gz.

If you plan on interactive installation or only simple scripting, there is no reason to do the trouble of customizing a memory root file system.

You may want to create a custom root file system in order to enable special customization prior or posterior to the installation that need extra scripting support. This section explains how.

Essentially, the memory disk device distributed on the installation media contains just a minimal set of configuration files and a "bootcrunch" file. A bootcrunch file is a special compressed binary containing statically linked executables. This format is useful when storage is limited.

The memory disk is loaded into the RAM, which determines the upper size limit for a memory root device. You can create a custom memory disk in two ways:

5.1.1 Creating root file system with a custom bootcrunch file

To create the bootcrunch file we can either customize the bootcrunch configuration file found in release/i386 - without any changes this will build the bootcrunch file found on installation media, or you can use the "rescue" make files as skeleton.

In the following we will use the makefiles found in /usr/src/resuce as skeleton to create a custom bootcrunch file. It turns out to be easier, because the make file also allows us to easily install the bootcrunch binary on the memory file system.

First create a copy of the rescue directory to leave original unmodified:

# cd /usr/src
# cp -R rescue jumpstart
# cd jumpstart
# mv rescue jumpstart
# mv librescue libjumpstart

In this directory there are three make-files, one in the top directory and one in the two sub-directories jumpstart and libjumpstart. Edit all these to replace all occurences of "rescue" with "jumpstart".

The make file in jumpstart defines which binaries and libraries to include, libjumpstart adds some specially linked libraries. Edit jumpstart/Makefile to suit your needs, you can use the bootcrunch configuration file found in release/i386 to see what you must include.

We need to create and mount the memory device to install the memory root file system. It can be any size as long as the jumpstart client has enough RAM. We create a 16MB memory disk:

# dd if=/dev/zero of=/var/tftp/boot/jumpstart bs=1k count=16k
# mdconfig -a -t vnode -f jumpstart -u0
# disklabel -r -w md0 auto
# newfs /dev/md0c

Next mount the file system:

# mount /dev/md0 /mnt
# cd /mnt

We now have an empty memory disk which will be served the client. Now we need to populate the file system to start the system installation, first create the base directory layout:

# cd /usr/src
# mtree -U -p /mnt -f /etc/mtree/BSD.root.mtree
# make DESTDIR=/mnt distribution
# mkdir /mnt/jumpstart

Now build and install the bootcrunch file:

# cd /usr/src/jumpstart
# make NO_ATM=YES
# make DESTDIR=/mnt install

Note: With the jumpstart makefiles I created, I got errors trying to compile with ATM, disabling this solved the problem.

And to finish up,

# cd /mnt
# rmdir /mnt/sbin /mnt/bin
# ln -s jumpstart bin
# ln -s jumpstart sbin

dhclient uses a shell script which must be installed separately:

# cp /usr/src/sbin/dhclient/dhclient-script /mnt/jumpstart/dhclient-script 
# chmod +x /mnt/jumpstart/dhclient-script

Unmount the file system and run fsck:

# cd /
# umount /mnt/mfs
# fsck -t ufs /dev/md0
# mdconfig -d -u 0
# gzip /var/tftp/boot/jumpstart

At this point we have a fully equipped memory file system that can be used for installation. Booting up your jumpstart client, you should get the standard interactive installation menu.

Note: The release is set according to the version of your kernel, if your kernel is 6.1-RELEASE sysinstall will assume this is the version you want to install. If you built a kernel from updated sources you may have a 6-STABLE kernel, and installation will fail since there is no such release. You can set the release you want to install in the menus.

5.2 Speeding up booting

Booting with PXE takes more time as all the files needs to be fetched over the network. The pxeboot program will first look for compressed files, then the non-compressed, the only file you cannot compres is pxeboot.

So, to speed up the transfer, you can gzip the kernel, any kernel modules and the memory file system. We may need to edit and customize the configuration files, so we let these be uncompressed.

5.3 Rebooting

Before you reboot, make sure that your new server won't boot again using pxeboot, hence repeating the process. My experience with the VIA board was that I had to disable LAN boot completely in the bios, not just have it as secondary boot device.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.