bcachefs: revert using json to hold bcachefs commits/hashes

The json appearantly contained the wrong checksum and we don't have a way to generate this
This commit is contained in:
Jörg Thalheim 2023-10-03 18:47:15 +00:00 committed by Jörg Thalheim
parent 1048867fe0
commit 98b8e0dee9
4 changed files with 21 additions and 27 deletions

View File

@ -1,5 +0,0 @@
{
"diffHash": "sha256-BmXd/5Hn/xr7gNFp6BsBMG2XeKFlPGxv66IQ8DEwh5k=",
"commit": "4d2faeb4fb58c389dc9f76b8d5ae991ef4497e04",
"date": "2023-09-28"
}

View File

@ -2,22 +2,22 @@
, stdenv
, fetchpatch
, kernel
, commitDate ? "2023-06-28"
# bcachefs-tools stores the expected-revision in:
# https://evilpiepirate.org/git/bcachefs-tools.git/tree/.bcachefs_revision
# but this does not means that it'll be the latest-compatible revision
, version ? lib.importJSON ./bcachefs.json
, currentCommit ? "4d2faeb4fb58c389dc9f76b8d5ae991ef4497e04"
, diffHash ? "sha256-DtMc8P4lTRzvS6PVvD7WtWEPsfnxIXSpqMsKKWs+edI="
, kernelPatches # must always be defined in bcachefs' all-packages.nix entry because it's also a top-level attribute supplied by callPackage
, argsOverride ? {}
, ...
} @ args:
let localversion = "-bcachefs-unstable-${version.date}";
in
# NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility
(kernel.override ( args // {
argsOverride = {
version = "${kernel.version}${localversion}";
modDirVersion = "${kernel.version}${localversion}";
version = "${kernel.version}-bcachefs-unstable-${commitDate}";
modDirVersion = kernel.modDirVersion;
extraMeta = {
homepage = "https://bcachefs.org/";
@ -27,8 +27,6 @@ in
} // argsOverride;
structuredExtraConfig = with lib.kernel; {
# we need this for uname
LOCALVERSION = freeform localversion;
BCACHEFS_FS = module;
BCACHEFS_QUOTA = option yes;
BCACHEFS_POSIX_ACL = option yes;
@ -37,12 +35,12 @@ in
};
kernelPatches = [ {
name = "bcachefs-${version.commit}";
name = "bcachefs-${currentCommit}";
patch = fetchpatch {
name = "bcachefs-${version.commit}.diff";
url = "https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=${version.commit}&id2=v${lib.versions.majorMinor kernel.version}";
sha256 = version.diffHash;
name = "bcachefs-${currentCommit}.diff";
url = "https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=${currentCommit}&id2=v${lib.versions.majorMinor kernel.version}";
sha256 = diffHash;
};
} ] ++ kernelPatches;
}))

View File

@ -19,13 +19,21 @@
, rustPlatform
, makeWrapper
, fuseSupport ? false
, version ? lib.importJSON ./version.json
}:
let
rev = "6b175a022496572416918bd38d083120c23ba5f2";
in
stdenv.mkDerivation {
pname = "bcachefs-tools";
version = "unstable-${version.date}";
version = "unstable-2023-09-29";
src = fetchFromGitHub (builtins.removeAttrs version ["date"]);
src = fetchFromGitHub {
owner = "koverstreet";
repo = "bcachefs-tools";
inherit rev;
hash = "sha256-qC6Bq2zdO8Tj+bZbIUvcVBqvuKccqDEX3HIeOXsEloQ=";
};
nativeBuildInputs = [
pkg-config
@ -63,7 +71,7 @@ stdenv.mkDerivation {
makeFlags = [
"PREFIX=${placeholder "out"}"
"VERSION=${lib.strings.substring 0 7 version.rev}"
"VERSION=${lib.strings.substring 0 7 rev}"
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
];

View File

@ -1,7 +0,0 @@
{
"owner": "koverstreet",
"repo": "bcachefs-tools",
"rev": "6b175a022496572416918bd38d083120c23ba5f2",
"sha256": "qC6Bq2zdO8Tj+bZbIUvcVBqvuKccqDEX3HIeOXsEloQ=",
"date": "2023-09-29"
}