126: Bcachefs fixes r=Mic92 a=Mic92



Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
bors[bot] 2023-01-23 09:57:20 +00:00 committed by GitHub
commit 2c82dbc132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 5 deletions

6
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1673606088, "lastModified": 1674236650,
"narHash": "sha256-wdYD41UwNwPhTdMaG0AIe7fE1bAdyHe6bB4HLUqUvck=", "narHash": "sha256-B4GKL1YdJnII6DQNNJ4wDW1ySJVx2suB1h/v4Ql8J0Q=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "37b97ae3dd714de9a17923d004a2c5b5543dfa6d", "rev": "cfb43ad7b941d9c3606fb35d91228da7ebddbfc5",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -24,6 +24,11 @@
disko = pkgs.callPackage ./package.nix {}; disko = pkgs.callPackage ./package.nix {};
disko-doc = pkgs.callPackage ./doc.nix { }; disko-doc = pkgs.callPackage ./doc.nix { };
default = self.packages.${system}.disko; 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... # TODO: disable bios-related tests on aarch64...
# Run checks: nix flake check -L # 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> { }) { pkgs ? (import <nixpkgs> { })
, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest , makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest
}: }:
let
linux-bcachefs = pkgs.callPackage ../linux-testing-bcachefs.nix {};
in
makeDiskoTest { makeDiskoTest {
disko-config = ../example/bcachefs.nix; disko-config = ../example/bcachefs.nix;
extraTestScript = '' extraTestScript = ''
@ -12,7 +15,10 @@ makeDiskoTest {
boot.supportedFilesystems = [ "bcachefs" ]; boot.supportedFilesystems = [ "bcachefs" ];
# disable zfs so we can support latest kernel # disable zfs so we can support latest kernel
nixpkgs.overlays = [(final: super: { 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));
}; };
} }