-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_img.sh
executable file
·37 lines (32 loc) · 1.24 KB
/
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
31
32
33
34
35
36
37
#!/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.img.bin
out_file_mz=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_mz=u-boot_S.mz.img.bin
out_file_xz=u-boot_S.xz.img.bin
# out_file=u-boot_S.img.bin
fi
echo ""
echo $out_file_mz
echo ./mkimage -A arm -O u-boot -C mz -a 0 -e 0 -n "$(echo $ms_ver)" -d u-boot.bin.mz "$out_file_mz"
./mkimage -A arm -O u-boot -C mz -a 0 -e 0 -n "$ms_ver" -d u-boot.bin.mz "$out_file_mz"
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 ""
#echo ""
#echo $out_file
#echo ./mkimage -A arm -O u-boot -C xz -a 0 -e 0 -n "$(echo $ms_ver)" -d u-boot.bin.xz "$out_file"
#./mkimage -A arm -O u-boot -C none -a 0 -e 0 -n "$ms_ver" -d u-boot.bin "$out_file"
#echo ""