aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Lewandowski <k.lewandowsk@samsung.com>2011-11-03 10:02:31 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-11-03 10:02:31 +0100
commitb5ebe5fdb3a520114fc4f956687e2c51f3b81429 (patch)
treed8d018097a76b55473551b800125e3f70d84b67a
parentf85554c26525ec2ddc860ccb1aadc05e7a3825f6 (diff)
downloadbusybox-w32-b5ebe5fdb3a520114fc4f956687e2c51f3b81429.tar.gz
busybox-w32-b5ebe5fdb3a520114fc4f956687e2c51f3b81429.tar.bz2
busybox-w32-b5ebe5fdb3a520114fc4f956687e2c51f3b81429.zip
mount: handle list of comma-separated fs types in -t option
Allows one to specify list of filesystem types to be tried when mounting particular device. E.g. mount -t vfat,ext2 ... Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/mount.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index fddd7fba9..f94b6e643 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -38,7 +38,7 @@
38//usage: ) 38//usage: )
39//usage: "\n -r Read-only mount" 39//usage: "\n -r Read-only mount"
40//usage: "\n -w Read-write mount (default)" 40//usage: "\n -w Read-write mount (default)"
41//usage: "\n -t FSTYPE Filesystem type" 41//usage: "\n -t FSTYPE[,...] Filesystem type(s)"
42//usage: "\n -O OPT Mount only filesystems with option OPT (-a only)" 42//usage: "\n -O OPT Mount only filesystems with option OPT (-a only)"
43//usage: "\n-o OPT:" 43//usage: "\n-o OPT:"
44//usage: IF_FEATURE_MOUNT_LOOP( 44//usage: IF_FEATURE_MOUNT_LOOP(
@@ -1827,7 +1827,16 @@ static int singlemount(struct mntent *mp, int ignore_busy)
1827 // If we know the fstype (or don't need to), jump straight 1827 // If we know the fstype (or don't need to), jump straight
1828 // to the actual mount. 1828 // to the actual mount.
1829 if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) { 1829 if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) {
1830 rc = mount_it_now(mp, vfsflags, filteropts); 1830 char *next;
1831 for (;;) {
1832 next = mp->mnt_type ? strchr(mp->mnt_type, ',') : NULL;
1833 if (next)
1834 *next = '\0';
1835 rc = mount_it_now(mp, vfsflags, filteropts);
1836 if (rc == 0 || !next)
1837 break;
1838 mp->mnt_type = next + 1;
1839 }
1831 } else { 1840 } else {
1832 // Loop through filesystem types until mount succeeds 1841 // Loop through filesystem types until mount succeeds
1833 // or we run out 1842 // or we run out
@@ -1844,7 +1853,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
1844 for (fl = fslist; fl; fl = fl->link) { 1853 for (fl = fslist; fl; fl = fl->link) {
1845 mp->mnt_type = fl->data; 1854 mp->mnt_type = fl->data;
1846 rc = mount_it_now(mp, vfsflags, filteropts); 1855 rc = mount_it_now(mp, vfsflags, filteropts);
1847 if (!rc) 1856 if (rc == 0)
1848 break; 1857 break;
1849 } 1858 }
1850 } 1859 }