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 14:55:44 +0000 |
commit | 22b72b23653736436f10d394de36201c32630d5d (patch) | |
tree | fd60a191a8702bbb3c15f7c680ad44efdeb805b2 /meta/recipes-core/udev/udev/udev-cache | |
parent | 4346516a6a719355d2793af289f93e14d3dedd0c (diff) | |
download | openembedded-core-contrib-22b72b23653736436f10d394de36201c32630d5d.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;
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
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 @@ # Short-Description: cache /dev to speedup the udev next boot ### END INIT INFO -[ -d /sys/class ] || exit 1 +export TZ=/etc/localtime + [ -r /proc/mounts ] || exit 1 [ -x /sbin/udevd ] || exit 1 +[ -d /sys/class ] || exit 1 + +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache -if [ ! -e /etc/dev.tar ]; then - (cd /; tar cf /etc/dev.tar dev) +if [ "$DEVCACHE" != "" ]; then + echo "Populating dev cache" + (cd /; tar cf "$DEVCACHE" dev) + mv /dev/shm/udev.cache /etc/udev/cache.data +else + rm -f /dev/shm/udev.cache fi exit 0 |