]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu-internal: Hide some harmless warning messages
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 9 Sep 2011 17:18:44 +0000 (18:18 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 9 Sep 2011 17:39:13 +0000 (18:39 +0100)
If sudo is used in the pseudo environment, as done in image tests when
the user hasn't pre-setup the tap device, ensure the LD_PRELOAD error
message isn't seen by the user.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu-internal

index 4f6909b734c370b327f7121fa3066ec564d1101b..ce3291f3a9f41b1ec22c2088402be1df57866328 100755 (executable)
@@ -173,7 +173,9 @@ if [ "$TAP" = "" ]; then
 
     GROUPID=`id -g`
     echo "Setting up tap interface under sudo"
-    tap=`sudo $QEMUIFUP $GROUPID $OECORE_NATIVE_SYSROOT`
+    # Redirect stderr since we could see a LD_PRELOAD warning here if pseudo is loaded
+    # but inactive. This looks scary but is harmless
+    tap=`sudo $QEMUIFUP $GROUPID $OECORE_NATIVE_SYSROOT 2> /dev/null`
     if [ $? -ne 0 ]; then
         # Re-run standalone to see verbose errors
         sudo $QEMUIFUP $GROUPID $OECORE_NATIVE_SYSROOT
@@ -191,7 +193,9 @@ fi
 
 cleanup() {
     if [ ! -e "$NOSUDO_FLAG" ]; then
-        sudo $QEMUIFDOWN $TAP $OECORE_NATIVE_SYSROOT
+        # Redirect stderr since we could see a LD_PRELOAD warning here if pseudo is loaded
+        # but inactive. This looks scary but is harmless
+        sudo $QEMUIFDOWN $TAP $OECORE_NATIVE_SYSROOT 2> /dev/null
     fi
     echo "Releasing lockfile of preconfigured tap device '$TAP'"
     release_lock $LOCKFILE