xref: /netbsd-src/usr.sbin/postinstall/postinstall.8 (revision a04395531661c5e8d314125d5ae77d4cbedd5d73)
1.\"	$NetBSD: postinstall.8,v 1.20 2018/11/21 20:13:09 martin Exp $
2.\"
3.\" Copyright (c) 2005-2008 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Thomas Klausner.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd November 20, 2018
31.Dt POSTINSTALL 8
32.Os
33.Sh NAME
34.Nm postinstall
35.Nd check and fix installation after system upgrades
36.Sh SYNOPSIS
37.Nm postinstall
38.Op Fl a Ar arch
39.Op Fl d Ar destdir
40.Op Fl m Ar machine
41.Op Fl s Brq Ar srcdir | Ar tgzdir | Ar tgzfile
42.Op Fl x Ar xsrcdir
43.Ar operation
44.Op Ar item Op ...
45.Sh DESCRIPTION
46The
47.Nm
48utility performs post-installation checks and/or fixes on a system's
49configuration files.
50It is especially useful after system upgrades, e.g. after updating
51from
52.Nx 1.6.2
53to
54.Nx 2.0 .
55The items to check or fix are divided in two groups: enabled by
56default and disabled by default.
57The latter are items that are dangerous for some reason, for example
58because they remove files which may be still in use.
59If no
60.Ar items
61are provided, the default checks or fixes are applied.
62Those which are disabled by default must be provided explicitly.
63.Pp
64Supported options:
65.Bl -tag -width XsXsrcdirXXX -offset indent
66.It Fl a Ar arch
67MACHINE_ARCH.
68Defaults to machine of the host operating system.
69.It Fl d Ar destdir
70Destination directory to check.
71Defaults to
72.Pa / .
73.It Fl m Ar machine
74MACHINE.
75Defaults to machine of the host operating system.
76.It Fl s Brq Ar srcdir | Ar tgzdir | Ar tgzfile
77The location of the reference files, or the
78.Nx
79source files used to create the reference files.
80This may be specified in one of three ways:
81.Bl -tag -width XXsXtgzfileXX
82.It Fl s Ar srcdir
83The top level directory of the
84.Nx
85source tree.
86By default this is
87.Pa /usr/src .
88.It Fl s Ar tgzdir
89A directory in which reference files have been
90extracted from a binary distribution of
91.Nx .
92The files that are distributed in the
93.Dq Pa etc.tgz
94or
95.Dq Pa etc.tar.xz
96set file must be present.
97The files that are distributed in the
98.Dq Pa xetc.tgz
99or
100.Dq Pa xetc.tar.xz
101set file are optional.
102.It Fl s Ar tgzfile
103The location of a set file
104(or
105.Dq "tgz file"
106or
107.Dq "tar.xz file" )
108such as
109.Dq Pa etc.tgz
110or
111.Dq Pa xetc.tgz
112from a binary distribution of
113.Nx .
114Each set file is a compressed archive containing reference files,
115which will be extracted to the
116.Pa temproot
117directory.
118Multiple
119.Fl s
120options may be used to specify multiple set files.
121The
122.Dq Pa etc.tgz
123set file must be specified.
124The
125.Dq Pa xetc.tgz
126set file is optional.
127.El
128.It Fl x Ar xsrcdir
129Location of the X11 source files.
130This must be a directory that contains a
131.Nx
132xsrc tree.
133.El
134.Pp
135The
136.Ar operation
137argument may be one of:
138.Bl -tag -width usageXX -offset indent
139.It Cm check
140Perform post-installation checks on items.
141.It Cm diff Op Xr diff 1 Li options
142Similar to
143.Cm check ,
144but also show the differences between the files.
145.It Cm fix
146Apply fixes that
147.Cm check
148determines need to be applied.
149Not all items can be automatically fixed by
150.Nm ,
151and in some cases an error will be reported,
152after which manual intervention will be required.
153.Pp
154Conflicts between existing files in the target file system
155and new files from the
156.Nx
157distribution are resolved by replacing the existing file
158with the new file; there is no attempt to merge the files.
159See
160.Xr etcupdate 8
161for an alternative update method that is able to merge files.
162.It Cm help
163Display a short help.
164.It Cm list
165List available
166.Ar items ,
167showing if they are enabled or disabled by default.
168.It Cm usage
169Same as
170.Cm help .
171.El
172.Sh EXIT STATUS
173The
174.Nm
175utility exits 0 on success, and >0 if an error occurs
176or a problem was found.
177.Sh SEE ALSO
178.Xr etcupdate 8
179.Sh HISTORY
180The
181.Nm
182utility first appeared in
183.Nx 1.6 .
184.Pp
185In
186.Nx 4.0 ,
187the
188.Fl s Ar tgzfile
189option was added.
190.Pp
191In
192.Nx 5.0 ,
193the ability to specify multiple colon-separated files with a single
194.Fl s
195option was deprecated.
196.Pp
197In
198.Nx 7.0 ,
199the ability to specify multiple colon-separated files with a single
200.Fl s
201option was removed.
202Multiple
203.Fl s
204options must be used instead.
205