diff options
Diffstat (limited to 'ubi-utils')
-rw-r--r-- | ubi-utils/scripts/unubi_test.sh | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/ubi-utils/scripts/unubi_test.sh b/ubi-utils/scripts/unubi_test.sh new file mode 100644 index 0000000..1cbe426 --- /dev/null +++ b/ubi-utils/scripts/unubi_test.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Use raw NAND data, extract UBI image and apply tool to it. +# Test basic functionality. +# +# 2007 Frank Haverkamp <haver@vnet.ibm.com> +# + +version=1.0 + +image=data.mif +oob=oob.bin +data=data.bin +pagesize=2048 +volmax=31 +datadir=unubi_data.bin + +echo "Testcase: ${0} Version: ${version}" +echo + +if [ -f $1 ]; then + image=${1} +fi + +echo "Testing nand2bin ..." +echo " Input: ${image}" +echo " Data: ${data}" +echo " OOB: ${oob}" +echo " Pagesize: ${pagesize}" + +nand2bin --pagesize ${pagesize} -o ${data} -O ${oob} ${image} +echo + +echo "Testing unubi ..." +unubi --version + +echo "Trying to extract first ${volmax} volumes ..." +for v in `seq 0 ${volmax}` ; do + unubi -r${v} ${data} + echo -n "." +done +echo "ok" + +ls -l unubi_data.bin/ + +echo "Extracting graphics ..." +unubi -a ${data} + + +echo "Extracting volume info table ..." +unubi -i ${data} + +echo +echo "Table 0" +echo "-------" +cat ${datadir}/vol_info_table0 + +echo +echo "Table 1" +echo "-------" +cat ${datadir}/vol_info_table1
\ No newline at end of file |