summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/udev-cache
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2011-12-20 14:13:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-02 16:55:32 +0000
commitac62f06e09be6d8b00ce1a0c7b8d90f776792471 (patch)
tree8b9bc6be10d71dd8d5c21e0d03dc1a0559af98e9 /meta/recipes-core/udev/udev/udev-cache
parent7923ba87a220a216292fcb498bf11149189a3cbb (diff)
downloadpoky-ac62f06e09be6d8b00ce1a0c7b8d90f776792471.tar.gz
udev: improve udev-cache robustness
* allow udev-cache to be disabled at runtime (using /etc/default/udev-cache); * make cache invalidated if kernel, bootparams or device list changes; (From OE-Core rev: 22b72b23653736436f10d394de36201c32630d5d) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> 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-cache14
1 files changed, 11 insertions, 3 deletions
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index 77bbda6f1b..9c24e76514 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -9,12 +9,20 @@
9# Short-Description: cache /dev to speedup the udev next boot 9# Short-Description: cache /dev to speedup the udev next boot
10### END INIT INFO 10### END INIT INFO
11 11
12[ -d /sys/class ] || exit 1 12export TZ=/etc/localtime
13
13[ -r /proc/mounts ] || exit 1 14[ -r /proc/mounts ] || exit 1
14[ -x /sbin/udevd ] || exit 1 15[ -x /sbin/udevd ] || exit 1
16[ -d /sys/class ] || exit 1
17
18[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
15 19
16if [ ! -e /etc/dev.tar ]; then 20if [ "$DEVCACHE" != "" ]; then
17 (cd /; tar cf /etc/dev.tar dev) 21 echo "Populating dev cache"
22 (cd /; tar cf "$DEVCACHE" dev)
23 mv /dev/shm/udev.cache /etc/udev/cache.data
24else
25 rm -f /dev/shm/udev.cache
18fi 26fi
19 27
20exit 0 28exit 0