From 3c6e0fd594801617d77ce78e01d8b066aeb5982e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 29 Nov 2012 18:51:44 +0100 Subject: [PATCH] Generate the binary hardware database required by systemd 196 --- modules/system/boot/systemd.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix index e76d35fa9f27..86e269e0763a 100644 --- a/modules/system/boot/systemd.nix +++ b/modules/system/boot/systemd.nix @@ -442,6 +442,18 @@ in } ]; + system.activationScripts.systemd = + '' + mkdir -p /var/lib/udev -m 0755 + + # Regenerate the hardware database /var/lib/udev/hwdb.bin + # whenever systemd changes. + if [ ! -e /var/lib/udev/prev-systemd -o "$(readlink /var/lib/udev/prev-systemd)" != ${systemd} ]; then + echo "regenerating udev hardware database..." + ${systemd}/bin/udevadm hwdb --update && ln -sfn ${systemd} /var/lib/udev/prev-systemd + fi + ''; + # Target for ‘charon send-keys’ to hook into. boot.systemd.targets.keys = { description = "Security Keys"; @@ -456,5 +468,6 @@ in system.requiredKernelConfig = map config.lib.kernelConfig.isEnabled [ "CGROUPS" "AUTOFS4_FS" "DEVTMPFS" ]; + }; }