Skip to content

Commit b2d5d69

Browse files
authored
Add partition manager (#286)
Implements #262. Goal of this PR is to have a crate that enables a storage device to be separated into partitions statically and checked. It achieves this by providing a general partition framework, implement typical traits from `embedded-storage-async` and `block-device-driver`, and have proc macros generate partition map definitions.
1 parent c1db685 commit b2d5d69

File tree

26 files changed

+2195
-1
lines changed

26 files changed

+2195
-1
lines changed

Cargo.lock

Lines changed: 136 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ members = [
66
"embedded-service",
77
"espi-service",
88
"hid-service",
9+
"partition-manager/generation",
10+
"partition-manager/macros",
11+
"partition-manager/partition-manager",
912
"platform-service",
1013
"power-button-service",
1114
"power-policy-service",
@@ -21,9 +24,12 @@ license = "MIT"
2124
repository = "https://github.com/OpenDevicePartnership/embedded-services"
2225

2326
[workspace.dependencies]
27+
aligned = "0.4"
28+
anyhow = "1.0"
2429
bitfield = "0.17.0"
2530
bitflags = "2.8.0"
2631
bitvec = { version = "1.0.1", default-features = false }
32+
block-device-driver = "0.2"
2733
cfg-if = "1.0.0"
2834
chrono = { version = "0.4", default-features = false }
2935
cortex-m = "0.7.6"
@@ -52,7 +58,11 @@ fixed = "1.23.1"
5258
heapless = "0.8.*"
5359
log = "0.4"
5460
postcard = "1.*"
61+
proc-macro2 = "1.0"
62+
quote = "1.0"
5563
rand_core = "0.6.4"
5664
serde = { version = "1.0.*", default-features = false }
65+
toml = { version = "0.8", default-features = false }
66+
syn = "2.0"
5767
tps6699x = { git = "https://github.com/OpenDevicePartnership/tps6699x" }
5868
tokio = { version = "1.42.0" }

partition-manager/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Partition manager #![no_std]
2+
3+
> Statically checked storage device mapping
4+
5+
Please check out the `./partition-manager` subfolder [README](./partition-manager/README.md).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[package]
2+
name = "partition-manager-generation"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
7+
8+
[target.'cfg(not(target_os = "none"))'.dependencies]
9+
proc-macro2.workspace = true
10+
syn.workspace = true
11+
quote.workspace = true
12+
anyhow.workspace = true
13+
14+
serde = { workspace = true, features = ["std", "derive"] }
15+
16+
toml = { workspace = true, features = [
17+
"preserve_order",
18+
"parse",
19+
], default-features = false, optional = true }
20+
21+
[features]
22+
default = ["toml"]
23+
toml = ["dep:toml"]

0 commit comments

Comments
 (0)