]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/xinstall/install.1
Implement pci_enable_msi() and pci_disable_msi() in the LinuxKPI.
[FreeBSD/FreeBSD.git] / usr.bin / xinstall / install.1
1 .\" Copyright (c) 1987, 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     From: @(#)install.1     8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD$
30 .\"
31 .Dd August 12, 2019
32 .Dt INSTALL 1
33 .Os
34 .Sh NAME
35 .Nm install
36 .Nd install binaries
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl bCcpSsUv
40 .Op Fl B Ar suffix
41 .Op Fl D Ar destdir
42 .Op Fl f Ar flags
43 .Op Fl g Ar group
44 .Op Fl h Ar hash
45 .Op Fl l Ar linkflags
46 .Op Fl M Ar metalog
47 .Op Fl m Ar mode
48 .Op Fl N Ar dbdir
49 .Op Fl o Ar owner
50 .Op Fl T Ar tags
51 .Ar file1 file2
52 .Nm
53 .Op Fl bCcpSsUv
54 .Op Fl B Ar suffix
55 .Op Fl D Ar destdir
56 .Op Fl f Ar flags
57 .Op Fl g Ar group
58 .Op Fl h Ar hash
59 .Op Fl l Ar linkflags
60 .Op Fl M Ar metalog
61 .Op Fl m Ar mode
62 .Op Fl N Ar dbdir
63 .Op Fl o Ar owner
64 .Op Fl T Ar tags
65 .Ar file1 ... fileN directory
66 .Nm
67 .Fl d
68 .Op Fl Uv
69 .Op Fl D Ar destdir
70 .Op Fl g Ar group
71 .Op Fl h Ar hash
72 .Op Fl M Ar metalog
73 .Op Fl m Ar mode
74 .Op Fl N Ar dbdir
75 .Op Fl o Ar owner
76 .Op Fl T Ar tags
77 .Ar directory ...
78 .Sh DESCRIPTION
79 The file(s) are copied
80 (or linked if the
81 .Fl l
82 option is specified) to the target file or directory.
83 If the destination is a directory, then the
84 .Ar file
85 is copied into
86 .Ar directory
87 with its original filename.
88 If the target file already exists, it is
89 either renamed to
90 .Ar file Ns Pa .old
91 if the
92 .Fl b
93 option is given
94 or overwritten
95 if permissions allow.
96 An alternate backup suffix may be specified via the
97 .Fl B
98 option's argument.
99 .Pp
100 The options are as follows:
101 .Bl -tag -width indent
102 .It Fl b
103 Back up any existing files before overwriting them by renaming
104 them to
105 .Ar file Ns Pa .old .
106 See
107 .Fl B
108 for specifying a different backup suffix.
109 .It Fl B Ar suffix
110 Use
111 .Ar suffix
112 as the backup suffix if
113 .Fl b
114 is given.
115 .It Fl C
116 Copy the file.
117 If the target file already exists and the files are the same,
118 then do not change the modification time of the target.
119 If the target's file flags and mode need not to be changed,
120 the target's inode change time is also unchanged.
121 .It Fl c
122 Copy the file.
123 This is actually the default.
124 The
125 .Fl c
126 option is only included for backwards compatibility.
127 .It Fl D Ar destdir
128 Specify the
129 .Ev DESTDIR
130 (top of the file hierarchy) that the items are installed in to.
131 If
132 .Fl M Ar metalog
133 is in use, a leading string of
134 .Dq Ar destdir
135 will be removed from the file names logged to the
136 .Ar metalog .
137 This option does not affect where the actual files are installed.
138 .It Fl d
139 Create directories.
140 Missing parent directories are created as required.
141 .It Fl f Ar flags
142 Specify the target's file flags; see
143 .Xr chflags 1
144 for a list of possible flags and their meanings.
145 .It Fl g Ar group
146 Specify a group.
147 A numeric GID is allowed.
148 .It Fl h Ar hash
149 When copying, calculate the digest of the files with
150 .Ar hash
151 to store in the
152 .Fl M Ar metalog .
153 When
154 .Fl d
155 is given no hash is emitted.
156 Supported digests:
157 .Bl -tag -width rmd160 -offset indent
158 .It Sy none
159 No hash.
160 This is the default.
161 .It Sy md5
162 The MD5 cryptographic message digest.
163 .It Sy rmd160
164 The RMD-160 cryptographic message digest.
165 .It Sy sha1
166 The SHA-1 cryptographic message digest.
167 .It Sy sha256
168 The 256-bits SHA-2 cryptographic message digest of the file.
169 .It Sy sha512
170 The 512-bits SHA-2 cryptographic message digest of the file.
171 .El
172 .It Fl l Ar linkflags
173 Instead of copying the file make a link to the source.
174 The type of the link is determined by the
175 .Ar linkflags
176 argument.
177 Valid
178 .Ar linkflags
179 are:
180 .Ar a
181 (absolute),
182 .Ar r
183 (relative),
184 .Ar h
185 (hard),
186 .Ar s
187 (symbolic),
188 .Ar m
189 (mixed).
190 Absolute and relative have effect only for symbolic links.
191 Mixed links
192 are hard links for files on the same filesystem, symbolic otherwise.
193 .It Fl M Ar metalog
194 Write the metadata associated with each item installed to
195 .Ar metalog
196 in an
197 .Xr mtree 8
198 .Dq full path
199 specification line.
200 The metadata includes: the file name and file type, and depending upon
201 other options, the owner, group, file flags, modification time, and tags.
202 .It Fl m Ar mode
203 Specify an alternate mode.
204 The default mode is set to rwxr-xr-x (0755).
205 The specified mode may be either an octal or symbolic value; see
206 .Xr chmod 1
207 for a description of possible mode values.
208 .It Fl N Ar dbdir
209 Use the user database text file
210 .Pa master.passwd
211 and group database text file
212 .Pa group
213 from
214 .Ar dbdir ,
215 rather than using the results from the system's
216 .Xr getpwnam 3
217 and
218 .Xr getgrnam 3
219 (and related) library calls.
220 .It Fl o Ar owner
221 Specify an owner.
222 A numeric UID is allowed.
223 .It Fl p
224 Preserve the access and modification times.
225 Copy the file, as if the
226 .Fl C
227 (compare and copy) option is specified,
228 except if the target file does not already exist or is different,
229 then preserve the access and modification times of the source file.
230 .It Fl S
231 Safe copy.
232 Normally,
233 .Nm
234 unlinks an existing target before installing the new file.
235 With the
236 .Fl S
237 flag a temporary file is used and then renamed to be
238 the target.
239 The reason this is safer is that if the copy or
240 rename fails, the existing target is left untouched.
241 .It Fl s
242 .Nm
243 exec's the command
244 .Xr strip 1
245 to strip binaries so that
246 .Nm
247 can be portable over a large
248 number of systems and binary types.
249 See below for how
250 .Nm
251 can be instructed to use another program to strip binaries.
252 .It Fl T Ar tags
253 Specify the
254 .Xr mtree 8
255 tags to write out for the file when using
256 .Fl M Ar metalog .
257 .It Fl U
258 Indicate that install is running unprivileged, and that it should not
259 try to change the owner, the group, or the file flags of the destination.
260 The information that would have been updated can be stored in a log
261 file with
262 .Fl M Ar metalog .
263 .It Fl v
264 Cause
265 .Nm
266 to be verbose,
267 showing files as they are installed or backed up.
268 .El
269 .Pp
270 By default,
271 .Nm
272 preserves all file flags, with the exception of the
273 .Dq nodump
274 flag.
275 .Pp
276 The
277 .Nm
278 utility attempts to prevent moving a file onto itself.
279 .Pp
280 Installing
281 .Pa /dev/null
282 creates an empty file.
283 .Sh ENVIRONMENT
284 The
285 .Nm
286 utility checks for the presence of the
287 .Ev STRIPBIN
288 environment variable and if present,
289 uses the assigned value as the program to run if and when the
290 .Fl s
291 option has been specified.
292 .Pp
293 If the
294 .Ev DONTSTRIP
295 environment variable is present,
296 .Nm
297 will ignore any specification of the
298 .Fl s
299 option.
300 This is mainly for use in debugging the
301 .Fx
302 Ports Collection.
303 .Sh FILES
304 .Bl -tag -width "INS@XXXX" -compact
305 .It Pa INS@XXXX
306 If either
307 .Fl S
308 option is specified, or the
309 .Fl C
310 or
311 .Fl p
312 option is used in conjunction with the
313 .Fl s
314 option, temporary files named
315 .Pa INS@XXXX ,
316 where
317 .Pa XXXX
318 is decided by
319 .Xr mkstemp 3 ,
320 are created in the target directory.
321 .El
322 .Sh EXIT STATUS
323 .Ex -std
324 .Sh COMPATIBILITY
325 Historically
326 .Nm
327 moved files by default.
328 The default was changed to copy in
329 .Fx 4.4 .
330 .Sh SEE ALSO
331 .Xr chflags 1 ,
332 .Xr chgrp 1 ,
333 .Xr chmod 1 ,
334 .Xr cp 1 ,
335 .Xr mv 1 ,
336 .Xr strip 1 ,
337 .Xr mmap 2 ,
338 .Xr getgrnam 3 ,
339 .Xr getpwnam 3 ,
340 .Xr chown 8
341 .Sh HISTORY
342 The
343 .Nm
344 utility appeared in
345 .Bx 4.2 .
346 .Sh BUGS
347 The meaning of the
348 .Fl M
349 option has changed as of
350 .Fx 9.2
351 and it now takes an argument.
352 Command lines that used the old
353 .Fl M
354 will get an error or in rare cases will append logs to the first of
355 multiple source files rather than installing it.
356 .Pp
357 Temporary files may be left in the target directory if
358 .Nm
359 exits abnormally.
360 .Pp
361 File flags cannot be set by
362 .Xr fchflags 2
363 over a NFS file system.
364 Other file systems do not have a concept of flags.
365 The
366 .Nm
367 utility will only warn when flags could not be set on a file system
368 that does not support them.
369 .Pp
370 The
371 .Nm
372 utility with
373 .Fl v
374 falsely says a file is copied when
375 .Fl C
376 snaps hard links.