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~1^2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1b8eff69cda7ccd4f1f0c461a74a74ef6a7052a7;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;