From 82fc9ab5c860720fa2c097e8dfe19261a9d5226e Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 12 Nov 2019 17:53:29 +0100 Subject: [PATCH] nixos/wpa_supplicant: fix unit-start script Ever since setting up bonding the `wpa_supplicant-unit-start` script has been failing. This is because the file `bonding_masters` in `/sys/class/net/` is *not* a directory containing `uevent`. Adding a test to verify the `uevent` path to be sourced exists resolves the problem. --- nixos/modules/services/networking/wpa_supplicant.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix index 294c0d70edea..8f05c3949fba 100644 --- a/nixos/modules/services/networking/wpa_supplicant.nix +++ b/nixos/modules/services/networking/wpa_supplicant.nix @@ -236,9 +236,12 @@ in { ${if ifaces == [] then '' for i in $(cd /sys/class/net && echo *); do DEVTYPE= - source /sys/class/net/$i/uevent - if [ "$DEVTYPE" = "wlan" -o -e /sys/class/net/$i/wireless ]; then - ifaces="$ifaces''${ifaces:+ -N} -i$i" + UEVENT_PATH=/sys/class/net/$i/uevent + if [ -e "$UEVENT_PATH" ]; then + source "$UEVENT_PATH" + if [ "$DEVTYPE" = "wlan" -o -e /sys/class/net/$i/wireless ]; then + ifaces="$ifaces''${ifaces:+ -N} -i$i" + fi fi done '' else ''