forked from Shenlhz/dtbo-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPatch.sh
30 lines (29 loc) · 897 Bytes
/
Patch.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
# BY Shenlhz
./bin/mkdtimg dump dtbo.img -b dtb
for i in `find dtb.*`; do
./bin/dtc -I dtb -O dts -@ $i -o $i.dts
mv $i.dts dts.$i
done
rm -rf dtb.*
rm -rf dts
mkdir dts
mv dts.dtb.* dts
info=`cat Info.txt`
hz=`printf %x $info`
Patch1=`grep -l -r -n "qcom,mdss-dsi-panel-framerate = <0x3c>" ./dts`
sed -i "s/qcom,mdss-dsi-panel-framerate = <0x3c>/qcom,mdss-dsi-panel-framerate = <0x$hz>/g" $Patch1
var=`expr "scale=5;$info / 60"|bc`
var2=`expr "$var * 1100000000"|bc`
var3=`printf %x $var2`
Patch2=`grep -l -r -n "qcom,mdss-dsi-panel-clockrate = <0x4190ab00>" ./dts`
sed -i "s/qcom,mdss-dsi-panel-clockrate = <0x4190ab00>/qcom,mdss-dsi-panel-clockrate = <0x$var3>/g" $Patch2
mv ./dts/dts.dtb.* ./
rm -rf dts
for i in `find dts.dtb.*`; do
./bin/dtc -I dts -O dtb -@ -o $i.dtb $i
mv $i.dtb dtb.$i
done
rm -rf dts.dtb.*
./bin/mkdtimg create dtbo_new.img dtb.dts.dtb.*
rm -rf dtb.dts.dtb.*