diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2011-12-20 14:13:14 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-02 16:55:32 +0000 |
commit | ac62f06e09be6d8b00ce1a0c7b8d90f776792471 (patch) | |
tree | 8b9bc6be10d71dd8d5c21e0d03dc1a0559af98e9 /meta/recipes-core/udev/udev/udev-cache | |
parent | 7923ba87a220a216292fcb498bf11149189a3cbb (diff) | |
download | poky-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-cache | 14 |
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 | 12 | export 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 | ||
16 | if [ ! -e /etc/dev.tar ]; then | 20 | if [ "$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 | ||
24 | else | ||
25 | rm -f /dev/shm/udev.cache | ||
18 | fi | 26 | fi |
19 | 27 | ||
20 | exit 0 | 28 | exit 0 |