Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs Allow for the logical volume label to be spe...
details: https://anonhg.NetBSD.org/src/rev/f0ccda8f8403
branches: trunk
changeset: 789090:f0ccda8f8403
user: reinoud <reinoud%NetBSD.org@localhost>
date: Tue Aug 06 12:19:34 2013 +0000
description:
Allow for the logical volume label to be specified as well as the physical
volume label. Also allow the volumeset name to be specified if desired. The
syntax follows the newfs_udf(8) syntax.
diffstat:
usr.sbin/makefs/makefs.8 | 17 +++++++++++++----
usr.sbin/makefs/udf.c | 38 +++++++++++++++++++++++++++++++-------
2 files changed, 44 insertions(+), 11 deletions(-)
diffs (129 lines):
diff -r 43aa4eb8b49d -r f0ccda8f8403 usr.sbin/makefs/makefs.8
--- a/usr.sbin/makefs/makefs.8 Tue Aug 06 12:15:20 2013 +0000
+++ b/usr.sbin/makefs/makefs.8 Tue Aug 06 12:19:34 2013 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: makefs.8,v 1.50 2013/08/06 12:12:51 wiz Exp $
+.\" $NetBSD: makefs.8,v 1.51 2013/08/06 12:19:34 reinoud Exp $
.\"
.\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
.\" All rights reserved.
@@ -397,10 +397,11 @@
.Pq Ql = ,
and a value.
The following keywords are supported:
+.Pp
.Bl -tag -width optimization -compact
.It Sy disctype
This can have the following values:
-.Bl -tag -width dvdramXbdreXdiskXXX -compact
+.Bl -tag -width cdromXdvdromXbdromXXX -compact
.It Sy cdrom , Sy dvdrom , Sy bdrom
create a read-only fs
.It Sy dvdram , Sy bdre , Sy disk
@@ -412,9 +413,17 @@
.El
When an optical media is selected here, the sectorsize and the default disc
size is assumed unless given explicitly.
-For rom images the disc size is the
-minimum needed.
+For rom images the disc size is the minimum needed.
.El
+.Bl -tag -width optimization -compact
+.It Sy loglabel
+Set the logical volume label of the disc to the specified argument.
+.It Sy discid
+Set the physical volume label of the disc to the specified argument. Prepend
+the physical volume label with a volumeset label separated with a ':' if
+wanted. For strict conformance and interchange, don't set the volumeset label
+manually unless it has an unique hex number in the first 8 character
+positions.
.Sh SEE ALSO
.Xr strsuftoll 3 ,
.Xr installboot 8 ,
diff -r 43aa4eb8b49d -r f0ccda8f8403 usr.sbin/makefs/udf.c
--- a/usr.sbin/makefs/udf.c Tue Aug 06 12:15:20 2013 +0000
+++ b/usr.sbin/makefs/udf.c Tue Aug 06 12:19:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.7 2013/08/06 09:32:23 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.8 2013/08/06 12:19:34 reinoud Exp $ */
/*
* Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: udf.c,v 1.7 2013/08/06 09:32:23 reinoud Exp $");
+__RCSID("$NetBSD: udf.c,v 1.8 2013/08/06 12:19:34 reinoud Exp $");
#include <stdio.h>
#include <stdlib.h>
@@ -288,9 +288,11 @@
time_t now;
const option_t udf_options[] = {
- OPT_STR('T', "disctype", "disc type (cdrom,dvdrom,bdrom,dvdram,bdre,disk,cdr,dvdr,bdr,cdrw,dvdrw)"),
-// { 'P', "progress", &display_progressbar, OPT_INT32, false, true,
-// "display progress bar" },
+ OPT_STR('T', "disctype", "disc type (cdrom,dvdrom,bdrom,"
+ "dvdram,bdre,disk,cdr,dvdr,bdr,cdrw,dvdrw)"),
+ OPT_STR('L', "loglabel", "\"logical volume name\""),
+ OPT_STR('P', "discid", "[\"volset name\"':']"
+ "\"physical volume name\""),
{ .name = NULL }
};
@@ -347,7 +349,7 @@
uint64_t stdsize;
uint32_t set_sectorsize;
const char *name, *desc;
- char buf[1024];
+ char buffer[1024], *buf, *colon;
int i;
assert(option != NULL);
@@ -355,7 +357,7 @@
if (debug & DEBUG_FS_PARSE_OPTS)
printf("udf_parse_opts: got `%s'\n", option);
- i = set_option(udf_options, option, buf, sizeof(buf));
+ i = set_option(udf_options, option, buffer, sizeof(buffer));
if (i == -1)
return 0;
@@ -365,6 +367,7 @@
set_sectorsize = 0;
stdsize = 0;
+ buf = buffer;
name = udf_options[i].name;
desc = udf_options[i].desc;
switch (udf_options[i].letter) {
@@ -404,6 +407,27 @@
}
if (mmc_profile != 0x01)
set_sectorsize = 2048;
+ break;
+ case 'L':
+ if (context.logvol_name) free(context.logvol_name);
+ context.logvol_name = strdup(buf);
+ break;
+ case 'P':
+ if ((colon = strstr(buf, ":"))) {
+ if (context.volset_name)
+ free(context.volset_name);
+ *colon = 0;
+ context.volset_name = strdup(buf);
+ buf = colon+1;
+ }
+ if (context.primary_name)
+ free(context.primary_name);
+ if ((strstr(buf, ":"))) {
+ perror("primary name can't have ':' in its name");
+ return 0;
+ }
+ context.primary_name = strdup(buf);
+ break;
}
if (set_sectorsize)
fsopts->sectorsize = set_sectorsize;
Home |
Main Index |
Thread Index |
Old Index