summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/udev-cache
diff options
context:
space:
mode:
authorRichard Tollerton <rich.tollerton@ni.com>2014-01-24 00:44:01 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-19 18:08:01 +0000
commit88c184a9bf550ca3774df364cf95edd0dae611bb (patch)
tree1931ecdee9090bdd7cd82d8682242bb347940f23 /meta/recipes-core/udev/udev/udev-cache
parent7c522ced96cc13c9893cb564599c7b68064c1023 (diff)
downloadpoky-88c184a9bf550ca3774df364cf95edd0dae611bb.tar.gz
udev-cache: invalidate on rules.d changes
Presently, the cache is not regenerated if udev rules are modified, which may cause the cache to preserve an old configuration. To fix, include the size, mtime, and filename of all udev rules in the system configuration. This change requires `stat`. If busybox supplies stat, CONFIG_FEATURE_STAT_FORMAT must be enabled. (From OE-Core rev: 8847e33b12171a21b7c7e1241198080ad9ef9284) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/udev/udev/udev-cache')
-rw-r--r--meta/recipes-core/udev/udev/udev-cache5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index 4d50876b64..571463fa01 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -25,9 +25,14 @@ DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
25CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices" 25CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
26[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags" 26[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
27 27
28# List of files whose metadata (size/mtime/name) will be included in cached
29# system state.
30META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*"
31
28# Command to compute system configuration. 32# Command to compute system configuration.
29sysconf_cmd () { 33sysconf_cmd () {
30 cat -- $CMP_FILE_LIST 34 cat -- $CMP_FILE_LIST
35 stat -L -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}'
31} 36}
32 37
33[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache 38[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache