kmod-static-nodes: don't run if module list is empty
authorMartin Pitt <martin.pitt@ubuntu.com>
Mon, 11 Jan 2016 15:26:17 +0000 (16:26 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Mon, 11 Jan 2016 15:26:17 +0000 (16:26 +0100)
With this kmod commit, modules.devname will be empty by default instead of
containing just a comment:

  https://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/?id=4c30a11d5f

Refine the startup condition of kmod-static-nodes.service to not run needlessly
if the list is empty.

units/kmod-static-nodes.service.in

index 0934a87..a9c8df1 100644 (file)
@@ -10,7 +10,7 @@ Description=Create list of required static device nodes for the current kernel
 DefaultDependencies=no
 Before=sysinit.target systemd-tmpfiles-setup-dev.service
 ConditionCapability=CAP_SYS_MODULE
-ConditionPathExists=/lib/modules/%v/modules.devname
+ConditionFileNotEmpty=/lib/modules/%v/modules.devname
 
 [Service]
 Type=oneshot