xref: /netbsd-src/usr.sbin/postinstall/postinstall.8 (revision 3a170d50289586ddee824ed62a8a64ff3199ed0a)
1*3a170d50Slukem.\"	$NetBSD: postinstall.8,v 1.21 2022/01/08 23:57:32 lukem Exp $
25c5750a5Slukem.\"
3*3a170d50Slukem.\" Copyright (c) 2005-2022 The NetBSD Foundation, Inc.
45c5750a5Slukem.\" All rights reserved.
55c5750a5Slukem.\"
65c5750a5Slukem.\" This code is derived from software contributed to The NetBSD Foundation
75c5750a5Slukem.\" by Thomas Klausner.
85c5750a5Slukem.\"
95c5750a5Slukem.\" Redistribution and use in source and binary forms, with or without
105c5750a5Slukem.\" modification, are permitted provided that the following conditions
115c5750a5Slukem.\" are met:
125c5750a5Slukem.\" 1. Redistributions of source code must retain the above copyright
135c5750a5Slukem.\"    notice, this list of conditions and the following disclaimer.
145c5750a5Slukem.\" 2. Redistributions in binary form must reproduce the above copyright
155c5750a5Slukem.\"    notice, this list of conditions and the following disclaimer in the
165c5750a5Slukem.\"    documentation and/or other materials provided with the distribution.
175c5750a5Slukem.\"
185c5750a5Slukem.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
195c5750a5Slukem.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
205c5750a5Slukem.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
215c5750a5Slukem.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
225c5750a5Slukem.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
235c5750a5Slukem.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
245c5750a5Slukem.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
255c5750a5Slukem.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
265c5750a5Slukem.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
275c5750a5Slukem.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
285c5750a5Slukem.\" POSSIBILITY OF SUCH DAMAGE.
295c5750a5Slukem.\"
30*3a170d50Slukem.Dd January 9, 2022
315c5750a5Slukem.Dt POSTINSTALL 8
325c5750a5Slukem.Os
335c5750a5Slukem.Sh NAME
345c5750a5Slukem.Nm postinstall
355c5750a5Slukem.Nd check and fix installation after system upgrades
365c5750a5Slukem.Sh SYNOPSIS
379358e88bSlukem.Nm postinstall
38bc4861bdSapb.Op Fl a Ar arch
39bc4861bdSapb.Op Fl d Ar destdir
40bc4861bdSapb.Op Fl m Ar machine
41*3a170d50Slukem.Op Fl s Pq Ar srcdir | Ar tgzdir | Ar tgzfile
42e32b8a4eSchristos.Op Fl x Ar xsrcdir
435c5750a5Slukem.Ar operation
44*3a170d50Slukem.Ar \&...
45*3a170d50Slukem.Nm postinstall
46*3a170d50Slukem.Fl \&?
475c5750a5Slukem.Sh DESCRIPTION
485c5750a5SlukemThe
495c5750a5Slukem.Nm
505c5750a5Slukemutility performs post-installation checks and/or fixes on a system's
515c5750a5Slukemconfiguration files.
525c5750a5SlukemIt is especially useful after system upgrades, e.g. after updating
535c5750a5Slukemfrom
545c5750a5Slukem.Nx 1.6.2
555c5750a5Slukemto
565c5750a5Slukem.Nx 2.0 .
579188cd99SpavelThe items to check or fix are divided in two groups: enabled by
589188cd99Spaveldefault and disabled by default.
599188cd99SpavelThe latter are items that are dangerous for some reason, for example
609188cd99Spavelbecause they remove files which may be still in use.
615c5750a5SlukemIf no
625c5750a5Slukem.Ar items
639188cd99Spavelare provided, the default checks or fixes are applied.
648e492a60SwizThose which are disabled by default must be provided explicitly.
655c5750a5Slukem.Pp
665c5750a5SlukemSupported options:
675c5750a5Slukem.Bl -tag -width XsXsrcdirXXX -offset indent
685c5750a5Slukem.It Fl a Ar arch
695c5750a5SlukemMACHINE_ARCH.
705c5750a5SlukemDefaults to machine of the host operating system.
715c5750a5Slukem.It Fl d Ar destdir
725c5750a5SlukemDestination directory to check.
735c5750a5SlukemDefaults to
745c5750a5Slukem.Pa / .
755c5750a5Slukem.It Fl m Ar machine
765c5750a5SlukemMACHINE.
775c5750a5SlukemDefaults to machine of the host operating system.
78*3a170d50Slukem.It Fl s Pq Ar srcdir | Ar tgzdir | Ar tgzfile
79bc4861bdSapbThe location of the reference files, or the
80bc4861bdSapb.Nx
81bc4861bdSapbsource files used to create the reference files.
82bc4861bdSapbThis may be specified in one of three ways:
83bc4861bdSapb.Bl -tag -width XXsXtgzfileXX
845c5750a5Slukem.It Fl s Ar srcdir
85bc4861bdSapbThe top level directory of the
86bc4861bdSapb.Nx
87bc4861bdSapbsource tree.
88bc4861bdSapbBy default this is
895c5750a5Slukem.Pa /usr/src .
90bc4861bdSapb.It Fl s Ar tgzdir
91bc4861bdSapbA directory in which reference files have been
923c2b4582Sapbextracted from a binary distribution of
93bc4861bdSapb.Nx .
943c2b4582SapbThe files that are distributed in the
953c2b4582Sapb.Dq Pa etc.tgz
96444da8f0Smartinor
97444da8f0Smartin.Dq Pa etc.tar.xz
983c2b4582Sapbset file must be present.
993c2b4582SapbThe files that are distributed in the
1003c2b4582Sapb.Dq Pa xetc.tgz
101444da8f0Smartinor
102444da8f0Smartin.Dq Pa xetc.tar.xz
1033c2b4582Sapbset file are optional.
104bc4861bdSapb.It Fl s Ar tgzfile
1059599e1b7SapbThe location of a set file
106bc4861bdSapb(or
107444da8f0Smartin.Dq "tgz file"
108444da8f0Smartinor
109444da8f0Smartin.Dq "tar.xz file" )
1109599e1b7Sapbsuch as
1113c2b4582Sapb.Dq Pa etc.tgz
1129599e1b7Sapbor
1133c2b4582Sapb.Dq Pa xetc.tgz
114bc4861bdSapbfrom a binary distribution of
115bc4861bdSapb.Nx .
1169599e1b7SapbEach set file is a compressed archive containing reference files,
1179599e1b7Sapbwhich will be extracted to the
1189599e1b7Sapb.Pa temproot
1199599e1b7Sapbdirectory.
1209599e1b7SapbMultiple
121bc4861bdSapb.Fl s
1229599e1b7Sapboptions may be used to specify multiple set files.
1233c2b4582SapbThe
1243c2b4582Sapb.Dq Pa etc.tgz
1253c2b4582Sapbset file must be specified.
1263c2b4582SapbThe
1273c2b4582Sapb.Dq Pa xetc.tgz
1283c2b4582Sapbset file is optional.
129bc4861bdSapb.El
130e32b8a4eSchristos.It Fl x Ar xsrcdir
131e32b8a4eSchristosLocation of the X11 source files.
1322eb17e07SwizThis must be a directory that contains a
1332eb17e07Swiz.Nx
1342eb17e07Swizxsrc tree.
135*3a170d50Slukem.It Fl \&?
136*3a170d50SlukemDisplay help to stdout, and exit.
1375c5750a5Slukem.El
1385c5750a5Slukem.Pp
1395c5750a5SlukemThe
1405c5750a5Slukem.Ar operation
1415c5750a5Slukemargument may be one of:
1425c5750a5Slukem.Bl -tag -width usageXX -offset indent
143*3a170d50Slukem.It Cm check Ar item Ar \&...
1445c5750a5SlukemPerform post-installation checks on items.
145*3a170d50Slukem.It Cm diff Oo Fl Ar bcenpuw Oc Ar item Ar \&...
1465c5750a5SlukemSimilar to
1475c5750a5Slukem.Cm check ,
1485c5750a5Slukembut also show the differences between the files.
149*3a170d50Slukem.It Cm fix Ar item Ar \&...
1505c5750a5SlukemApply fixes that
1515c5750a5Slukem.Cm check
1525c5750a5Slukemdetermines need to be applied.
153d4b07411SlukemNot all items can be automatically fixed by
154bf49cd32Sapb.Nm ,
155bf49cd32Sapband in some cases an error will be reported,
156bf49cd32Sapbafter which manual intervention will be required.
157bf49cd32Sapb.Pp
158bf49cd32SapbConflicts between existing files in the target file system
159bf49cd32Sapband new files from the
160bf49cd32Sapb.Nx
161bf49cd32Sapbdistribution are resolved by replacing the existing file
162bf49cd32Sapbwith the new file; there is no attempt to merge the files.
163bf49cd32SapbSee
164f83266c2Shubertf.Xr etcupdate 8
165bf49cd32Sapbfor an alternative update method that is able to merge files.
1665c5750a5Slukem.It Cm help
167*3a170d50SlukemDisplay help to stdout, and exit.
1685c5750a5Slukem.It Cm list
1695c5750a5SlukemList available
1709188cd99Spavel.Ar items ,
1719188cd99Spavelshowing if they are enabled or disabled by default.
1725c5750a5Slukem.It Cm usage
173*3a170d50SlukemDisplay help to stdout, and exit.
1745c5750a5Slukem.El
1755c5750a5Slukem.Sh EXIT STATUS
1765c5750a5SlukemThe
1775c5750a5Slukem.Nm
17801869ca4Swizutility exits 0 on success, and >0 if an error occurs
1795c5750a5Slukemor a problem was found.
180ac583aa3Shubertf.Sh SEE ALSO
181ac583aa3Shubertf.Xr etcupdate 8
1829358e88bSlukem.Sh HISTORY
1839358e88bSlukemThe
1849358e88bSlukem.Nm
1859358e88bSlukemutility first appeared in
1869358e88bSlukem.Nx 1.6 .
1879599e1b7Sapb.Pp
1889599e1b7SapbIn
1899599e1b7Sapb.Nx 4.0 ,
1909599e1b7Sapbthe
1919599e1b7Sapb.Fl s Ar tgzfile
1929599e1b7Sapboption was added.
1939599e1b7Sapb.Pp
1949599e1b7SapbIn
1959599e1b7Sapb.Nx 5.0 ,
1969b182ae0Smbalmerthe ability to specify multiple colon-separated files with a single
1979599e1b7Sapb.Fl s
1982d19284cSapboption was deprecated.
1991de7d5f1Sapb.Pp
2001de7d5f1SapbIn
2011de7d5f1Sapb.Nx 7.0 ,
2021de7d5f1Sapbthe ability to specify multiple colon-separated files with a single
2031de7d5f1Sapb.Fl s
2041de7d5f1Sapboption was removed.
2051de7d5f1SapbMultiple
2061de7d5f1Sapb.Fl s
2071de7d5f1Sapboptions must be used instead.
208