[oe-commits] Richard Tollerton : udev-cache: Compress the cache

git at git.openembedded.org git at git.openembedded.org
Sat Aug 23 12:31:18 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: c8689986c67e8eaa38f3e44aa143489f2f4c0986
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c8689986c67e8eaa38f3e44aa143489f2f4c0986

Author: Richard Tollerton <rich.tollerton at ni.com>
Date:   Fri Aug 22 16:30:48 2014 -0500

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.

Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-core/udev/udev/udev-cache         | 3 ++-
 meta/recipes-core/udev/udev/udev-cache.default | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index c08cef2..ec07f50 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -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
 
diff --git a/meta/recipes-core/udev/udev/udev-cache.default b/meta/recipes-core/udev/udev/udev-cache.default
index 2093336..909ec87 100644
--- a/meta/recipes-core/udev/udev/udev-cache.default
+++ b/meta/recipes-core/udev/udev/udev-cache.default
@@ -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"



More information about the Openembedded-commits mailing list