bcachefs-tools/rust-src
TruongSinh Tran-Nguyen c1a8e27a3f chore(rust): add opt_get! and expose some FMODE_* as Rust const
In an effort to rewrite `bch2_read_super` from C to Rust,
it is neccessary to have `opt_get!` macro defined, and some
FMODE_* consts (defined as macro in `include/linux/blkdev.h`)
defined as Rust const.

Bindgen is currently unable to exapnd C functional macro [1],
this this commit use the workaround as introduced in [2].

[1] https://github.com/rust-lang/rust-bindgen/issues/753
[2] https://github.com/rust-lang/rust-bindgen/issues/753#issuecomment-608546390

Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
2023-04-27 19:23:17 -04:00
..
bch_bindgen chore(rust): add opt_get! and expose some FMODE_* as Rust const 2023-04-27 19:23:17 -04:00
src feat(cmd_mount): Add support for magic keyword OLD_BLKID_UUID 2023-04-26 17:46:23 -04:00
.gitignore Rust now integrated into bcachefs binary 2023-02-21 01:03:08 -05:00
Cargo.lock rust: Filesystem options now supported 2023-02-28 06:15:48 -05:00
Cargo.toml chore: logger for idiomatic style and expanded logging levels 2023-04-26 17:46:23 -04:00
README.md Rust now integrated into bcachefs binary 2023-02-21 01:03:08 -05:00
rustfmt.toml Rust now integrated into bcachefs binary 2023-02-21 01:03:08 -05:00

Usage

bcachefs-mount 0.1.0
Mount a bcachefs filesystem by its UUID

USAGE:
    bcachefs-mount [OPTIONS] <uuid> <mountpoint>

FLAGS:
    -h, --help       
            Prints help information

    -V, --version    
            Prints version information


OPTIONS:
    -o <options>                 
            Mount options [default: ]

    -p, --password <password>    
            Where the password would be loaded from.
            
            Possible values are: "fail" - don't ask for password, fail if filesystem is encrypted; "wait" - wait for
            password to become available before mounting; "ask" -  prompt the user for password; [default: fail]

ARGS:
    <uuid>          
            External UUID of the bcachefs filesystem

    <mountpoint>    
            Where the filesystem should be mounted

Caveats

  • --password ask is not yet implemented, but you can use --password wait, and load the key with bcachefs unlock.

Build

$ git submodule update --init --recursive
$ cargo build --release

Binary will be built in target/release/bcachefs-mount

Dependencies:

  • rust
  • blkid
  • uuid
  • liburcu
  • libsodium
  • zlib
  • liblz4
  • libzstd
  • libkeyutils