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.
41 is used for installation of new systems, both for system setup from
42 installation media, e.g., CD-ROMs, and for use on live systems to prepare
47 takes a target and possible parameters of the target as arguments.
48 If invoked with no arguments, it will invoke the
50 target, which provides a standard interactive installation, invoking the
52 To perform a scripted installation,
53 these subtargets can be invoked separately by an installation script.
56 supports the following options, global to all targets:
57 .Bl -tag -width indent+
59 Provide a path for the installation log file
60 .Pq overrides Ev BSDINSTALL_LOG .
62 .Sx ENVIRONMENT VARIABLES
63 for more information on
67 Most of the following targets are only useful for scripting the installer.
68 For interactive use, most users will be interested only in the
74 .Bl -tag -width ".Cm jail Ar destination"
76 Run the standard interactive installation, including disk partitioning.
77 .It Cm jail Ar destination
78 Sets up a new chroot system at
82 Behavior is generally similar to
84 except that disk partitioning and network setup are skipped and a kernel is
85 not installed into the new system.
86 .It Cm script Ar script
87 Runs the installation script at
91 for more information on this target.
93 If the current controlling TTY is a
97 console, asks the user to set the current keymap, and saves the result to the
101 Prompts the user for a host name for the new system and saves the result to the
105 .Ev BSDINSTALL_CONFIGCURRENT
106 is set, also sets the host name of the current system.
108 Interactively configures network interfaces (first invoking
110 on wireless interfaces), saving the result to the new system's
115 .Ev BSDINSTALL_CONFIGCURRENT
116 is set, also configures the network interfaces of the current system to match.
118 Provides the installer's interactive guided disk partitioner for single-disk
122 Provides an alternative ZFS-only automatic interactive disk partitioner.
125 with separate datasets for
133 Optionally can set up
137 Provides the installer's interactive manual disk partitioner with an interface
140 Supports multiple disks as well as UFS, ZFS, and FAT file systems.
141 ZFS is set up with one pool and dataset per partition.
142 .It Cm scriptedpart Ar parameters
147 but non-interactively according to the disk setup specified in
149 Each disk setup is specified by a three-part argument:
155 Multiple disk setups are separated by semicolons.
158 argument specifies the disk on which to operate (which will be erased),
161 argument specifies the
163 partition scheme to apply to the disk.
168 will apply the default bootable scheme on your platform.
171 argument is also optional and specifies how to partition
173 It consists of a comma-separated list of partitions to create enclosed in
175 Each partition declaration takes the form
182 specifies the partition size to create in bytes (K, M, and G suffixes
183 can be appended to specify kilobytes, megabytes, and gigabytes respectively),
186 keyword causes the partition to take all the remaining space on the disk.
191 filesystem type, e.g., freebsd-ufs, freebsd-zfs, or freebsd-swap.
194 argument sets where the created partition is to be mounted in the installed
196 As an example, a typical invocation looks like:
198 bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr }
200 A shorter invocation to use the default partitioning (as
202 would have used) on the same disk:
204 bsdinstall scriptedpart ada0
206 Mounts the file systems previously configured by
212 .Ev BSDINSTALL_CHROOT .
214 Fetches the distributions in
217 .Ev BSDINSTALL_DISTDIR
219 .Ev BSDINSTALL_DISTSITE .
221 Verifies the checksums of the distributions listed in
223 against the distribution manifest.
225 Extracts the distributions listed in
228 .Ev BSDINSTALL_CHROOT .
230 Interactively invokes
232 in the new system to set the root user's password.
234 Interactively invokes
238 Interactively sets the time, date, and time zone of the new system.
240 Queries the user for the system daemons to begin at system startup,
241 writing the result into the new system's
244 Reads a small amount of data from
246 and stores it in a file in the new system's root directory.
248 Installs the configuration files destined for the new system, e.g.,
250 fragments generated by
252 etc.) onto the new system.
254 .Sh ENVIRONMENT VARIABLES
255 The following environment variables control various aspects of the installation
257 Many are used internally during installation and have reasonable default values
258 for most installation scenarios.
259 Others are set by various interactive user prompts, and can be usefully
260 overridden when making scripted or customized installers.
261 .Bl -tag -width ".Ev BSDINSTALL_DISTSITE"
263 The set of distributions to install, e.g., "base kernel ports".
265 .It Ev BSDINSTALL_DISTDIR
266 The directory in which the distribution files can be found (or to which they
267 should be downloaded).
269 .Pa /usr/freebsd-dist
270 .It Ev BSDINSTALL_DISTSITE
271 URL from which the distribution files should be downloaded if they are not
272 already present in the directory defined by
273 .Ev BSDINSTALL_DISTDIR .
274 This should be a full path to the files, including architecture and release
282 mirror will skip that step if this variable is already defined in the
285 .Pa ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc64/9.1-RELEASE
286 .It Ev BSDINSTALL_CHROOT
287 The directory into which the distribution files should be unpacked and the
288 directory at which the root file system of the new system should be mounted.
291 .It Ev BSDINSTALL_LOG
292 Path to a log file for the installation.
294 .Pa /tmp/bsdinstall_log
295 .It Ev BSDINSTALL_TMPETC
296 Directory where files destined for the new system's
298 will be stored until the
301 If this directory does not already exist, it will be created.
303 .Pa /tmp/bsdinstall_etc
304 .It Ev BSDINSTALL_TMPBOOT
305 Directory where files destined for the new system's
307 will be stored until the
310 If this directory does not already exist, it will be created.
312 .Pa /tmp/bsdinstall_boot
316 scripts consist of two parts: a
320 The preamble sets up the options for the installation (how to partition the
321 disk[s], which distributions to install, etc.) and the optional second part is
322 a shell script run under
324 in the newly installed system before
327 The two parts are separated by the usual script header (#!), which also sets
328 the interpreter for the setup script.
330 A typical bsdinstall script looks like this:
331 .Bd -literal -offset indent
333 DISTRIBUTIONS="kernel.txz base.txz"
336 echo "ifconfig_em0=DHCP" >> /etc/rc.conf
337 echo "sshd_enable=YES" >> /etc/rc.conf
343 release media, such a script placed at
344 .Pa /etc/installerconfig
345 will be run at boot time and the system will be rebooted automatically after
346 the installation has completed.
347 This can be used for unattended network installation of new systems; see
351 The preamble consists of installer settings.
352 These control global installation parameters (see
353 .Sx ENVIRONMENT VARIABLES )
354 as well as disk partitioning.
355 The preamble is interpreted as a
357 script run at the very beginning of the install.
358 If more complicated behavior than setting these variables is desired,
359 arbitrary commands can be run here to extend the installer.
360 In addition to the variables in
361 .Sx ENVIRONMENT VARIABLES ,
364 the preamble can contain a variable
366 which is passed to the
368 target to control disk setup.
374 the preamble can contain the variable
379 Following the preamble is an optional shell script, beginning with a #!
381 This script will be run at the end of the installation process inside a
383 environment in the newly installed system and can be used to set up
384 configuration files, install packages, etc.
385 Note that newly configured system services, e.g., networking have not
386 been started in the installed system at this time and only installation
387 host services are available.
395 .An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org