From 1ef77db7b5b8789d4c9c51c955fb0af81e8ef9e3 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 4 Oct 2014 16:32:39 +0100 Subject: [PATCH] mount: Implement -o defaults This is needed to support mounting non-root filesystems in initramfs-tools. Signed-off-by: Ben Hutchings Gbp-Pq: Name mount-implement-o-defaults.patch --- usr/utils/mount_opts.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr/utils/mount_opts.c b/usr/utils/mount_opts.c index 05d1729..bb26c7d 100644 --- a/usr/utils/mount_opts.c +++ b/usr/utils/mount_opts.c @@ -89,8 +89,13 @@ parse_mount_options(char *arg, unsigned long rwflag, struct extra_opts *extra) break; } - if (res != 0 && s[0]) - add_extra_option(extra, opt); + if (res != 0 && s[0]) { + if (!strcmp(opt, "defaults")) + rwflag &= ~(MS_RDONLY|MS_NOSUID|MS_NODEV| + MS_NOEXEC|MS_SYNCHRONOUS); + else + add_extra_option(extra, opt); + } } return rwflag; -- 2.30.2