From 4e8448778cdec05f994f0e2772432fd90b6219d5 Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Fri, 1 Dec 2023 21:18:52 -0800 Subject: Fix mount options --- ayafs-core/src/bin/main.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ayafs-core/src/bin/main.rs') diff --git a/ayafs-core/src/bin/main.rs b/ayafs-core/src/bin/main.rs index a2d838c..e61f6c6 100644 --- a/ayafs-core/src/bin/main.rs +++ b/ayafs-core/src/bin/main.rs @@ -16,7 +16,7 @@ struct Args { #[arg(long)] auto_unmount: bool, #[arg(long)] - allow_root: bool, + allow_other: bool, } fn main() { @@ -32,12 +32,16 @@ fn main() { _ => LevelFilter::Trace, }; env_logger::builder().filter_level(log_level).init(); - let options = vec![ - // MountOption::RO, - MountOption::FSName("hello".to_string()), - MountOption::AutoUnmount, - MountOption::AllowRoot, + let mut options = vec![ + MountOption::FSName("Aya".to_string()), ]; + if args.auto_unmount { + options.push(MountOption::AutoUnmount); + } + if args.allow_other { + options.push(MountOption::AllowOther); + } + let disk = Arc::new(Disk::new(PathBuf::from(device_path))); let filesystem = AyaFS::load(disk); -- cgit v1.2.3-70-g09d2