[OE-core] [PATCH v2 11/12] udev-cache: Update cache asynchronously

Richard Tollerton rich.tollerton at ni.com
Fri Aug 22 21:30:57 UTC 2014


Don't hold up the boot while the cache is being updated.

Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
Signed-off-by: Ben Shelton <ben.shelton at ni.com>
Acked-by: Gratian Crisan <gratian.crisan at ni.com>
---
 meta/recipes-core/udev/udev/udev-cache | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index c499676..baeb125 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -43,14 +43,17 @@ fi
 
 if [ "$DEVCACHE" != "" -a -e "$DEVCACHE_REGEN" ]; then
 	echo "Populating dev cache"
-	# Run sysconf_cmd before `tar`, not after, so that as little time as
-	# possible elapses between creating $SYSCONF_CACHED and $DEVCACHE.
-	sysconf_cmd > "$SYSCONF_CACHED"
-	find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \
-		| xargs tar cf "${DEVCACHE_TMP}" -T-
-	gzip < "${DEVCACHE_TMP}" > "$DEVCACHE"
-	rm -f "${DEVCACHE_TMP}"
-	rm -f "$DEVCACHE_REGEN"
+	(
+		# Run sysconf_cmd before `tar`, not after, so that as little
+		# time as possible elapses between creating $SYSCONF_CACHED and
+		# $DEVCACHE.
+		sysconf_cmd > "$SYSCONF_CACHED"
+		find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \
+			| xargs tar cf "${DEVCACHE_TMP}" -T-
+		gzip < "${DEVCACHE_TMP}" > "$DEVCACHE"
+		rm -f "${DEVCACHE_TMP}"
+		rm -f "$DEVCACHE_REGEN"
+	) &
 fi
 
 exit 0
-- 
2.0.4




More information about the Openembedded-core mailing list