Skip to content

Commit

Permalink
Enable puzzlefs to be used as a MOUNT_HELPER in the LXC OCI template
Browse files Browse the repository at this point in the history
The mount-helper is called like this:
mount-helper mount --writable <oci_dir>:<oci_name> <mountpoint>
mount-helper umount <mountpoint>

I've added the support for the `--writable` flag that creates a writable
overlay on top of a PuzzleFS mountpoint (used as a lowerdir). This
requires root privileges.

I've also added the support for the `umount` subcommand which detects
whether the puzzlefs filesystem was mounted as a read-only fuse driver
or whether an overlay was created on top of it, and handles the
unmounting accordingly. Unmounting an overlay requires root privileges.

I've implemented the changes on the LXC side in [1].

[1] lxc/lxc#4483

Signed-off-by: Ariel Miculas-Trif <[email protected]>
  • Loading branch information
ariel-miculas committed Oct 3, 2024
1 parent e06329c commit 672bb0f
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 17 deletions.
81 changes: 65 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion exe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ edition = "2021"

[dependencies]
anyhow = "1.0.75"
nix = "0.27.1"
nix = {version = "0.27.1", features = ["mount"] }
clap = { version = "4.0.18", features = ["derive"] }
# Version 0.5 drops exit_action so we're stuck with 0.4
daemonize = "0.4.1"
Expand All @@ -26,6 +26,7 @@ syslog = "6.0.1"
os_pipe = "1.1.2"
puzzlefs-lib = { path = "../puzzlefs-lib", version = "0.2.0" }
hex = "0.4.3"
libmount = "0.1.15"

[dev-dependencies]
assert_cmd = "2.0.12"
Expand Down
Loading

0 comments on commit 672bb0f

Please sign in to comment.