tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
stratisd: 3.2.2 -> 3.3.0
Nick Cao
3 years ago
1ef31a55
b5934423
+8
-53
2 changed files
expand all
collapse all
unified
split
pkgs
tools
filesystems
stratisd
default.nix
paths.patch
+8
-11
pkgs/tools/filesystems/stratisd/default.nix
···
4
, rustPlatform
5
, pkg-config
6
, asciidoc
0
7
, dbus
8
, cryptsetup
9
, util-linux
···
23
24
stdenv.mkDerivation rec {
25
pname = "stratisd";
26
-
version = "3.2.2";
27
28
src = fetchFromGitHub {
29
owner = "stratis-storage";
30
repo = pname;
31
rev = "v${version}";
32
-
hash = "sha256-dNbbKGRLSYVnPdKfxlLIwXNEf7P6EvGbOp8sfpaw38g=";
33
};
34
35
cargoDeps = rustPlatform.fetchCargoTarball {
36
inherit src;
37
-
hash = "sha256-tJT0GKLpZtiQ/AZACkNeC3zgso54k/L03dFI0m1Jbls=";
38
};
39
40
-
patches = [
41
-
# Allow overriding BINARIES_PATHS with environment variable at compile time
42
-
./paths.patch
43
-
];
44
-
45
postPatch = ''
46
substituteInPlace udev/61-stratisd.rules \
47
--replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \
···
61
rust.rustc
62
pkg-config
63
asciidoc
0
64
];
65
66
buildInputs = [
···
70
udev
71
];
72
73
-
BINARIES_PATHS = lib.makeBinPath ([
74
xfsprogs
75
thin-provisioning-tools
76
udev
···
84
coreutils
85
]);
86
87
-
makeFlags = [ "PREFIX=${placeholder "out"}" ];
88
-
buildFlags = [ "release" "release-min" "docs/stratisd.8" ];
89
90
doCheck = true;
91
checkTarget = "test";
···
4
, rustPlatform
5
, pkg-config
6
, asciidoc
7
+
, ncurses
8
, dbus
9
, cryptsetup
10
, util-linux
···
24
25
stdenv.mkDerivation rec {
26
pname = "stratisd";
27
+
version = "3.3.0";
28
29
src = fetchFromGitHub {
30
owner = "stratis-storage";
31
repo = pname;
32
rev = "v${version}";
33
+
hash = "sha256-6CCSs359gPwUMQ2SFpxaWHXCjqqgIbvCaPL2zLuYRKg=";
34
};
35
36
cargoDeps = rustPlatform.fetchCargoTarball {
37
inherit src;
38
+
hash = "sha256-9nE/SFGv1tYyGDdemCahxHlRnLms3eK0r4XQMhQBjSQ=";
39
};
40
0
0
0
0
0
41
postPatch = ''
42
substituteInPlace udev/61-stratisd.rules \
43
--replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \
···
57
rust.rustc
58
pkg-config
59
asciidoc
60
+
ncurses # tput
61
];
62
63
buildInputs = [
···
67
udev
68
];
69
70
+
EXECUTABLES_PATHS = lib.makeBinPath ([
71
xfsprogs
72
thin-provisioning-tools
73
udev
···
81
coreutils
82
]);
83
84
+
makeFlags = [ "PREFIX=${placeholder "out"}" "INSTALL=install" ];
85
+
buildFlags = [ "build" "build-min" "docs/stratisd.8" ];
86
87
doCheck = true;
88
checkTarget = "test";
-42
pkgs/tools/filesystems/stratisd/paths.patch
···
1
-
diff --git a/src/engine/strat_engine/cmd.rs b/src/engine/strat_engine/cmd.rs
2
-
index daaff70f..ed528f7f 100644
3
-
--- a/src/engine/strat_engine/cmd.rs
4
-
+++ b/src/engine/strat_engine/cmd.rs
5
-
@@ -39,8 +39,6 @@ use crate::{
6
-
// The maximum allowable size of the thinpool metadata device
7
-
const MAX_META_SIZE: MetaBlocks = MetaBlocks(255 * ((1 << 14) - 64));
8
-
9
-
-const BINARIES_PATHS: [&str; 4] = ["/usr/sbin", "/sbin", "/usr/bin", "/bin"];
10
-
-
11
-
/// Find the binary with the given name by looking in likely locations.
12
-
/// Return None if no binary was found.
13
-
/// Search an explicit list of directories rather than the user's PATH
14
-
@@ -49,7 +47,7 @@ const BINARIES_PATHS: [&str; 4] = ["/usr/sbin", "/sbin", "/usr/bin", "/bin"];
15
-
fn find_binary(name: &str) -> Option<PathBuf> {
16
-
BINARIES_PATHS
17
-
.iter()
18
-
- .map(|pre| [pre, name].iter().collect::<PathBuf>())
19
-
+ .map(|pre| [pre, &name.into()].iter().collect::<PathBuf>())
20
-
.find(|path| path.exists())
21
-
}
22
-
23
-
@@ -147,6 +145,10 @@ lazy_static! {
24
-
.and_then(|mut hm| hm
25
-
.remove(CLEVIS)
26
-
.and_then(|c| hm.remove(JOSE).map(|j| (c, j))));
27
-
+ static ref BINARIES_PATHS: Vec<PathBuf> = match std::option_env!("BINARIES_PATHS") {
28
-
+ Some(paths) => std::env::split_paths(paths).collect(),
29
-
+ None => ["/usr/sbin", "/sbin", "/usr/bin", "/bin"].iter().map(|p| p.into()).collect(),
30
-
+ };
31
-
}
32
-
33
-
/// Verify that all binaries that the engine might invoke are available at some
34
-
@@ -160,7 +162,7 @@ pub fn verify_binaries() -> StratisResult<()> {
35
-
name,
36
-
BINARIES_PATHS
37
-
.iter()
38
-
- .map(|p| format!("\"{}\"", p))
39
-
+ .map(|p| format!("\"{}\"", p.display()))
40
-
.collect::<Vec<_>>()
41
-
.join(", "),
42
-
))),
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0