Skip to content
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

File mounter refactoring #105

Merged
merged 8 commits into from
Feb 21, 2024
Merged

File mounter refactoring #105

merged 8 commits into from
Feb 21, 2024

Conversation

florianhartung
Copy link
Collaborator

This PR mostly refactors the FileMounter to be more intuitive to use.

The FileMounter is just a light wrapper around the nix::mount call. It is moved to a separate submodule to keep things organized and modular.
…r initialization

The use of an associated function `FileMounter::from_paths(PathBuf, PathBuf)` is more intuitive than using `TryFrom<&(PathBuf, PathBuf)>`.
…o relative path

If a FileMounter is initialized with an absolute target path, this path is converted to a relative path by stripping the first '/'. This is a hidden conversion not documented anywhere, which may lead to unexpected behaviour. The conversion is now replaced with an error stating that the target directory must be relative.
…relative

Previously absolute paths got converted silently into relative ones by stripping the first '/'. Now that this conversion is removed, the dev_random example is also required to use relative paths.
…bsolute

The target path is then internally converted into a relative one, so it can be appended to the partitions base directory.
@sevenautumns sevenautumns merged commit b565773 into main Feb 21, 2024
10 checks passed
@sevenautumns sevenautumns deleted the file-mounter-refactoring branch February 21, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants