[OE-core] [PATCH 06/20] udev-cache: Remove superfluous subshell on extract

Ben Shelton ben.shelton at ni.com
Mon Aug 4 18:40:58 UTC 2014


From: Richard Tollerton <rich.tollerton at ni.com>

tar -C exists in both GNU and busybox tar, so use that instead of
(cd /; tar ...). This allows the subshell to be removed.

Natinst-Rally-ID: TA44427
Acked-by: Gratian Crisan <gratian.crisan at ni.com>
Natinst-ReviewBoard-ID: 58620
Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
---
 meta/recipes-core/udev/udev/init       | 2 +-
 meta/recipes-core/udev/udev/udev-cache | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index a96309d..bcb9040 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -69,7 +69,7 @@ case "$1" in
 		    readfiles /etc/udev/cache.data
 		    OLDDATA="$READDATA"
 		    if [ "$OLDDATA" = "$NEWDATA" ]; then
-                            (cd /; tar xzf $DEVCACHE --exclude=log)
+                            tar xzf $DEVCACHE -C / --exclude=log
                             not_first_boot=1
                             [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
                             [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index 154d2ad..11c5f0e 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -25,7 +25,7 @@ fi
 
 if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
 	[ "${VERBOSE}" != "no" ] && echo "Populating dev cache"
-	(cd /; tar czf "$DEVCACHE" dev)
+	tar czf "$DEVCACHE" dev -C / --exclude=log
 	mv /dev/shm/udev.cache /etc/udev/cache.data
 fi
 
-- 
2.0.4




More information about the Openembedded-core mailing list