diff options
Diffstat (limited to 'tests/make_barebox_env')
-rwxr-xr-x | tests/make_barebox_env | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/make_barebox_env b/tests/make_barebox_env index 84b069497..ac130bb1d 100755 --- a/tests/make_barebox_env +++ b/tests/make_barebox_env @@ -4,6 +4,15 @@ set -e PTXDIST_SETENV_BAREBOX_ENV="${1}" ENVTMPDIR="$(mktemp -d "${PTXDIST_TEMPDIR}/barebox_env.XXXXXX")" +# IMAGEDIR is not set if we use this script with "ptxdist test" directly +# since it comes from kwraper. +[ -z "${IMAGEDIR}" ] && export IMAGEDIR=${PTXDIST_PLATFORMDIR}/images + +if [ ! -r ${PTXDIST_PLATFORMCONFIGDIR}/barebox-env/config ]; then + echo "ERROR: missing valid ${PTXDIST_PLATFORMCONFIGDIR}/barebox-env/config" >&2 + exit 1 +fi + tar -C "${PTXDIST_PLATFORMCONFIGDIR}/barebox-env/" -c . \ --exclude .svn \ --exclude .pc \ @@ -12,8 +21,9 @@ tar -C "${PTXDIST_PLATFORMCONFIGDIR}/barebox-env/" -c . \ --exclude "*/*~" \ | tar -C "${ENVTMPDIR}" -x -${PTXDIST_SYSROOT_HOST}/bin/bareboxenv -s "${ENVTMPDIR}" "${IMAGEDIR}/barebox-environment" +bareboxenv -s "${ENVTMPDIR}" "${IMAGEDIR}/barebox-environment" -cp "${IMAGEDIR}/barebox-environment" "${PTXDIST_SETENV_BAREBOX_ENV}" +# only copy the image if we are called by "test setenv" +[ -n "${PTXDIST_SETENV_BAREBOX_ENV}" ] && cp "${IMAGEDIR}/barebox-environment" "${PTXDIST_SETENV_BAREBOX_ENV}" rm -rf "${ENVTMPDIR}" |