John Titor
73a271e130
nix: add meta.mainProgram to allow directly running from this repo
2024-07-31 22:37:13 +05:30
koverstreet
c60ce81890
Merge pull request #323 from koverstreet/update_flake_lock_action
...
flake.lock: Update
2024-07-30 20:46:21 -04:00
github-actions[bot]
1eaac529af
flake.lock: Update
...
Flake lock file updates:
• Updated input 'crane':
'github:ipetkov/crane/8a68b987c476a33e90f203f0927614a75c3f47ea?narHash=sha256-a0G1NvyXGzdwgu6e1HQpmK5R5yLsfxeBe07nNDyYd%2Bg%3D' (2024-07-18)
→ 'github:ipetkov/crane/529c1a0b1f29f0d78fa3086b8f6a134c71ef3aaf?narHash=sha256-k3oiD2z2AAwBFLa4%2BxfU%2B7G5fisRXfkvrMTCJrjZzXo%3D' (2024-07-24)
• Updated input 'fenix':
'github:nix-community/fenix/d3121c162a1fa4fabcb9af9642d50e8b05ddfe83?narHash=sha256-AJjRiL2diAitpARbE9bUTlgtqHC8QS1ImXNaXMRhKoU%3D' (2024-07-20)
→ 'github:nix-community/fenix/483df76def3e5010d709aa3a0418ba2088503994?narHash=sha256-DfGaJtgrzcwPQYLTvjL1KaVIjpvi85b2MpM6yEGvJzM%3D' (2024-07-30)
• Updated input 'fenix/rust-analyzer-src':
'github:rust-lang/rust-analyzer/b333f85a9dc06a45d9eb126c6371414c49b46784?narHash=sha256-23zmEelXzAvnfMlLsJ6a6P7yNiI9WOUrS9xh9dXVc/U%3D' (2024-07-19)
→ 'github:rust-lang/rust-analyzer/a021b85be57d34b1eed687fcafd5d5ec64b2d853?narHash=sha256-KxjkPVn9rQqYam6DhiN/V2NcMXtYW25maxkJoiVMpmE%3D' (2024-07-29)
• Updated input 'nixpkgs':
'github:nixos/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374?narHash=sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0%3D' (2024-07-19)
→ 'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28)
• Updated input 'treefmt-nix':
'github:numtide/treefmt-nix/888bfb10a9b091d9ed2f5f8064de8d488f7b7c97?narHash=sha256-wNXLQ/ATs1S4Opg1PmuNoJ%2BWamqj93rgZYV3Di7kxkg%3D' (2024-07-20)
→ 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7?narHash=sha256-uru7JzOa33YlSRwf9sfXpJG%2BUAV%2BbnBEYMjrzKrQZFw%3D' (2024-07-30)
2024-07-30 21:57:23 +00:00
koverstreet
1e5452a027
Merge pull request #322 from tmuehlbacher/fix-c-exit-code
...
Fix C exit code
2024-07-30 17:56:43 -04:00
Thomas Mühlbacher
fb6a56bb81
fix(nix): silence trace from treefmt-nix
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-30 23:35:39 +02:00
Thomas Mühlbacher
b4db95b16e
fix: don't try to convert C command returns to u8
...
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>
2024-07-30 23:33:09 +02:00
Kent Overstreet
57cd58db1e
mount: Fix UAF in option string handling
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-22 11:22:34 -04:00
koverstreet
dfc39d36c4
Merge pull request #317 from koverstreet/update_flake_lock_action
...
flake.lock: Update
2024-07-20 20:11:19 -04:00
github-actions[bot]
52dd7f6391
flake.lock: Update
...
Flake lock file updates:
• Updated input 'crane':
'github:ipetkov/crane/0095fd8ea00ae0a9e6014f39c375e40c2fbd3386?narHash=sha256-UKrfy/46YF2TRnxTtKCYzqf2f5ZPRRWwKCCJb7O5X8U%3D' (2024-06-15)
→ 'github:ipetkov/crane/8a68b987c476a33e90f203f0927614a75c3f47ea?narHash=sha256-a0G1NvyXGzdwgu6e1HQpmK5R5yLsfxeBe07nNDyYd%2Bg%3D' (2024-07-18)
• Updated input 'fenix':
'github:nix-community/fenix/ab655c627777ab5f9964652fe23bbb1dfbd687a8?narHash=sha256-ixopuTeTouxqTxfMuzs6IaRttbT8JqRW5C9Q/57WxQw%3D' (2024-06-08)
→ 'github:nix-community/fenix/d3121c162a1fa4fabcb9af9642d50e8b05ddfe83?narHash=sha256-AJjRiL2diAitpARbE9bUTlgtqHC8QS1ImXNaXMRhKoU%3D' (2024-07-20)
• Updated input 'fenix/rust-analyzer-src':
'github:rust-lang/rust-analyzer/48bbdd6a74f3176987d5c809894ac33957000d19?narHash=sha256-%2BlRAmz92CNUxorqWusgJbL9VE1eKCnQQojglRemzwkw%3D' (2024-06-05)
→ 'github:rust-lang/rust-analyzer/b333f85a9dc06a45d9eb126c6371414c49b46784?narHash=sha256-23zmEelXzAvnfMlLsJ6a6P7yNiI9WOUrS9xh9dXVc/U%3D' (2024-07-19)
• Updated input 'flake-parts':
'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8?narHash=sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw%3D' (2024-06-01)
→ 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7?narHash=sha256-pQMhCCHyQGRzdfAkdJ4cIWiw%2BJNuWsTX7f0ZYSyz0VY%3D' (2024-07-03)
• Updated input 'flake-parts/nixpkgs-lib':
'eb9ceca17d
.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01)
→ '5daf051448
.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01)
• Updated input 'nixpkgs':
'github:nixos/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13)
→ 'github:nixos/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374?narHash=sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0%3D' (2024-07-19)
• Updated input 'treefmt-nix':
'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81?narHash=sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls%3D' (2024-06-16)
→ 'github:numtide/treefmt-nix/888bfb10a9b091d9ed2f5f8064de8d488f7b7c97?narHash=sha256-wNXLQ/ATs1S4Opg1PmuNoJ%2BWamqj93rgZYV3Di7kxkg%3D' (2024-07-20)
2024-07-21 00:00:57 +00:00
koverstreet
da81a430b1
Merge pull request #316 from tmuehlbacher/disable-treefmt-check
...
ci: disable treefmt-check
2024-07-20 20:00:19 -04:00
Thomas Mühlbacher
b105a566ec
ci: disable treefmt-check
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-21 01:54:10 +02:00
koverstreet
201b1e8216
Merge pull request #315 from tmuehlbacher/variety-changes
...
Variety changes
2024-07-20 19:37:06 -04:00
Thomas Mühlbacher
cdcc241167
refactor: fix clippy lint
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-21 01:17:27 +02:00
Thomas Mühlbacher
7c68f2758d
style: nix fmt
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-21 01:17:27 +02:00
Thomas Mühlbacher
e218119b01
fix(logging): re-enable warn and error by default
...
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>
2024-07-21 01:16:28 +02:00
Thomas Mühlbacher
09cde4869d
feat(logging): switch to custom file:line format
...
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>
2024-07-21 01:16:28 +02:00
Thomas Mühlbacher
48c51020e5
build: rm package.version
from Cargo.toml
...
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>
2024-07-21 01:16:28 +02:00
Thomas Mühlbacher
ceb5e80d0e
chore: rm leftover gitignore entries
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-21 01:16:28 +02:00
Kent Overstreet
52b9e813bd
Rename option commands
...
set-option -> set-fs-option
setattr -> set-file-option
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-20 16:45:08 -04:00
Kent Overstreet
59ccde4a2f
mount: Fall back to read-only on -EROFS
...
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>
2024-07-20 11:33:46 -04:00
Kent Overstreet
60ff4f2f3c
bump version to 1.9.5
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-18 20:48:14 -04:00
Kent Overstreet
9058835b97
mount: Close devices before doing mount
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-18 20:48:14 -04:00
Kent Overstreet
573d635b2c
Update bcachefs sources to 1592eaa60418 bcachefs: Btree path tracepoints
2024-07-18 18:52:15 -04:00
Alexander Fougner
088e17a54a
ci: bump upload-artifact action
...
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2024-07-17 11:24:07 +02:00
Alexander Fougner
f8d6a67db0
ci: fix build for older debian deps
...
also drop ubuntu 20.04 from build matrix, include 24.04 instead which
is soon to go stable.
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2024-07-17 11:24:05 +02:00
Kent Overstreet
9020d202a4
kill old python tests
...
these were never used, kill a dependency
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-15 23:34:58 -04:00
Kent Overstreet
07913d1185
logging: kill quiet option
...
no logging by default, enabled with -v
logging by default broke fstests
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-15 23:20:54 -04:00
Kent Overstreet
e084e9f65b
update debian/ from upstream
...
'make deb' works
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-15 21:23:38 -04:00
Kent Overstreet
8594891772
cmd_set_option: Can now set device options
...
This allows data_allowed (and others) to be set on an offline
filesystem.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-15 20:17:37 -04:00
Kent Overstreet
32fbdff2a9
Update bcachefs sources to 4a7a003763f5 bcachefs: Opt_durability can now be set via bch2_opt_set_sb()
2024-07-15 20:17:37 -04:00
Kent Overstreet
2d60567685
fix silly clippy warning
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-14 22:16:13 -04:00
Lauri Tirkkonen
7ebd67e63a
mount: replace rpassword with rustix::termios
...
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>
2024-07-14 21:49:58 -04:00
Thomas Bertschinger
9e12dd06b9
include debuginfo in bcachefs binary by default
...
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>
2024-07-14 16:20:17 -04:00
Kent Overstreet
061a9ff2a3
Update bcachefs sources to 4d1d53862afb bcachefs: show none if label is not set
2024-07-14 15:20:16 -04:00
Kent Overstreet
a1764e00cd
Update bcachefs sources to 47d1e7a86242 bcachefs: drop packed, aligned from bkey_inode_buf
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-12 14:42:54 -04:00
Kent Overstreet
4be409afea
provide atomic64_try_cmpxchg() for 32bit
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-12 14:24:38 -04:00
Kent Overstreet
0f9b409aee
add i686-linux to nix flake
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-12 14:14:55 -04:00
Tavian Barnes
53d7722563
raid/cpu: Use memcpy() instead of type punning
...
The vendor may not be suitably aligned for uint32_t *.
Signed-off-by: Tavian Barnes <tavianator@tavianator.com>
2024-07-12 14:02:14 -04:00
Kent Overstreet
8b06995115
Update bcachefs sources to 2be6fc9b111c bcachefs: bch2_gc_btree() should not use btree_root_lock
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-05 09:16:45 -04:00
koverstreet
d061c7ea11
Merge pull request #309 from tmuehlbacher/improve-logging-exiting
...
Improve logging and exiting
2024-06-29 14:16:14 -04:00
Kent Overstreet
755788e2d6
Be explicit about which fsck implementation we're running
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-29 11:55:03 -04:00
Kent Overstreet
34b5654d9e
Update bcachefs sources to 9404a01d3dc5 bcachefs: Make read_only a mount option again, but hidden
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-28 18:26:04 -04:00
Thomas Mühlbacher
5cce07e986
feat: use ExitCode
over std::process:exit()
...
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>
2024-06-29 00:11:07 +02:00
Thomas Mühlbacher
176d76bceb
feat: add --quiet
cli argument
...
To silence log outputs on the CLI.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-28 21:29:47 +02:00
Thomas Mühlbacher
df09682869
feat: use env_logger
...
Instead of the custom logger impl, which limits the features we can
easily provide for users.
This introduces the `BCACHEFS_LOG` environment variable for setting the
log verbosity. Setting `BCACHEFS_LOG=trace`, e.g. in a test environment,
will yield all log messages.
Also I think it's reasonable to print INFO level logs by default.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-28 21:29:20 +02:00
koverstreet
b0eb3c2930
Merge pull request #305 from Artturin/use-ar-var
...
Use the AR variable in Makefile
2024-06-28 11:21:19 -04:00
Thomas Mühlbacher
7a17d429d5
feat(key): make UnlockPolicy::Fail
more useful
...
We already can check if an fs is encrypted with `bcachefs unlock -c`.
With this option we can now instead check if we have a key but not
actually mount by not specifying a mount point. e.g.
```sh
if bcachefs mount -k fail "$blkdev"`; then
echo "device is unlocked!"
fi
```
Not sure what the original intent for this was. For scenarios where
encryption is simply not supported on principle?
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26 19:14:45 +02:00
Thomas Mühlbacher
ee5f3719d3
refactor(key): split up unlocking functions
...
This is more similar to the existing C code, which is already in nice
small chunks.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26 19:14:45 +02:00
Thomas Mühlbacher
795585e289
refactor: simplify branches for parsing dev
...
Less repetition and no nested if/else.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26 19:14:45 +02:00
Thomas Mühlbacher
9bd3ada1d1
feat(mount): make unlock policy optional/explict
...
This changes the semantics of some arguments related to unlocking and
slightly changes the unlocking logic. Also update help formatting/text.
Instead of defaulting to `UnlockPolicy::Ask`, the argument becomes
optional. That means if it is specified, the user really wants that
specific policy. Similar to how `passphrase_file` also works.
This also extends `UnlockPolicy` to override `isatty` detection.
Fixes : #292
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26 19:14:45 +02:00