-# $OpenBSD: Makefile,v 1.3 1996/06/23 14:31:45 deraadt Exp $
+# $OpenBSD: Makefile,v 1.4 1997/02/23 03:51:22 millert Exp $
# $NetBSD: Makefile,v 1.10 1996/05/16 07:13:01 thorpej Exp $
PROG= newfs
MAN= newfs.8
MOUNT= ${.CURDIR}/../mount
-CFLAGS+=-DMFS -I${MOUNT}
+CFLAGS+=-DMFS -DFSIRAND -I${MOUNT}
.PATH: ${MOUNT} ${.CURDIR}/../disklabel
DPADD= ${LIBUTIL}
-/* $OpenBSD: mkfs.c,v 1.5 1997/02/21 22:55:19 millert Exp $ */
+/* $OpenBSD: mkfs.c,v 1.6 1997/02/23 03:51:23 millert Exp $ */
/* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)mkfs.c 8.3 (Berkeley) 2/3/94";
#else
-static char rcsid[] = "$OpenBSD: mkfs.c,v 1.5 1997/02/21 22:55:19 millert Exp $";
+static char rcsid[] = "$OpenBSD: mkfs.c,v 1.6 1997/02/23 03:51:23 millert Exp $";
#endif
#endif /* not lint */
sblock.fs_cstotal.cs_nifree = 0;
sblock.fs_cstotal.cs_nffree = 0;
sblock.fs_fmod = 0;
- sblock.fs_clean = FS_ISCLEAN;
sblock.fs_ronly = 0;
+ sblock.fs_clean = FS_ISCLEAN;
+#ifdef FSIRAND
+ sblock.fs_id[0] = (u_int32_t)utime;
+ sblock.fs_id[1] = (u_int32_t)arc4random();
+#endif
/*
* Dump out summary information about file system.
*/
acg.cg_cs.cs_nifree--;
}
for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) {
+#ifdef FSIRAND
+ for (j = 0; j < sblock.fs_bsize / sizeof(struct dinode); j++)
+ zino[j].di_gen = (u_int32_t)arc4random();
+#endif
wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno) + i),
sblock.fs_bsize, (char *)zino);
}
daddr_t d;
int c;
+#ifdef FSIRAND
+ ip->di_gen = (u_int32_t)arc4random();
+#endif
c = ino_to_cg(&sblock, ino);
rdfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize,
(char *)&acg);
-.\" $OpenBSD: newfs.8,v 1.4 1996/12/04 08:38:58 deraadt Exp $
+.\" $OpenBSD: newfs.8,v 1.5 1997/02/23 03:51:24 millert Exp $
.\" $NetBSD: newfs.8,v 1.12 1995/03/18 14:58:41 cgd Exp $
.\"
.\" Copyright (c) 1983, 1987, 1991, 1993, 1994
.Nm mount_mfs
on a machine without any disks.)
.Pp
+Both
+.Nm
+and
+.Nm mount_mfs
+now have the functionality of
+.Xr fsirand 8
+built-in so it is not necesary to run
+.Xr fsirand 8
+manually unless you wish to re-randomize the
+filesystem (or list the inode generation numbers).
+.Pp
The following options define the general layout policies.
.Bl -tag -width Fl
.It Fl N
.Xr fsck 8 ,
.Xr format 8 ,
.Xr mount 8 ,
-.Xr tunefs 8
+.Xr tunefs 8 ,
+.Xr fsirand 8
.Rs
.%A M. McKusick
.%A W. Joy
-/* $OpenBSD: newfs.c,v 1.13 1997/02/22 05:53:35 millert Exp $ */
+/* $OpenBSD: newfs.c,v 1.14 1997/02/23 03:51:25 millert Exp $ */
/* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */
/*
#if 0
static char sccsid[] = "@(#)newfs.c 8.8 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: newfs.c,v 1.13 1997/02/22 05:53:35 millert Exp $";
+static char rcsid[] = "$OpenBSD: newfs.c,v 1.14 1997/02/23 03:51:25 millert Exp $";
#endif
#endif /* not lint */
fatal("%s: %s", argv[1], strerror(errno));
}
#endif
- if (!Nflag) {
- (void)execl(_PATH_FSIRAND, "fsirand", special, NULL);
- err(1, "Can't exec %s", _PATH_FSIRAND);
- } else {
- exit(0);
- }
+ exit(0);
}
#ifdef COMPAT