-
Notifications
You must be signed in to change notification settings - Fork 4
/
create_img.sh
30 lines (25 loc) · 985 Bytes
/
create_img.sh
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
#!/bin/sh
rm -Rf u-boot.bin.mz
rm -Rf u-boot.bin.xz
./mz c u-boot.bin u-boot.bin.mz
xz -z -k u-boot.bin u-boot.bin.xz
ms_ver="$(strings -a -T binary u-boot.bin | grep 'MVX' | grep 'UBT1501' | sed 's/\\*MVX/MVX/g' | cut -c 1-32)"
#./mkimage -A arm -O u-boot -C mz -a 0 -e 0 -n "$ms_ver" -d u-boot.bin.mz u-boot.mz.img.bin
out_file=u-boot.mz.img.bin
out_file_xz=u-boot.xz.img.bin
if [ `echo $ms_ver | grep -c "MVX1S" ` -gt 0 ];then
out_file=u-boot_S.mz.img.bin
out_file_xz=u-boot_S.xz.img.bin
fi
echo ""
echo $out_file
echo ./mkimage -A arm -O u-boot -C mz -a 0 -e 0 -n "$(echo $ms_ver)" -d u-boot.bin.mz "$out_file"
./mkimage -A arm -O u-boot -C mz -a 0 -e 0 -n "$ms_ver" -d u-boot.bin.mz "$out_file"
rm -Rf u-boot.bin.mz
echo ""
echo ""
echo $out_file_xz
echo ./mkimage -A arm -O u-boot -C xz -a 0 -e 0 -n "$(echo $ms_ver)" -d u-boot.bin.xz "$out_file_xz"
./mkimage -A arm -O u-boot -C lzma -a 0 -e 0 -n "$ms_ver" -d u-boot.bin.xz "$out_file_xz"
rm -Rf u-boot.bin.xz
echo ""