From 7c33418bb0e722a632658b9f847e144dab14a5e0 Mon Sep 17 00:00:00 2001 From: Matt Christ Date: Sun, 4 Aug 2024 13:23:34 -0500 Subject: [PATCH] brscan5: remove deprecated SYSFS udev rule This patch resolves an issue where systemd-udevd outputs events like: /nix/store/jm9paymkapbi6pzwbjgmi634vaf2y5va-udev-rules/49-brother-mfp-brscan5-1.0.2-2.rules:17 Invalid key 'SYSFS'. (cherry picked from commit ff62fe41360357452cd5232c7006661e4f512798) --- nixos/tests/brscan5.nix | 4 ++++ pkgs/by-name/br/brscan5/package.nix | 3 +++ 2 files changed, 7 insertions(+) diff --git a/nixos/tests/brscan5.nix b/nixos/tests/brscan5.nix index f61228bac41e6..ba1916e27d26a 100644 --- a/nixos/tests/brscan5.nix +++ b/nixos/tests/brscan5.nix @@ -48,6 +48,10 @@ import ./make-test-python.nix ( print(scanimage) assert """device `brother5:net1;dev0' is a Brother b ADS-1200""" in scanimage assert """device `brother5:net1;dev1' is a Brother a ADS-1200""" in scanimage + + # Confirm systemd-udevd no longer logs errors about SYSFS + logs = machine.succeed('journalctl --unit systemd-udevd') + assert "Invalid key 'SYSFS'" not in logs ''; } ) diff --git a/pkgs/by-name/br/brscan5/package.nix b/pkgs/by-name/br/brscan5/package.nix index 2a0490da9ed59..01a36caff2ab8 100644 --- a/pkgs/by-name/br/brscan5/package.nix +++ b/pkgs/by-name/br/brscan5/package.nix @@ -79,6 +79,9 @@ stdenv.mkDerivation rec { # driver is hardcoded to look in /opt/brother/scanner/brscan5/models for model metadata. # patch it to look in /etc/opt/brother/scanner/models instead, so nixos environment.etc can make it available printf '/etc/opt/brother/scanner/models\x00' | dd of=opt/brother/scanner/brscan5/libsane-brother5.so.1.0.7 bs=1 seek=${toString patchOffsetBytes} conv=notrunc + + # remove deprecated SYSFS udev rule + sed -i -e '/^SYSFS/d' opt/brother/scanner/brscan5/udev-rules/*.rules ''; installPhase = ''