xref: /src/usr.sbin/bsdinstall/bsdinstall.8 (revision ed5023c96c6e0228d4c38d89b86809c713ed3d68)
181d9e08aSAlexander Ziaee.\"
281d9e08aSAlexander Ziaee.\" SPDX-License-Identifier: BSD-2-Clause
381d9e08aSAlexander Ziaee.\"
45475ce62SMateusz Piotrowski.\" Copyright (c) 2011-2013 Nathan Whitehorn <nwhitehorn@FreeBSD.org> All rights reserved.
55475ce62SMateusz Piotrowski.\" Copyright (c) 2018 Roberto Fernandez Cueto <roberfern@gmail.com>
6bbe2a1daSBjoern A. Zeeb.\" Copyright (c) 2024 The FreeBSD Foundation
7bbe2a1daSBjoern A. Zeeb.\"
8bbe2a1daSBjoern A. Zeeb.\" Portions of this documentation were written by Björn Zeeb
9bbe2a1daSBjoern A. Zeeb.\" under sponsorship from the FreeBSD Foundation.
1097e0f2b4SNathan Whitehorn.\"
1197e0f2b4SNathan Whitehorn.\" Redistribution and use in source and binary forms, with or without
1297e0f2b4SNathan Whitehorn.\" modification, are permitted provided that the following conditions
1397e0f2b4SNathan Whitehorn.\" are met:
1497e0f2b4SNathan Whitehorn.\" 1. Redistributions of source code must retain the above copyright
1597e0f2b4SNathan Whitehorn.\"    notice, this list of conditions and the following disclaimer.
1697e0f2b4SNathan Whitehorn.\" 2. Redistributions in binary form must reproduce the above copyright
1797e0f2b4SNathan Whitehorn.\"    notice, this list of conditions and the following disclaimer in the
1897e0f2b4SNathan Whitehorn.\"    documentation and/or other materials provided with the distribution.
1997e0f2b4SNathan Whitehorn.\"
2097e0f2b4SNathan Whitehorn.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2197e0f2b4SNathan Whitehorn.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2297e0f2b4SNathan Whitehorn.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2397e0f2b4SNathan Whitehorn.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
2497e0f2b4SNathan Whitehorn.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2597e0f2b4SNathan Whitehorn.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2697e0f2b4SNathan Whitehorn.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2797e0f2b4SNathan Whitehorn.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
2897e0f2b4SNathan Whitehorn.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
2997e0f2b4SNathan Whitehorn.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3097e0f2b4SNathan Whitehorn.\" POSSIBILITY OF SUCH DAMAGE.
3197e0f2b4SNathan Whitehorn.\"
3281d9e08aSAlexander Ziaee.Dd October 3, 2025
33edf5bf99SJoel Dahl.Dt BSDINSTALL 8
3497e0f2b4SNathan Whitehorn.Os
3597e0f2b4SNathan Whitehorn.Sh NAME
3697e0f2b4SNathan Whitehorn.Nm bsdinstall
3797e0f2b4SNathan Whitehorn.Nd system installer
3897e0f2b4SNathan Whitehorn.Sh SYNOPSIS
3997e0f2b4SNathan Whitehorn.Nm
40bc4a673fSDevin Teske.Op Ar options
4197e0f2b4SNathan Whitehorn.Op Ar target
4297e0f2b4SNathan Whitehorn.Op Ar ...
4397e0f2b4SNathan Whitehorn.Sh DESCRIPTION
4497e0f2b4SNathan Whitehorn.Nm
4581d9e08aSAlexander Ziaeeis used for installation of new systems,
4681d9e08aSAlexander Ziaeeboth for system setup from installation media,
4781d9e08aSAlexander Ziaeesuch as discs, USBs, or network boot environments,
4881d9e08aSAlexander Ziaeeand for use on live systems to prepare jails and virtual machine images.
4997e0f2b4SNathan Whitehorn.Pp
5097e0f2b4SNathan WhitehornMuch like
5197e0f2b4SNathan Whitehorn.Xr make 1 , Nm
525a7c7dc5SEnji Coopertakes a target and possible parameters of the target as arguments.
535a7c7dc5SEnji CooperIf invoked with no arguments, it will invoke the
5497e0f2b4SNathan Whitehorn.Cm auto
5597e0f2b4SNathan Whitehorntarget, which provides a standard interactive installation, invoking the
565a7c7dc5SEnji Cooperothers in sequence.
575a7c7dc5SEnji CooperTo perform a scripted installation,
585a7c7dc5SEnji Cooperthese subtargets can be invoked separately by an installation script.
59bc4a673fSDevin Teske.Sh OPTIONS
60bc4a673fSDevin Teske.Nm
61bc4a673fSDevin Teskesupports the following options, global to all targets:
6281d9e08aSAlexander Ziaee.Bl -tag -width "-D file"
63bc4a673fSDevin Teske.It Fl D Ar file
64bc4a673fSDevin TeskeProvide a path for the installation log file
65bc4a673fSDevin Teske.Pq overrides Ev BSDINSTALL_LOG .
66bc4a673fSDevin TeskeSee
67bc4a673fSDevin Teske.Sx ENVIRONMENT VARIABLES
68bc4a673fSDevin Teskefor more information on
69bc4a673fSDevin Teske.Ev BSDINSTALL_LOG .
70e2defa52SJoel Dahl.El
7197e0f2b4SNathan Whitehorn.Sh TARGETS
7297e0f2b4SNathan WhitehornMost of the following targets are only useful for scripting the installer.
7397e0f2b4SNathan WhitehornFor interactive use, most users will be interested only in the
7453f01f3aSNathan Whitehorn.Cm auto ,
7553f01f3aSNathan Whitehorn.Cm jail ,
7697e0f2b4SNathan Whitehornand
7753f01f3aSNathan Whitehorn.Cm script
7897e0f2b4SNathan Whitehorntargets.
7981d9e08aSAlexander Ziaee.Bl -tag -width "-D file"
8097e0f2b4SNathan Whitehorn.It Cm auto
8197e0f2b4SNathan WhitehornRun the standard interactive installation, including disk partitioning.
8297e0f2b4SNathan Whitehorn.It Cm jail Ar destination
8397e0f2b4SNathan WhitehornSets up a new chroot system at
8497e0f2b4SNathan Whitehorn.Pa destination ,
8597e0f2b4SNathan Whitehornsuitable for use with
8697e0f2b4SNathan Whitehorn.Xr jail 8 .
8797e0f2b4SNathan WhitehornBehavior is generally similar to
8897e0f2b4SNathan Whitehorn.Cm auto ,
8997e0f2b4SNathan Whitehornexcept that disk partitioning and network setup are skipped and a kernel is
9097e0f2b4SNathan Whitehornnot installed into the new system.
9153f01f3aSNathan Whitehorn.It Cm script Ar script
9253f01f3aSNathan WhitehornRuns the installation script at
9353f01f3aSNathan Whitehorn.Pa script .
9453f01f3aSNathan WhitehornSee
9553f01f3aSNathan Whitehorn.Sx SCRIPTING
9653f01f3aSNathan Whitehornfor more information on this target.
9797e0f2b4SNathan Whitehorn.It Cm keymap
9897e0f2b4SNathan WhitehornIf the current controlling TTY is a
9997e0f2b4SNathan Whitehorn.Xr syscons 4
100f071b64eSStefan Eßeror
101f071b64eSStefan Eßer.Xr vt 4
10297e0f2b4SNathan Whitehornconsole, asks the user to set the current keymap, and saves the result to the
10397e0f2b4SNathan Whitehornnew system's
10497e0f2b4SNathan Whitehorn.Pa rc.conf .
10597e0f2b4SNathan Whitehorn.It Cm hostname
10697e0f2b4SNathan WhitehornPrompts the user for a host name for the new system and saves the result to the
10797e0f2b4SNathan Whitehornnew system's
10897e0f2b4SNathan Whitehorn.Pa rc.conf .
10997e0f2b4SNathan WhitehornIf
11097e0f2b4SNathan Whitehorn.Ev BSDINSTALL_CONFIGCURRENT
11197e0f2b4SNathan Whitehornis set, also sets the host name of the current system.
11297e0f2b4SNathan Whitehorn.It Cm netconfig
11397e0f2b4SNathan WhitehornInteractively configures network interfaces (first invoking
11497e0f2b4SNathan Whitehorn.Cm wlanconfig
11597e0f2b4SNathan Whitehornon wireless interfaces), saving the result to the new system's
11697e0f2b4SNathan Whitehorn.Pa rc.conf
11797e0f2b4SNathan Whitehornand
11897e0f2b4SNathan Whitehorn.Pa resolv.conf .
11997e0f2b4SNathan WhitehornIf
12097e0f2b4SNathan Whitehorn.Ev BSDINSTALL_CONFIGCURRENT
12197e0f2b4SNathan Whitehornis set, also configures the network interfaces of the current system to match.
12297e0f2b4SNathan Whitehorn.It Cm autopart
12397e0f2b4SNathan WhitehornProvides the installer's interactive guided disk partitioner for single-disk
1245a7c7dc5SEnji Cooperinstallations.
1255a7c7dc5SEnji CooperDefaults to UFS.
12689be2c1eSMateusz Piotrowski.It Cm bootconfig
12789be2c1eSMateusz PiotrowskiDetects an appropriate partition and installs UEFI boot loader files.
1286ef5a07eSDevin Teske.It Cm zfsboot
129d512033eSBen WoodsProvides a ZFS-only automatic interactive disk partitioner.
1306ef5a07eSDevin TeskeCreates a single
1316ef5a07eSDevin Teske.Ic zpool
1325b9ee78dSNathan Whitehornwith separate datasets for
1333bb92304SMike Karels.Pa /home ,
1345b9ee78dSNathan Whitehorn.Pa /tmp ,
1355b9ee78dSNathan Whitehorn.Pa /usr ,
1365b9ee78dSNathan Whitehorn.Pa /usr/ports ,
1375b9ee78dSNathan Whitehorn.Pa /usr/src ,
1386ef5a07eSDevin Teskeand
1395b9ee78dSNathan Whitehorn.Pa /var .
1405b9ee78dSNathan WhitehornOptionally can set up
1415b9ee78dSNathan Whitehorn.Xr geli 8
1425b9ee78dSNathan Whitehornto encrypt the disk.
14397e0f2b4SNathan Whitehorn.It Cm partedit
1445b9ee78dSNathan WhitehornProvides the installer's interactive manual disk partitioner with an interface
1455b9ee78dSNathan Whitehornidentical to
1465b9ee78dSNathan Whitehorn.Xr sade 8 .
1475a7c7dc5SEnji CooperSupports multiple disks as well as UFS, ZFS, and FAT file systems.
1485a7c7dc5SEnji CooperZFS is set up with one pool and dataset per partition.
14953f01f3aSNathan Whitehorn.It Cm scriptedpart Ar parameters
15053f01f3aSNathan WhitehornSets up disks like
15153f01f3aSNathan Whitehorn.Cm autopart
15253f01f3aSNathan Whitehornand
15353f01f3aSNathan Whitehorn.Cm partedit ,
15453f01f3aSNathan Whitehornbut non-interactively according to the disk setup specified in
15553f01f3aSNathan Whitehorn.Ar parameters .
15653f01f3aSNathan WhitehornEach disk setup is specified by a three-part argument:
15753f01f3aSNathan Whitehorn.Pp
158aeff2fb3SNathan Whitehorn.Ar disk
159aeff2fb3SNathan Whitehorn.Op Ar scheme
160aeff2fb3SNathan Whitehorn.Op Ar {partitions}
16153f01f3aSNathan Whitehorn.Pp
1625a7c7dc5SEnji CooperMultiple disk setups are separated by semicolons.
1635a7c7dc5SEnji CooperThe
16453f01f3aSNathan Whitehorn.Ar disk
16553f01f3aSNathan Whitehornargument specifies the disk on which to operate (which will be erased),
1665140034cSNathan Whitehornor the special value
1675140034cSNathan Whitehorn.Em DEFAULT ,
1685140034cSNathan Whitehornwhich will result in either a selection window (as in
1695140034cSNathan Whitehorn.Cm autopart )
1705140034cSNathan Whitehornfor the destination disk or, if there is only one possible disk, will
1715140034cSNathan Whitehornautomatically select it.
1725140034cSNathan WhitehornThe
17353f01f3aSNathan Whitehorn.Ar scheme
17453f01f3aSNathan Whitehornargument specifies the
17553f01f3aSNathan Whitehorn.Xr gpart 8
1765a7c7dc5SEnji Cooperpartition scheme to apply to the disk.
1775a7c7dc5SEnji CooperIf
17853f01f3aSNathan Whitehorn.Ar scheme
17953f01f3aSNathan Whitehornis unspecified,
18053f01f3aSNathan Whitehorn.Cm scriptedpart
18153f01f3aSNathan Whitehornwill apply the default bootable scheme on your platform.
18253f01f3aSNathan WhitehornThe
18353f01f3aSNathan Whitehorn.Ar partitions
18453f01f3aSNathan Whitehornargument is also optional and specifies how to partition
18553f01f3aSNathan Whitehorn.Ar disk .
18653f01f3aSNathan WhitehornIt consists of a comma-separated list of partitions to create enclosed in
1875a7c7dc5SEnji Coopercurly braces.
1885a7c7dc5SEnji CooperEach partition declaration takes the form
18953f01f3aSNathan Whitehorn.Pp
190aeff2fb3SNathan Whitehorn.Ar size
191aeff2fb3SNathan Whitehorn.Ar type
192aeff2fb3SNathan Whitehorn.Op Ar mount point
19353f01f3aSNathan Whitehorn.Pp
19453f01f3aSNathan Whitehorn.Ar size
19553f01f3aSNathan Whitehornspecifies the partition size to create in bytes (K, M, and G suffixes
19653f01f3aSNathan Whitehorncan be appended to specify kilobytes, megabytes, and gigabytes respectively),
19753f01f3aSNathan Whitehornwhile the
19853f01f3aSNathan Whitehorn.Em auto
1995a7c7dc5SEnji Cooperkeyword causes the partition to take all the remaining space on the disk.
2005a7c7dc5SEnji CooperThe
20153f01f3aSNathan Whitehorn.Ar type
20253f01f3aSNathan Whitehornoption chooses the
20353f01f3aSNathan Whitehorn.Xr gpart 8
2045a7c7dc5SEnji Cooperfilesystem type, e.g., freebsd-ufs, freebsd-zfs, or freebsd-swap.
20553f01f3aSNathan WhitehornThe optional
20653f01f3aSNathan Whitehorn.Ar mount point
20753f01f3aSNathan Whitehornargument sets where the created partition is to be mounted in the installed
2085a7c7dc5SEnji Coopersystem.
2095a7c7dc5SEnji CooperAs an example, a typical invocation looks like:
21053f01f3aSNathan Whitehorn.Pp
21153f01f3aSNathan Whitehornbsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr }
2125b9ee78dSNathan Whitehorn.Pp
213e8b4c5a6SNathan WhitehornNote that the list of partitions should
214e8b4c5a6SNathan Whitehorn.Em not
215e8b4c5a6SNathan Whitehorninclude boot partitions (e.g. EFI system partitions), which will be created automatically on whatever disk includes /.
216e8b4c5a6SNathan Whitehorn.Pp
2175b9ee78dSNathan WhitehornA shorter invocation to use the default partitioning (as
2185b9ee78dSNathan Whitehorn.Cm autopart
2195b9ee78dSNathan Whitehornwould have used) on the same disk:
2205b9ee78dSNathan Whitehorn.Pp
2215b9ee78dSNathan Whitehornbsdinstall scriptedpart ada0
2225140034cSNathan Whitehorn.Pp
2235140034cSNathan Whitehornor, even shorter:
2245140034cSNathan Whitehorn.Pp
2255140034cSNathan Whitehornbsdinstall scriptedpart DEFAULT
22697e0f2b4SNathan Whitehorn.It Cm mount
22797e0f2b4SNathan WhitehornMounts the file systems previously configured by
22853f01f3aSNathan Whitehorn.Cm autopart ,
22953f01f3aSNathan Whitehorn.Cm partedit ,
23097e0f2b4SNathan Whitehornor
23153f01f3aSNathan Whitehorn.Cm scriptedpart
23297e0f2b4SNathan Whitehornunder
23397e0f2b4SNathan Whitehorn.Ev BSDINSTALL_CHROOT .
23497e0f2b4SNathan Whitehorn.It Cm distfetch
23597e0f2b4SNathan WhitehornFetches the distributions in
23697e0f2b4SNathan Whitehorn.Ev DISTRIBUTIONS
23797e0f2b4SNathan Whitehornto
23897e0f2b4SNathan Whitehorn.Ev BSDINSTALL_DISTDIR
23997e0f2b4SNathan Whitehornfrom
24097e0f2b4SNathan Whitehorn.Ev BSDINSTALL_DISTSITE .
24197e0f2b4SNathan Whitehorn.It Cm checksum
24297e0f2b4SNathan WhitehornVerifies the checksums of the distributions listed in
24397e0f2b4SNathan Whitehorn.Ev DISTRIBUTIONS
24497e0f2b4SNathan Whitehornagainst the distribution manifest.
24597e0f2b4SNathan Whitehorn.It Cm distextract
24697e0f2b4SNathan WhitehornExtracts the distributions listed in
24797e0f2b4SNathan Whitehorn.Ev DISTRIBUTIONS
24897e0f2b4SNathan Whitehorninto
24997e0f2b4SNathan Whitehorn.Ev BSDINSTALL_CHROOT .
250ed5023c9SLexi Winter.It Cm pkgbase Op Fl -jail
251ee9cfd72SIsaac FreundFetch and install base system packages to
252ee9cfd72SIsaac Freund.Ev BSDINSTALL_CHROOT .
253ee9cfd72SIsaac FreundPackages are fetched according to repository configuration in
254ee9cfd72SIsaac Freund.Ev BSDINSTALL_PKG_REPOS_DIR
255ee9cfd72SIsaac Freundif set, or
256ee9cfd72SIsaac Freund.Lk pkg.freebsd.org
257ee9cfd72SIsaac Freundotherwise.
258ee9cfd72SIsaac FreundIf the
259ed5023c9SLexi Winter.Fl -jail
2608d0a9051SLexi Winteroption is passed, no kernel is installed, and the
2618d0a9051SLexi Winter.Dq jail
2628d0a9051SLexi Wintervariant of each package set will be selected where applicable.
263bbe2a1daSBjoern A. Zeeb.It Cm firmware
264bbe2a1daSBjoern A. Zeebexecutes
265bbe2a1daSBjoern A. Zeeb.Xr fwget 8
266bbe2a1daSBjoern A. Zeebinside the
267bbe2a1daSBjoern A. Zeeb.Ev BSDINSTALL_CHROOT
268bbe2a1daSBjoern A. Zeebto install any needed and available firmware for the new system.
26997e0f2b4SNathan Whitehorn.It Cm rootpass
27097e0f2b4SNathan WhitehornInteractively invokes
27197e0f2b4SNathan Whitehorn.Xr passwd 1
27297e0f2b4SNathan Whitehornin the new system to set the root user's password.
27397e0f2b4SNathan Whitehorn.It Cm adduser
27497e0f2b4SNathan WhitehornInteractively invokes
27597e0f2b4SNathan Whitehorn.Xr adduser 8
27697e0f2b4SNathan Whitehornin the new system.
27797e0f2b4SNathan Whitehorn.It Cm time
27897e0f2b4SNathan WhitehornInteractively sets the time, date, and time zone of the new system.
27997e0f2b4SNathan Whitehorn.It Cm services
28097e0f2b4SNathan WhitehornQueries the user for the system daemons to begin at system startup,
28197e0f2b4SNathan Whitehornwriting the result into the new system's
28297e0f2b4SNathan Whitehorn.Pa rc.conf .
2835b9ee78dSNathan Whitehorn.It Cm entropy
2845b9ee78dSNathan WhitehornReads a small amount of data from
2855b9ee78dSNathan Whitehorn.Pa /dev/random
2865b9ee78dSNathan Whitehornand stores it in a file in the new system's root directory.
28797e0f2b4SNathan Whitehorn.It Cm config
2885a7c7dc5SEnji CooperInstalls the configuration files destined for the new system, e.g.,
2895a7c7dc5SEnji Cooper.Xr rc.conf 5
29097e0f2b4SNathan Whitehornfragments generated by
29197e0f2b4SNathan Whitehorn.Cm netconfig ,
29297e0f2b4SNathan Whitehornetc.) onto the new system.
29397e0f2b4SNathan Whitehorn.El
29497e0f2b4SNathan Whitehorn.Sh ENVIRONMENT VARIABLES
29597e0f2b4SNathan WhitehornThe following environment variables control various aspects of the installation
2965a7c7dc5SEnji Cooperprocess.
2975a7c7dc5SEnji CooperMany are used internally during installation and have reasonable default values
2985a7c7dc5SEnji Cooperfor most installation scenarios.
2995a7c7dc5SEnji CooperOthers are set by various interactive user prompts, and can be usefully
3005a7c7dc5SEnji Cooperoverridden when making scripted or customized installers.
30181d9e08aSAlexander Ziaee.Bl -tag -width "-D file"
302a107ddbbSRebecca Cran.It Ev TMPDIR
303a107ddbbSRebecca CranThe directory to use for temporary files.
304a107ddbbSRebecca CranDefault:
305a107ddbbSRebecca Cran.Dq Pa /tmp
30697e0f2b4SNathan Whitehorn.It Ev DISTRIBUTIONS
3076e02be63SMateusz PiotrowskiThe set of distributions to install, e.g., "base.txz kernel.txz ports.txz".
3085475ce62SMateusz PiotrowskiDefault: unset
30989be2c1eSMateusz Piotrowski.It Ev PARTITIONS
31089be2c1eSMateusz PiotrowskiThe partitioning of the disk onto which the system is being installed.
31189be2c1eSMateusz PiotrowskiSee
31289be2c1eSMateusz Piotrowski.Cm scriptedpart
31389be2c1eSMateusz Piotrowskiof
31489be2c1eSMateusz Piotrowskithe
31589be2c1eSMateusz Piotrowski.Sx TARGETS
3165140034cSNathan Whitehornsection for format details. If this variable is unset, the installer will
3175140034cSNathan Whitehornuse the default partitioning as in
3185140034cSNathan Whitehorn.Cm autopart .
31989be2c1eSMateusz PiotrowskiDefault: unset
32097e0f2b4SNathan Whitehorn.It Ev BSDINSTALL_DISTDIR
32197e0f2b4SNathan WhitehornThe directory in which the distribution files can be found (or to which they
3225a7c7dc5SEnji Coopershould be downloaded).
3235a7c7dc5SEnji CooperDefault:
3245475ce62SMateusz Piotrowski.Dq Pa /usr/freebsd-dist
325aeff2fb3SNathan Whitehorn.It Ev BSDINSTALL_DISTSITE
326aeff2fb3SNathan WhitehornURL from which the distribution files should be downloaded if they are not
327aeff2fb3SNathan Whitehornalready present in the directory defined by
328aeff2fb3SNathan Whitehorn.Ev BSDINSTALL_DISTDIR .
329aeff2fb3SNathan WhitehornThis should be a full path to the files, including architecture and release
3305a7c7dc5SEnji Coopernames.
3315a7c7dc5SEnji CooperMost targets, e.g.,
332aeff2fb3SNathan Whitehorn.Cm auto
333aeff2fb3SNathan Whitehornand
3345a7c7dc5SEnji Cooper.Cm jail ,
335aeff2fb3SNathan Whitehornthat prompt for a
336aeff2fb3SNathan Whitehorn.Fx
337aeff2fb3SNathan Whitehornmirror will skip that step if this variable is already defined in the
3385a7c7dc5SEnji Cooperenvironment.
3395a7c7dc5SEnji CooperExample:
340aa35037bSMateusz Piotrowski.Pa https://download.freebsd.org/ftp/releases/powerpc/powerpc64/13.1-RELEASE/
341aa35037bSMateusz Piotrowskior
342aa35037bSMateusz Piotrowski.Pa http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/12.2-RELEASE/ .
343ee9cfd72SIsaac Freund.It Ev BSDINSTALL_PKG_REPOS_DIR
344ee9cfd72SIsaac FreundDirectory containing
345ee9cfd72SIsaac Freund.Xr pkg 8
346ee9cfd72SIsaac Freundrepository configuration files used by the
347ee9cfd72SIsaac Freund.Cm pkgbase
348ee9cfd72SIsaac Freundtarget.
349ee9cfd72SIsaac FreundSee
350ee9cfd72SIsaac Freund.Sx REPOSITORY CONFIGURATION
351ee9cfd72SIsaac Freundin
352ee9cfd72SIsaac Freund.Xr pkg.conf 5 .
353ee9cfd72SIsaac FreundDefault: unset
35497e0f2b4SNathan Whitehorn.It Ev BSDINSTALL_CHROOT
35597e0f2b4SNathan WhitehornThe directory into which the distribution files should be unpacked and the
35697e0f2b4SNathan Whitehorndirectory at which the root file system of the new system should be mounted.
35797e0f2b4SNathan WhitehornDefault:
3585475ce62SMateusz Piotrowski.Dq Pa /mnt
35997e0f2b4SNathan Whitehorn.It Ev BSDINSTALL_LOG
3605a7c7dc5SEnji CooperPath to a log file for the installation.
3615a7c7dc5SEnji CooperDefault:
362a107ddbbSRebecca Cran.Dq Pa $TMPDIR/bsdinstall_log
363bbe2a1daSBjoern A. Zeeb.It Ev BSDINSTALL_SKIP_FIRMWARE
364bbe2a1daSBjoern A. ZeebIf not empty, the
365bbe2a1daSBjoern A. Zeeb.Cm auto
366bbe2a1daSBjoern A. Zeebtarget
367bbe2a1daSBjoern A. Zeebwill not invoke the
368bbe2a1daSBjoern A. Zeeb.Cm firmware
369bbe2a1daSBjoern A. Zeebtarget.
370fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_HARDENING
371fea2cffbSMateusz PiotrowskiIf not empty, the
372fea2cffbSMateusz Piotrowski.Cm auto
373fea2cffbSMateusz Piotrowskitarget
374fea2cffbSMateusz Piotrowskiwill not invoke the
375fea2cffbSMateusz Piotrowski.Cm hardening
376fea2cffbSMateusz Piotrowskitarget.
377fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_HOSTNAME
378fea2cffbSMateusz PiotrowskiIf not empty, the
379fea2cffbSMateusz Piotrowski.Cm auto
380fea2cffbSMateusz Piotrowskitarget
381fea2cffbSMateusz Piotrowskiwill not invoke the
382fea2cffbSMateusz Piotrowski.Cm hostname
383fea2cffbSMateusz Piotrowskitarget.
384fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_KEYMAP
385fea2cffbSMateusz PiotrowskiIf not empty, the
386fea2cffbSMateusz Piotrowski.Cm auto
387fea2cffbSMateusz Piotrowskitarget
388fea2cffbSMateusz Piotrowskiwill not invoke the
389fea2cffbSMateusz Piotrowski.Cm keymap
390fea2cffbSMateusz Piotrowskitarget.
391fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_MANUAL
392fea2cffbSMateusz PiotrowskiIf not empty, the
393fea2cffbSMateusz Piotrowski.Cm auto
394fea2cffbSMateusz Piotrowskitarget will not offer to open a shell in the new system
395fea2cffbSMateusz Piotrowskifor final manual modifications.
396fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_SERVICES
397fea2cffbSMateusz PiotrowskiIf not empty, the
398fea2cffbSMateusz Piotrowski.Cm auto
399fea2cffbSMateusz Piotrowskitarget
400fea2cffbSMateusz Piotrowskiwill not invoke the
401fea2cffbSMateusz Piotrowski.Cm services
402fea2cffbSMateusz Piotrowskitarget.
403fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_TIME
404fea2cffbSMateusz PiotrowskiIf not empty, the
405fea2cffbSMateusz Piotrowski.Cm auto
406fea2cffbSMateusz Piotrowskitarget
407fea2cffbSMateusz Piotrowskiwill not invoke the
408fea2cffbSMateusz Piotrowski.Cm time
409fea2cffbSMateusz Piotrowskitarget.
410fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_USERS
411fea2cffbSMateusz PiotrowskiIf not empty, the
412fea2cffbSMateusz Piotrowski.Cm auto
413fea2cffbSMateusz Piotrowskitarget
414fea2cffbSMateusz Piotrowskiwill not invoke the
415fea2cffbSMateusz Piotrowski.Cm adduser
416fea2cffbSMateusz Piotrowskitarget.
417fea2cffbSMateusz Piotrowski.It Ev BSDINSTALL_SKIP_FINALCONFIG
418fea2cffbSMateusz PiotrowskiIf not empty, the
419fea2cffbSMateusz Piotrowski.Cm auto
420fea2cffbSMateusz Piotrowskitarget will not show the final configuration dialog,
421fea2cffbSMateusz Piotrowskiwhere earlier configuration choices can be revisited.
42297e0f2b4SNathan Whitehorn.It Ev BSDINSTALL_TMPETC
42397e0f2b4SNathan WhitehornDirectory where files destined for the new system's
42497e0f2b4SNathan Whitehorn.Pa /etc
42597e0f2b4SNathan Whitehornwill be stored until the
42697e0f2b4SNathan Whitehorn.Cm config
4275a7c7dc5SEnji Coopertarget is executed.
4285a7c7dc5SEnji CooperIf this directory does not already exist, it will be created.
4295a7c7dc5SEnji CooperDefault:
430a107ddbbSRebecca Cran.Dq Pa $TMPDIR/bsdinstall_etc
431ff134040SDevin Teske.It Ev BSDINSTALL_TMPBOOT
432ff134040SDevin TeskeDirectory where files destined for the new system's
433ff134040SDevin Teske.Pa /boot
434ff134040SDevin Teskewill be stored until the
435ff134040SDevin Teske.Cm config
4365a7c7dc5SEnji Coopertarget is executed.
4375a7c7dc5SEnji CooperIf this directory does not already exist, it will be created.
4385a7c7dc5SEnji CooperDefault:
439a107ddbbSRebecca Cran.Dq Pa $TMPDIR/bsdinstall_boot
4403e1101f2SBrad Davis.It Ev ROOTPASS_ENC
4413e1101f2SBrad DavisEncrypted string to set the root password to in the format expected by
4423e1101f2SBrad Davis.Xr pw 8
4433e1101f2SBrad Davis.Fl H Ar 0 .
4443e1101f2SBrad DavisThis option is used if both it and
4453e1101f2SBrad Davis.Ev ROOTPASS_PLAIN
4463e1101f2SBrad Davisare set.
4473e1101f2SBrad Davis.It Ev ROOTPASS_PLAIN
4483e1101f2SBrad DavisPlain text string to set the root password to.
4495475ce62SMateusz Piotrowski.It Ev ZFSBOOT_POOL_NAME
4505475ce62SMateusz PiotrowskiName for the pool containing the base system.
4515475ce62SMateusz PiotrowskiDefault:
4525475ce62SMateusz Piotrowski.Dq zroot
4535475ce62SMateusz Piotrowski.It Ev ZFSBOOT_POOL_CREATE_OPTIONS
4545475ce62SMateusz PiotrowskiOptions to be used when creating the base system's pool.
4558422d54fSJens SchweikhardtEach option must be preceded by the -O flag to be taken into consideration
4565475ce62SMateusz Piotrowskior the pool will not be created due to errors using the command
4575475ce62SMateusz Piotrowski.Cm zpool .
4585475ce62SMateusz PiotrowskiDefault:
45916045420SLexi Winter.Dq Li "-O compression=on -O atime=off"
4605475ce62SMateusz Piotrowski.It Ev ZFSBOOT_BEROOT_NAME
4615475ce62SMateusz PiotrowskiName for the boot environment parent dataset.
4625475ce62SMateusz PiotrowskiThis is a non-mountable dataset meant to be a parent dataset where different
4635475ce62SMateusz Piotrowskiboot environment are going to be created.
4645475ce62SMateusz PiotrowskiDefault:
4655475ce62SMateusz Piotrowski.Dq ROOT
4665475ce62SMateusz Piotrowski.It Ev ZFSBOOT_BOOTFS_NAME
4675475ce62SMateusz PiotrowskiName for the primary boot environment, which will be the default boot
4685475ce62SMateusz Piotrowskienvironment for the system.
4695475ce62SMateusz PiotrowskiDefault:
4705475ce62SMateusz Piotrowski.Dq default
4715475ce62SMateusz Piotrowski.It Ev ZFSBOOT_VDEV_TYPE
4725475ce62SMateusz PiotrowskiThe type of pool to be created for the base system.
473e0e236baSMarc FonvieilleThis variable can take one of this values: stripe (No redundancy),
4745475ce62SMateusz Piotrowskimirror (n-Way mirroring), raid10 (RAID 1+0 - n x 2-Way Mirrors),
4754a3c7e67SMaxim Konovalovraidz1 (RAID-Z1 - Single Redundancy RAID), raidz2 (RAID-Z2 - Double Redundancy RAID)
4764a3c7e67SMaxim Konovalovor raidz3 (RAID-Z3 Triple Redundancy RAID).
4775475ce62SMateusz PiotrowskiDefault:
4785475ce62SMateusz Piotrowski.Dq stripe
4795475ce62SMateusz Piotrowski.It Ev ZFSBOOT_FORCE_4K_SECTORS
48084f77303SJohn BaldwinControls the minimum sector size of the pool.
48184f77303SJohn BaldwinIf this variable is not empty, the minimum sector size is 4K.
48284f77303SJohn BaldwinIf this variable is empty, the minimum sector size is 512.
48384f77303SJohn BaldwinNote that the sector size of the pool will always be at least
48484f77303SJohn Baldwinthe sector size of the backing disks.
4855475ce62SMateusz PiotrowskiDefault:
4865475ce62SMateusz Piotrowski.Dq 1
4875475ce62SMateusz Piotrowski.It Ev ZFSBOOT_GELI_ENCRYPTION
4885475ce62SMateusz PiotrowskiIf this variable is not empty, it will use
4895475ce62SMateusz Piotrowski.Xr geli 8
4905475ce62SMateusz Piotrowskito encrypt the root pool, enabling automatically the
4915475ce62SMateusz Piotrowski.Ev ZFSBOOT_BOOT_POOL
4925475ce62SMateusz Piotrowskivariable.
4935475ce62SMateusz PiotrowskiDefault:
4945475ce62SMateusz Piotrowski.Dq ""
4955475ce62SMateusz Piotrowski.It Ev ZFSBOOT_GELI_KEY_FILE
4965475ce62SMateusz PiotrowskiPath to the
4975475ce62SMateusz Piotrowski.Xr geli 8
4985475ce62SMateusz Piotrowskikeyfile used to encrypt the pool where the base system is stored.
4995475ce62SMateusz PiotrowskiDefault:
5005475ce62SMateusz Piotrowski.Dq Pa /boot/encryption.key
5015475ce62SMateusz Piotrowski.It Ev ZFSBOOT_BOOT_POOL
5028422d54fSJens SchweikhardtIf set, a separated boot pool will be created for the kernel of the
5035475ce62SMateusz Piotrowskisystem and
5045475ce62SMateusz Piotrowski.Xr loader 8 .
5055475ce62SMateusz PiotrowskiDefault: unset
5065475ce62SMateusz Piotrowski.It Ev ZFSBOOT_BOOT_POOL_CREATE_OPTIONS
5075475ce62SMateusz PiotrowskiOptions to use when creating the boot pool, when enabled (See
5085475ce62SMateusz Piotrowski.Ev ZFSBOOT_BOOT_POOL ).
5095475ce62SMateusz PiotrowskiDefault: unset
5105475ce62SMateusz Piotrowski.It Ev ZFSBOOT_BOOT_POOL_NAME
5115475ce62SMateusz PiotrowskiName for the optional boot pool when it is enabled, (See
5125475ce62SMateusz Piotrowski.Ev ZFSBOOT_BOOT_POOL ).
5135475ce62SMateusz PiotrowskiDefault:
5145475ce62SMateusz Piotrowski.Dq bootpool
5155475ce62SMateusz Piotrowski.It Ev ZFSBOOT_BOOT_POOL_SIZE
5165475ce62SMateusz PiotrowskiSize of the boot pool when it is enabled (See
5175475ce62SMateusz Piotrowski.Ev ZFSBOOT_BOOT_POOL ).
5185475ce62SMateusz PiotrowskiDefault:
5195475ce62SMateusz Piotrowski.Dq 2g
5205475ce62SMateusz Piotrowski.It Ev ZFSBOOT_DISKS
5215475ce62SMateusz PiotrowskiDisks to be used for the base system, including the boot pool.
5225475ce62SMateusz PiotrowskiThis variable must only be used on a scripted installation.
5235475ce62SMateusz PiotrowskiSee
5245475ce62SMateusz Piotrowski.Sx SCRIPTING
5255475ce62SMateusz Piotrowskifor more information.
5265475ce62SMateusz PiotrowskiDefault: unset
5275475ce62SMateusz Piotrowski.It Ev ZFSBOOT_SWAP_SIZE
5285475ce62SMateusz PiotrowskiSize of the swap partition on each block device.
5295475ce62SMateusz PiotrowskiThis variable will be passed to
5305475ce62SMateusz Piotrowski.Xr gpart 8 ;
5315475ce62SMateusz Piotrowskiwhich supports SI unit suffixes.
5325475ce62SMateusz PiotrowskiDefault:
5335475ce62SMateusz Piotrowski.Dq 2g
5345475ce62SMateusz Piotrowski.It Ev ZFSBOOT_SWAP_ENCRYPTION
5355475ce62SMateusz PiotrowskiIf set, enables the encryption of the swap partition using
5365475ce62SMateusz Piotrowski.Xr geli 8 .
537ace67128SMateusz PiotrowskiDefault: ""
5385475ce62SMateusz Piotrowski.It Ev ZFSBOOT_SWAP_MIRROR
5395475ce62SMateusz PiotrowskiIf set, enables a swap mirroring using
5405475ce62SMateusz Piotrowski.Xr gmirror 8 .
5415475ce62SMateusz PiotrowskiDefault:
5425475ce62SMateusz Piotrowskiunset
5435475ce62SMateusz Piotrowski.It Ev ZFSBOOT_DATASETS
5445475ce62SMateusz PiotrowskiZFS datasets to be created on the root zpool, it requires the
5455475ce62SMateusz Piotrowskifollowing datasets:
5465475ce62SMateusz Piotrowski.Pa /tmp ,
5475475ce62SMateusz Piotrowski.Pa /var/tmp ,
5485475ce62SMateusz Piotrowski.Pa /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME .
5495475ce62SMateusz PiotrowskiSee
5505475ce62SMateusz Piotrowski.Sx ZFS DATASETS
5518422d54fSJens Schweikhardtfor more information about how to populate this variable and
5528422d54fSJens Schweikhardtits default value.
5535475ce62SMateusz Piotrowski.It Ev ZFSBOOT_CONFIRM_LAYOUT
5545475ce62SMateusz PiotrowskiIf set and the installation is interactive, allow the user to confirm
5555475ce62SMateusz Piotrowskithe layout before continuing with the installation.
5565475ce62SMateusz PiotrowskiDefault:
5575475ce62SMateusz Piotrowski.Dq 1
55897e0f2b4SNathan Whitehorn.El
55953f01f3aSNathan Whitehorn.Sh SCRIPTING
56053f01f3aSNathan Whitehorn.Nm
5613b20b988SNathan Whitehornsupports unattended, or minimally-attended, installations using scripting.
5623b20b988SNathan WhitehornThis can be used with either modified physical installation media or with
5633b20b988SNathan Whitehorn.Xr diskless 8
5643b20b988SNathan Whitehorninstallations over the network; information on preparing such media can be
5653b20b988SNathan Whitehornfound in
5663b20b988SNathan Whitehorn.Sx BUILDING AUTOMATIC INSTALL MEDIA
5673b20b988SNathan Whitehorn.Pp
5683b20b988SNathan WhitehornScripted installations follow an essentially identical path to interactive
5693b20b988SNathan Whitehorninstallations, though with some minor feature differences (for example,
5703b20b988SNathan Whitehornscripted installations do not support fetching of remote distribution files
5713b20b988SNathan Whitehornsince scripted installations normally install the same files and the distributions
5723b20b988SNathan Whitehorncan be added directly to the installation media).
5733b20b988SNathan Whitehorn.Nm
57453f01f3aSNathan Whitehornscripts consist of two parts: a
57553f01f3aSNathan Whitehorn.Em preamble
57653f01f3aSNathan Whitehornand a
57753f01f3aSNathan Whitehorn.Em setup script .
57853f01f3aSNathan WhitehornThe preamble sets up the options for the installation (how to partition the
5793193ad88SNathan Whitehorndisk[s], which distributions to install, etc.) and the optional second part is
5803193ad88SNathan Whitehorna shell script run under
5813193ad88SNathan Whitehorn.Xr chroot 8
5823193ad88SNathan Whitehornin the newly installed system before
58353f01f3aSNathan Whitehorn.Nm
5845a7c7dc5SEnji Cooperexits.
5855a7c7dc5SEnji CooperThe two parts are separated by the usual script header (#!), which also sets
5865a7c7dc5SEnji Cooperthe interpreter for the setup script.
58753f01f3aSNathan Whitehorn.Pp
588b8639a10SNathan WhitehornA typical bsdinstall script, using the default filesystem layout and the UFS
589b8639a10SNathan Whitehornfilesystem, looks like this:
59053f01f3aSNathan Whitehorn.Bd -literal -offset indent
5915140034cSNathan WhitehornPARTITIONS=DEFAULT
59253f01f3aSNathan WhitehornDISTRIBUTIONS="kernel.txz base.txz"
59353f01f3aSNathan Whitehorn
59453f01f3aSNathan Whitehorn#!/bin/sh
595f91026bfSNathan Whitehornsysrc ifconfig_DEFAULT=DHCP
596fb4f0dcaSNathan Whitehornsysrc sshd_enable=YES
59753f01f3aSNathan Whitehornpkg install puppet
59853f01f3aSNathan Whitehorn.Ed
59953f01f3aSNathan Whitehorn.Pp
600b8639a10SNathan WhitehornFor a scripted installation involving a ZFS pool spanning multiple disks,
601b8639a10SNathan Whitehornthe script instead looks like this:
6025475ce62SMateusz Piotrowski.Bd -literal -offset indent
6035475ce62SMateusz PiotrowskiDISTRIBUTIONS="kernel.txz base.txz"
6045475ce62SMateusz Piotrowskiexport ZFSBOOT_VDEV_TYPE=stripe
605b8639a10SNathan Whitehornexport ZFSBOOT_DISKS="ada0 ada1"
6065475ce62SMateusz Piotrowskiexport nonInteractive="YES"
6075475ce62SMateusz Piotrowski
6085475ce62SMateusz Piotrowski#!/bin/sh
609f91026bfSNathan Whitehornecho "ifconfig_DEFAULT=DHCP" >> /etc/rc.conf
6105475ce62SMateusz Piotrowskiecho "sshd_enable=YES" >> /etc/rc.conf
6115475ce62SMateusz Piotrowskipkg install puppet
6125475ce62SMateusz Piotrowski.Ed
6135475ce62SMateusz Piotrowski.Pp
61453f01f3aSNathan WhitehornOn
61553f01f3aSNathan Whitehorn.Fx
61653f01f3aSNathan Whitehornrelease media, such a script placed at
61753f01f3aSNathan Whitehorn.Pa /etc/installerconfig
61853f01f3aSNathan Whitehornwill be run at boot time and the system will be rebooted automatically after
6195a7c7dc5SEnji Cooperthe installation has completed.
6205a7c7dc5SEnji CooperThis can be used for unattended network installation of new systems; see
62153f01f3aSNathan Whitehorn.Xr diskless 8
62253f01f3aSNathan Whitehornfor details.
62353f01f3aSNathan Whitehorn.Ss PREAMBLE
6245a7c7dc5SEnji CooperThe preamble consists of installer settings.
6255a7c7dc5SEnji CooperThese control global installation parameters (see
62653f01f3aSNathan Whitehorn.Sx ENVIRONMENT VARIABLES )
6275a7c7dc5SEnji Cooperas well as disk partitioning.
6285a7c7dc5SEnji CooperThe preamble is interpreted as a
62953f01f3aSNathan Whitehorn.Xr sh 1
6305a7c7dc5SEnji Cooperscript run at the very beginning of the install.
6315a7c7dc5SEnji CooperIf more complicated behavior than setting these variables is desired,
6325a7c7dc5SEnji Cooperarbitrary commands can be run here to extend the installer.
6335a7c7dc5SEnji CooperIn addition to the variables in
63453f01f3aSNathan Whitehorn.Sx ENVIRONMENT VARIABLES ,
63553f01f3aSNathan Whitehornin particular
63653f01f3aSNathan Whitehorn.Ev DISTRIBUTIONS ,
63753f01f3aSNathan Whitehornthe preamble can contain a variable
63853f01f3aSNathan Whitehorn.Ev PARTITIONS
63953f01f3aSNathan Whitehornwhich is passed to the
64053f01f3aSNathan Whitehorn.Cm scriptedpart
64153f01f3aSNathan Whitehorntarget to control disk setup.
642b8639a10SNathan Whitehorn.Pp
6436ef5a07eSDevin TeskeAlternatively,
6445b9ee78dSNathan Whitehornto use
6455b9ee78dSNathan Whitehorn.Cm zfsboot
6466ef5a07eSDevin Teskeinstead of
6475b9ee78dSNathan Whitehorn.Cm partedit ,
6486ef5a07eSDevin Teskethe preamble can contain the variable
6496ef5a07eSDevin Teske.Ev ZFSBOOT_DATASETS
6505b9ee78dSNathan Whitehorninstead of
651b8639a10SNathan Whitehorn.Ev PARTITIONS
652b8639a10SNathan Whitehorn(see below).
6538422d54fSJens SchweikhardtIf using
6548422d54fSJens Schweikhardt.Cm zfsboot ,
6558422d54fSJens Schweikhardtthe variables
6565475ce62SMateusz Piotrowski.Ev ZFSBOOT_DISKS
6575475ce62SMateusz Piotrowskiand
6585475ce62SMateusz Piotrowski.Ev ZFSBOOT_VDEV_TYPE
659b8639a10SNathan Whitehornmust be set to create the pool of disks for the base system.
6608422d54fSJens SchweikhardtUsually, for a mirrored booting disk, these two variables look like this:
6615475ce62SMateusz Piotrowski.Bd -literal -offset indent
6625475ce62SMateusz PiotrowskiZFSBOOT_DISKS="ada0 ada1"
6635475ce62SMateusz PiotrowskiZFSBOOT_VDEV_TYPE=mirror
6645475ce62SMateusz Piotrowski.Ed
6655475ce62SMateusz Piotrowski.Pp
6664a3c7e67SMaxim KonovalovRemember to export all the variables for the
6675475ce62SMateusz Piotrowski.Cm zfsboot
668b8639a10SNathan Whitehorncommand, otherwise installation will fail.
66953f01f3aSNathan Whitehorn.Ss SETUP SCRIPT
670aeff2fb3SNathan WhitehornFollowing the preamble is an optional shell script, beginning with a #!
6715a7c7dc5SEnji Cooperdeclaration.
6725a7c7dc5SEnji CooperThis script will be run at the end of the installation process inside a
67353f01f3aSNathan Whitehorn.Xr chroot 8
67453f01f3aSNathan Whitehornenvironment in the newly installed system and can be used to set up
6755a7c7dc5SEnji Cooperconfiguration files, install packages, etc.
6765a7c7dc5SEnji CooperNote that newly configured system services, e.g., networking have not
6775a7c7dc5SEnji Cooperbeen started in the installed system at this time and only installation
6785a7c7dc5SEnji Cooperhost services are available.
6795475ce62SMateusz Piotrowski.Ss ZFS DATASETS
680b8639a10SNathan WhitehornIf using
6815475ce62SMateusz Piotrowski.Cm zfsboot
682b8639a10SNathan Whitehornin an installation script, the
683b8639a10SNathan Whitehorn.Cm zfsboot
684b8639a10SNathan Whitehornpartitioning tool takes the
6855475ce62SMateusz Piotrowski.Ev ZFSBOOT_DATASETS
686b8639a10SNathan Whitehornvariable to create the ZFS datasets on the base system.
687b8639a10SNathan WhitehornThis variable definition can become large if the pool contains many datasets.
6888422d54fSJens SchweikhardtThe default value of
6895475ce62SMateusz Piotrowski.Ev ZFSBOOT_DATASETS
690b8639a10SNathan Whitehornis:
6915475ce62SMateusz Piotrowski.Bd -literal -offset indent
6925475ce62SMateusz Piotrowski# DATASET	OPTIONS (comma or space separated; or both)
6935475ce62SMateusz Piotrowski
6945475ce62SMateusz Piotrowski# Boot Environment [BE] root and default boot dataset
6955475ce62SMateusz Piotrowski/$ZFSBOOT_BEROOT_NAME				mountpoint=none
6965475ce62SMateusz Piotrowski/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME	mountpoint=/
6975475ce62SMateusz Piotrowski
6983bb92304SMike Karels# Home directories separated so they are common to all BEs
6993bb92304SMike Karels/home		mountpoint=/home
7003bb92304SMike Karels
701f304c5bbSMichael Osipov# Create /tmp and allow exec but not setuid
7025475ce62SMateusz Piotrowski/tmp		mountpoint=/tmp,exec=on,setuid=off
7035475ce62SMateusz Piotrowski
7045475ce62SMateusz Piotrowski# Do not mount /usr so that 'base' files go to the BEROOT
7055475ce62SMateusz Piotrowski/usr		mountpoint=/usr,canmount=off
7065475ce62SMateusz Piotrowski
7075475ce62SMateusz Piotrowski# Ports tree
7085475ce62SMateusz Piotrowski/usr/ports	setuid=off
7095475ce62SMateusz Piotrowski
710f304c5bbSMichael Osipov# Source tree
7115475ce62SMateusz Piotrowski/usr/src
7125475ce62SMateusz Piotrowski
7135475ce62SMateusz Piotrowski# Create /var and friends
7145475ce62SMateusz Piotrowski/var		mountpoint=/var,canmount=off
7155475ce62SMateusz Piotrowski/var/audit	exec=off,setuid=off
7165475ce62SMateusz Piotrowski/var/crash	exec=off,setuid=off
7175475ce62SMateusz Piotrowski/var/log	exec=off,setuid=off
7185475ce62SMateusz Piotrowski/var/mail	atime=on
7195475ce62SMateusz Piotrowski/var/tmp	setuid=off
7205475ce62SMateusz Piotrowski.Ed
7215475ce62SMateusz Piotrowski.Pp
722b8639a10SNathan WhitehornThe first column is the name of the dataset to be created as part of the
7235475ce62SMateusz Piotrowski.Ev ZFSBOOT_POOL_NAME
724b8639a10SNathan Whitehornpool and the remainder of each line contains the options to be set on each dataset.
725b8639a10SNathan WhitehornIf multiple options are given, they can be separated by either commas or whitespace;
726b8639a10SNathan Whitehorneverything following a pound/hash character is ignored as a comment.
727c8923d19SNathan Whitehorn.Ss BUILDING AUTOMATIC INSTALL MEDIA
728c8923d19SNathan WhitehornIf building automatic install media, use tar to extract a release ISO:
729c8923d19SNathan Whitehorn.Dl mkdir release-media
7304b1e2c2fSFarhan Khan.Dl tar -C release-media -xvf FreeBSD-13.0-RELEASE-amd64-disc1.iso
731c8923d19SNathan Whitehorn.Pp
732c8923d19SNathan WhitehornThen place a script as above in
733c8923d19SNathan Whitehorn.Pa etc/installerconfig
734c8923d19SNathan Whitehorn.Pp
735c8923d19SNathan WhitehornThis directory can then be used directly as an NFS root for
736c8923d19SNathan Whitehorn.Xr diskless 8
737c8923d19SNathan Whitehorninstallations or it can be rebuilt into an ISO image using the release scripts in
738c8923d19SNathan Whitehorn.Pa /usr/src/release .
739c8923d19SNathan WhitehornFor example, on amd64:
740c8923d19SNathan Whitehorn.Dl sh /usr/src/release/amd64/mkisoimages.sh -b '13_0_RELEASE_AMD64_CD' output.iso release-media
74197e0f2b4SNathan Whitehorn.Sh HISTORY
74297e0f2b4SNathan WhitehornThis version of
74397e0f2b4SNathan Whitehorn.Nm
74497e0f2b4SNathan Whitehornfirst appeared in
74597e0f2b4SNathan Whitehorn.Fx 9.0 .
74697e0f2b4SNathan Whitehorn.Sh AUTHORS
74701c2b8acSBaptiste Daroussin.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org
748b8639a10SNathan Whitehorn.An Devin Teske Aq Mt dteske@FreeBSD.org
749b8639a10SNathan Whitehorn.An Allan Jude Aq Mt allanjude@FreeBSD.org
750