xref: /netbsd-src/usr.sbin/postinstall/postinstall.8 (revision 3a170d50289586ddee824ed62a8a64ff3199ed0a)
1.\"	$NetBSD: postinstall.8,v 1.21 2022/01/08 23:57:32 lukem Exp $
2.\"
3.\" Copyright (c) 2005-2022 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 January 9, 2022
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 Pq Ar srcdir | Ar tgzdir | Ar tgzfile
42.Op Fl x Ar xsrcdir
43.Ar operation
44.Ar \&...
45.Nm postinstall
46.Fl \&?
47.Sh DESCRIPTION
48The
49.Nm
50utility performs post-installation checks and/or fixes on a system's
51configuration files.
52It is especially useful after system upgrades, e.g. after updating
53from
54.Nx 1.6.2
55to
56.Nx 2.0 .
57The items to check or fix are divided in two groups: enabled by
58default and disabled by default.
59The latter are items that are dangerous for some reason, for example
60because they remove files which may be still in use.
61If no
62.Ar items
63are provided, the default checks or fixes are applied.
64Those which are disabled by default must be provided explicitly.
65.Pp
66Supported options:
67.Bl -tag -width XsXsrcdirXXX -offset indent
68.It Fl a Ar arch
69MACHINE_ARCH.
70Defaults to machine of the host operating system.
71.It Fl d Ar destdir
72Destination directory to check.
73Defaults to
74.Pa / .
75.It Fl m Ar machine
76MACHINE.
77Defaults to machine of the host operating system.
78.It Fl s Pq Ar srcdir | Ar tgzdir | Ar tgzfile
79The location of the reference files, or the
80.Nx
81source files used to create the reference files.
82This may be specified in one of three ways:
83.Bl -tag -width XXsXtgzfileXX
84.It Fl s Ar srcdir
85The top level directory of the
86.Nx
87source tree.
88By default this is
89.Pa /usr/src .
90.It Fl s Ar tgzdir
91A directory in which reference files have been
92extracted from a binary distribution of
93.Nx .
94The files that are distributed in the
95.Dq Pa etc.tgz
96or
97.Dq Pa etc.tar.xz
98set file must be present.
99The files that are distributed in the
100.Dq Pa xetc.tgz
101or
102.Dq Pa xetc.tar.xz
103set file are optional.
104.It Fl s Ar tgzfile
105The location of a set file
106(or
107.Dq "tgz file"
108or
109.Dq "tar.xz file" )
110such as
111.Dq Pa etc.tgz
112or
113.Dq Pa xetc.tgz
114from a binary distribution of
115.Nx .
116Each set file is a compressed archive containing reference files,
117which will be extracted to the
118.Pa temproot
119directory.
120Multiple
121.Fl s
122options may be used to specify multiple set files.
123The
124.Dq Pa etc.tgz
125set file must be specified.
126The
127.Dq Pa xetc.tgz
128set file is optional.
129.El
130.It Fl x Ar xsrcdir
131Location of the X11 source files.
132This must be a directory that contains a
133.Nx
134xsrc tree.
135.It Fl \&?
136Display help to stdout, and exit.
137.El
138.Pp
139The
140.Ar operation
141argument may be one of:
142.Bl -tag -width usageXX -offset indent
143.It Cm check Ar item Ar \&...
144Perform post-installation checks on items.
145.It Cm diff Oo Fl Ar bcenpuw Oc Ar item Ar \&...
146Similar to
147.Cm check ,
148but also show the differences between the files.
149.It Cm fix Ar item Ar \&...
150Apply fixes that
151.Cm check
152determines need to be applied.
153Not all items can be automatically fixed by
154.Nm ,
155and in some cases an error will be reported,
156after which manual intervention will be required.
157.Pp
158Conflicts between existing files in the target file system
159and new files from the
160.Nx
161distribution are resolved by replacing the existing file
162with the new file; there is no attempt to merge the files.
163See
164.Xr etcupdate 8
165for an alternative update method that is able to merge files.
166.It Cm help
167Display help to stdout, and exit.
168.It Cm list
169List available
170.Ar items ,
171showing if they are enabled or disabled by default.
172.It Cm usage
173Display help to stdout, and exit.
174.El
175.Sh EXIT STATUS
176The
177.Nm
178utility exits 0 on success, and >0 if an error occurs
179or a problem was found.
180.Sh SEE ALSO
181.Xr etcupdate 8
182.Sh HISTORY
183The
184.Nm
185utility first appeared in
186.Nx 1.6 .
187.Pp
188In
189.Nx 4.0 ,
190the
191.Fl s Ar tgzfile
192option was added.
193.Pp
194In
195.Nx 5.0 ,
196the ability to specify multiple colon-separated files with a single
197.Fl s
198option was deprecated.
199.Pp
200In
201.Nx 7.0 ,
202the ability to specify multiple colon-separated files with a single
203.Fl s
204option was removed.
205Multiple
206.Fl s
207options must be used instead.
208