Move main avbroot code to a workspace member

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This commit is contained in:
Andrew Gunnerson
2023-08-30 18:54:29 -04:00
parent 44d62f5147
commit b92513609b
44 changed files with 85 additions and 84 deletions
+1 -1
View File
@@ -13,4 +13,4 @@
*.patched
# We do want the test images
!/tests/data/*.img
!/avbroot/tests/data/*.img
+3 -77
View File
@@ -1,81 +1,7 @@
[package]
name = "avbroot"
version = "0.1.0"
license = "GPL-3.0-only"
edition = "2021"
repository = "https://github.com/chenxiaolong/avbroot"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.75"
base64 = "0.21.3"
byteorder = "1.4.3"
clap = { version = "4.4.1", features = ["derive"] }
clap_complete = "4.4.0"
cms = { version = "0.2.2", features = ["std"] }
const-oid = "0.9.5"
ctrlc = "3.4.0"
flate2 = "1.0.27"
hex = "0.4.3"
lz4_flex = "0.11.1"
memchr = "2.6.0"
num-bigint-dig = "0.8.4"
num-traits = "0.2.16"
phf = { version = "0.11.2", features = ["macros"] }
pkcs8 = { version = "0.10.2", features = ["encryption", "pem"] }
quick-protobuf = "0.8.1"
rand = "0.8.5"
rayon = "1.7.0"
regex = { version = "1.9.4", default-features = false, features = ["perf", "std"] }
# We use ring instead of sha2 for sha256 digest computation of large files
# because sha2 is significantly slower on older x86_64 CPUs without the SHA-NI
# instructions. sha2 is still used for signing purposes.
# https://github.com/RustCrypto/hashes/issues/327
ring = "0.16.20"
rpassword = "7.2.0"
rsa = { version = "0.9.2", features = ["sha1", "sha2"] }
serde = { version = "1.0.188", features = ["derive"] }
sha1 = "0.10.5"
sha2 = "0.10.7"
tempfile = "3.8.0"
thiserror = "1.0.47"
toml_edit = { version = "0.19.14", features = ["serde"] }
topological-sort = "0.2.2"
x509-cert = { version = "0.2.4", features = ["builder"] }
xz2 = "0.1.7"
# There's an upstream bug that causes an infinite loop in the write::BzDecoder
# destructor if the decoder is fed invalid data. While this never happens during
# normal operation, it is possible to run into this by running `ota extract`
# against a `--stripped` OTA file.
# https://github.com/alexcrichton/bzip2-rs/pull/99
[dependencies.bzip2]
git = "https://github.com/jongiddy/bzip2-rs"
rev = "2aefcb4d3634de1df226c73d93f758d65228bb8c"
# https://github.com/zip-rs/zip/pull/383
[dependencies.zip]
git = "https://github.com/chenxiaolong/zip"
rev = "989101f9384b9e94e36e6e9e0f51908fdf98bde6"
default-features = false
features = ["deflate"]
[target.'cfg(unix)'.dependencies]
rustix = { version = "0.38.9", default-features = false, features = ["process"] }
[build-dependencies]
# Disable the clap feature since it pulls in an ancient version of clap.
pb-rs = { version = "0.10.0", default-features = false }
[dev-dependencies]
assert_matches = "1.5.0"
[features]
static = ["bzip2/static", "xz2/static"]
[workspace]
members = ["e2e", "xtask"]
default-members = ["avbroot"]
members = ["avbroot", "e2e", "xtask"]
resolver = "2"
[workspace.package]
version = "0.1.0"
+76
View File
@@ -0,0 +1,76 @@
[package]
name = "avbroot"
version.workspace = true
license.workspace = true
edition.workspace = true
repository.workspace = true
publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.75"
base64 = "0.21.3"
byteorder = "1.4.3"
clap = { version = "4.4.1", features = ["derive"] }
clap_complete = "4.4.0"
cms = { version = "0.2.2", features = ["std"] }
const-oid = "0.9.5"
ctrlc = "3.4.0"
flate2 = "1.0.27"
hex = "0.4.3"
lz4_flex = "0.11.1"
memchr = "2.6.0"
num-bigint-dig = "0.8.4"
num-traits = "0.2.16"
phf = { version = "0.11.2", features = ["macros"] }
pkcs8 = { version = "0.10.2", features = ["encryption", "pem"] }
quick-protobuf = "0.8.1"
rand = "0.8.5"
rayon = "1.7.0"
regex = { version = "1.9.4", default-features = false, features = ["perf", "std"] }
# We use ring instead of sha2 for sha256 digest computation of large files
# because sha2 is significantly slower on older x86_64 CPUs without the SHA-NI
# instructions. sha2 is still used for signing purposes.
# https://github.com/RustCrypto/hashes/issues/327
ring = "0.16.20"
rpassword = "7.2.0"
rsa = { version = "0.9.2", features = ["sha1", "sha2"] }
serde = { version = "1.0.188", features = ["derive"] }
sha1 = "0.10.5"
sha2 = "0.10.7"
tempfile = "3.8.0"
thiserror = "1.0.47"
toml_edit = { version = "0.19.14", features = ["serde"] }
topological-sort = "0.2.2"
x509-cert = { version = "0.2.4", features = ["builder"] }
xz2 = "0.1.7"
# There's an upstream bug that causes an infinite loop in the write::BzDecoder
# destructor if the decoder is fed invalid data. While this never happens during
# normal operation, it is possible to run into this by running `ota extract`
# against a `--stripped` OTA file.
# https://github.com/alexcrichton/bzip2-rs/pull/99
[dependencies.bzip2]
git = "https://github.com/jongiddy/bzip2-rs"
rev = "2aefcb4d3634de1df226c73d93f758d65228bb8c"
# https://github.com/zip-rs/zip/pull/383
[dependencies.zip]
git = "https://github.com/chenxiaolong/zip"
rev = "989101f9384b9e94e36e6e9e0f51908fdf98bde6"
default-features = false
features = ["deflate"]
[target.'cfg(unix)'.dependencies]
rustix = { version = "0.38.9", default-features = false, features = ["process"] }
[build-dependencies]
# Disable the clap feature since it pulls in an ancient version of clap.
pb-rs = { version = "0.10.0", default-features = false }
[dev-dependencies]
assert_matches = "1.5.0"
[features]
static = ["bzip2/static", "xz2/static"]
View File
View File
View File
View File
View File
+2 -2
View File
@@ -13,11 +13,11 @@ use avbroot::{self, format::avb};
fn get_test_key() -> RsaPrivateKey {
let data = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
env!("CARGO_WORKSPACE_DIR"),
"/e2e/keys/TEST_KEY_DO_NOT_USE_avb.key",
));
let passphrase = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
env!("CARGO_WORKSPACE_DIR"),
"/e2e/keys/TEST_KEY_DO_NOT_USE_avb.passphrase",
));
@@ -15,11 +15,11 @@ use rsa::RsaPrivateKey;
fn get_test_key() -> RsaPrivateKey {
let data = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
env!("CARGO_WORKSPACE_DIR"),
"/e2e/keys/TEST_KEY_DO_NOT_USE_avb.key",
));
let passphrase = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
env!("CARGO_WORKSPACE_DIR"),
"/e2e/keys/TEST_KEY_DO_NOT_USE_avb.passphrase",
));
+1 -1
View File
@@ -10,7 +10,7 @@ publish = false
[dependencies]
anyhow = "1.0.75"
avbroot = { path = ".." }
avbroot = { path = "../avbroot" }
clap = { version = "4.4.1", features = ["derive"] }
ctrlc = "3.4.0"
hex = { version = "0.4.3", features = ["serde"] }
-1
View File
@@ -20,7 +20,6 @@ fn update_cargo_version(version: &str) -> Result<()> {
let data = fs::read_to_string(&path)?;
let mut document: Document = data.parse()?;
document["package"]["version"] = value(version.clone());
document["workspace"]["package"]["version"] = value(version.clone());
fs::write(path, document.to_string())?;