udev-cache: Compress the cache
authorRichard Tollerton <rich.tollerton@ni.com>
Fri, 22 Aug 2014 21:30:48 +0000 (16:30 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 Aug 2014 22:01:58 +0000 (23:01 +0100)
$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>
meta/recipes-core/udev/udev/udev-cache
meta/recipes-core/udev/udev/udev-cache.default

index c08cef2..ec07f50 100644 (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
 
index 2093336..909ec87 100644 (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"