aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util-linux/Config.in8
-rw-r--r--util-linux/mkswap.c2
-rw-r--r--util-linux/mount.c21
3 files changed, 28 insertions, 3 deletions
diff --git a/util-linux/Config.in b/util-linux/Config.in
index d236b77b6..e97f84062 100644
--- a/util-linux/Config.in
+++ b/util-linux/Config.in
@@ -392,9 +392,11 @@ config FEATURE_MOUNT_HELPERS
392 depends on MOUNT 392 depends on MOUNT
393 help 393 help
394 Enable mounting of virtual file systems via external helpers. 394 Enable mounting of virtual file systems via external helpers.
395 E.g. mount obexfs#-b00.11.22.33.44.55 /mnt will in effect call 395 E.g. "mount obexfs#-b00.11.22.33.44.55 /mnt" will in effect call
396 obexfs -b00.11.22.33.44.55 /mnt 396 "obexfs -b00.11.22.33.44.55 /mnt"
397 The idea is to use such virtual filesystems in /etc/fstab 397 Also "mount -t sometype [-o opts] fs /mnt" will try
398 "sometype [-o opts] fs /mnt" if simple mount syscall fails.
399 The idea is to use such virtual filesystems in /etc/fstab.
398 400
399config FEATURE_MOUNT_NFS 401config FEATURE_MOUNT_NFS
400 bool "Support mounting NFS file systems" 402 bool "Support mounting NFS file systems"
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index f047cce26..31d577315 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -66,7 +66,9 @@ int mkswap_main(int argc, char **argv)
66 fd = xopen(argv[1], O_RDWR); 66 fd = xopen(argv[1], O_RDWR);
67 /* fdlength was reported to be unreliable - use seek */ 67 /* fdlength was reported to be unreliable - use seek */
68 len = xlseek(fd, 0, SEEK_END); 68 len = xlseek(fd, 0, SEEK_END);
69#if ENABLE_SELINUX
69 xlseek(fd, 0, SEEK_SET); 70 xlseek(fd, 0, SEEK_SET);
71#endif
70 pagesize = getpagesize(); 72 pagesize = getpagesize();
71 printf("Setting up swapspace version 1, size = %"OFF_FMT"u bytes\n", 73 printf("Setting up swapspace version 1, size = %"OFF_FMT"u bytes\n",
72 len - pagesize); 74 len - pagesize);
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 4ac52cd02..5e6c3ba72 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -309,6 +309,27 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
309 for (;;) { 309 for (;;) {
310 rc = mount(mp->mnt_fsname, mp->mnt_dir, mp->mnt_type, 310 rc = mount(mp->mnt_fsname, mp->mnt_dir, mp->mnt_type,
311 vfsflags, filteropts); 311 vfsflags, filteropts);
312
313 // If mount failed, try
314 // helper program <mnt_type>
315 if (ENABLE_FEATURE_MOUNT_HELPERS && rc) {
316 char *args[6];
317 int errno_save = errno;
318 args[0] = mp->mnt_type;
319 rc = 1;
320 if (filteropts) {
321 args[rc++] = (char *)"-o";
322 args[rc++] = filteropts;
323 }
324 args[rc++] = mp->mnt_fsname;
325 args[rc++] = mp->mnt_dir;
326 args[rc] = NULL;
327 rc = wait4pid(spawn(args));
328 if (!rc)
329 break;
330 errno = errno_save;
331 }
332
312 if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS)) 333 if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
313 break; 334 break;
314 if (!(vfsflags & MS_SILENT)) 335 if (!(vfsflags & MS_SILENT))