summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev
diff options
context:
space:
mode:
authorRichard Tollerton <rich.tollerton@ni.com>2014-12-08 17:25:10 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-19 18:08:01 +0000
commitc6e8f075a943dd897d7976e29109897856bba821 (patch)
tree0cfcc024810421ffcffcc82b4d7651319282e063 /meta/recipes-core/udev
parent7f8634cc90bd09a5052dc4cf465c61003e3d05cd (diff)
downloadpoky-c6e8f075a943dd897d7976e29109897856bba821.tar.gz
udev-cache: don't generate sysconf twice
The udev initscript signals udev-cache to run by generating a new sysconf; but udev-cache now overwrites that with its own copy. To eliminate the needless sysconf generating in udev, we instead trigger udev-cache to run by touching a new file $DEVCACHE_REGEN. (From OE-Core rev: 8d2325be2d03086b7e5a02618edb05b19fbcdc48) 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')
-rw-r--r--meta/recipes-core/udev/udev/init5
-rw-r--r--meta/recipes-core/udev/udev/udev-cache4
2 files changed, 7 insertions, 2 deletions
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index ee7967063a..337b6d4c11 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -16,6 +16,7 @@ export TZ=/etc/localtime
16[ -x @UDEVD@ ] || exit 1 16[ -x @UDEVD@ ] || exit 1
17SYSCONF_CACHED="/etc/udev/cache.data" 17SYSCONF_CACHED="/etc/udev/cache.data"
18SYSCONF_TMP="/dev/shm/udev.cache" 18SYSCONF_TMP="/dev/shm/udev.cache"
19DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
19[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache 20[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
20[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf 21[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
21[ -f /etc/default/rcS ] && . /etc/default/rcS 22[ -f /etc/default/rcS ] && . /etc/default/rcS
@@ -62,6 +63,7 @@ case "$1" in
62 not_first_boot=1 63 not_first_boot=1
63 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" 64 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
64 [ -e $SYSCONF_TMP ] && rm -f "$SYSCONF_TMP" 65 [ -e $SYSCONF_TMP ] && rm -f "$SYSCONF_TMP"
66 [ -e "$DEVCACHE_REGEN" ] && rm -f "$DEVCACHE_REGEN"
65 else 67 else
66 # Output detailed reason why the cached /dev is not used 68 # Output detailed reason why the cached /dev is not used
67 if [ "$VERBOSE" != "no" ]; then 69 if [ "$VERBOSE" != "no" ]; then
@@ -70,12 +72,13 @@ case "$1" in
70 echo "udev: cached sysconf: $SYSCONF_CACHED" 72 echo "udev: cached sysconf: $SYSCONF_CACHED"
71 echo "udev: current sysconf: $SYSCONF_TMP" 73 echo "udev: current sysconf: $SYSCONF_TMP"
72 fi 74 fi
75 touch "$DEVCACHE_REGEN"
73 fi 76 fi
74 else 77 else
75 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then 78 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
76 # If rootfs is not read-only, it's possible that a new udev cache would be generated; 79 # If rootfs is not read-only, it's possible that a new udev cache would be generated;
77 # otherwise, we do not bother to read files. 80 # otherwise, we do not bother to read files.
78 cat -- "$CMP_FILE_LIST" > "$SYSCONF_TMP" 81 touch "$DEVCACHE_REGEN"
79 fi 82 fi
80 fi 83 fi
81 fi 84 fi
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index e0e1c39488..814ef54c3c 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -19,6 +19,7 @@ export TZ=/etc/localtime
19DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar" 19DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar"
20SYSCONF_CACHED="/etc/udev/cache.data" 20SYSCONF_CACHED="/etc/udev/cache.data"
21SYSCONF_TMP="/dev/shm/udev.cache" 21SYSCONF_TMP="/dev/shm/udev.cache"
22DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
22 23
23# A list of files which are used as a criteria to judge whether the udev cache could be reused. 24# A list of files which are used as a criteria to judge whether the udev cache could be reused.
24CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices" 25CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
@@ -30,7 +31,7 @@ if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
30 exit 0 31 exit 0
31fi 32fi
32 33
33if [ "$DEVCACHE" != "" -a -e "$SYSCONF_TMP" ]; then 34if [ "$DEVCACHE" != "" -a -e "$DEVCACHE_REGEN" ]; then
34 echo "Populating dev cache" 35 echo "Populating dev cache"
35 udevadm control --stop-exec-queue 36 udevadm control --stop-exec-queue
36 cat -- $CMP_FILE_LIST > "$SYSCONF_TMP" 37 cat -- $CMP_FILE_LIST > "$SYSCONF_TMP"
@@ -40,6 +41,7 @@ if [ "$DEVCACHE" != "" -a -e "$SYSCONF_TMP" ]; then
40 rm -f "${DEVCACHE_TMP}" 41 rm -f "${DEVCACHE_TMP}"
41 mv "$SYSCONF_TMP" "$SYSCONF_CACHED" 42 mv "$SYSCONF_TMP" "$SYSCONF_CACHED"
42 udevadm control --start-exec-queue 43 udevadm control --start-exec-queue
44 rm -f "$DEVCACHE_REGEN"
43fi 45fi
44 46
45exit 0 47exit 0