// Not real flags, but we want to be able to check for this.
enum {
- MOUNT_USERS = (1 << 28) * ENABLE_DESKTOP,
+ MOUNT_USERS = (1 << 27) * ENABLE_DESKTOP,
+ MOUNT_NOFAIL = (1 << 28) * ENABLE_DESKTOP,
MOUNT_NOAUTO = (1 << 29),
MOUNT_SWAP = (1 << 30),
+ MOUNT_FAKEFLAGS = MOUNT_USERS | MOUNT_NOFAIL | MOUNT_NOAUTO | MOUNT_SWAP
};
/* "swap" */ MOUNT_SWAP,
IF_DESKTOP(/* "user" */ MOUNT_USERS,)
IF_DESKTOP(/* "users" */ MOUNT_USERS,)
+ IF_DESKTOP(/* "nofail" */ MOUNT_NOFAIL,)
/* "_netdev" */ 0,
IF_DESKTOP(/* "comment=" */ 0,) /* systemd uses this in fstab */
)
"swap\0"
IF_DESKTOP("user\0")
IF_DESKTOP("users\0")
+ IF_DESKTOP("nofail\0")
"_netdev\0"
IF_DESKTOP("comment=\0") /* systemd uses this in fstab */
)
{
int rc = 0;
+ vfsflags &= ~(unsigned long)MOUNT_FAKEFLAGS;
+
if (FAKE_IT) {
if (verbose >= 2)
bb_error_msg("would do mount('%s','%s','%s',0x%08lx,'%s')",
if (errno == EBUSY && ignore_busy)
return 0;
+ if (errno == ENOENT && (vfsflags & MOUNT_NOFAIL))
+ return 0;
if (rc != 0)
bb_perror_msg("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
return rc;