English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Contents of /branches/freewrt_1_0/tools/paxmirabilis/src/cpio.1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2715 - (show annotations) (download)
Tue Jun 5 14:52:44 2007 UTC (6 years, 8 months ago) by tg
File size: 9879 byte(s)
• 1.0 -> scripts/param.h, paxmirabilis: MFC the new version from trunk
• both 1.0 and trunk: implement “make targz”, “make tarbz2”
  (I like the gzip(1)d versions better though)
• 1.0 -> package/config/Makefile: quieten the “clean” target to be consistent
1 .\" $MirOS: src/bin/pax/cpio.1,v 1.15 2006/07/21 17:34:59 tg Exp $
2 .\" $OpenBSD: cpio.1,v 1.23 2006/01/03 17:22:47 jmc Exp $
3 .\"
4 .\" Copyright (c) 2005 Thorsten Glaser <tg@66h.42h.de>
5 .\" Copyright (c) 1997 SigmaSoft, Th. Lockert
6 .\" All rights reserved.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .\"
28 .Dd July 21, 2006
29 .Dt CPIO 1
30 .Os MirBSD
31 .\" for portability
32 .de Mx
33 .nr cF \\n(.f
34 .nr cZ \\n(.s
35 .ds aa \&\f\\n(cF\s\\n(cZ
36 .if \\n(aC==0 \{\
37 . ie \\n(.$==0 \&MirOS\\*(aa
38 . el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
39 .\}
40 .if \\n(aC>\\n(aP \{\
41 . nr aP \\n(aP+1
42 . ie \\n(C\\n(aP==2 \{\
43 . as b1 \&MirOS\ #\&\\*(A\\n(aP\\*(aa
44 . ie \\n(aC>\\n(aP \{\
45 . nr aP \\n(aP+1
46 . nR
47 . \}
48 . el .aZ
49 . \}
50 . el \{\
51 . as b1 \&MirOS\\*(aa
52 . nR
53 . \}
54 .\}
55 ..
56 .Sh NAME
57 .Nm cpio
58 .Nd copy file archives in and out
59 .Sh SYNOPSIS
60 .Nm cpio
61 .Fl o
62 .Op Fl aABcLvzZ
63 .Op Fl C Ar bytes
64 .Op Fl F Ar archive
65 .Op Fl H Ar format
66 .Op Fl M Ar flag
67 .Op Fl O Ar archive
68 .Ar "< name-list"
69 .Op Ar "> archive"
70 .Nm cpio
71 .Fl i
72 .Op Fl bBcdfmrsStuvzZ6
73 .Op Fl C Ar bytes
74 .Op Fl E Ar file
75 .Op Fl F Ar archive
76 .Op Fl H Ar format
77 .Op Fl I Ar archive
78 .Op Ar "pattern ..."
79 .Op Ar "< archive"
80 .Nm cpio
81 .Fl p
82 .Op Fl adlLmuv
83 .Ar destination-directory
84 .Ar "< name-list"
85 .Sh DESCRIPTION
86 The
87 .Nm
88 command copies files to and from a
89 .Nm
90 archive.
91 .Pp
92 The options are as follows:
93 .Bl -tag -width Ds
94 .It Fl o
95 Create an archive.
96 Reads the list of files to store in the
97 archive from standard input, and writes the archive on standard
98 output.
99 .Bl -tag -width Ds
100 .It Fl a
101 Reset the access times on files that have been copied to the
102 archive.
103 .It Fl A
104 Append to the specified archive.
105 .It Fl B
106 Set block size of output to 5120 bytes.
107 .It Fl c
108 Use ASCII format for
109 .Nm
110 header for portability.
111 .It Fl C Ar bytes
112 Set the block size of output to
113 .Ar bytes .
114 .It Fl F Ar archive
115 .It Fl O Ar archive
116 Use the specified file name as the archive to write to.
117 .It Fl H Ar format
118 Write the archive in the specified format.
119 Recognised formats are:
120 .Pp
121 .Bl -tag -width sv4cpio -compact
122 .It Ar bcpio
123 Old binary
124 .Nm
125 format.
126 Selected by
127 .Fl 6 .
128 .It Ar cpio
129 Old octal character
130 .Nm
131 format.
132 Selected by
133 .Fl c .
134 .It Ar sv4cpio
135 SVR4 hex
136 .Nm
137 format.
138 .It Ar sv4crc
139 SVR4 hex
140 .Nm
141 format with checksums.
142 This is the default format for creating new archives.
143 .It Ar tar
144 Old tar format.
145 .It Ar ustar
146 POSIX ustar format.
147 .It "\ "
148 .It Ar bin
149 These
150 .It Ar crc
151 four
152 .It Ar newc
153 formats
154 .It Ar odc
155 are supported for backwards compatibility only.
156 .El
157 .It Fl L
158 Follow symbolic links.
159 .It Fl M Ar flag
160 Configure the archive normaliser.
161 .Ar flag
162 is either a numeric value compatible to
163 .Xr strtonum 3
164 which is directly stored in the flags word, or
165 one of the following values, prefixed with
166 .Dq no-
167 to turn them off, or not, to turn them on:
168 .Pp
169 .Bl -tag -width xxxxxx -compact
170 .It Ar inodes
171 0x0001: Serialise inodes, zero device info.
172 .It Ar links
173 0x0002: Store content of hard links only once.
174 .It Ar mtime
175 0x0004: Zero out the file modification time.
176 .It Ar uidgid
177 0x0008: Set owner to 0:0 (root:wheel).
178 .It Ar dist
179 0x000B: Clean everything except mtime.
180 .It Ar set
181 0x0003: Keep ownership and mtime intact.
182 .It Ar norm
183 0x000F: Clean everything.
184 .It Ar root
185 0x0009: Clean owner and device information.
186 .It Ar verb
187 0x0010: Debug this option.
188 .It Ar debug
189 0x0020: Debug file header storage.
190 .El
191 .Pp
192 This option is only implemented for the cpio, sv4cpio,
193 sv4crc, and ustar file format writing routines.
194 For the ustar format, the
195 .Ar inodes
196 and
197 .Ar links
198 specifiers are ignored.
199 .It Fl v
200 Be verbose about operations.
201 List filenames as they are written to the archive.
202 .It Fl z
203 Compress archive using
204 .Xr gzip 1
205 format.
206 .It Fl Z
207 Compress archive using
208 .Xr compress 1
209 format.
210 .El
211 .It Fl i
212 Restore files from an archive.
213 Reads the archive file from
214 standard input and extracts files matching the
215 .Ar patterns
216 that were specified on the command line.
217 .Bl -tag -width Ds
218 .It Fl b
219 Do byte and word swapping after reading in data from the
220 archive, for restoring archives created on systems with
221 a different byte order.
222 .It Fl B
223 Set the block size of the archive being read to 5120 bytes.
224 .It Fl c
225 Expect the archive headers to be in ASCII format.
226 .It Fl C Ar bytes
227 Read archive written with a block size of
228 .Ar bytes .
229 .It Fl d
230 Create any intermediate directories as needed during
231 restore.
232 .It Fl E Ar file
233 Read list of file name patterns to extract or list from
234 .Ar file .
235 .It Fl f
236 Restore all files except those matching the
237 .Ar patterns
238 given on the command line.
239 .It Fl F Ar archive
240 .It Fl I Ar archive
241 Use the specified file as the input for the archive.
242 .It Fl H Ar format
243 Read an archive of the specified format.
244 Recognised formats are:
245 .Pp
246 .Bl -tag -width sv4cpio -compact
247 .It Ar bcpio
248 Old binary
249 .Nm
250 format.
251 .It Ar cpio
252 Old octal character
253 .Nm
254 format.
255 .It Ar sv4cpio
256 SVR4 hex
257 .Nm
258 format.
259 .It Ar sv4crc
260 SVR4 hex
261 .Nm
262 format with checksums.
263 .It Ar tar
264 Old tar format.
265 .It Ar ustar
266 POSIX ustar format.
267 .It "\ "
268 .It Ar bin
269 These
270 .It Ar crc
271 four
272 .It Ar newc
273 formats
274 .It Ar odc
275 are supported for backwards compatibility only.
276 .El
277 .It Fl m
278 Restore modification times on files.
279 .It Fl r
280 Rename restored files interactively.
281 .It Fl s
282 Swap bytes after reading data from the archive.
283 .It Fl S
284 Swap words after reading data from the archive.
285 .It Fl t
286 Only list the contents of the archive, no files or
287 directories will be created.
288 .It Fl u
289 Overwrite files even when the file in the archive is
290 older than the one that will be overwritten.
291 .It Fl v
292 Be verbose about operations.
293 List filenames as they are copied in from the archive.
294 .It Fl z
295 Uncompress archive using
296 .Xr gzip 1
297 format.
298 .It Fl Z
299 Uncompress archive using
300 .Xr compress 1
301 format.
302 .It Fl 6
303 Process old-style
304 .Nm
305 format archives.
306 .El
307 .It Fl p
308 Copy files from one location to another in a single pass.
309 The list of files to copy are read from standard input and
310 written out to a directory relative to the specified
311 .Ar directory
312 argument.
313 .Bl -tag -width Ds
314 .It Fl a
315 Reset the access times on files that have been copied.
316 .It Fl d
317 Create any intermediate directories as needed to write
318 the files at the new location.
319 .It Fl l
320 When possible, link files rather than creating an
321 extra copy.
322 .It Fl L
323 Follow symbolic links.
324 .It Fl m
325 Restore modification times on files.
326 .It Fl u
327 Overwrite files even when the original file being copied is
328 older than the one that will be overwritten.
329 .It Fl v
330 Be verbose about operations.
331 List filenames as they are copied.
332 .El
333 .El
334 .Sh ENVIRONMENT
335 .Bl -tag -width Fl
336 .It Ev TMPDIR
337 Path in which to store temporary files.
338 .El
339 .Sh ERRORS
340 .Nm
341 will exit with one of the following values:
342 .Bl -tag -width 2n
343 .It 0
344 All files were processed successfully.
345 .It 1
346 An error occurred.
347 .El
348 .Pp
349 Whenever
350 .Nm
351 cannot create a file or a link when extracting an archive or cannot
352 find a file while writing an archive, or cannot preserve the user
353 ID, group ID, file mode, or access and modification times when the
354 .Fl p
355 option is specified, a diagnostic message is written to standard
356 error and a non-zero exit value will be returned, but processing
357 will continue.
358 In the case where
359 .Nm
360 cannot create a link to a file,
361 .Nm
362 will not create a second copy of the file.
363 .Pp
364 If the extraction of a file from an archive is prematurely terminated
365 by a signal or error,
366 .Nm
367 may have only partially extracted the file the user wanted.
368 Additionally, the file modes of extracted files and directories may
369 have incorrect file bits, and the modification and access times may
370 be wrong.
371 .Pp
372 If the creation of an archive is prematurely terminated by a signal
373 or error,
374 .Nm
375 may have only partially created the archive, which may violate the
376 specific archive format specification.
377 .Sh SEE ALSO
378 .Xr pax 1 ,
379 .Xr tar 1
380 .Sh AUTHORS
381 Keith Muller at the University of California, San Diego.
382 .Sh CAVEATS
383 Different file formats have different maximum file sizes.
384 It is recommended that a format such as cpio or ustar
385 be used for larger files.
386 .Pp
387 .Bl -column "File format" "Maximum file size" -offset indent -compact
388 .It Sy "File format" Ta Sy "Maximum file size"
389 .It bcpio Ta 4 Gibibytes
390 .It sv4cpio Ta 4 Gibibytes
391 .It cpio Ta 8 Gibibytes
392 .It tar Ta 8 Gibibytes
393 .It ustar Ta 8 Gibibytes
394 .El
395 .Sh BUGS
396 The
397 .Fl s
398 and
399 .Fl S
400 options are currently not implemented.
401 .Sh CAVEATS
402 The backwards-compatible format options are not available in the
403 .Xr pax 1
404 front-end.
405 .Pp
406 The
407 .Fl M
408 option is a MirBSD extensions, available starting with
409 .Mx 8 .
410 Archives written using these options are, however, compatible to
411 the standard and should be readable on any other system.
412 The only option whose behaviour is not explicitly allowed by the
413 standard is hard link unification (write file contens only once)
414 selected by
415 .Fl M Ar 0x0002 .

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20