From 6dbcf7d2e93eb204fd468ca540c37350b97051ea Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Thu, 12 Jan 2017 11:11:20 +0300 Subject: [PATCH] udev service: verify that hwdb is generated without errors --- 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 14d65978c320..028907693a5a 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -143,7 +143,10 @@ let done echo "Generating hwdb database..." - ${udev}/bin/udevadm hwdb --update --root=$(pwd) + # hwdb --update doesn't return error code even on errors! + res="$(${udev}/bin/udevadm hwdb --update --root=$(pwd) 2>&1)" + echo "$res" + [ -z "$(echo "$res" | egrep '^Error')" ] mv etc/udev/hwdb.bin $out '';