diff options
Diffstat (limited to 'ayafs-core/src')
-rw-r--r-- | ayafs-core/src/bin/main.rs | 16 | ||||
-rw-r--r-- | ayafs-core/src/bin/mem_run.rs | 15 |
2 files changed, 19 insertions, 12 deletions
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); diff --git a/ayafs-core/src/bin/mem_run.rs b/ayafs-core/src/bin/mem_run.rs index 7ba6f4e..0ba4c9c 100644 --- a/ayafs-core/src/bin/mem_run.rs +++ b/ayafs-core/src/bin/mem_run.rs @@ -15,7 +15,7 @@ struct Args { #[arg(long)] auto_unmount: bool, #[arg(long)] - allow_root: bool, + allow_other: bool, } fn main() { @@ -30,12 +30,15 @@ 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(MemoryDisk::new(16384)); let filesystem = AyaFS::new(disk, 16384, get_current_uid(), get_current_gid()); |