View | Details | Raw Unified | Return to bug 25273 | Differences between
and this patch

Collapse All | Expand All

(-)vnconfig.8 (-4 / +20 lines)
Lines 176-189 Link Here
176
Swapping is enabled on the special file.
176
Swapping is enabled on the special file.
177
See
177
See
178
.Xr swapon 2 .
178
.Xr swapon 2 .
179
.It Dv Pf mountro= Pa mount_point
179
.It Dv Pf mountro= Pa mount_point[,fstype]
180
The special file is mounted read-only on
180
The special file is mounted read-only on
181
.Ar mount_point .
181
.Ar mount_point
182
using the file system type
183
.Ar fstype
184
if provided. The type
185
.Ar ufs
186
is the default.
182
See
187
See
183
.Xr mount 2 .
188
.Xr mount 2 .
184
.It Dv Pf mountrw= Pa mount_point
189
.It Dv Pf mountrw= Pa mount_point[,fstype]
185
The special file is mounted read-write on
190
The special file is mounted read-write on
186
.Ar mount_point .
191
.Ar mount_point
192
using the file system type
193
.Ar fstype
194
if provided. The type
195
.Ar ufs
196
is the default.
187
See
197
See
188
.Xr mount 2 .
198
.Xr mount 2 .
189
.It Dv Pf mount= Pa mount_point
199
.It Dv Pf mount= Pa mount_point
Lines 217-222 Link Here
217
Configures
227
Configures
218
.Pa vn0c
228
.Pa vn0c
219
and enables swapping on it.
229
and enables swapping on it.
230
.Pp
231
.Dl vnconfig -e vn0c myisoimage mountro=/iso,cd9660
232
.Pp
233
Configures
234
.Pa vn0c
235
and read-only mounts an ISO-9660 image file.
220
.Pp
236
.Pp
221
.Dl vnconfig -d vn0c myfilesystem mount=/mnt
237
.Dl vnconfig -d vn0c myfilesystem mount=/mnt
222
.Pp
238
.Pp
(-)vnconfig.c (-9 / +25 lines)
Lines 75-80 Link Here
75
	int	flags;
75
	int	flags;
76
	int	size;
76
	int	size;
77
	char	*oarg;
77
	char	*oarg;
78
	char	*otype;
78
} vndisks[MAXVNDISK];
79
} vndisks[MAXVNDISK];
79
80
80
#define VN_CONFIG	0x01
81
#define VN_CONFIG	0x01
Lines 222-227 Link Here
222
		vndisks[0].flags = flags;
223
		vndisks[0].flags = flags;
223
		vndisks[0].size = size;
224
		vndisks[0].size = size;
224
		vndisks[0].autolabel = autolabel;
225
		vndisks[0].autolabel = autolabel;
226
		vndisks[0].oarg = NULL;
227
		vndisks[0].otype = "ufs";
225
		if (optind < argc)
228
		if (optind < argc)
226
			getoptions(&vndisks[0], argv[optind]);
229
			getoptions(&vndisks[0], argv[optind]);
227
		nvndisks = 1;
230
		nvndisks = 1;
Lines 242-249 Link Here
242
	if (!strcmp(str,"follow")) { *p |= VN_FOLLOW; return 0; }
245
	if (!strcmp(str,"follow")) { *p |= VN_FOLLOW; return 0; }
243
	if (!strcmp(str,"debug")) { *p |= VN_DEBUG; return 0; }
246
	if (!strcmp(str,"debug")) { *p |= VN_DEBUG; return 0; }
244
	if (!strcmp(str,"io")) { *p |= VN_IO; return 0; }
247
	if (!strcmp(str,"io")) { *p |= VN_IO; return 0; }
245
	if (!strcmp(str,"all")) { *p |= ~0; return 0; }
248
	if (!strcmp(str,"all")) { *p = ~0; return 0; }
246
	if (!strcmp(str,"none")) { *p |= 0; return 0; }
249
	if (!strcmp(str,"none")) { *p = 0; return 0; }
247
	return 1;
250
	return 1;
248
}
251
}
249
252
Lines 251-257 Link Here
251
config(vnp)
254
config(vnp)
252
	struct vndisk *vnp;
255
	struct vndisk *vnp;
253
{
256
{
254
	char *dev, *file, *oarg;
257
	char *dev, *file, *oarg, *otype;
255
	int flags;
258
	int flags;
256
	struct vn_ioctl vnio;
259
	struct vn_ioctl vnio;
257
	register int rv;
260
	register int rv;
Lines 272-277 Link Here
272
	file = vnp->file;
275
	file = vnp->file;
273
	flags = vnp->flags;
276
	flags = vnp->flags;
274
	oarg = vnp->oarg;
277
	oarg = vnp->oarg;
278
	otype = vnp->otype;
275
279
276
	if (flags & VN_IGNORE)
280
	if (flags & VN_IGNORE)
277
		return(0);
281
		return(0);
Lines 436-441 Link Here
436
			printf("%s: flags now=%08lx\n",dev,l);
440
			printf("%s: flags now=%08lx\n",dev,l);
437
	}
441
	}
438
442
443
	fclose(f);
444
439
	/*
445
	/*
440
	 * Enable special functions on the device
446
	 * Enable special functions on the device
441
	 */
447
	 */
Lines 453-467 Link Here
453
459
454
			args.fspec = dev;
460
			args.fspec = dev;
455
			mflags = (flags & VN_MOUNTRO) ? MNT_RDONLY : 0;
461
			mflags = (flags & VN_MOUNTRO) ? MNT_RDONLY : 0;
456
			rv = mount("ufs", oarg, mflags, &args);
462
			rv = mount(otype, oarg, mflags, &args);
457
			if (rv)
463
			if (rv)
458
				warn("mount");
464
				warn("mount");
459
			else if (verbose)
465
			else if (verbose)
460
				printf("%s: mounted on %s\n", dev, oarg);
466
				printf("%s: mounted on %s (%s)\n", dev, oarg, otype);
461
		}
467
		}
462
	}
468
	}
463
/* done: */
469
/* done: */
464
	fclose(f);
465
	fflush(stdout);
470
	fflush(stdout);
466
	return(rv < 0);
471
	return(rv < 0);
467
}
472
}
Lines 509-522 Link Here
509
514
510
		if (*sp == '%' && strtol(sp + 1, NULL, 0) > 0) {
515
		if (*sp == '%' && strtol(sp + 1, NULL, 0) > 0) {
511
			vndisks[ix].size = getsize(sp + 1);
516
			vndisks[ix].size = getsize(sp + 1);
517
			vndisks[ix].file = NULL;
512
		} else {
518
		} else {
519
			vndisks[ix].size = 0;
513
			vndisks[ix].file = malloc(cp - sp);
520
			vndisks[ix].file = malloc(cp - sp);
514
			strcpy(vndisks[ix].file, sp);
521
			strcpy(vndisks[ix].file, sp);
515
		}
522
		}
516
523
		vndisks[ix].autolabel = NULL;
517
		while (!EOL(*cp) && WHITE(*cp))
524
		while (!EOL(*cp) && WHITE(*cp))
518
			cp++;
525
			cp++;
519
		vndisks[ix].flags = flags;
526
		vndisks[ix].flags = flags;
527
		vndisks[ix].oarg = NULL;
528
		vndisks[ix].otype = "ufs";
520
		if (!EOL(*cp)) {
529
		if (!EOL(*cp)) {
521
			sp = cp;
530
			sp = cp;
522
			while (!EOL(*cp) && !WHITE(*cp))
531
			while (!EOL(*cp) && !WHITE(*cp))
Lines 536-541 Link Here
536
{
545
{
537
	int flags = 0;
546
	int flags = 0;
538
	char *oarg = NULL;
547
	char *oarg = NULL;
548
	char *otype = NULL;
539
549
540
	if (strcmp(fstr, "swap") == 0)
550
	if (strcmp(fstr, "swap") == 0)
541
		flags |= VN_SWAP;
551
		flags |= VN_SWAP;
Lines 550-561 Link Here
550
		oarg = &fstr[8];
560
		oarg = &fstr[8];
551
	} else if (strcmp(fstr, "ignore") == 0)
561
	} else if (strcmp(fstr, "ignore") == 0)
552
		flags |= VN_IGNORE;
562
		flags |= VN_IGNORE;
563
	if (flags & (VN_MOUNTRW|VN_MOUNTRO))
564
		if (strtok(oarg, ","))
565
			otype = strtok(NULL, ",");
553
	vnp->flags |= flags;
566
	vnp->flags |= flags;
554
	if (oarg) {
567
	if (oarg) {
555
		vnp->oarg = malloc(strlen(oarg) + 1);
568
		vnp->oarg = malloc(strlen(oarg) + 1);
556
		strcpy(vnp->oarg, oarg);
569
		strcpy(vnp->oarg, oarg);
557
	} else
570
	}
558
		vnp->oarg = NULL;
571
	if (otype) {
572
		vnp->otype = malloc(strlen(otype) + 1);
573
		strcpy(vnp->otype, otype);
574
	}
559
}
575
}
560
576
561
char *
577
char *

Return to bug 25273