Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/newfs_lfs Add -F flag to override newfs_lfs' preference...
details: https://anonhg.NetBSD.org/src/rev/c20ed5ca0dee
branches: trunk
changeset: 482064:c20ed5ca0dee
user: perseant <perseant%NetBSD.org@localhost>
date: Sat Feb 12 23:58:09 2000 +0000
description:
Add -F flag to override newfs_lfs' preference for 4.4LFS-labelled partitions.
diffstat:
sbin/newfs_lfs/newfs.c | 22 +++++++++++++++++-----
sbin/newfs_lfs/newfs_lfs.8 | 7 ++++++-
2 files changed, 23 insertions(+), 6 deletions(-)
diffs (86 lines):
diff -r a14338fb807d -r c20ed5ca0dee sbin/newfs_lfs/newfs.c
--- a/sbin/newfs_lfs/newfs.c Sat Feb 12 23:44:16 2000 +0000
+++ b/sbin/newfs_lfs/newfs.c Sat Feb 12 23:58:09 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs.c,v 1.2 1999/07/15 19:09:40 perseant Exp $ */
+/* $NetBSD: newfs.c,v 1.3 2000/02/12 23:58:09 perseant Exp $ */
/*-
* Copyright (c) 1989, 1992, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)newfs.c 8.5 (Berkeley) 5/24/95";
#else
-__RCSID("$NetBSD: newfs.c,v 1.2 1999/07/15 19:09:40 perseant Exp $");
+__RCSID("$NetBSD: newfs.c,v 1.3 2000/02/12 23:58:09 perseant Exp $");
#endif
#endif /* not lint */
@@ -111,7 +111,7 @@
struct partition *pp;
struct disklabel *lp;
struct stat st;
- int debug, lfs, fsi, fso, segsize, maxpartitions;
+ int debug, force, lfs, fsi, fso, segsize, maxpartitions;
char *cp, *opstring;
if ((progname = strrchr(*argv, '/')) != NULL)
@@ -123,9 +123,9 @@
if (maxpartitions > 26)
fatal("insane maxpartitions value %d", maxpartitions);
- opstring = "B:DLNb:f:m:s:";
+ opstring = "B:DFLNb:f:m:s:";
- debug = lfs = segsize = 0;
+ debug = force = lfs = segsize = 0;
while ((ch = getopt(argc, argv, opstring)) != -1)
switch(ch) {
case 'B': /* LFS segment size */
@@ -135,6 +135,9 @@
case 'D':
debug = 1;
break;
+ case 'F':
+ force = 1;
+ break;
case 'L': /* Create lfs */
lfs = 1;
break;
@@ -225,6 +228,15 @@
if (pp->p_size == 0)
fatal("%s: `%c' partition is unavailable", argv[0], *cp);
+ /* If force, make the partition look like an LFS */
+ if(force) {
+ pp->p_fstype = FS_BSDLFS;
+ /* 0 means to use defaults */
+ pp->p_fsize = 0;
+ pp->p_frag = 0;
+ pp->p_sgs = 0;
+ }
+
/* If we're making a LFS, we break out here */
exit(make_lfs(fso, lp, pp, minfree, bsize, fsize, segsize));
}
diff -r a14338fb807d -r c20ed5ca0dee sbin/newfs_lfs/newfs_lfs.8
--- a/sbin/newfs_lfs/newfs_lfs.8 Sat Feb 12 23:44:16 2000 +0000
+++ b/sbin/newfs_lfs/newfs_lfs.8 Sat Feb 12 23:58:09 2000 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: newfs_lfs.8,v 1.6 2000/02/05 11:57:30 enami Exp $
+.\" $NetBSD: newfs_lfs.8,v 1.7 2000/02/12 23:58:09 perseant Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@@ -72,6 +72,11 @@
The block size of the file system in bytes. If not specified, the block
size is taken from the partition label, or if the partition label
indicates 0, a compile-time default of 8K is used.
+.It Fl F
+Force creation of an LFS even on a partition labeled as another type.
+.Nm
+will use compile-time default values for block and fragment size, and segment
+shift, unless these are overridden by command-line flags.
.It Fl f Ar fragment-size
The fragment size of the file system in bytes. If not specified,
the fragment size is taken from the partition label, or if the partition
Home |
Main Index |
Thread Index |
Old Index