Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs add support for setting the ufs label. (Nath...
details: https://anonhg.NetBSD.org/src/rev/72db2c1838ac
branches: trunk
changeset: 770259:72db2c1838ac
user: christos <christos%NetBSD.org@localhost>
date: Sun Oct 09 21:33:43 2011 +0000
description:
add support for setting the ufs label. (Nathan Whitehorn)
diffstat:
usr.sbin/makefs/ffs.c | 7 +++++--
usr.sbin/makefs/ffs.h | 6 +++++-
usr.sbin/makefs/ffs/mkfs.c | 9 ++++++---
usr.sbin/makefs/makefs.8 | 6 ++++--
4 files changed, 20 insertions(+), 8 deletions(-)
diffs (106 lines):
diff -r fcd78d882ee1 -r 72db2c1838ac usr.sbin/makefs/ffs.c
--- a/usr.sbin/makefs/ffs.c Sun Oct 09 21:17:33 2011 +0000
+++ b/usr.sbin/makefs/ffs.c Sun Oct 09 21:33:43 2011 +0000
@@ -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 @@
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);
diff -r fcd78d882ee1 -r 72db2c1838ac usr.sbin/makefs/ffs.h
--- a/usr.sbin/makefs/ffs.h Sun Oct 09 21:17:33 2011 +0000
+++ b/usr.sbin/makefs/ffs.h Sun Oct 09 21:33:43 2011 +0000
@@ -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 */
diff -r fcd78d882ee1 -r 72db2c1838ac usr.sbin/makefs/ffs/mkfs.c
--- a/usr.sbin/makefs/ffs/mkfs.c Sun Oct 09 21:17:33 2011 +0000
+++ b/usr.sbin/makefs/ffs/mkfs.c Sun Oct 09 21:33:43 2011 +0000
@@ -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 @@
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;
diff -r fcd78d882ee1 -r 72db2c1838ac usr.sbin/makefs/makefs.8
--- a/usr.sbin/makefs/makefs.8 Sun Oct 09 21:17:33 2011 +0000
+++ b/usr.sbin/makefs/makefs.8 Sun Oct 09 21:33:43 2011 +0000
@@ -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 @@
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
Home |
Main Index |
Thread Index |
Old Index