Fixes Rust panics if some C command (like fsck) returns a value bigger
than 255. The process exit code will be mangled but what can we do, it's
less confusing than a panic (that unfortunately doesn't print the return
value).
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
This would allow to supply the password via the plymouth password input.
If systemd-ask-password does not exist or fails to start, falls back to
the old-style password request.
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Same as it was in most previous releases. Without this, you may not see
any output for certain errors.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
This mostly tries to be similar to the default `env_logger` format but
instead of using the more vague target in the log message, we instead
put the file name and line number in the log.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
This sets the version, that can be read at build time using the
environment variable `CARGO_PKG_VERSION`, to the default
value (`0.0.0`).
Setting `package.version` in the Cargo manifest is mandatory for
publishing to crates.io. We're not publishing the crate currently, and
there isn't an obvious case for doing so in the future that comes to
mind.
Our sources are not using the version from cargo currently. `clap` and
some other dependencies may use them by default but still we don't use
that version in any outputs. Therefore, we should be fine without it.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
this is the mount helper's job, and since we're the mount helper...
fixes: xfstests generic/050
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
because rpassword unconditionally open()s /dev/tty, it fails with ENXIO
on the console without workarounds like busybox's cttyhack. in contrast,
bcachefs unlock works fine on console, so change the passphrase prompt
logic in mount to be closer to what it is in unlock.
Signed-off-by: Lauri Tirkkonen <lauri@hacktheplanet.fi>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
The debuginfo is used by the "bcachefs debug" and "bcachefs list_bkeys"
commands.
Rust 1.77 [1] changed Cargo's release profile to strip debuginfo by default,
but we always want it included.
[1] https://github.com/rust-lang/cargo/pull/13257
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
The second mount works if the device is already part of the `bcachefs
format` but fails if it's added afterwards. In particular the `blkid`
output is interesting.
This reverts commit 88aa61eb95.
No longer required because the added nixos-tests check already causes
the package to be built now.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
This in particular speeds up the dev/run/debug cycle for writing more
tests. Without this, the actual bcachefs-tools package will be rebuilt
by Nix all the time because of changes to files that are tracked by git.
Even when it's changes in parts that aren't relevant to that package
build such as `checks/*`.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Use nixos-test scaffolding to spawn VMs and run any scripts in
`checks/*.sh` as tests inside of the VM. This should lessen the risk of
any obvious breakage in the CI but needs more and better tests to cover
more commands.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Should provide us with better outputs on process failure, also makes
unwinding better and is generally recommended over `exit()`.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>