FreeBSD Bugzilla – Attachment 13215 Details for
Bug 25273
add fs type feature to vnconfig(8) to allow direct mount of iso images and co.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.42 KB, created by
Cyrille Lefevre
on 2001-02-22 04:00:07 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Cyrille Lefevre
Created:
2001-02-22 04:00:07 UTC
Size:
4.42 KB
patch
obsolete
>Index: vnconfig.8 >=================================================================== >RCS file: /home/ncvs/src/usr.sbin/vnconfig/vnconfig.8,v >retrieving revision 1.14.2.4 >diff -u -r1.14.2.4 vnconfig.8 >--- vnconfig.8 2000/12/27 16:23:31 1.14.2.4 >+++ vnconfig.8 2001/02/22 03:52:12 >@@ -188,6 +188,12 @@ > .Xr mount 2 . > .It Dv Pf mount= Pa mount_point > Same as ``mountrw=''. >+.It Dv Pf type= Pa fstype >+Mounts the file system as type >+.Ar fstype . >+The type >+.Ar ufs >+is the default. > .El > .Pp > A configuration file contains one line per device/file pair in the form: >@@ -217,6 +223,12 @@ > Configures > .Pa vn0c > and enables swapping on it. >+.Pp >+.Dl vnconfig -e vn0c myisoimage mountro=/iso type=cd9660 >+.Pp >+Configures >+.Pa vn0c >+and read-only mounts an ISO-9660 image file. > .Pp > .Dl vnconfig -d vn0c myfilesystem mount=/mnt > .Pp >Index: vnconfig.c >=================================================================== >RCS file: /home/ncvs/src/usr.sbin/vnconfig/vnconfig.c,v >retrieving revision 1.13.2.4 >diff -u -r1.13.2.4 vnconfig.c >--- vnconfig.c 2001/02/02 21:16:34 1.13.2.4 >+++ vnconfig.c 2001/02/22 03:45:13 >@@ -75,6 +75,7 @@ > int flags; > int size; > char *oarg; >+ char *otype; > } vndisks[MAXVNDISK]; > > #define VN_CONFIG 0x01 >@@ -222,8 +223,10 @@ > vndisks[0].flags = flags; > vndisks[0].size = size; > vndisks[0].autolabel = autolabel; >- if (optind < argc) >- getoptions(&vndisks[0], argv[optind]); >+ vndisks[0].oarg = NULL; >+ vndisks[0].otype = "ufs"; >+ while (optind < argc) >+ getoptions(&vndisks[0], argv[optind++]); > nvndisks = 1; > } > rv = 0; >@@ -242,8 +245,8 @@ > if (!strcmp(str,"follow")) { *p |= VN_FOLLOW; return 0; } > if (!strcmp(str,"debug")) { *p |= VN_DEBUG; return 0; } > if (!strcmp(str,"io")) { *p |= VN_IO; return 0; } >- if (!strcmp(str,"all")) { *p |= ~0; return 0; } >- if (!strcmp(str,"none")) { *p |= 0; return 0; } >+ if (!strcmp(str,"all")) { *p = ~0; return 0; } >+ if (!strcmp(str,"none")) { *p = 0; return 0; } > return 1; > } > >@@ -251,7 +254,7 @@ > config(vnp) > struct vndisk *vnp; > { >- char *dev, *file, *oarg; >+ char *dev, *file, *oarg, *otype; > int flags; > struct vn_ioctl vnio; > register int rv; >@@ -272,6 +275,7 @@ > file = vnp->file; > flags = vnp->flags; > oarg = vnp->oarg; >+ otype = vnp->otype; > > if (flags & VN_IGNORE) > return(0); >@@ -436,6 +440,8 @@ > printf("%s: flags now=%08lx\n",dev,l); > } > >+ fclose(f); >+ > /* > * Enable special functions on the device > */ >@@ -446,22 +452,21 @@ > warn("swapon"); > else if (verbose) > printf("%s: swapping enabled\n", dev); >- } >+ } else > if (flags & (VN_MOUNTRO|VN_MOUNTRW)) { > struct ufs_args args; > int mflags; > > args.fspec = dev; > mflags = (flags & VN_MOUNTRO) ? MNT_RDONLY : 0; >- rv = mount("ufs", oarg, mflags, &args); >+ rv = mount(otype, oarg, mflags, &args); > if (rv) > warn("mount"); > else if (verbose) >- printf("%s: mounted on %s\n", dev, oarg); >+ printf("%s: mounted on %s (%s)\n", dev, oarg, otype); > } > } > /* done: */ >- fclose(f); > fflush(stdout); > return(rv < 0); > } >@@ -509,15 +514,19 @@ > > if (*sp == '%' && strtol(sp + 1, NULL, 0) > 0) { > vndisks[ix].size = getsize(sp + 1); >+ vndisks[ix].file = NULL; > } else { >+ vndisks[ix].size = 0; > vndisks[ix].file = malloc(cp - sp); > strcpy(vndisks[ix].file, sp); > } >- >+ vndisks[ix].autolabel = NULL; > while (!EOL(*cp) && WHITE(*cp)) > cp++; > vndisks[ix].flags = flags; >- if (!EOL(*cp)) { >+ vndisks[ix].oarg = NULL; >+ vndisks[ix].otype = "ufs"; >+ while (!EOL(*cp)) { > sp = cp; > while (!EOL(*cp) && !WHITE(*cp)) > cp++; >@@ -536,6 +545,7 @@ > { > int flags = 0; > char *oarg = NULL; >+ char *otype = NULL; > > if (strcmp(fstr, "swap") == 0) > flags |= VN_SWAP; >@@ -548,14 +558,18 @@ > } else if (strncmp(fstr, "mountro=", 8) == 0) { > flags |= VN_MOUNTRO; > oarg = &fstr[8]; >+ } else if (strncmp(fstr, "type=", 5) == 0) { >+ otype = &fstr[5]; > } else if (strcmp(fstr, "ignore") == 0) > flags |= VN_IGNORE; > vnp->flags |= flags; > if (oarg) { > vnp->oarg = malloc(strlen(oarg) + 1); > strcpy(vnp->oarg, oarg); >- } else >- vnp->oarg = NULL; >+ } else if (otype) { >+ vnp->otype = malloc(strlen(otype) + 1); >+ strcpy(vnp->otype, otype); >+ } > } > > char * >@@ -585,7 +599,7 @@ > { > fprintf(stderr, "%s\n%s\n%s\n", > "usage: vnconfig [-cdeguv] [-s option] [-r option] [-S value] special_file", >- " [regular_file] [feature]", >+ " [regular_file] [features]", > " vnconfig -a [-cdeguv] [-s option] [-r option] [-f config_file]"); > exit(1); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 25273
: 13215 |
13216