From 16d25f4fa690d2c6a22aff7b6b5d351fec13db13 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Mon, 6 Apr 2015 09:14:54 +0200 Subject: [PATCH] Check if /proc/sys/kernel/hotplug exists before writing If a kernel without CONFIG_UEVENT_HELPER set is used with NixOS, the file /proc/sys/kernel/hotplug does not exist. Before writing to it to disable this deprecated mechanism, we have to ensure it actually exists because otherwise the activation script will fail. --- nixos/modules/services/hardware/udev.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index a775aed0fda..50588e44958 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -237,7 +237,10 @@ in system.activationScripts.udevd = '' - echo "" > /proc/sys/kernel/hotplug + # The deprecated hotplug uevent helper is not used anymore + if [ -e /proc/sys/kernel/hotplug ]; then + echo "" > /proc/sys/kernel/hotplug + fi # Regenerate the hardware database /var/lib/udev/hwdb.bin # whenever systemd changes.