-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SC64][SW] Add inital fuse support #97
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
**/*.zip | ||
|
||
!**/.vscode/tasks.json | ||
sw/deployer/.idea/ | ||
.idea/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,11 @@ rust-ini = "0.18.0" | |
serial2 = "0.2.26" | ||
serialport = "4.4.0" | ||
|
||
[target.'cfg(unix)'.dependencies] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is anything preventing this code from working on macOS? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my understanding "unix" does also include macOS? I didn't test it yet though |
||
fuse_mt = "0.6.1" | ||
libc = "0.2.161" | ||
log = "0.4.22" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this even needed? |
||
|
||
[profile.release] | ||
lto = true | ||
strip = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,6 +272,14 @@ enum SDCommands { | |
/// Format the SD card | ||
#[command(name = "mkfs")] | ||
Format, | ||
|
||
/// Mount the SD card | ||
#[command(name = "fuse")] | ||
#[cfg(unix)] | ||
Fuse { | ||
/// Path to the directory | ||
mount_path: PathBuf, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the name of parameter to |
||
}, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
|
@@ -990,6 +998,12 @@ fn handle_sd_command(connection: Connection, command: &SDCommands) -> Result<(), | |
} | ||
log_wait(format!("Formatting the SD card"), || ff.mkfs())?; | ||
} | ||
#[cfg(unix)] | ||
SDCommands::Fuse { mount_path } => { | ||
let fuse_args = [std::ffi::OsStr::new("-o"), std::ffi::OsStr::new("fsname=passthrufs,allow_other,auto_unmount")]; | ||
|
||
fuse_mt::mount(fuse_mt::FuseMT::new(ff, 1), mount_path, &fuse_args[..])?; | ||
} | ||
} | ||
|
||
Ok(()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
**/.idea
instead of creating specific entries. Please keep the style consistent by moving it above!..
entry, and don't forget to sort entries alphabetically.