-# $OpenBSD: Makefile,v 1.1 1996/06/10 06:37:11 deraadt Exp $
+# $OpenBSD: Makefile,v 1.2 1997/01/10 19:04:08 kstailey Exp $
PROG= newfs_msdos
MAN= newfs_msdos.8
+DPADD= ${LIBUTIL}
+LDADD= -lutil
###################################################################
#
-.\" $OpenBSD: newfs_msdos.8,v 1.3 1997/01/03 16:45:38 kstailey Exp $
+.\" $OpenBSD: newfs_msdos.8,v 1.4 1997/01/10 19:04:09 kstailey Exp $
.\"
.\" Copyright (c) 1995, 1996 Joerg Wunsch
.\"
.Nd create an MS-DOS (FAT) file system
.Sh SYNOPSIS
.Nm newfs_msdos
-.Bq Fl f Ar capacity
+.Bq Fl s Ar kilobytes
.Bq Fl L Ar vollabel
.Ar device
.Sh DESCRIPTION
.Pp
The options are as follows:
.Bl -tag -width 10n -offset indent
-.It Fl f Ar capacity
+.It Fl s Ar kilobytes
Use defaults for a typical file system with
.Ar capacity
kilobytes. Currently, the values 360, 720, 1200, and 1440 are
-/* $OpenBSD: newfs_msdos.c,v 1.2 1996/12/04 08:33:58 deraadt Exp $ */
+/* $OpenBSD: newfs_msdos.c,v 1.3 1997/01/10 19:04:10 kstailey Exp $ */
/*
* Copyright (c) 1995, 1996 Joerg Wunsch
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <util.h>
#include "bootcode.h"
#include "dosfs.h"
struct tm *tp;
time_t now;
int c, i, fd, format = 0, rootdirsize;
+ char *rdev;
while ((c = getopt(argc, argv, "s:L:t:")) != EOF)
switch (c) {
if (argc != 1)
usage();
+#if 0
if ((fd = open(argv[0], O_RDWR | O_EXCL, 0)) == -1)
err(1, "open(%s)", argv[0]);
+#else
+ if ((fd = opendev(argv[0], O_RDWR | O_EXCL, OPENDEV_PART, &rdev)) < 0)
+ err(1, "%s", rdev);
+#endif
if (format == 0) {
/*