[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH] mount: support "X-" and "x-" options
From: Daniel Thau <danthau () bedrocklinux ! org>
Date: 2021-07-03 12:21:37
Message-ID: 20210703122137.GA631 () euclid
[Download RAW message or body]
util-linux supports userspace application-specific capital "X-" mount
options which serve as /etc/fstab comments. They should be ignored by
mount and should not be passed to mount(2).
util-linux also supports userspace application-specific lowercase "x-"
mount options which serve as comments both in /etc/fstab and
/run/mount/utab. Similar to "X-", they should not be passed to
mount(2). Had busybox support for /run/mount/utab, they should be
stored there; since busybox does not, they are simply ignored
completely.
This is commonly used by systemd, e.g. "x-systemd.device-timeout=0".
---
util-linux/mount.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 831dab9e2..e26db33ed 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -347,6 +347,8 @@ static const int32_t mount_options[] ALIGN4 = {
IF_DESKTOP(/* "nofail" */ MOUNT_NOFAIL,)
/* "_netdev" */ 0,
IF_DESKTOP(/* "comment=" */ 0,) /* systemd uses this in fstab */
+ IF_DESKTOP(/* "X-" */ 0,) /* fstab comment */
+ IF_DESKTOP(/* "x-" */ 0,) /* fstab and utab comment */
)
IF_FEATURE_MOUNT_FLAGS(
@@ -410,6 +412,8 @@ static const char mount_option_str[] ALIGN1 =
IF_DESKTOP("nofail\0")
"_netdev\0"
IF_DESKTOP("comment=\0") /* systemd uses this in fstab */
+ IF_DESKTOP("X-\0") /* fstab comment */
+ IF_DESKTOP("x-\0") /* fstab and utab comment */
)
IF_FEATURE_MOUNT_FLAGS(
// vfs flags
@@ -610,6 +614,8 @@ static unsigned long parse_mount_options(char *options, char **unrecognized)
&& (options[opt_len] == '\0'
/* or is it "comment=" thingy in fstab? */
IF_FEATURE_MOUNT_FSTAB(IF_DESKTOP( || option_str[opt_len-1] == '=' ))
+ /* or is it a "X-" or "x-" fstab comment? */
+ IF_FEATURE_MOUNT_FSTAB(IF_DESKTOP( || strcasecmp(option_str, "x-") == 0))
)
) {
unsigned long fl = mount_options[i];
--
2.20.1
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic