Skip to content

Commit

Permalink
strip useless RPATH when verifying ipk
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Sep 30, 2023
1 parent 4954e87 commit 509c5da
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 70 deletions.
83 changes: 47 additions & 36 deletions Cargo.lock

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

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"common/fw",
"common/bin",
Expand All @@ -9,3 +10,11 @@ members = [
"packages/fw-extract",
"packages/gen-manifest",
]

[workspace.dependencies]
clap = "4.4.6"
regex = "1.9.5"
serde = "1.0.188"
serde_json = "1.0.107"
semver = "1.0.19"
path-slash = "0.2.1"
6 changes: 3 additions & 3 deletions common/bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2021"

[dependencies]
elf = "0.7.2"
serde = { version = "1.0.183", features = ["derive"] }
serde_json = "1.0.105"
semver = "1.0.18"
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
semver = { workspace = true }

[features]
linux-install = []
6 changes: 3 additions & 3 deletions common/fw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
semver = "1.0.18"
serde = { version = "1.0.183", features = ["derive"] }
serde_json = "1.0.105"
semver = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }

[dependencies.bin-lib]
path = "../bin"
Expand Down
9 changes: 5 additions & 4 deletions common/ipk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[package]
name = "ipk-lib"
version = "0.1.1"
version = "0.1.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = { version = "1.0.183", features = ["derive"] }
serde_json = "1.0.105"
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
debpkg = "0.6.0"
tempfile = "3.8.0"
path-slash = "0.2.1"
path-slash = { workspace = true }
common-path = "1.0.0"

[dependencies.bin-lib]
path = "../bin"
17 changes: 11 additions & 6 deletions common/ipk/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::fs;
use std::fs::File;
use std::io::{Error, ErrorKind};
use std::path::{Path, PathBuf};
use common_path::common_path;

use path_slash::CowExt;

Expand Down Expand Up @@ -137,15 +138,19 @@ impl<T> Component<T> {
where
P: AsRef<Path>,
{
let origin = bin_path.as_ref().parent().unwrap();
return rpath
.iter()
.filter_map(|p| {
PathBuf::from(p.replace(
"$ORIGIN",
bin_path.as_ref().parent().unwrap().to_str().unwrap(),
))
.canonicalize()
.ok()
PathBuf::from(p.replace("$ORIGIN", origin.to_string_lossy().as_ref()))
.canonicalize()
.ok()
})
.filter(|p| {
let Some(common) = common_path(&p, &origin) else {
return false;
};
return common.components().count() > 1;
})
.collect();
}
Expand Down
6 changes: 3 additions & 3 deletions packages/elf-verify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ authors = ["Mariotaku Lee <[email protected]>"]
license = "Apache-2.0"

[dependencies]
serde = "1.0.183"
serde_json = "1.0.96"
semver = "1.0.18"
serde = { workspace = true }
serde_json = { workspace = true }
semver = { workspace = true }

[dependencies.clap]
version = "4.3.23"
Expand Down
10 changes: 5 additions & 5 deletions packages/fw-extract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ license = "Apache-2.0"
description = "Firmware symbols data and extractor utility"

[dependencies]
regex = "1"
path-slash = "0.2.1"
serde = "1.0.183"
serde_json = "1.0.105"
semver = "1.0.18"
regex = { workspace = true }
path-slash = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
semver = { workspace = true }
fw-lib = { path = "../../common/fw" }
bin-lib = { path = "../../common/bin" }

Expand Down
8 changes: 4 additions & 4 deletions packages/gen-manifest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ license = "Apache-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = { version = "1.0.183", features = ["derive"] }
serde_json = "1.0.105"
clap = { version = "4.3.23", features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
clap = { workspace = true, features = ["derive"] }
ipk-lib = { path = "../../common/ipk" }
sha256 = "1.3.0"
sha256 = "1.4.0"

[package.metadata.deb]
name = "webosbrew-toolbox-gen-manifest"
Expand Down
12 changes: 6 additions & 6 deletions packages/ipk-verify/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = "ipk-verify"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
description = "Command line tool for checking symbols in an exectuable and libraries in an IPK file"
authors = ["Mariotaku Lee <[email protected]>"]
license = "Apache-2.0"

[dependencies]
serde = "1.0.183"
serde_json = "1.0.105"
serde = { workspace = true }
serde_json = { workspace = true }
debpkg = "0.6.0"
tempfile = "3.8.0"
path-slash = "0.2.1"
path-slash = { workspace = true }
prettytable-rs = "^0.10"
semver = "1.0.18"
semver = { workspace = true }
is-terminal = "0.4.9"
term = "0.7.0"
clap = { version = "4.3.23", features = ["derive"] }
clap = { version = "4.4.6", features = ["derive"] }
verify-lib = { path = "../../common/verify", features = ["ipk"] }

[dependencies.fw-lib]
Expand Down

0 comments on commit 509c5da

Please sign in to comment.