NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/48808
The following reply was made to PR kern/48808; it has been noted by GNATS.
From: "Thomas Schmitt" <scdbackup%gmx.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: kern/48808
Date: Sun, 01 Jun 2014 17:03:09 +0200
--- sbin/mount_cd9660/mount_cd9660.c.orig 2011-08-29 14:35:00.000000000
+0000
+++ sbin/mount_cd9660/mount_cd9660.c 2014-06-01 13:56:09.000000000 +0000
@@ -79,6 +79,7 @@ static const struct mntopt mopts[] = {
{ "rrip", 1, ISOFSMNT_NORRIP, 1 },
{ "joliet", 1, ISOFSMNT_NOJOLIET, 1 },
{ "rrcaseins", 0, ISOFSMNT_RRCASEINS, 1 },
+ { "ssector", 0, 0, 1 }, /* not setable, only for info via getargs */
MOPT_NULL,
};
@@ -102,11 +103,13 @@ mount_cd9660_parseargs(int argc, char **
int ch, opts;
mntoptparse_t mp;
char *dev, *dir;
+ char *ep;
+ long long int llnum;
memset(args, 0, sizeof(*args));
*mntflags = opts = 0;
optind = optreset = 1;
- while ((ch = getopt(argc, argv, "egijo:r")) != -1)
+ while ((ch = getopt(argc, argv, "egijo:rs:")) != -1)
switch (ch) {
case 'e':
/* obsolete, retained for compatibility only, use
@@ -134,6 +137,19 @@ mount_cd9660_parseargs(int argc, char **
* -o norrip */
opts |= ISOFSMNT_NORRIP;
break;
+ case 's':
+ /* learned from mount/fattr.c : a_num() */
+ llnum = strtoll(optarg, &ep, 0);
+ if (*ep || optarg == ep || llnum < 0 ||
+ llnum > (long long int) 0xffffff00) {
+ (void)fprintf(stderr,
+ "%s : unusable parameter with option -s\n",
+ getprogname());
+ usage();
+ }
+ args->ssector = llnum;
+ opts |= ISOFSMNT_SSECTOR;
+ break;
case '?':
default:
usage();
@@ -177,6 +193,8 @@ mount_cd9660(int argc, char **argv)
char buf[2048];
(void)snprintb(buf, sizeof(buf), ISOFSMNT_BITS, args.flags);
printf("%s\n", buf);
+ if (args.flags & ISOFSMNT_SSECTOR)
+ printf("-s %"PRIu32"\n", args.ssector);
}
exit(0);
@@ -186,6 +204,7 @@ static void
usage(void)
{
(void)fprintf(stderr,
- "usage: %s [-o options] special node\n", getprogname());
+ "usage: %s [-o options | -s block_offset] special node\n",
+ getprogname());
exit(1);
}
--- sbin/mount_cd9660/mount_cd9660.8.orig 2009-01-03 22:56:23.000000000
+0000
+++ sbin/mount_cd9660/mount_cd9660.8 2014-05-16 19:49:05.000000000 +0000
@@ -57,7 +57,7 @@
.\"
.\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94
.\"
-.Dd January 3, 2009
+.Dd May, 16, 2014
.Dt MOUNT_CD9660 8
.Os
.Sh NAME
@@ -66,6 +66,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl o Ar options
+.Op Fl s Ar block_offset
.Ar special node
.Sh DESCRIPTION
The
@@ -130,8 +131,41 @@ For compatibility with Solaris only.
.It Cm rrcaseins
Makes all lookups case-insensitive even for CD-ROMs with Rock-Ridge
extensions (for Rock-Ridge, default is case-sensitive lookup).
+.It Cm ssector
+Is ignored as input option but reported by
+.Cm getargs
+if option
+.Cm Fl s
+is in effect.
.El
.El
+.Bl -tag -width indent
+.It Fl s Ar block_offset
+Read the superblock from block address
+.Ar block_offset
+rather than from the default position implied by the choice of the device
file.
+The block size is 2048 bytes.
+.Pp
+Command
+.Xr mscdlabel 8
+may have connected some
+.Pa /dev/cd*
+files to logical tracks of an optical
+multi-session medium, giving the device files the matching superblock
+positions for the recognized ISO-9660 filesystems.
+Such a default offset will be overridden by option
+.Fl s
+so that all
+.Pa /dev/cd*
+will behave like raw partition devices.
+.Pp
+.Xr mscdlabel 8
+has limitations with finding all ISO-9660 sessions which are accessible via
+a storage device. The burn software suite which produced the ISO-9660
+filesystem should be able to tell all suitable
+.Ar block_offset
+values.
+.El
.Pp
For compatibility with previous releases, following obsolete flags are
still recognized:
Home |
Main Index |
Thread Index |
Old Index