Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/newfs change the default back to checking the file syst...
details: https://anonhg.NetBSD.org/src/rev/cda0d8cd42d5
branches: trunk
changeset: 522485:cda0d8cd42d5
user: lukem <lukem%NetBSD.org@localhost>
date: Wed Feb 20 04:04:39 2002 +0000
description:
change the default back to checking the file system type is '4.2BSD',
and add -I to ignore this check. per discussion with thorpej.
diffstat:
sbin/newfs/newfs.8 | 22 +++++++++++++++-------
sbin/newfs/newfs.c | 23 ++++++++++-------------
2 files changed, 25 insertions(+), 20 deletions(-)
diffs (145 lines):
diff -r f7564557c908 -r cda0d8cd42d5 sbin/newfs/newfs.8
--- a/sbin/newfs/newfs.8 Wed Feb 20 03:52:51 2002 +0000
+++ b/sbin/newfs/newfs.8 Wed Feb 20 04:04:39 2002 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: newfs.8,v 1.40 2002/02/08 01:30:45 ross Exp $
+.\" $NetBSD: newfs.8,v 1.41 2002/02/20 04:04:39 lukem Exp $
.\"
.\" Copyright (c) 1983, 1987, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
.\"
-.Dd January 4, 2002
+.Dd February 20, 2002
.Dt NEWFS 8
.Os
.Sh NAME
@@ -42,7 +42,7 @@
.Sh SYNOPSIS
.Nm ""
.Op Fl B Ar byte-order
-.Op Fl FNOZ
+.Op Fl FINOZ
.Op Fl S Ar sector-size
.Op Fl T Ar disk-type
.Op Fl a Ar maxcontig
@@ -105,7 +105,10 @@
.Ar special .
The file system size needs to be specified with
.Dq Fl s Ar size .
-No attempts to use or update the disklabel will be made.
+No attempts to use or update the disk label will be made.
+.It Fl I
+Do not require that the file system type listed in the disk label is
+.Ql 4.2BSD .
.It Fl N
Causes the file system parameters to be printed out
without really creating the file system.
@@ -118,7 +121,7 @@
.It Fl T Ar disk-type
Uses information for the specified disk from
.Pa /etc/disktab
-instead of trying to get the information from a disklabel.
+instead of trying to get the information from the disk label.
.It Fl Z
Pre-zeros the file system image created with
.Fl F .
@@ -325,9 +328,14 @@
For the
.Nm
command to succeed,
-the disklabel should first be updated such that the fstype field for the
+the disk label should first be updated such that the fstype field for the
partition is set to
-.Bx 4.2 .
+.Ql 4.2BSD ,
+unless
+.Fl F
+or
+.Fl I
+is used.
.Sh SEE ALSO
.Xr disktab 5 ,
.Xr fs 5 ,
diff -r f7564557c908 -r cda0d8cd42d5 sbin/newfs/newfs.c
--- a/sbin/newfs/newfs.c Wed Feb 20 03:52:51 2002 +0000
+++ b/sbin/newfs/newfs.c Wed Feb 20 04:04:39 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs.c,v 1.57 2002/02/16 19:39:30 thorpej Exp $ */
+/* $NetBSD: newfs.c,v 1.58 2002/02/20 04:04:39 lukem Exp $ */
/*
* Copyright (c) 1983, 1989, 1993, 1994
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: newfs.c,v 1.57 2002/02/16 19:39:30 thorpej Exp $");
+__RCSID("$NetBSD: newfs.c,v 1.58 2002/02/20 04:04:39 lukem Exp $");
#endif
#endif /* not lint */
@@ -216,7 +216,7 @@
struct disklabel mfsfakelabel;
struct partition oldpartition;
struct statfs *mp;
- int ch, fsi, fso, len, maxpartitions, n, Fflag, Zflag;
+ int ch, fsi, fso, len, maxpartitions, n, Fflag, Iflag, Zflag;
char *cp, *endp, *s1, *s2, *special;
const char *opstring;
long long llsize;
@@ -233,7 +233,7 @@
cp = NULL;
fsi = fso = -1;
- Fflag = Zflag = 0;
+ Fflag = Iflag = Zflag = 0;
if (strstr(getprogname(), "mfs")) {
mfs = 1;
mfsmode = 01777; /* default mode for a /tmp-type directory */
@@ -248,7 +248,7 @@
opstring = mfs ?
"NT:a:b:c:d:e:f:g:h:i:m:o:p:s:u:" :
- "B:FNOS:T:Za:b:c:d:e:f:g:h:i:k:l:m:n:o:p:r:s:t:u:x:";
+ "B:FINOS:T:Za:b:c:d:e:f:g:h:i:k:l:m:n:o:p:r:s:t:u:x:";
while ((ch = getopt(argc, argv, opstring)) != -1)
switch (ch) {
case 'B':
@@ -266,6 +266,9 @@
case 'F':
Fflag = 1;
break;
+ case 'I':
+ Iflag = 1;
+ break;
case 'N':
Nflag = 1;
break;
@@ -555,15 +558,8 @@
pp = &lp->d_partitions[*cp - 'a'];
if (pp->p_size == 0)
errx(1, "`%c' partition is unavailable", *cp);
-#if 0
- /*
- * While one might think this test is useful, newfs
- * has historically allowed this operation, and some
- * people make use of this feature.
- */
- if (pp->p_fstype != FS_BSDFFS)
+ if (!Iflag && pp->p_fstype != FS_BSDFFS)
errx(1, "`%c' partition type is not `4.2BSD'", *cp);
-#endif
} /* !Fflag && !mfs */
if (fssize == 0)
@@ -887,6 +883,7 @@
} const help_strings[] = {
{ NEWFS, "-B byteorder\tbyte order (`be' or `le')" },
{ NEWFS, "-F \t\tcreate file system image in regular file" },
+ { NEWFS, "-I \t\tdo not check that the file system type is '4.2BSD'" },
{ BOTH, "-N \t\tdo not create file system, just print out "
"parameters" },
{ NEWFS, "-O \t\tcreate a 4.3BSD format filesystem" },
Home |
Main Index |
Thread Index |
Old Index