+# Setup tmpdir - if TMPDIR env variable is set, use that one
+# else create in $HOME/fueltmp
+if [ -n "${TMPDIR}" ]; then
+ if [ -d ${TMPDIR} ]; then
+ tmpdir=${TMPDIR}/fueltmp
+ echo "Using TMPDIR=${TMPDIR}, so tmpdir=${tmpdir}"
+ else
+ error_exit "No such directory for TMPDIR: ${TMPDIR}"
+ fi
+else
+ tmpdir=${HOME}/fueltmp
+ echo "Default: tmpdir=$tmpdir"
+fi
+
+# Umask must be changed so files created are readable by qemu
+umask 0022
+