From: Ben Hutchings Date: Sat, 4 Oct 2014 15:32:39 +0000 (+0100) Subject: mount: Implement -o defaults X-Git-Tag: archive/raspbian/2.0.4-11+rpi1^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1ef77db7b5b8789d4c9c51c955fb0af81e8ef9e3;p=klibc.git 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 --- 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;