Commit 2beb8ed3 authored by Jakob Unterwurzacher's avatar Jakob Unterwurzacher

example: loopback: implement -ro flag

Currently fails like this

	18:13:57.008805 Mount fail: read-only file system

because pollHack requires write access.

This will be fixed in pollHack in a later commit.

Change-Id: I37b459339eda2e8270ca8094455db3ddbf764911
parent f612a450
...@@ -46,6 +46,7 @@ func main() { ...@@ -46,6 +46,7 @@ func main() {
debug := flag.Bool("debug", false, "print debugging messages.") debug := flag.Bool("debug", false, "print debugging messages.")
other := flag.Bool("allow-other", false, "mount with -o allowother.") other := flag.Bool("allow-other", false, "mount with -o allowother.")
quiet := flag.Bool("q", false, "quiet") quiet := flag.Bool("q", false, "quiet")
ro := flag.Bool("ro", false, "mount read-only")
cpuprofile := flag.String("cpuprofile", "", "write cpu profile to this file") cpuprofile := flag.String("cpuprofile", "", "write cpu profile to this file")
memprofile := flag.String("memprofile", "", "write memory profile to this file") memprofile := flag.String("memprofile", "", "write memory profile to this file")
flag.Parse() flag.Parse()
...@@ -100,6 +101,9 @@ func main() { ...@@ -100,6 +101,9 @@ func main() {
// Make the kernel check file permissions for us // Make the kernel check file permissions for us
opts.MountOptions.Options = append(opts.MountOptions.Options, "default_permissions") opts.MountOptions.Options = append(opts.MountOptions.Options, "default_permissions")
} }
if *ro {
opts.MountOptions.Options = append(opts.MountOptions.Options, "ro")
}
// First column in "df -T": original dir // First column in "df -T": original dir
opts.MountOptions.Options = append(opts.MountOptions.Options, "fsname="+orig) opts.MountOptions.Options = append(opts.MountOptions.Options, "fsname="+orig)
// Second column in "df -T" will be shown as "fuse." + Name // Second column in "df -T" will be shown as "fuse." + Name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment