]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts: use OE_TMPDIR instead of TMPDIR external variable
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 28 Sep 2011 15:28:25 +0000 (16:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 28 Sep 2011 20:36:51 +0000 (21:36 +0100)
On OpenSUSE within an X session, TMPDIR is set to the system temporary
directory (/tmp) which is incorrect for these scripts. Thus, change
runqemu and oe-setup-rpmrepo to use OE_TMPDIR from the external
environment rather than TMPDIR.

Fixes [YOCTO #1530]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/imagetest-qemu.bbclass
scripts/oe-setup-rpmrepo
scripts/qemuimage-testlib
scripts/runqemu

index 18798e025c83c8deffc46658eb60b553e4b7be0d..4ea86c04fe5c12a8d3714dc86d9c72ba02657733 100644 (file)
@@ -70,7 +70,7 @@ def qemuimagetest_main(d):
         os.environ["DISPLAY"] = bb.data.getVar("DISPLAY", d, True)
         os.environ["COREBASE"] = bb.data.getVar("COREBASE", d, True)
         os.environ["TOPDIR"] = bb.data.getVar("TOPDIR", d, True)
-        os.environ["TMPDIR"] = bb.data.getVar("TMPDIR", d, True)
+        os.environ["OE_TMPDIR"] = bb.data.getVar("TMPDIR", d, True)
         os.environ["TEST_STATUS"] = bb.data.getVar("TEST_STATUS", d, True)
         os.environ["TARGET_IPSAVE"] = bb.data.getVar("TARGET_IPSAVE", d, True)
         os.environ["TEST_SERIALIZE"] = bb.data.getVar("TEST_SERIALIZE", d, True)
index 03372b61992331ebec1e372672ff9b359378fdfa..fc2f7a8c0cf5d9f08d66dfb431d2adc7688e74e0 100755 (executable)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
+
+# Don't use TMPDIR from the external environment, it may be a distro
+# variable pointing to /tmp (e.g. within X on OpenSUSE)
+# Instead, use OE_TMPDIR for passing this in externally.
+TMPDIR="$OE_TMPDIR"
+
 function usage() {
        echo "Usage: $0 <rpm-dir>"
-       echo "  <rpm-dir>: default is $TPMDIR/deploy/rpm"
+       echo "  <rpm-dir>: default is $TMPDIR/deploy/rpm"
 }
 
 if [ $# -gt 1 ]; then
index 9ffaa7c785fbb7ad61bd9f78346d3dee1df48470..6a1b9002a426bbe8675e9c6159c9107371a130a5 100644 (file)
@@ -467,8 +467,8 @@ Test_Create_Qemu()
                export MACHINE=$QEMUARCH
 
                # Create Qemu in localhost VNC Port 1
-               echo "Running xterm -display ${DISPLAY} -e 'TMPDIR=${TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} && /bin/sleep 60' &"
-               xterm -display ${DISPLAY} -e "TMPDIR=${TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} && /bin/sleep 60" &
+               echo "Running xterm -display ${DISPLAY} -e 'OE_TMPDIR=${OE_TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} && /bin/sleep 60' &"
+               xterm -display ${DISPLAY} -e "OE_TMPDIR=${OE_TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} && /bin/sleep 60" &
        
                # Get the pid of the xterm processor, which will be used in Test_Kill_Qemu
                PID=$!
index 0f943b5fec5791dbbf54e42b14839d8ee81c72f9..31e98226936c81d37616025434207da78ebf7485 100755 (executable)
@@ -55,6 +55,11 @@ SCRIPT_QEMU_OPT=""
 SCRIPT_QEMU_EXTRA_OPT=""
 SCRIPT_KERNEL_OPT=""
 
+# Don't use TMPDIR from the external environment, it may be a distro
+# variable pointing to /tmp (e.g. within X on OpenSUSE)
+# Instead, use OE_TMPDIR for passing this in externally.
+TMPDIR="$OE_TMPDIR"
+
 # Determine whether the file is a kernel or QEMU image, and set the
 # appropriate variables
 process_filename() {
@@ -260,7 +265,7 @@ SPITZ_DEFAULT_FSTYPE=ext3
 
 setup_tmpdir() {
     if [ -z "$TMPDIR" ]; then
-        # BUILDDIR unset, try and get TMPDIR from bitbake
+        # Try to get TMPDIR from bitbake
         type -P bitbake &>/dev/null || {
             echo "In order for this script to dynamically infer paths";
             echo "to kernels or filesystem images, you either need";