Nick Cao 2024-01-24 13:34:29 -05:00
parent 0e148322b3
commit c30811fd17
No known key found for this signature in database
2 changed files with 46 additions and 53 deletions

View file

@ -411,17 +411,6 @@ dependencies = [
"termcolor", "termcolor",
] ]
[[package]]
name = "errno"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
dependencies = [
"errno-dragonfly",
"libc",
"winapi",
]
[[package]] [[package]]
name = "errno" name = "errno"
version = "0.3.1" version = "0.3.1"
@ -676,9 +665,9 @@ dependencies = [
[[package]] [[package]]
name = "itertools" name = "itertools"
version = "0.11.0" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0"
dependencies = [ dependencies = [
"either", "either",
] ]
@ -837,12 +826,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
[[package]] [[package]]
name = "loopdev" name = "loopdev-3"
version = "0.4.0" version = "0.5.0"
source = "git+https://github.com/mulkieran/loopdev?branch=bump-bindgen-reduce-version-0.68.1#63e6105d5599d9df00041de873d7fc91f53b9f20" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "378e7ca4e85e592564e6a96c362303972b5c7860367014383aadc10a8704fc38"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"errno 0.2.8", "errno",
"libc", "libc",
] ]
@ -861,6 +851,15 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "memoffset"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
dependencies = [
"autocfg",
]
[[package]] [[package]]
name = "minimal-lexical" name = "minimal-lexical"
version = "0.2.1" version = "0.2.1"
@ -900,11 +899,23 @@ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"cfg-if 1.0.0", "cfg-if 1.0.0",
"libc", "libc",
"memoffset", "memoffset 0.7.1",
"pin-utils", "pin-utils",
"static_assertions", "static_assertions",
] ]
[[package]]
name = "nix"
version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.4.0",
"cfg-if 1.0.0",
"libc",
"memoffset 0.9.0",
]
[[package]] [[package]]
name = "nom" name = "nom"
version = "7.1.3" version = "7.1.3"
@ -1010,9 +1021,9 @@ dependencies = [
[[package]] [[package]]
name = "pretty-hex" name = "pretty-hex"
version = "0.3.0" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5" checksum = "bbc83ee4a840062f368f9096d80077a9841ec117e17e7f700df81958f1451254"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
@ -1154,7 +1165,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"errno 0.3.1", "errno",
"io-lifetimes", "io-lifetimes",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
@ -1229,9 +1240,9 @@ dependencies = [
[[package]] [[package]]
name = "shlex" name = "shlex"
version = "1.1.0" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]] [[package]]
name = "signal-hook-registry" name = "signal-hook-registry"
@ -1269,7 +1280,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]] [[package]]
name = "stratisd" name = "stratisd"
version = "3.6.3" version = "3.6.4"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"assert_matches", "assert_matches",
@ -1287,7 +1298,7 @@ dependencies = [
"env_logger", "env_logger",
"futures", "futures",
"iocuddle", "iocuddle",
"itertools 0.11.0", "itertools 0.12.0",
"lazy_static", "lazy_static",
"libblkid-rs", "libblkid-rs",
"libc", "libc",
@ -1296,8 +1307,8 @@ dependencies = [
"libmount", "libmount",
"libudev", "libudev",
"log", "log",
"loopdev", "loopdev-3",
"nix 0.26.2", "nix 0.27.1",
"pkg-config", "pkg-config",
"predicates", "predicates",
"pretty-hex", "pretty-hex",

View file

@ -1,7 +1,6 @@
{ lib { lib
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, rustPlatform , rustPlatform
, cargo , cargo
, rustc , rustc
@ -28,38 +27,19 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "stratisd"; pname = "stratisd";
version = "3.6.3"; version = "3.6.4";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "stratis-storage"; owner = "stratis-storage";
repo = pname; repo = pname;
rev = "refs/tags/stratisd-v${version}"; rev = "refs/tags/stratisd-v${version}";
hash = "sha256-Wu3SkuHyMCBape+pMymQntXRtdMIlF5wz75kKxaZlms="; hash = "sha256-0zSMFjAzTtTmpSCqlIq5GXk3/AhlhtECFZXmo6xcjWA=";
}; };
cargoDeps = rustPlatform.importCargoLock { cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock; lockFile = ./Cargo.lock;
outputHashes = {
"loopdev-0.4.0" = "sha256-YS0hqxphxbbImT/mn/XBzkgabK2kbIym5VqG3XDVAx8=";
};
}; };
patches = [
# Can be removed with the next release after v. 3.6.3
(fetchpatch {
name = "remove-unused-imports.patch";
url = "https://github.com/stratis-storage/stratisd/commit/78440de6e6ed8eab5ddd25dbdfb7804d0698f2a2.patch";
hash = "sha256-RW2nyAWaoIbqrgbhCApQsMXkJWtWoOWL3VO7fIImJgY=";
})
# Can be removed with the next release after v. 3.6.3
(fetchpatch {
name = "flag-import-not-used-in-build-as-test-only.patch";
url = "https://github.com/stratis-storage/stratisd/commit/0d1c67f71338d0ee6c1e6aa06f7fd6264ce9a4c5.patch";
hash = "sha256-6Nb8izUqYUirjy0dTFhITxoM/AKoChoc0w6Qm9K6+7I=";
})
];
postPatch = '' postPatch = ''
substituteInPlace udev/61-stratisd.rules \ substituteInPlace udev/61-stratisd.rules \
--replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \ --replace stratis-base32-decode "$out/lib/udev/stratis-base32-decode" \
@ -116,10 +96,10 @@ stdenv.mkDerivation rec {
# remove files for supporting dracut # remove files for supporting dracut
postInstall = '' postInstall = ''
mkdir -p "$initrd/bin" mkdir -p "$initrd/bin"
cp "dracut/90stratis/stratis-rootfs-setup" "$initrd/bin" cp "$out/lib/dracut/modules.d/90stratis/stratis-rootfs-setup" "$initrd/bin"
mkdir -p "$initrd/lib/systemd/system" mkdir -p "$initrd/lib/systemd/system"
substitute "dracut/90stratis/stratisd-min.service" "$initrd/lib/systemd/system/stratisd-min.service" \ substitute "$out/lib/dracut/modules.d/90stratis/stratisd-min.service" \
--replace /usr "$out" \ "$initrd/lib/systemd/system/stratisd-min.service" \
--replace mkdir "${coreutils}/bin/mkdir" --replace mkdir "${coreutils}/bin/mkdir"
mkdir -p "$initrd/lib/udev/rules.d" mkdir -p "$initrd/lib/udev/rules.d"
cp udev/61-stratisd.rules "$initrd/lib/udev/rules.d" cp udev/61-stratisd.rules "$initrd/lib/udev/rules.d"
@ -127,7 +107,9 @@ stdenv.mkDerivation rec {
rm -r "$out/lib/systemd/system-generators" rm -r "$out/lib/systemd/system-generators"
''; '';
passthru.tests = nixosTests.stratis; passthru.tests = nixosTests.stratis // {
inherit (nixosTests.installer-systemd-stage-1) stratisRoot;
};
meta = with lib; { meta = with lib; {
description = "Easy to use local storage management for Linux"; description = "Easy to use local storage management for Linux";