summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-06-18 12:48:17 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-25 17:44:56 +0100
commit9d68aa5e3590c8eefb221f62b0390a05061a756a (patch)
treedb832bfb11d472c76a8304c3af49a0248b93f6b3 /meta/recipes-core/udev
parent763ebb62cd154d6435dc1f5eaf6534b3911c9ebc (diff)
downloadpoky-9d68aa5e3590c8eefb221f62b0390a05061a756a.tar.gz
udev-cache: fix to use udev-cache correctly
Previouly, the udev-cache has no real effect even if it's installed into the system. The key problem here is that at first boot, the /etc/dev.tar is not present, thus resulting /dev/shm/udev.cache not created on first boot even if udev-cache is enabled. This patch fixes this problem. The /dev/shm/udev.cache will be created if necessary, that is, on first boot or when some part of the system is changed. In the latter case, the udev cache may not be valid. [YOCTO #4738] (From OE-Core rev: 84e0ec2e677fb0236a38478372cdd75797cf5a2e) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.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/init6
-rw-r--r--meta/recipes-core/udev/udev/udev-cache4
2 files changed, 6 insertions, 4 deletions
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index 95f9c0355f..9b81700ba2 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -68,8 +68,12 @@ case "$1" in
68 if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then 68 if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
69 (cd /; tar xf $DEVCACHE > /dev/null 2>&1) 69 (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
70 not_first_boot=1 70 not_first_boot=1
71 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
72 [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
73 else
74 echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
71 fi 75 fi
72 76 else
73 echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache 77 echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
74 fi 78 fi
75 fi 79 fi
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index 01fec6e96e..8a84fa9dc8 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -17,12 +17,10 @@ export TZ=/etc/localtime
17 17
18[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache 18[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
19 19
20if [ "$DEVCACHE" != "" ]; then 20if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
21 echo "Populating dev cache" 21 echo "Populating dev cache"
22 (cd /; tar cf "$DEVCACHE" dev) 22 (cd /; tar cf "$DEVCACHE" dev)
23 mv /dev/shm/udev.cache /etc/udev/cache.data 23 mv /dev/shm/udev.cache /etc/udev/cache.data
24else
25 rm -f /dev/shm/udev.cache
26fi 24fi
27 25
28exit 0 26exit 0