add support for setting the ufs label. (Nathan Whitehorn)

This commit is contained in:
christos 2011-10-09 21:33:43 +00:00
parent 24dea3d577
commit 4a5d314575
4 changed files with 20 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $ */
/* $NetBSD: ffs.c,v 1.45 2011/10/09 21:33:43 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -71,7 +71,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
__RCSID("$NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $");
__RCSID("$NetBSD: ffs.c,v 1.45 2011/10/09 21:33:43 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@ -241,6 +241,9 @@ ffs_parse_opts(const char *option, fsinfo_t *fsopts)
goto leave_ffs_parse_opts;
}
rv = 1;
} else if (strcmp(var, "label") == 0) {
strlcpy(ffs_opts->label, val, sizeof(ffs_opts->label));
rv = 1;
} else
rv = set_option(ffs_options, var, val);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs.h,v 1.1 2004/12/20 20:51:42 jmc Exp $ */
/* $NetBSD: ffs.h,v 1.2 2011/10/09 21:33:43 christos Exp $ */
/*
* Copyright (c) 2001-2003 Wasabi Systems, Inc.
@ -38,7 +38,11 @@
#ifndef _FFS_H
#define _FFS_H
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
typedef struct {
char label[MAXVOLLEN]; /* volume name/label */
int bsize; /* block size */
int fsize; /* fragment size */
int cpg; /* cylinders per group */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mkfs.c,v 1.21 2004/12/20 20:51:42 jmc Exp $ */
/* $NetBSD: mkfs.c,v 1.22 2011/10/09 21:33:43 christos Exp $ */
/*
* Copyright (c) 2002 Networks Associates Technology, Inc.
@ -48,7 +48,7 @@
static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#else
#ifdef __RCSID
__RCSID("$NetBSD: mkfs.c,v 1.21 2004/12/20 20:51:42 jmc Exp $");
__RCSID("$NetBSD: mkfs.c,v 1.22 2011/10/09 21:33:43 christos Exp $");
#endif
#endif
#endif /* not lint */
@ -147,7 +147,10 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts)
avgfpdir = ffs_opts->avgfpdir;
bbsize = BBSIZE;
sbsize = SBLOCKSIZE;
strlcpy((char *)sblock.fs_volname, ffs_opts->label,
sizeof(sblock.fs_volname));
if (Oflag == 0) {
sblock.fs_old_inodefmt = FS_42INODEFMT;
sblock.fs_maxsymlinklen = 0;

View File

@ -1,4 +1,4 @@
.\" $NetBSD: makefs.8,v 1.36 2011/08/15 14:45:01 wiz Exp $
.\" $NetBSD: makefs.8,v 1.37 2011/10/09 21:33:43 christos Exp $
.\"
.\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
.\" All rights reserved.
@ -33,7 +33,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 13, 2011
.Dd October 9, 2011
.Dt MAKEFS 8
.Os
.Sh NAME
@ -238,6 +238,8 @@ Block size.
Bytes per inode.
.It Sy fsize
Fragment size.
.It Sy label
Label name of the image.
.It Sy maxbpg
Maximum blocks per file in a cylinder group.
.It Sy minfree