Skip to content

Commit 3cd899b

Browse files
authored
brscan5: use udevCheckHook and fix permissions of udev rules file (#409344)
2 parents d9305c9 + 6035e60 commit 3cd899b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

nixos/tests/brscan5.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ import ./make-test-python.nix (
4848
print(scanimage)
4949
assert """device `brother5:net1;dev0' is a Brother b ADS-1200""" in scanimage
5050
assert """device `brother5:net1;dev1' is a Brother a ADS-1200""" in scanimage
51-
52-
# Confirm systemd-udevd no longer logs errors about SYSFS
53-
logs = machine.succeed('journalctl --unit systemd-udevd')
54-
assert "Invalid key 'SYSFS'" not in logs
5551
'';
5652
}
5753
)

pkgs/by-name/br/brscan5/package.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
glib,
1010
libredirect,
1111
nixosTests,
12+
udevCheckHook,
1213
}:
1314
let
1415
myPatchElf = file: ''
@@ -43,6 +44,7 @@ stdenv.mkDerivation rec {
4344
nativeBuildInputs = [
4445
makeWrapper
4546
patchelf
47+
udevCheckHook
4648
];
4749
buildInputs = [
4850
libusb1
@@ -114,7 +116,7 @@ stdenv.mkDerivation rec {
114116
echo "brother5" > $out/etc/sane.d/dll.d/brother5.conf
115117
116118
mkdir -p $out/etc/udev/rules.d
117-
cp -p $PATH_TO_BRSCAN5/udev-rules/NN-brother-mfp-brscan5-1.0.2-2.rules \
119+
install -m 0444 $PATH_TO_BRSCAN5/udev-rules/NN-brother-mfp-brscan5-1.0.2-2.rules \
118120
$out/etc/udev/rules.d/49-brother-mfp-brscan5-1.0.2-2.rules
119121
120122
ETCDIR=$out/etc/opt/brother/scanner/brscan5
@@ -124,6 +126,9 @@ stdenv.mkDerivation rec {
124126
runHook postInstall
125127
'';
126128

129+
# We want to run the udevCheckHook
130+
doInstallCheck = true;
131+
127132
dontPatchELF = true;
128133

129134
passthru.tests = { inherit (nixosTests) brscan5; };

0 commit comments

Comments
 (0)