udev-cache: Compress the cache

$DEVCACHE is observed to be 100k uncompressed; compressing it reduces
its size to ~5k. But compress it outside of `tar` so that archival
operation takes as little time as possible, to minimize the risk of
devices being created/removed during execution.

(From OE-Core rev: 571df6ddba1caa6805f7c96cd592eea399c2aee2)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Tollerton 2014-08-22 16:30:48 -05:00 committed by Richard Purdie
parent bd7fb7c3ca
commit 8c423bf995
2 changed files with 3 additions and 2 deletions

View File

@ -27,7 +27,8 @@ fi
if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
echo "Populating dev cache"
(cd /; tar cf "${DEVCACHE_TMP}" dev)
mv -f "${DEVCACHE_TMP}" "$DEVCACHE"
gzip < "${DEVCACHE_TMP}" > "$DEVCACHE"
rm -f "${DEVCACHE_TMP}"
mv /dev/shm/udev.cache /etc/udev/cache.data
fi

View File

@ -1,5 +1,5 @@
# Default for /etc/init.d/udev
# Comment this out to disable device cache
DEVCACHE="/etc/dev.tar"
DEVCACHE="/etc/dev.tar.gz"
PROBE_PLATFORM_BUS="yes"