1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

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>
This commit is contained in:
Chen Qi
2013-06-18 12:48:17 +08:00
committed by Richard Purdie
parent 763ebb62cd
commit 9d68aa5e35
3 changed files with 11 additions and 5 deletions
+5 -1
View File
@@ -59,8 +59,12 @@ case "$1" in
if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
not_first_boot=1
[ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
[ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
else
echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
fi
else
echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
fi
fi
+5 -1
View File
@@ -68,8 +68,12 @@ case "$1" in
if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
not_first_boot=1
[ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
[ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
else
echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
fi
else
echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
fi
fi
+1 -3
View File
@@ -17,12 +17,10 @@ export TZ=/etc/localtime
[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
if [ "$DEVCACHE" != "" ]; then
if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; 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