2 .\" Copyright (c) 2011-2013 Nathan Whitehorn <nwhitehorn@FreeBSD.org>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 .\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
18 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
22 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
23 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 .\" POSSIBILITY OF SUCH DAMAGE.
40 is used for installation of new systems, both for system setup from
41 installation media (e.g. CD-ROMs) and for use on live systems to prepare
46 takes a target and possible parameters of the target as arguments. If
47 invoked with no arguments, it will invoke the
49 target, which provides a standard interactive installation, invoking the
50 others in sequence. To perform a scripted installation, these subtargets
51 can be invoked separately by an installation script.
53 Most of the following targets are only useful for scripting the installer.
54 For interactive use, most users will be interested only in the
60 .Bl -tag -width ".Cm jail Ar destination"
62 Run the standard interactive installation, including disk partitioning.
63 .It Cm jail Ar destination
64 Sets up a new chroot system at
68 Behavior is generally similar to
70 except that disk partitioning and network setup are skipped and a kernel is
71 not installed into the new system.
72 .It Cm script Ar script
73 Runs the installation script at
77 for more information on this target.
79 If the current controlling TTY is a
81 console, asks the user to set the current keymap, and saves the result to the
85 Prompts the user for a host name for the new system and saves the result to the
89 .Ev BSDINSTALL_CONFIGCURRENT
90 is set, also sets the host name of the current system.
92 Interactively configures network interfaces (first invoking
94 on wireless interfaces), saving the result to the new system's
99 .Ev BSDINSTALL_CONFIGCURRENT
100 is set, also configures the network interfaces of the current system to match.
102 Provides the installer's interactive guided disk partitioner for single-disk
103 installations. Partitions disks, runs
105 and writes the new system's
108 Provides the installer's interactive manual disk partitioner, with support
109 for multi disk setups, non-UFS file systems, and manual selection of
110 partition schemes. Partitions disks, runs
112 and writes the new system's
114 .It Cm scriptedpart Ar parameters
119 but non-interactively according to the disk setup specified in
121 Each disk setup is specified by a three-part argument:
127 Multiple disk setups are separated by semicolons. The
129 argument specifies the disk on which to operate (which will be erased),
132 argument specifies the
134 partition scheme to apply to the disk. If
138 will apply the default bootable scheme on your platform.
141 argument is also optional and specifies how to partition
143 It consists of a comma-separated list of partitions to create enclosed in
144 curly braces. Each partition declaration takes the form
151 specifies the partition size to create in bytes (K, M, and G suffixes
152 can be appended to specify kilobytes, megabytes, and gigabytes respectively),
155 keyword causes the partition to take all the remaining space on the disk. The
159 filesystem type (e.g. freebsd-ufs or freebsd-swap).
162 argument sets where the created partition is to be mounted in the installed
163 system. As an example, a typical invocation looks like:
165 bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr }
167 Mounts the file systems previously configured by
173 .Ev BSDINSTALL_CHROOT .
175 Fetches the distributions in
178 .Ev BSDINSTALL_DISTDIR
180 .Ev BSDINSTALL_DISTSITE .
182 Verifies the checksums of the distributions listed in
184 against the distribution manifest.
186 Extracts the distributions listed in
189 .Ev BSDINSTALL_CHROOT .
191 Interactively invokes
193 in the new system to set the root user's password.
195 Interactively invokes
199 Interactively sets the time, date, and time zone of the new system.
201 Queries the user for the system daemons to begin at system startup,
202 writing the result into the new system's
205 Installs the configuration files destined for the new system (e.g. rc.conf
206 fragments generated by
208 etc.) onto the new system.
210 .Sh ENVIRONMENT VARIABLES
211 The following environment variables control various aspects of the installation
212 process. Many are used internally during installation and have reasonable
213 default values for most installation scenarios. Others are set by various
214 interactive user prompts, and can be usefully overridden when making scripted
215 or customized installers.
216 .Bl -tag -width ".Ev BSDINSTALL_DISTSITE"
218 The set of distributions to install (e.g. "base kernel ports"). Default: none
219 .It Ev BSDINSTALL_DISTDIR
220 The directory in which the distribution files can be found (or to which they
221 should be downloaded). Default:
222 .Pa /usr/freebsd-dist
223 .It Ev BSDINSTALL_DISTSITE
224 URL from which the distribution files should be downloaded if they are not
225 already present in the directory defined by
226 .Ev BSDINSTALL_DISTDIR .
227 This should be a full path to the files, including architecture and release
228 names. Most targets (e.g.
234 mirror will skip that step if this variable is already defined in the
235 environment. Example:
236 .Pa ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc64/9.1-RELEASE
237 .It Ev BSDINSTALL_CHROOT
238 The directory into which the distribution files should be unpacked and the
239 directory at which the root file system of the new system should be mounted.
242 .It Ev BSDINSTALL_LOG
243 Path to a log file for the installation. Default:
244 .Pa /tmp/bsdinstall_log
245 .It Ev BSDINSTALL_TMPETC
246 Directory where files destined for the new system's
248 will be stored until the
250 target is executed. If this directory does not already exist, it will be
252 .Pa /tmp/bsdinstall_etc
256 scripts consist of two parts: a
260 The preamble sets up the options for the installation (how to partition the
261 disk[s], which distributions to install, etc.) and the optional second part is
262 a shell script run under
264 in the newly installed system before
266 exits. The two parts are separated by the usual script header (#!), which
267 also sets the interpreter for the setup script.
269 A typical bsdinstall script looks like this:
270 .Bd -literal -offset indent
272 DISTRIBUTIONS="kernel.txz base.txz"
275 echo "ifconfig_em0=DHCP" >> /etc/rc.conf
276 echo "sshd_enable=YES" >> /etc/rc.conf
282 release media, such a script placed at
283 .Pa /etc/installerconfig
284 will be run at boot time and the system will be rebooted automatically after
285 the installation has completed. This can be used for unattended network
286 installation of new systems; see
290 The preamble consists of installer settings. These control global installation
292 .Sx ENVIRONMENT VARIABLES )
293 as well as disk partitioning. The preamble is interpreted as a
295 script run at the very beginning of the install. If more complicated behavior
296 than setting these variables is desired, arbitrary commands can be run here
297 to extend the installer. In addition to the variables in
298 .Sx ENVIRONMENT VARIABLES ,
301 the preamble can contain a variable
303 which is passed to the
305 target to control disk setup.
307 Following the preamble is an optional shell script, beginning with a #!
308 declaration. This script will be run at the end of the installation process
311 environment in the newly installed system and can be used to set up
312 configuration files, install packages, etc. Note that newly configured
313 system services (e.g. networking) have not been started in the installed
314 system at this time and only installation host services are available.
322 .An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org