-
Notifications
You must be signed in to change notification settings - Fork 10
/
fix.sh
32 lines (28 loc) · 754 Bytes
/
fix.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
#!/sbin/bbx sh
PATH=/system/xbin:/system/bin:/sbin
fixReference()
{
FIXBLK=$(/sbin/bbx cat /proc/partitions | /sbin/bbx grep ${2} | /sbin/bbx cut -c26-35 | /sbin/bbx sed s/\t*//)
if [ "$FIXBLK" != "" ]; then
/sbin/bbx sed s/$FIXBLK/${3}/ < ${1} > ${1}.bak
RESULT=`echo $?`
if [ $RESULT -eq 0 ]; then
if [ -f ${1}.bak ]; then
/sbin/bbx mv ${1}.bak ${1}
fi
else
/sbin/rm ${1}.bak
fi
fi
}
# fix "old" style mounts
for f in ./init.*.rc
do
fixReference "$f" system system
fixReference "$f" userdata userdata
fixReference "$f" cache cache
fixReference "$f" pds pds
# include translations for older SS2 style ROMs (preinstall / webtop used as system)
fixReference "$f" preinstall system
fixReference "$f" webtop system
done