vendorize bcachefs kernel

This commit is contained in:
Jörg Thalheim 2023-01-23 10:49:01 +01:00
parent 825be2b627
commit eca1957835
3 changed files with 41 additions and 2 deletions

View File

@ -24,6 +24,11 @@
disko = pkgs.callPackage ./package.nix {};
disko-doc = pkgs.callPackage ./doc.nix { };
default = self.packages.${system}.disko;
# The way bcachefs support is maintained in nixpkgs is prone to breakage.
# That's why we need to maintain a fork here:
# https://github.com/NixOS/nixpkgs/issues/212086
linux-bcachefs = pkgs.callPackage ./linux-testing-bcachefs.nix {};
linuxPackages_bcachefs = pkgs.linuxPackagesFor self.packages.${pkgs.system}.linux-bcachefs;
});
# TODO: disable bios-related tests on aarch64...
# Run checks: nix flake check -L

View File

@ -0,0 +1,28 @@
# nixpkgs's variant is broken because they have non-applying patches on top of the latest kernel,
# instead of using kernel.
{ lib
, buildLinux
, fetchFromGitHub
, ...
} @ args:
buildLinux (args // {
# NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility
version = "6.1.0-2022-12-29";
modDirVersion = "6.1.0";
src = fetchFromGitHub {
owner = "koverstreet";
repo = "bcachefs";
rev = "8f064a4cb5c7cce289b83d7a459e6d8620188b37";
sha256 = "sha256-UgWAbYToauAjGrgeS+o6N42/oW0roICJIoJlEAHBRPk=";
};
kernelPatches = (args.kernelPatches or []) ++ [{
name = "bcachefs-config";
patch = null;
extraConfig = ''
BCACHEFS_FS m
'';
}];
} // (args.argsOverride or {}))

View File

@ -1,6 +1,9 @@
{ pkgs ? (import <nixpkgs> { })
, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest
}:
let
linux-bcachefs = pkgs.callPackage ../linux-testing-bcachefs.nix {};
in
makeDiskoTest {
disko-config = ../example/bcachefs.nix;
extraTestScript = ''
@ -12,7 +15,10 @@ makeDiskoTest {
boot.supportedFilesystems = [ "bcachefs" ];
# disable zfs so we can support latest kernel
nixpkgs.overlays = [(final: super: {
zfs = super.zfs.overrideAttrs(_: {meta.platforms = [];});}
)];
zfs = super.zfs.overrideAttrs(_: {
meta.platforms = [];
});
})];
boot.kernelPackages = pkgs.lib.mkForce (pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux-bcachefs));
};
}