Skip to content

Commit

Permalink
blockdev: Add tool
Browse files Browse the repository at this point in the history
This supports most of the functionality; only missing functionality is
--report with no arguments.
  • Loading branch information
dezgeg committed Jan 18, 2025
1 parent 231cdb8 commit 8c98151
Show file tree
Hide file tree
Showing 8 changed files with 548 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ default = ["feat_common_core"]
uudoc = []

feat_common_core = [
"blockdev",
"ctrlaltdel",
"dmesg",
"fsfreeze",
Expand Down Expand Up @@ -67,6 +68,7 @@ phf = { workspace = true }
textwrap = { workspace = true }
uucore = { workspace = true }

blockdev = { optional = true, version = "0.0.1", package = "uu_blockdev", path = "src/uu/blockdev" }
ctrlaltdel = { optional = true, version = "0.0.1", package = "uu_ctrlaltdel", path = "src/uu/ctrlaltdel" }
dmesg = { optional = true, version = "0.0.1", package = "uu_dmesg", path = "src/uu/dmesg" }
fsfreeze = { optional = true, version = "0.0.1", package = "uu_fsfreeze", path = "src/uu/fsfreeze" }
Expand Down
19 changes: 19 additions & 0 deletions src/uu/blockdev/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "uu_blockdev"
version = "0.0.1"
edition = "2021"
description = "blockdev ~ Get or set various block device attributes."

[lib]
path = "src/blockdev.rs"

[[bin]]
name = "blockdev"
path = "src/main.rs"

[dependencies]
clap = { workspace = true }
linux-raw-sys = { workspace = true }
regex = { workspace = true }
sysinfo = { workspace = true }
uucore = { workspace = true }
8 changes: 8 additions & 0 deletions src/uu/blockdev/blockdev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# blockdev

```
blockdev <COMMAND...> <DEVICE...>
blockdev --report <DEVICE...>
```

Get or set various block device attributes.
Loading

0 comments on commit 8c98151

Please sign in to comment.