History

20080809-2014

forsyth committed 17 years ago

Commit ea36ff61 parent ce0a0c37 files · +157 −183Browse files

Unified · Split

7 files
  1. CHANGES +3 −0
  2. appl/cmd/disk/mkext.b +10 −35
  3. appl/cmd/disk/mkfs.b +47 −93
  4. dis/disk/mkext.dis +0 −0
  5. dis/disk/mkfs.dis +0 −0
  6. include/version.h +1 −1
  7. man/8/mkfs +98 −56
CHANGES+3−0
@@ -1,3 +1,6 @@
1+20090809
2+ bring mkfs(8) up to date (issue 176)
3+ remove -q options from mkfs and mkext (-q was a transitional option to suppress quoting of file names)
14 20090806
25 increase `backlog' value in all listen calls in hosted Inferno (emu/*/ipif*.c) [powerman]
36 20090805
appl/cmd/disk/mkext.b+10−35
@@ -30,17 +30,10 @@ tflag := 0; · 29 unmodified lines
3030 hflag := 0;
3131 vflag := 0;
3232 fflag := 0;
33−qflag := 1;
3433 stderr: ref Sys->FD;
3534 bout: ref Iobuf;
3635 argv0 := "mkext";
3736
38−usage()
39−{
40− fprint(stderr, "Usage: mkext [-h] [-u] [-v] [-f] [-t] [-q] [-d dest-fs] [file ...]\n");
41− raise "fail:usage";
42−}
43−
4437 init(nil: ref Draw->Context, args: list of string)
4538 {
4639 sys = load Sys Sys->PATH;
@@ -59,12 +52,11 @@ init(nil: ref Draw->Context, args: list of string) · 12 unmodified lines
5952
6053 destdir := "";
6154 arg->init(args);
55+ arg->setusage("mkext [-h] [-d destdir] [-T] [-u] [-v] [file ...]");
6256 while((c := arg->opt()) != 0)
6357 case c {
6458 'd' =>
65− destdir = arg->arg();
66− if(destdir == nil)
67− error("destination directory name missing");
59+ destdir = arg->earg();
6860 'f' =>
6961 fflag = 1;
7062
@@ -75,14 +67,13 @@ init(nil: ref Draw->Context, args: list of string) · 4 unmodified lines
7567 error(sys->sprint("can't access standard output: %r"));
7668 'u' =>
7769 uflag = 1;
78− 't' =>
70+ tflag = 1;
71+ 't' or 'T' =>
7972 tflag = 1;
8073 'v' =>
8174 vflag = 1;
82− 'q' =>
83− qflag = 0;
8475 * =>
85− usage();
76+ arg->usage();
8677 }
8778 args = arg->argv();
8879
@@ -94,14 +85,8 @@ init(nil: ref Draw->Context, args: list of string) · 5 unmodified lines
9485 fprint(stderr, "done\n");
9586 quit(nil);
9687 }
97− fields: list of string;
98− nf: int;
99− if(qflag){
100− fields = str->unquoted(p);
101− nf = len fields;
102− }else
103− (nf, fields) = sys->tokenize(p, " \t\n");
104− if(nf != NFLDS){
88+ fields := str->unquoted(p);
89+ if(len fields != NFLDS){
10590 warn("too few fields in file header");
10691 continue;
10792 }
@@ -126,8 +111,8 @@ init(nil: ref Draw->Context, args: list of string) · 18 unmodified lines
126111 }
127112 name = destdir+name;
128113 if(hflag){
129− bout.puts(sys->sprint("%s %s %s %s %ud %bd\n",
130− quoted(name), octal(mode), uid, gid, mtime, bytes));
114+ bout.puts(sys->sprint("%q %s %s %s %ud %bd\n",
115+ name, octal(mode), uid, gid, mtime, bytes));
131116 if(bytes != big 0)
132117 seekpast(bytes);
133118 continue;
@@ -212,7 +197,6 @@ mkdir(name: string, mode: int, mtime: int, uid: string, gid: string) · 78 unmodified lines
212197 if(uflag){
213198 d.uid = uid;
214199 d.gid = gid;
215− d.mtime = mtime;
216200 }
217201 d.mode = mode;
218202 if(sys->wstat(name, d) < 0)
@@ -272,7 +256,7 @@ extract(name: string, mode: int, mtime: int, uid: string, gid: string, bytes: bi · 53 unmodified lines
272256 if(p == nil)
273257 p = name;
274258 d.name = p;
275− if(tflag || uflag)
259+ if(tflag)
276260 d.mtime = mtime;
277261 if(uflag){
278262 d.uid = uid;
@@ -366,12 +350,3 @@ create(name : string, rw : int, mode : int) : ref Sys->FD · 87 unmodified lines
366350 }
367351 return fd;
368352 }
369−
370−quoted(s: string): string
371−{
372− if(qflag)
373− for(i:=0; i<len s; i++)
374− if((c := s[i]) == ' ' || c == '\t' || c == '\n' || c == '\'')
375− return str->quoted(s :: nil);
376− return s;
377−}
appl/cmd/disk/mkfs.b+47−93
@@ -55,7 +55,6 @@ modes: int; · 54 unmodified lines
5555 ream: int;
5656 debug: int;
5757 xflag: int;
58−qflag := 1;
5958 sfd: ref Sys->FD;
6059 fskind: int; # Kfs, Fs, Archive
6160 user: string;
@@ -63,12 +62,6 @@ stderr: ref Sys->FD; · 1 unmodified line
6362 usrid, grpid : string;
6463 setuid: int;
6564
66−usage()
67−{
68− fprint(stderr, "usage: %s [-apqrvx] [-d root] [-n kfsname] [-s src-fs] [-u userfile] [-z n] proto ...\n", prog);
69− quit("usage");
70−}
71−
7265 init(nil: ref Draw->Context, args: list of string)
7366 {
7467 sys = load Sys Sys->PATH;
@@ -80,7 +73,7 @@ init(nil: ref Draw->Context, args: list of string) · 5 unmodified lines
8073
8174 stderr = sys->fildes(2);
8275 if(arg == nil)
83− error(sys->sprint("can't load %s: %r", Arg->PATH));
76+ error(sys->sprint("can't load %q: %r", Arg->PATH));
8477
8578 user = getuser();
8679 if(user == nil)
@@ -95,6 +88,7 @@ init(nil: ref Draw->Context, args: list of string) · 8 unmodified lines
9588 users = nil;
9689 fskind = Kfs; # i suspect Inferno default should be different
9790 arg->init(args);
91+ arg->setusage("mkfs [-aprvxS] [-d root] [-n kfscmdname] [-s src-fs] [-u userfile] [-z n] [-G group] [-U user] proto ...");
9892 while((c := arg->opt()) != 0)
9993 case c {
10094 'a' =>
@@ -105,49 +99,52 @@ init(nil: ref Draw->Context, args: list of string) · 4 unmodified lines
10599 error(sys->sprint("can't open standard output for archive: %r"));
106100 'd' =>
107101 fskind = Fs;
108− newroot = reqarg("destination directory (-d)");
102+ newroot = arg->earg();
109103 'D' =>
110104 debug = 1;
111105 'n' =>
112− name = reqarg("kfs instance name (-n)");
106+ name = arg->earg();
113107 'p' =>
114108 modes = 1;
115109 'q' =>
116− qflag = 0;
110+ ;
117111 'r' =>
118112 ream = 1;
119113 's' =>
120− oldroot = reqarg("source directory (-d)");
114+ oldroot = arg->earg();
121115 'u' =>
122− users = reqarg("/adm/users file (-u)");
116+ users = arg->earg();
123117 'v' =>
124118 verb = 1;
125119 'x' =>
126120 xflag = 1;
127121 'z' =>
128− (buflen, nil) = str->toint(reqarg("buffer length (-z)"), 10);
122+ (buflen, nil) = str->toint(arg->earg(), 10);
129123 buflen -= 8; # qid.path and tag at end of each kfs block
130124 'U' =>
131− usrid = reqarg("user name (-U)");
125+ usrid = arg->earg();
132126 'G' =>
133− grpid = reqarg("group name (-G)");
127+ grpid = arg->earg();
134128 'S' =>
135129 setuid = 1;
136130 * =>
137− usage();
131+ arg->usage();
138132 }
139133
140134 args = arg->argv();
141135 if(args == nil)
142− usage();
136+ arg->usage();
143137
144138 buf = array [buflen] of byte;
145139 zbuf = array [buflen] of { * => byte 0 };
146140
147− mountkfs(name);
141+ if(name != nil)
142+ openkfscmd(name);
148143 kfscmd("allow");
149− proto = "users";
150− setusers();
144+ if(users != nil){
145+ proto = "users"; # for diagnostics
146+ setusers();
147+ }
151148 cputype = getenv("cputype");
152149 if(cputype == nil)
153150 cputype = "dis";
@@ -159,7 +156,7 @@ init(nil: ref Draw->Context, args: list of string) · 5 unmodified lines
159156
160157 b = bufio->open(proto, Sys->OREAD);
161158 if(b == nil){
162− fprint(stderr, "%s: can't open %s: %r: skipping\n", prog, proto);
159+ fprint(stderr, "%s: can't open %q: %r: skipping\n", prog, proto);
163160 errs++;
164161 continue;
165162 }
@@ -190,15 +187,6 @@ quit(why: string) · 24 unmodified lines
190187 exit;
191188 }
192189
193−reqarg(what: string): string
194−{
195− if((o := arg->arg()) == nil){
196− sys->fprint(stderr, "%s: missing %s\n", prog, what);
197− quit("usage");
198− }
199− return o;
200−}
201−
202190 mkfs(me: ref File, level: int)
203191 {
204192 (child, fp) := getfile(me);
@@ -227,7 +215,7 @@ mktree(me: ref File, rec: int, filesonly: int) · 22 unmodified lines
227215 {
228216 fd := sys->open(oldfile, Sys->OREAD);
229217 if(fd == nil){
230− warn(sys->sprint("can't open %s: %r", oldfile));
218+ warn(sys->sprint("can't open %q: %r", oldfile));
231219 return;
232220 }
233221
@@ -282,7 +270,7 @@ mkfile(f: ref File): int · 48 unmodified lines
282270 {
283271 (i, dir) := sys->stat(oldfile);
284272 if(i < 0){
285− warn(sys->sprint("can't stat file %s: %r", oldfile));
273+ warn(sys->sprint("can't stat file %q: %r", oldfile));
286274 skipdir();
287275 return 0;
288276 }
@@ -294,7 +282,7 @@ copyfile(f: ref File, d: ref Dir, permonly: int): int · 5 unmodified lines
294282 mode: int;
295283
296284 if(xflag && bout != nil){
297− bout.puts(sys->sprint("%s\t%d\t%bd\n", quoted(f.new), d.mtime, d.length));
285+ bout.puts(sys->sprint("%q\t%d\t%bd\n", f.new, d.mtime, d.length));
298286 return (d.mode & Sys->DMDIR) != 0;
299287 }
300288 d.name = f.elem;
@@ -329,7 +317,7 @@ copyfile(f: ref File, d: ref Dir, permonly: int): int · 28 unmodified lines
329317 mkdir(d);
330318 else {
331319 if(verb)
332− fprint(stderr, "%s\n", f.new);
320+ fprint(stderr, "%q\n", f.new);
333321 copy(d);
334322 }
335323 }else if(modes){
@@ -338,7 +326,7 @@ copyfile(f: ref File, d: ref Dir, permonly: int): int · 2 unmodified lines
338326 nd.mtime = d.mtime;
339327 nd.gid = d.gid;
340328 if(sys->wstat(newfile, nd) < 0)
341− warn(sys->sprint("can't set modes for %s: %r", f.new));
329+ warn(sys->sprint("can't set modes for %q: %r", f.new));
342330 # do the uid separately since different file systems object
343331 nd = sys->nulldir;
344332 nd.uid = d.uid;
@@ -368,7 +356,7 @@ copy(d: ref Dir) · 23 unmodified lines
368356
369357 f := sys->open(oldfile, Sys->OREAD);
370358 if(f == nil){
371− warn(sys->sprint("can't open %s: %r", oldfile));
359+ warn(sys->sprint("can't open %q: %r", oldfile));
372360 return;
373361 }
374362 t = nil;
@@ -381,7 +369,7 @@ copy(d: ref Dir) · 6 unmodified lines
381369 cptmp := dname+"__mkfstmp";
382370 t = sys->create(cptmp, Sys->OWRITE, 8r666);
383371 if(t == nil){
384− warn(sys->sprint("can't create %s: %r", newfile));
372+ warn(sys->sprint("can't create %q: %r", newfile));
385373 return;
386374 }
387375 }
@@ -389,7 +377,7 @@ copy(d: ref Dir) · 1 unmodified line
389377 for(tot := big 0;; tot += big n){
390378 n = sys->read(f, buf, buflen);
391379 if(n < 0){
392− warn(sys->sprint("can't read %s: %r", oldfile));
380+ warn(sys->sprint("can't read %q: %r", oldfile));
393381 break;
394382 }
395383 if(n == 0)
@@ -399,9 +387,9 @@ copy(d: ref Dir) · 3 unmodified lines
399387 error(sys->sprint("write error: %r"));
400388 }else if(buf[0:buflen] == zbuf[0:buflen]){
401389 if(sys->seek(t, big buflen, 1) < big 0)
402− error(sys->sprint("can't write zeros to %s: %r", newfile));
390+ error(sys->sprint("can't write zeros to %q: %r", newfile));
403391 }else if(sys->write(t, buf, n) < n)
404− error(sys->sprint("can't write %s: %r", newfile));
392+ error(sys->sprint("can't write %q: %r", newfile));
405393 }
406394 f = nil;
407395 if(tot != d.length){
@@ -420,11 +408,11 @@ copy(d: ref Dir) · 12 unmodified lines
420408 nd.mode = d.mode;
421409 nd.mtime = d.mtime;
422410 if(sys->fwstat(t, nd) < 0)
423− error(sys->sprint("can't move tmp file to %s: %r", newfile));
411+ error(sys->sprint("can't move tmp file to %q: %r", newfile));
424412 nd = sys->nulldir;
425413 nd.gid = d.gid;
426414 if(sys->fwstat(t, nd) < 0)
427− warn(sys->sprint("can't set group id of %s to %s: %r", newfile, d.gid));
415+ warn(sys->sprint("can't set group id of %q to %q: %r", newfile, d.gid));
428416 nd.gid = nil;
429417 nd.uid = d.uid;
430418 sys->fwstat(t, nd);
@@ -444,16 +432,16 @@ mkdir(d: ref Dir) · 13 unmodified lines
444432 if(fd == nil){
445433 (i, d1) := sys->stat(newfile);
446434 if(i < 0 || !(d1.mode & Sys->DMDIR))
447− error(sys->sprint("can't create %s", newfile));
435+ error(sys->sprint("can't create %q", newfile));
448436 if(sys->wstat(newfile, nd) < 0)
449− warn(sys->sprint("can't set modes for %s: %r", newfile));
437+ warn(sys->sprint("can't set modes for %q: %r", newfile));
450438 nd = sys->nulldir;
451439 nd.uid = d.uid;
452440 sys->wstat(newfile, nd);
453441 return;
454442 }
455443 if(sys->fwstat(fd, nd) < 0)
456− warn(sys->sprint("can't set modes for %s: %r", newfile));
444+ warn(sys->sprint("can't set modes for %q: %r", newfile));
457445 nd = sys->nulldir;
458446 nd.uid = d.uid;
459447 sys->fwstat(fd, nd);
@@ -461,8 +449,8 @@ mkdir(d: ref Dir) · 1 unmodified line
461449
462450 arch(d: ref Dir)
463451 {
464− bout.puts(sys->sprint("%s %s %s %s %ud %bd\n",
465− quoted(newfile), octal(d.mode), d.uid, d.gid, d.mtime, d.length));
452+ bout.puts(sys->sprint("%q %uo %q %q %ud %bd\n",
453+ newfile, d.mode, d.uid, d.gid, d.mtime, d.length));
466454 }
467455
468456 mkpath(prefix, elem: string): string
@@ -543,11 +531,11 @@ getfile(old: ref File): (ref File, big) · 74 unmodified lines
543531 f = ref File;
544532 (elem, p) = getname(p);
545533 if(debug)
546− fprint(stderr, "getfile: %s root %s\n", elem, old.new);
534+ fprint(stderr, "getfile: %q root %q\n", elem, old.new);
547535 f.new = mkpath(old.new, elem);
548536 (nil, f.elem) = str->splitr(f.new, "/");
549537 if(f.elem == nil)
550− error(sys->sprint("can't find file name component of %s", f.new));
538+ error(sys->sprint("can't find file name component of %q", f.new));
551539 (f.mode, p) = getmode(p);
552540 (f.uid, p) = getname(p);
553541 if(f.uid == nil)
@@ -585,7 +573,7 @@ getname(p: string): (string, string) · 31 unmodified lines
585573 for(; (c = p[0]) != '\n' && (c != ' ' && c != '\t' || quoted); p = p[1:]){
586574 if(quoted && c == '\'' && p[1] == '\'')
587575 p = p[1:];
588− else if(c == '\'' && qflag){
576+ else if(c == '\''){
589577 quoted = !quoted;
590578 continue;
591579 }
@@ -594,7 +582,7 @@ getname(p: string): (string, string) · 2 unmodified lines
594582 if(len s > 0 && s[0] == '$'){
595583 s = getenv(s[1:]);
596584 if(s == nil)
597− error(sys->sprint("can't read environment variable %s", s));
585+ error(sys->sprint("can't read environment variable %q", s));
598586 }
599587 return (s, p);
600588 }
@@ -654,13 +642,6 @@ getmode(p: string): (int, string) · 53 unmodified lines
654642 return (m|v, p);
655643 }
656644
657−quoted(s: string): string
658−{
659− if(qflag)
660− return sys->sprint("%q", s);
661− return s;
662−}
663−
664645 setusers()
665646 {
666647 if(fskind != Kfs)
@@ -693,30 +674,14 @@ setusers() · 26 unmodified lines
693674 modes = m;
694675 }
695676
696−# this isn't right for the current #K
697−mountkfs(name: string)
677+openkfscmd(name: string)
698678 {
699− kname: string;
700−
701679 if(fskind != Kfs)
702680 return;
703− if(name != nil)
704− kname = sys->sprint("/srv/kfs.%s", name);
705− else
706− kname = "/srv/kfs";
707− fd := sys->open(kname, Sys->ORDWR);
708− if(fd == nil){
709− fprint(stderr, "%s: can't open %s: %r\n", prog, kname);
710− quit("open kfs");
711− }
712− if(sys->mount(fd, nil, "/n/kfs", Sys->MREPL|Sys->MCREATE, "") < 0){
713− fprint(stderr, "%s: can't mount kfs on /n/kfs: %r\n", prog);
714− quit("mount kfs");
715− }
716− kname += ".cmd";
681+ kname := sys->sprint("/chan/kfs.%s.cmd", name);
717682 sfd = sys->open(kname, Sys->ORDWR);
718683 if(sfd == nil){
719− fprint(stderr, "%s: can't open %s: %r\n", prog, kname);
684+ fprint(stderr, "%s: can't open %q: %r\n", prog, kname);
720685 quit("open kfscmd");
721686 }
722687 }
@@ -747,7 +712,7 @@ kfscmd(cmd: string) · 24 unmodified lines
747712
748713 error(s: string)
749714 {
750− fprint(stderr, "%s: %s: %d: %s\n", prog, proto, lineno, s);
715+ fprint(stderr, "%s: %s:%d: %s\n", prog, proto, lineno, s);
751716 kfscmd("disallow");
752717 kfscmd("sync");
753718 quit("error");
@@ -755,24 +720,13 @@ error(s: string) · 1 unmodified line
755720
756721 warn(s: string)
757722 {
758− fprint(stderr, "%s: %s: %d: %s\n", prog, proto, lineno, s);
723+ fprint(stderr, "%s: %s:%d: %s\n", prog, proto, lineno, s);
759724 }
760725
761726 printfile(f: ref File)
762727 {
763728 if(f.old != nil)
764− fprint(stderr, "%s from %s %s %s %s\n", f.new, f.old, f.uid, f.gid, octal(f.mode));
729+ fprint(stderr, "%q from %q %q %q %uo\n", f.new, f.old, f.uid, f.gid, f.mode);
765730 else
766− fprint(stderr, "%s %s %s %s\n", f.new, f.uid, f.gid, octal(f.mode));
767−}
768−
769−octal(i: int): string
770−{
771− s := "";
772− do {
773− t: string;
774− t[0] = '0' + (i&7);
775− s = t+s;
776− } while((i = (i>>3)&~(7<<29)) != 0);
777− return s;
731+ fprint(stderr, "%q %q %q %uo\n", f.new, f.uid, f.gid, f.mode);
778732 }
dis/disk/mkext.dis+0−0

Binary file not shown.

dis/disk/mkfs.dis+0−0

Binary file not shown.

include/version.h+1−1
@@ -1 +1 @@
1−#define VERSION "Fourth Edition (20090806)"
1+#define VERSION "Fourth Edition (20090809)"
man/8/mkfs+98−56
@@ -3,7 +3,9 @@ · 2 unmodified lines
33 mkfs, mkext \- archive or update a file system
44 .SH SYNOPSIS
55 .B disk/mkfs
6−.RB [ -aprvx ]
6+.RB [ -aprvxS ]
7+.RB [ -d
8+.IR dest ]
79 .RB [ -n
810 .IR name ]
911 .RB [ -s
@@ -12,15 +14,23 @@ mkfs, mkext \- archive or update a file system · 2 unmodified lines
1214 .IR users ]
1315 .RB [ -z
1416 .IR n ]
17+.RB [ -G
18+.IR group ]
19+.RB [ -U
20+.IR user ]
1521 .I proto ...
1622 .PP
1723 .B disk/mkext
1824 .RB [ -d
1925 .IR name ]
20−.RB [ -u ]
26+.RB [ -f ]
2127 .RB [ -h ]
28+.RB [ -T ]
29+.RB [ -u ]
2230 .RB [ -v ]
31+[
2332 .I file ...
33+]
2434 .SH DESCRIPTION
2535 .I Mkfs
2636 copies files from the file tree
@@ -30,24 +40,22 @@ copies files from the file tree · 3 unmodified lines
3040 to a
3141 .B kfs
3242 file system (see
33−.IR kfs (4)).
34−The kfs service is mounted on
35−.BR /n/kfs ,
36−and
37−.BR /adm/users ,
38−if it exists, is copied to
39−.BR /n/kfs/adm/users .
43+.IR kfs (4))
44+assumed to be mounted on
45+.I dest
46+(default:
47+.BR /n/kfs ).
4048 The
4149 .I proto
4250 files are read,
4351 and any files specified in them that are out of date are copied to
44−.BR /n/kfs .
52+.IR dest .
4553 See
4654 .IR proto (6)
4755 for the description of file system prototype files.
4856 .PP
4957 .I Mkfs
50−copies only those files that are out of date.
58+by default copies only those files that are out of date.
5159 Such a file is first copied into a temporary
5260 file in the appropriate destination directory
5361 and then moved to the destination file.
@@ -61,88 +69,122 @@ are not updated and not removed. · 7 unmodified lines
6169 The options to
6270 .I mkfs
6371 are:
64−.TF "s source"
72+.TF "-s source"
6573 .TP
66−.B a
74+.B -a
6775 Instead of writing to a
6876 .B kfs
6977 file system, write an archive file to standard output, suitable for
7078 .IR mkext .
7179 All files in
72−.IR proto ,
73−not just those out of date, are archived.
80+.I proto
81+are archived,
82+not just those out of date.
7483 .TP
75−.B x
84+.B -x
7685 For use with
7786 .BR -a ,
7887 this option writes a list of file names, dates, and sizes to standard output
7988 rather than producing an archive file.
8089 .TP
81−.BI "n " name
90+.BI -n " name"
8291 Use
83−.RI kfs. name
84−as the name of the kfs service (default
85−.BR kfs ).
92+.BI kfs. name .cmd
93+as the name of the command file for the
94+.IR kfs (4)
95+assumed to be mounted on
96+.IR dest .
8697 .TP
87−.B p
98+.B -p
8899 Update the permissions of a file even if it is up to date.
89100 .TP
90−.B r
101+.B -r
91102 Copy all files.
92103 .TP
93−.BI "s " source
104+.BI -s " source"
94105 Copy from files rooted at the tree
95106 .IR source .
96107 .TP
97−.BI "u " users
98−Copy file
108+.BI -u " users"
109+Before copying any other file, copy file
99110 .I users
100111 into
101−.B /adm/users
102−in the new system.
112+.IB dest /adm/users ,
113+and if the
114+.B -n
115+option was given, also issue the
116+.IR kfs (4)
117+command
118+.B users
119+to update
120+.IR kfs 's
121+own user list.
103122 .TP
104−.B v
123+.B -v
105124 Print the names of all of the files as they are copied.
106125 .TP
107−.BI "z " n
108−Copy files assuming kfs block
126+.BI -z " n"
127+Copy files assuming
128+.I kfs
129+is using a block size of
109130 .I n
110−(default 1024)
111−bytes long.
131+bytes
132+(default 1024).
112133 If a block contains only 0-valued bytes, it is not copied.
134+.TP
135+.B -S
136+For use with the
137+.B -d
138+option,
139+make owner and group of each file copied match the original.
140+.TP
141+.BI -G " group"
142+Force all files copied to have the given
143+.IR group .
144+.TP
145+.BI -U " user"
146+Force all files copied to be owned by the given
147+.IR user .
113148 .PD
114149 .PP
115150 .I Mkext
116−unpacks archive files made by the
151+unpacks an archive created by the
117152 .B -a
118153 option of
119−.IR mkfs .
120−The
121−.B -d
122−option specifies a directory (default
123−.BR /n/kfs )
124−to serve as the root of the unpacked file system.
125−The
126−.B -u
127−option, to be used only when initializing a new
128−.IR kfs (4)
129−file system, sets the owners of the files created to correspond to
130−those in the archive and restores the modification times of the files.
131−(This is only permitted at the initial load of the files into a file
132−system.)
133−Each file on the command line is unpacked in one pass through the archive.
134−If the file is a directory,
154+.IR mkfs ,
155+read from the standard input.
156+If one or more files are specified on the command line,
157+only those files are unpacked.
158+If a
159+.I file
160+is a directory,
135161 all files and subdirectories of that directory are also unpacked.
136162 When a file is unpacked, the entire path is created if it
137163 does not exist.
138164 If no files are specified, the entire archive is unpacked;
139165 in this case, missing intermediate directories are not created.
140−The
141−.B -v
142−option prints the names and sizes of files as they are extracted;
166+The options are:
167+.TP
168+.BI -d " dir"
169+Treat
170+.I dir
171+(default
172+.LR / )
173+as the root directory when unpacking the archive.
174+.TP
143175 .B -h
144−prints headers for the files on standard output
176+Print headers for the files on standard output
145177 instead of unpacking the files.
178+.TP
179+.B -T
180+Restore the modification times of the files.
181+.TP
182+.B -u
183+Set the owners of the files created to correspond to
184+those in the archive and restore the modification times of the files.
185+.TP
186+.B -v
187+Print the names and sizes of files as they are extracted.
146188 .SH EXAMPLES
147189 .PP
148190 Make an archive to establish a new file system
@@ -153,7 +195,7 @@ is not referenced by · 4 unmodified lines
153195 .IP
154196 .EX
155197 bind '#U' /n/local
156−disk/mkfs -a -u files/adm.users -s /n/local proto > arch
198+disk/mkfs -a -s /n/local proto > arch
157199 .EE
158200 .PP
159201 Unpack that archive on another machine:
@@ -168,8 +210,8 @@ disk/mkext -u -d /n/remote < arch · 8 unmodified lines
168210 .B /lib/proto
169211 directory of prototype files.
170212 .TP
171−.B /lib/proto/portproto
172−generic prototype file.
213+.B /lib/proto/all
214+contains a single + (archive any directory structure)
173215 .SH SOURCE
174216 .B /appl/cmd/disk/mkfs.b
175217 .br