summaryrefslogtreecommitdiff
path: root/ubi-utils/scripts/unubi_test.sh
blob: 1cbe42622bae2c0fa3caacdc86a0fa0bde71f075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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