Wed Mar 6 05:11:13 2019 UTC ()
make ext2fs rev1 the default.  this enables LARGEFILES support.


(mrg)
diff -r1.12 -r1.13 src/sbin/newfs_ext2fs/newfs_ext2fs.8
diff -r1.9 -r1.10 src/sbin/newfs_ext2fs/newfs_ext2fs.c

cvs diff -r1.12 -r1.13 src/sbin/newfs_ext2fs/newfs_ext2fs.8 (expand / switch to unified diff)

--- src/sbin/newfs_ext2fs/newfs_ext2fs.8 2017/07/03 21:33:42 1.12
+++ src/sbin/newfs_ext2fs/newfs_ext2fs.8 2019/03/06 05:11:13 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: newfs_ext2fs.8,v 1.12 2017/07/03 21:33:42 wiz Exp $ 1.\" $NetBSD: newfs_ext2fs.8,v 1.13 2019/03/06 05:11:13 mrg Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1987, 1991, 1993, 1994 3.\" Copyright (c) 1983, 1987, 1991, 1993, 1994
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 30.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
31.\" 31.\"
32.Dd March 1, 2009 32.Dd March 5, 2019
33.Dt NEWFS_EXT2FS 8 33.Dt NEWFS_EXT2FS 8
34.Os 34.Os
35.Sh NAME 35.Sh NAME
36.Nm newfs_ext2fs 36.Nm newfs_ext2fs
37.Nd construct a new ext2 file system 37.Nd construct a new ext2 file system
38.Sh SYNOPSIS 38.Sh SYNOPSIS
39.Nm 39.Nm
40.Op Fl FINZ 40.Op Fl FINZ
41.Op Fl b Ar block-size 41.Op Fl b Ar block-size
42.Op Fl D Ar inodesize 42.Op Fl D Ar inodesize
43.Op Fl f Ar frag-size 43.Op Fl f Ar frag-size
44.Op Fl i Ar bytes-per-inode 44.Op Fl i Ar bytes-per-inode
45.Op Fl m Ar free-space 45.Op Fl m Ar free-space
@@ -130,30 +130,30 @@ and @@ -130,30 +130,30 @@ and
130.Fl n 130.Fl n
131are specified then 131are specified then
132.Fl n 132.Fl n
133takes precedence. 133takes precedence.
134The default number of inodes is calculated from a number of blocks in 134The default number of inodes is calculated from a number of blocks in
135the file system. 135the file system.
136.It Fl O Ar filesystem-format 136.It Fl O Ar filesystem-format
137Select the filesystem-format. 137Select the filesystem-format.
138.Bl -tag -width 3n -offset indent -compact 138.Bl -tag -width 3n -offset indent -compact
139.It 0 139.It 0
140.Ql GOOD_OLD_REV ; 140.Ql GOOD_OLD_REV ;
141this option is primarily used to build root file systems that can be 141this option is primarily used to build root file systems that can be
142understood by old or dumb firmwares for bootstrap. 142understood by old or dumb firmwares for bootstrap.
143(default) 
144.It 1 143.It 1
145.Ql DYNAMIC_REV ; 144.Ql DYNAMIC_REV ;
146various extended (and sometimes incompatible) features are enabled 145the default.
 146Various extended (and sometimes incompatible) features are enabled
147(though not all features are supported on 147(though not all features are supported on
148.Nx ) . 148.Nx ) .
149Currently only the following features are supported: 149Currently only the following features are supported:
150.Bl -tag -width "SPARSESUPER" -offset indent -compact 150.Bl -tag -width "SPARSESUPER" -offset indent -compact
151.It RESIZE 151.It RESIZE
152Prepare some reserved structures which enable future file system resizing. 152Prepare some reserved structures which enable future file system resizing.
153.It FTYPE 153.It FTYPE
154Store file types in directory entries to improve performance. 154Store file types in directory entries to improve performance.
155.It SPARSESUPER 155.It SPARSESUPER
156Prepare superblock backups for the 156Prepare superblock backups for the
157.Xr fsck_ext2fs 8 157.Xr fsck_ext2fs 8
158utility on not all but sparse block groups. 158utility on not all but sparse block groups.
159.It LARGEFILE 159.It LARGEFILE

cvs diff -r1.9 -r1.10 src/sbin/newfs_ext2fs/newfs_ext2fs.c (expand / switch to unified diff)

--- src/sbin/newfs_ext2fs/newfs_ext2fs.c 2013/10/19 01:09:59 1.9
+++ src/sbin/newfs_ext2fs/newfs_ext2fs.c 2019/03/06 05:11:13 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: newfs_ext2fs.c,v 1.9 2013/10/19 01:09:59 christos Exp $ */ 1/* $NetBSD: newfs_ext2fs.c,v 1.10 2019/03/06 05:11:13 mrg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1983, 1989, 1993, 1994 4 * Copyright (c) 1983, 1989, 1993, 1994
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#ifndef lint 33#ifndef lint
34__COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1993, 1994\ 34__COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1993, 1994\
35 The Regents of the University of California. All rights reserved."); 35 The Regents of the University of California. All rights reserved.");
36#endif /* not lint */ 36#endif /* not lint */
37 37
38#ifndef lint 38#ifndef lint
39#if 0 39#if 0
40static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95"; 40static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95";
41#else 41#else
42__RCSID("$NetBSD: newfs_ext2fs.c,v 1.9 2013/10/19 01:09:59 christos Exp $"); 42__RCSID("$NetBSD: newfs_ext2fs.c,v 1.10 2019/03/06 05:11:13 mrg Exp $");
43#endif 43#endif
44#endif /* not lint */ 44#endif /* not lint */
45 45
46/* 46/*
47 * newfs: friendly front end to mke2fs 47 * newfs: friendly front end to mke2fs
48 */ 48 */
49#include <sys/param.h> 49#include <sys/param.h>
50#include <sys/ioctl.h> 50#include <sys/ioctl.h>
51#include <sys/disklabel.h> 51#include <sys/disklabel.h>
52#include <sys/disk.h> 52#include <sys/disk.h>
53#include <sys/file.h> 53#include <sys/file.h>
54#include <sys/mount.h> 54#include <sys/mount.h>
55 55
@@ -90,27 +90,27 @@ static void usage(void) __dead; @@ -90,27 +90,27 @@ static void usage(void) __dead;
90 * We allocate one inode slot per 2, 4, or 8 blocks, expecting this 90 * We allocate one inode slot per 2, 4, or 8 blocks, expecting this
91 * to be far more than we will ever need. 91 * to be far more than we will ever need.
92 */ 92 */
93#define S_DFL_NINODE(blocks) ((blocks) / 8) 93#define S_DFL_NINODE(blocks) ((blocks) / 8)
94#define M_DFL_NINODE(blocks) ((blocks) / 4) 94#define M_DFL_NINODE(blocks) ((blocks) / 4)
95#define L_DFL_NINODE(blocks) ((blocks) / 2) 95#define L_DFL_NINODE(blocks) ((blocks) / 2)
96 96
97/* 97/*
98 * Default sector size. 98 * Default sector size.
99 */ 99 */
100#define DFL_SECSIZE 512 100#define DFL_SECSIZE 512
101 101
102int Nflag; /* run without writing file system */ 102int Nflag; /* run without writing file system */
103int Oflag = 0; /* format as conservative REV0 by default */ 103int Oflag = 1; /* format as REV1 by default */
104int verbosity; /* amount of printf() output */ 104int verbosity; /* amount of printf() output */
105#define DEFAULT_VERBOSITY 3 /* 4 is traditional behavior of newfs(8) */ 105#define DEFAULT_VERBOSITY 3 /* 4 is traditional behavior of newfs(8) */
106int64_t fssize; /* file system size */ 106int64_t fssize; /* file system size */
107uint sectorsize; /* bytes/sector */ 107uint sectorsize; /* bytes/sector */
108uint16_t inodesize = EXT2_REV0_DINODE_SIZE; /* inode size */ 108uint16_t inodesize = EXT2_REV0_DINODE_SIZE; /* inode size */
109uint fsize = 0; /* fragment size */ 109uint fsize = 0; /* fragment size */
110uint bsize = 0; /* block size */ 110uint bsize = 0; /* block size */
111uint minfree = MINFREE; /* free space threshold */ 111uint minfree = MINFREE; /* free space threshold */
112uint density; /* number of bytes per inode */ 112uint density; /* number of bytes per inode */
113uint num_inodes; /* number of inodes (overrides density) */ 113uint num_inodes; /* number of inodes (overrides density) */
114char *volname = NULL; /* volume name */ 114char *volname = NULL; /* volume name */
115 115
116static char *disktype = NULL; 116static char *disktype = NULL;