chore(workspace): move most things into the workspace

This commit is contained in:
2025-11-02 22:35:07 -05:00
parent 9c12e5f12f
commit ccc75a2e14
4 changed files with 39 additions and 49 deletions

32
Cargo.lock generated
View File

@@ -8,17 +8,6 @@ version = "1.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "async-trait"
version = "0.1.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "bit_field" name = "bit_field"
version = "0.10.3" version = "0.10.3"
@@ -40,12 +29,6 @@ dependencies = [
"generic-array", "generic-array",
] ]
[[package]]
name = "bytes"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.4" version = "1.0.4"
@@ -87,9 +70,10 @@ version = "0.0.17"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bitflags", "bitflags",
"hex",
"log", "log",
"serde", "serde",
"sha256", "sha2",
"toml", "toml",
"uefi", "uefi",
"uefi-raw", "uefi-raw",
@@ -233,18 +217,6 @@ dependencies = [
"digest", "digest",
] ]
[[package]]
name = "sha256"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f880fc8562bdeb709793f00eb42a2ad0e672c4f883bbe59122b926eca935c8f6"
dependencies = [
"async-trait",
"bytes",
"hex",
"sha2",
]
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.108" version = "2.0.108"

View File

@@ -4,9 +4,28 @@ members = [
] ]
resolver = "3" resolver = "3"
[profile.dev] [workspace.package]
# We have to compile for opt-level = 2 due to optimization passes license = "Apache-2.0"
version = "0.0.17"
homepage = "https://sprout.edera.dev"
repository = "https://github.com/edera-dev/sprout"
edition = "2024"
[workspace.dependencies]
anyhow = "1.0.100"
bitflags = "2.10.0"
hex = "0.4.3"
log = "0.4.28"
serde = "1.0.228"
sha2 = "0.10.9"
toml = "0.9.8"
uefi = "0.36.0"
uefi-raw = "0.12.0"
# Common build profiles
# NOTE: We have to compile everything for opt-level = 2 due to optimization passes
# which don't handle the UEFI target properly. # which don't handle the UEFI target properly.
[profile.dev]
opt-level = 2 opt-level = 2
[profile.release] [profile.release]

View File

@@ -1,32 +1,30 @@
[package] [package]
name = "edera-sprout" name = "edera-sprout"
description = "Modern UEFI bootloader" description = "Modern UEFI bootloader"
license = "Apache-2.0" license.workspace = true
version = "0.0.17" version.workspace = true
homepage = "https://sprout.edera.dev" homepage.workspace = true
repository = "https://github.com/edera-dev/sprout" repository.workspace = true
edition = "2024" edition.workspace = true
[dependencies] [dependencies]
anyhow = "1.0.100" anyhow.workspace = true
bitflags = "2.10.0" bitflags.workspace = true
toml = "0.9.8" hex.workspace = true
log = "0.4.28" sha2.workspace = true
toml.workspace = true
log.workspace = true
[dependencies.serde] [dependencies.serde]
version = "1.0.228" workspace = true
features = ["derive"] features = ["derive"]
[dependencies.sha256]
version = "1.6.0"
default-features = false
[dependencies.uefi] [dependencies.uefi]
version = "0.36.0" workspace = true
features = ["alloc", "logger"] features = ["alloc", "logger"]
[dependencies.uefi-raw] [dependencies.uefi-raw]
version = "0.12.0" workspace = true
[[bin]] [[bin]]
name = "sprout" name = "sprout"

View File

@@ -1,4 +1,5 @@
use anyhow::{Context, Result, bail}; use anyhow::{Context, Result, bail};
use sha2::{Digest, Sha256};
use std::ops::Deref; use std::ops::Deref;
use uefi::boot::SearchType; use uefi::boot::SearchType;
use uefi::fs::{FileSystem, Path}; use uefi::fs::{FileSystem, Path};
@@ -201,7 +202,7 @@ pub fn combine_options<T: AsRef<str>>(options: impl Iterator<Item = T>) -> Strin
/// Produce a unique hash for the input. /// Produce a unique hash for the input.
/// This uses SHA-256, which is unique enough but relatively short. /// This uses SHA-256, which is unique enough but relatively short.
pub fn unique_hash(input: &str) -> String { pub fn unique_hash(input: &str) -> String {
sha256::digest(input.as_bytes()) hex::encode(Sha256::digest(input.as_bytes()))
} }
/// Represents the type of partition GUID that can be retrieved. /// Represents the type of partition GUID that can be retrieved.