diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 0394f94dddd1..74e66ce95ad6 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -2621,6 +2621,12 @@ githubId = 30630233; name = "Timo Triebensky"; }; + birkb = { + email = "birk@batchworks.de"; + github = "birkb"; + githubId = 10164833; + name = "Birk Bohne"; + }; bjornfor = { email = "bjorn.forsman@gmail.com"; github = "bjornfor"; diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 144eecd7e0ee..9ef92632094d 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -578,6 +578,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - QtMultimedia has changed its default backend to `QT_MEDIA_BACKEND=ffmpeg` (previously `gstreamer` on Linux or `darwin` on MacOS). The previous native backends remain available but are now minimally maintained. Refer to [upstream documentation](https://doc.qt.io/qt-6/qtmultimedia-index.html#ffmpeg-as-the-default-backend) for further details about each platform. +- The `drbd` out-of-tree Linux kernel driver has been added in version `9.2.7`. With it the DRBD 9.x features can be used instead of the 8.x features provided by the `8.4.11` in-tree driver. + - The oil shell's c++ version is now available as `oils-for-unix`. The python version is still available as `oil` - `documentation.man.mandoc` now by default uses `MANPATH` to set the directories where mandoc will search for manual pages. diff --git a/nixos/tests/drbd.nix b/nixos/tests/drbd.nix index bede7206d706..defbad693393 100644 --- a/nixos/tests/drbd.nix +++ b/nixos/tests/drbd.nix @@ -31,11 +31,11 @@ import ./make-test-python.nix ( } on drbd1 { - address ${nodes.drbd1.config.networking.primaryIPAddress}:${toString drbdPort}; + address ${nodes.drbd1.networking.primaryIPAddress}:${toString drbdPort}; } on drbd2 { - address ${nodes.drbd2.config.networking.primaryIPAddress}:${toString drbdPort}; + address ${nodes.drbd2.networking.primaryIPAddress}:${toString drbdPort}; } } ''; @@ -45,7 +45,7 @@ import ./make-test-python.nix ( { name = "drbd"; meta = with pkgs.lib.maintainers; { - maintainers = [ ryantm astro ]; + maintainers = [ ryantm astro birkb ]; }; nodes.drbd1 = drbdConfig; diff --git a/pkgs/os-specific/linux/drbd/driver.nix b/pkgs/os-specific/linux/drbd/driver.nix new file mode 100644 index 000000000000..efc771905e53 --- /dev/null +++ b/pkgs/os-specific/linux/drbd/driver.nix @@ -0,0 +1,57 @@ +{ stdenv, lib, fetchurl, kernel, flex, coccinelle, python3 }: + +stdenv.mkDerivation rec { + name = "drbd-${version}-${kernel.version}"; + version = "9.2.7"; + + src = fetchurl { + url = "https://pkg.linbit.com//downloads/drbd/9/drbd-${version}.tar.gz"; + sha256 = "1355ns10z0fjgqsdpf09qfy01j8lg2n7zy4kclmar3s798n3mh56"; + }; + + hardeningDisable = [ "pic" ]; + + nativeBuildInputs = [ + kernel.moduleBuildDependencies + flex + coccinelle + python3 + ]; + + makeFlags = [ + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "SPAAS=false" + ]; + + # 6.4 and newer provide a in-tree version of the handshake module https://www.kernel.org/doc/html/v6.4/networking/tls-handshake.html + installPhase = '' + runHook preInstall + install -D drbd/drbd.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd + install -D drbd/drbd_transport_tcp.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd + install -D drbd/drbd_transport_lb-tcp.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd + install -D drbd/drbd_transport_rdma.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd + ${lib.optionalString (lib.versionOlder kernel.version "6.4") '' + install -D drbd/drbd-kernel-compat/handshake/handshake.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd + ''} + runHook postInstall + ''; + + postPatch = '' + patchShebangs . + substituteInPlace Makefile --replace 'SHELL=/bin/bash' 'SHELL=${builtins.getEnv "SHELL"}' + ''; + + enableParallelBuilding = true; + + meta = with lib; { + homepage = "https://github.com/LINBIT/drbd"; + description = "LINBIT DRBD kernel module"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ birkb ]; + longDescription = '' + DRBD is a software-based, shared-nothing, replicated storage solution + mirroring the content of block devices (hard disks, partitions, logical volumes, and so on) between hosts. + ''; + }; +} diff --git a/pkgs/os-specific/linux/drbd/default.nix b/pkgs/os-specific/linux/drbd/utils.nix similarity index 90% rename from pkgs/os-specific/linux/drbd/default.nix rename to pkgs/os-specific/linux/drbd/utils.nix index 0c5acd0ac064..ad50c2c3e50a 100644 --- a/pkgs/os-specific/linux/drbd/default.nix +++ b/pkgs/os-specific/linux/drbd/utils.nix @@ -10,7 +10,9 @@ , libxslt , nixosTests , perl +, perlPackages , systemd +, keyutils # drbd-utils are compiled twice, once with forOCF = true to extract # its OCF definitions for use in the ocf-resource-agents derivation, @@ -22,11 +24,11 @@ stdenv.mkDerivation rec { pname = "drbd"; - version = "9.19.1"; + version = "9.27.0"; src = fetchurl { url = "https://pkg.linbit.com/downloads/drbd/utils/${pname}-utils-${version}.tar.gz"; - sha256 = "1l99kcrb0j85wxxmrdihpx9bk1a4sdi7wlp5m1x5l24k8ck1m5cf"; + sha256 = "1qwdrjrgas8z8vc6c85xcrqaczjwyqd61yig01n44wa5z0j3v4aq"; }; nativeBuildInputs = [ @@ -34,11 +36,12 @@ stdenv.mkDerivation rec { libxslt docbook_xsl asciidoctor + keyutils ]; buildInputs = [ perl - # perlPackages.Po4a used by ja documentation + perlPackages.Po4a ]; configureFlags = [ @@ -123,6 +126,10 @@ stdenv.mkDerivation rec { description = "Distributed Replicated Block Device, a distributed storage system for Linux (userspace utilities)"; license = licenses.gpl2Plus; platforms = platforms.linux; - maintainers = with maintainers; [ ryantm astro ]; + maintainers = with maintainers; [ ryantm astro birkb ]; + longDescription = '' + DRBD is a software-based, shared-nothing, replicated storage solution + mirroring the content of block devices (hard disks, partitions, logical volumes, and so on) between hosts. + ''; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e2a2edba2584..658be7616011 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27230,7 +27230,7 @@ with pkgs; dmraid = callPackage ../os-specific/linux/dmraid { lvm2 = lvm2_dmeventd; }; - drbd = callPackage ../os-specific/linux/drbd { }; + drbd = callPackage ../os-specific/linux/drbd/utils.nix { }; dropwatch = callPackage ../os-specific/linux/dropwatch { }; diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 4ab227d9975a..307576e85687 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -574,6 +574,8 @@ in { hid-tmff2 = callPackage ../os-specific/linux/hid-tmff2 { }; + drbd = callPackage ../os-specific/linux/drbd/driver.nix { }; + } // lib.optionalAttrs config.allowAliases { ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18; hid-nintendo = throw "hid-nintendo was added in mainline kernel version 5.16"; # Added 2023-07-30