Scripting in bsdinstall

Nathan Whitehorn nwhitehorn at freebsd.org
Tue Jan 22 03:07:56 UTC 2013


After many, many requests, I've finally added a first round of real
scripting support to bsdinstall, which is now documented in some detail
in bsdinstall(8) on -CURRENT.

The basic scheme (some changes still coming) is to make a script that
looks like this:

PARTITIONS=ada0
DISTRIBUTIONS="kernel.txz base.txz"

#!/bin/sh
echo "Installation complete, running in host system"
echo "sshd_enable=YES" >> /etc/rc.conf
echo "Setup done"

This replaces anything on ada0 with a default partitioning scheme (other
partition schemes and layouts can be specified, as well as installations
spanning multiple disks; see the man page), installs a minimal set of
distributions, and then runs the system setup script that is found at
the bottom and can be used to install packages, etc.

Right now, the release(7) infrastructure is set up to autorun a script
like this at /etc/installerconfig, if it exists, which is meant for
unattended PXE installations. You can also run any other script by
running bsdinstall script /path/to/script. In the next week or so, I'm
hoping to hook up PXE image generation to the release infrastructure.

Please let me know if you have any comments about how this works or
feature requests.
-Nathan


More information about the freebsd-sysinstall mailing list