From c2c2960d2ad2eeb2aed777bd5a4276618514d9ac Mon Sep 17 00:00:00 2001 From: Birk Date: Mon, 29 Apr 2024 14:44:10 +0000 Subject: [PATCH] linuxPackages.drbd: fix file collision (#307550) --- pkgs/os-specific/linux/drbd/driver.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/drbd/driver.nix b/pkgs/os-specific/linux/drbd/driver.nix index d025fd5e229a..106bcf71cd98 100644 --- a/pkgs/os-specific/linux/drbd/driver.nix +++ b/pkgs/os-specific/linux/drbd/driver.nix @@ -26,12 +26,12 @@ stdenv.mkDerivation rec { # 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 + install -D drbd/drbd.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd9 + install -D drbd/drbd_transport_tcp.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd9 + install -D drbd/drbd_transport_lb-tcp.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd9 + install -D drbd/drbd_transport_rdma.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd9 ${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 + install -D drbd/drbd-kernel-compat/handshake/handshake.ko -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd9 ''} runHook postInstall ''; @@ -41,9 +41,13 @@ stdenv.mkDerivation rec { substituteInPlace Makefile --replace 'SHELL=/bin/bash' 'SHELL=${builtins.getEnv "SHELL"}' ''; + # builder.pl had complained about the same file (drbd.ko.xz) provided by two different packages + # builder.pl also had complained about different permissions between the files from the two packages + # The compression is required because the kernel has the CONFIG_MODULE_COMPRESS_XZ option enabled postFixup = '' - for ko in $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd/*.ko; do + for ko in $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/block/drbd9/*.ko; do xz --compress -6 --threads=0 $ko + chmod 0444 $ko.xz done '';