summaryrefslogtreecommitdiffstats
path: root/tests/make_barebox_env
diff options
context:
space:
mode:
authorLuotao Fu <l.fu@pengutronix.de>2010-02-24 14:29:03 +0100
committerLuotao Fu <l.fu@pengutronix.de>2010-02-24 14:29:06 +0100
commit0cb71a4303bf640c1a4041d6f274abbd1fc1dba3 (patch)
tree85fd68f2ab50a0564a653e2733c1341ac7494fe1 /tests/make_barebox_env
parent192c88011611e1685fad281a5764bd5098f40cb2 (diff)
downloadptxdist-0cb71a4303bf640c1a4041d6f274abbd1fc1dba3.tar.gz
ptxdist-0cb71a4303bf640c1a4041d6f274abbd1fc1dba3.tar.xz
[ptxdist] add environment image generation for barebox
ptxdist now can tell if the target has a barebox or u-boot-v2 bootloader running and calls, depending on this information, the proper script to generate a environment image for the target. Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Diffstat (limited to 'tests/make_barebox_env')
-rwxr-xr-xtests/make_barebox_env18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/make_barebox_env b/tests/make_barebox_env
new file mode 100755
index 000000000..b362dd074
--- /dev/null
+++ b/tests/make_barebox_env
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+PTXDIST_SETENV_U_BOOT_V2_ENV="${1}"
+ENVTMPDIR="$(mktemp -d "${PTXDIST_TEMPDIR}/uboot_v2_env.XXXXXX")"
+
+tar -C "${PTXDIST_PLATFORMCONFIGDIR}/u-boot-env/" -c . \
+ --exclude .svn \
+ --exclude .pc \
+ --exclude .git \
+ --exclude "${PTXDIST_PLATFORMCONFIGDIR}/u-boot-env/config.in" \
+ | tar -C "${ENVTMPDIR}" -x
+
+${PTXDIST_SYSROOT_HOST}/bin/bareboxenv -s "${ENVTMPDIR}" "${IMAGEDIR}/barebox-environment"
+
+cp "${IMAGEDIR}/barebox-environment" "${PTXDIST_SETENV_U_BOOT_V2_ENV}"
+
+rm -rf "${ENVTMPDIR}"