diff --git a/Cargo.lock b/Cargo.lock index a470b98b49..756eb376f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -163,17 +163,6 @@ version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" -[[package]] -name = "archive-common" -version = "0.1.0" -dependencies = [ - "anyhow", - "log", - "pathdiff", - "plain", - "redox-initfs", -] - [[package]] name = "arrayvec" version = "0.7.6" @@ -1750,10 +1739,6 @@ dependencies = [ name = "redox-initfs" version = "0.2.0" dependencies = [ - "anyhow", - "archive-common", - "env_logger", - "log", "plain", ] @@ -1762,10 +1747,10 @@ name = "redox-initfs-tools" version = "0.2.0" dependencies = [ "anyhow", - "archive-common", "clap 4.5.58", "env_logger", "log", + "pathdiff", "plain", "redox-initfs", "twox-hash", diff --git a/Cargo.toml b/Cargo.toml index cd662d6bdc..f087b5a050 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ members = [ "daemon", "init", "initfs", - "initfs/archive-common", "initfs/tools", "ipcd", "logd", diff --git a/initfs/Cargo.toml b/initfs/Cargo.toml index b7a4fb48da..96980c9654 100644 --- a/initfs/Cargo.toml +++ b/initfs/Cargo.toml @@ -14,10 +14,3 @@ plain = "0.2" default = ["std"] std = [] - -[dev-dependencies] -# FIXME remove loggers -anyhow.workspace = true -archive-common = {path = "archive-common"} -env_logger = "0.8" -log.workspace = true diff --git a/initfs/archive-common/Cargo.toml b/initfs/archive-common/Cargo.toml deleted file mode 100644 index 04b681190c..0000000000 --- a/initfs/archive-common/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "archive-common" -version = "0.1.0" -authors = ["4lDO2 <4lDO2@protonmail.com>", "Kamil Koczurek "] -edition = "2021" - -[dependencies] -anyhow.workspace = true -log.workspace = true -pathdiff = "0.2.1" -plain = "0.2" -redox-initfs = {path = ".."} diff --git a/initfs/tools/Cargo.toml b/initfs/tools/Cargo.toml index 8305e5cc36..8c4a263b91 100644 --- a/initfs/tools/Cargo.toml +++ b/initfs/tools/Cargo.toml @@ -21,8 +21,8 @@ anyhow.workspace = true clap = {version = "4", features = ["cargo"]} env_logger = "0.8" log.workspace = true +pathdiff = "0.2.1" plain = "0.2" twox-hash = "1.6" -archive-common = {path = "../archive-common"} redox-initfs = {path = ".."} diff --git a/initfs/data/foo/file-link.txt b/initfs/tools/data/foo/file-link.txt similarity index 100% rename from initfs/data/foo/file-link.txt rename to initfs/tools/data/foo/file-link.txt diff --git a/initfs/data/foo/file.txt b/initfs/tools/data/foo/file.txt similarity index 100% rename from initfs/data/foo/file.txt rename to initfs/tools/data/foo/file.txt diff --git a/initfs/tools/out.img b/initfs/tools/out.img new file mode 100644 index 0000000000..13de974a37 Binary files /dev/null and b/initfs/tools/out.img differ diff --git a/initfs/tools/src/bin/archive.rs b/initfs/tools/src/bin/archive.rs index 5e6291417a..128e2ab6a9 100644 --- a/initfs/tools/src/bin/archive.rs +++ b/initfs/tools/src/bin/archive.rs @@ -3,7 +3,7 @@ use std::path::Path; use anyhow::{Context, Result}; use clap::{Arg, Command}; -use archive_common::{self as archive, Args, DEFAULT_MAX_SIZE}; +use redox_initfs_tools::{self as archive, Args, DEFAULT_MAX_SIZE}; fn main() -> Result<()> { let matches = Command::new("redox-initfs-ar") diff --git a/initfs/archive-common/src/lib.rs b/initfs/tools/src/lib.rs similarity index 100% rename from initfs/archive-common/src/lib.rs rename to initfs/tools/src/lib.rs diff --git a/initfs/tests/archive_and_read.rs b/initfs/tools/tests/archive_and_read.rs similarity index 93% rename from initfs/tests/archive_and_read.rs rename to initfs/tools/tests/archive_and_read.rs index 00880b878a..1a7d8b5365 100644 --- a/initfs/tests/archive_and_read.rs +++ b/initfs/tools/tests/archive_and_read.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, path::Path}; -use anyhow::{Context, Result, anyhow}; +use anyhow::{anyhow, Context, Result}; use redox_initfs::{InitFs, InodeKind, InodeStruct}; #[derive(Debug, Clone, PartialEq)] @@ -74,13 +74,13 @@ fn build_tree<'a>(fs: InitFs<'a>, inode: InodeStruct<'a>) -> anyhow::Result Result<()> { env_logger::init(); - let args = archive_common::Args { + let args = redox_initfs_tools::Args { destination_path: Path::new("out.img"), source: Path::new("data"), bootstrap_code: None, - max_size: archive_common::DEFAULT_MAX_SIZE, + max_size: redox_initfs_tools::DEFAULT_MAX_SIZE, }; - archive_common::archive(&args).context("failed to archive")?; + redox_initfs_tools::archive(&args).context("failed to archive")?; let data = std::fs::read(args.destination_path).context("failed to read new archive")?; let filesystem =