summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-07-22 17:58:19 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-08-17 12:44:37 +0200
commitcfcb14b81513db1af6153a08ed891856da802b37 (patch)
tree59bd7b546f84d04b0b1e96f8f8569d95e28f4e24 /tests
parente2aa3e9ce260646191aa49293bbc99bda034cc38 (diff)
downloadptxdist-cfcb14b81513db1af6153a08ed891856da802b37.tar.gz
ptxdist-cfcb14b81513db1af6153a08ed891856da802b37.tar.xz
[setenv] use make_*_env to create the full bootloader environment
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setenv50
-rwxr-xr-xtests/setenv.kermit11
2 files changed, 8 insertions, 53 deletions
diff --git a/tests/setenv b/tests/setenv
index 6602d30bc..af6ec889a 100755
--- a/tests/setenv
+++ b/tests/setenv
@@ -9,57 +9,9 @@ set -a
. "${PTXDIST_BOARDSETUP}"
set +a
-# We can put both u-boot-env and barebox-env in the platformconfig directory.
-# Both of them will be scanned and parsed. Kermit script will recognize which
-# bootloader is running on the target and pick up the right configuration.
-UBOOT_ENVDIR="${PTXDIST_PLATFORMCONFIGDIR}/u-boot-env"
-BAREBOX_ENVDIR="${PTXDIST_PLATFORMCONFIGDIR}/barebox-env"
-
-if [ -d ${UBOOT_ENVDIR} -a -r ${UBOOT_ENVDIR} ]; then
- CONFFILE="${UBOOT_ENVDIR}/config${PTXDIST_PLATFORMSUFFIX}"
- if [ ! -r "${CONFFILE}.in" ]; then
- if [ -r "`dirname "${CONFFILE}"`/config.in" ]; then
- CONFFILE="`dirname "${CONFFILE}"`/config"
- else
- echo "Direcotry for U-Boot environment found, but config file is missing!" >&2
- exit 1
- fi
- fi
- #Replace @magics@ with PTXCONF-variables
- #FIXME: Warn if variable is empty?
- awk 'match($0, "@[A-Z0-9_]+@") { var=substr($0,RSTART+1,RLENGTH-2); gsub("@"var"@", ENVIRON[var]); } {print} ' "${CONFFILE}".in >"${CONFFILE}"
- UBOOT_CONFFILE="${CONFFILE}"
-fi
-
-if [ -d "${BAREBOX_ENVDIR}" -a -r "${BAREBOX_ENVDIR}" ]; then
- CONFFILE="${BAREBOX_ENVDIR}/config${PTXDIST_PLATFORMSUFFIX}"
- if [ ! -r "${CONFFILE}.in" ]; then
- if [ -r "`dirname "${CONFFILE}"`/config.in" ]; then
- CONFFILE="`dirname "${CONFFILE}"`/config"
- else
- echo "Directory for Barebox environment found, but config file is missing!" >&2
- exit 1
- fi
- fi
- #Replace @magics@ with PTXCONF-variables
- #FIXME: Warn if variable is empty?
- awk 'match($0, "@[A-Z0-9_]+@") { var=substr($0,RSTART+1,RLENGTH-2); gsub("@"var"@", ENVIRON[var]); } {print} ' "${CONFFILE}".in >"${CONFFILE}"
- # Neith u-boot-v2 nor barebox acutally need CONFFILE while calling
- # kermit setenv function. However U-Boot V1 need this. So we have to
- # pass this information to the kwrapper. In case that we only have
- # barebox env directory we set UBOOT_CONFFILE to a dummy value to
- # make sure that setenv can parse the parameters correctly
- [ -z "${UBOOT_CONFFILE}" ] && UBOOT_CONFFILE="NULL"
-fi
-
-if [ -z "${CONFFILE}" ]; then
- echo "No environment directory found!" >&2
- exit 1
-fi
-
PTXDIST_SETENV_ENV_IMAGE="$(mktemp "${PTXCONF_BOARDSETUP_TFTP_PATH}/environment_image.XXXXXX")"
chmod 644 "${PTXDIST_SETENV_ENV_IMAGE}"
-"${PTXDIST_TOPDIR}/tests/kwrapper" setenv "${UBOOT_CONFFILE}" "${PTXDIST_SETENV_ENV_IMAGE}"
+"${PTXDIST_TOPDIR}/tests/kwrapper" setenv "${PTXDIST_SETENV_ENV_IMAGE}"
rm -rf "${PTXDIST_SETENV_ENV_IMAGE}"
diff --git a/tests/setenv.kermit b/tests/setenv.kermit
index 5be088f68..3fab9ec30 100755
--- a/tests/setenv.kermit
+++ b/tests/setenv.kermit
@@ -1,5 +1,8 @@
define setenv_uboot_v1 {
+ run \%1/make_uboot_env \%2
+ ptx_check_fail "Could not generate new environment"
+
ptx_test_start "Setting new environment"
# Open the file with the new environment
@@ -57,13 +60,13 @@ define setenv_uboot_v1 {
define setenv_uboot_v2 {
if eq \m(uboot_prompt) "barebox:" {
- run \%1/make_barebox_env \%3
+ run \%1/make_barebox_env \%2
} else {
- run \%1/make_uboot_v2_env \%3
+ run \%1/make_uboot_v2_env \%2
}
ptx_check_fail "Could not generate new environment"
- .imagename := \fbasename(\%3)
+ .imagename := \fbasename(\%2)
ptx_test_start "Setting initial environment"
ptx_uboot_exec 3 "eth0.ipaddr=\m(PTXCONF_BOARDSETUP_TARGETIP)"
@@ -106,6 +109,6 @@ ptx_init \%2
ptx_uboot_enter_shell
-setenv_uboot_v\m(uboot_version) \%1 \%3 \%4
+setenv_uboot_v\m(uboot_version) \%1 \%3
ptx_exit