forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_data_local_to_update_script
More file actions
executable file
·68 lines (55 loc) · 2.08 KB
/
add_data_local_to_update_script
File metadata and controls
executable file
·68 lines (55 loc) · 2.08 KB
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
62
63
64
65
66
67
68
############################################################################
#
# Copyright (c) 2011 - dsixda ([email protected])
#
# Android Kitchen is 100% free. This script file is intended for personal
# and/or educational use only. It may not be duplicated for monetary
# benefit or any other purpose without the permission of the developer.
#
############################################################################
cd WORKING_*
cd META-INF/com/google/android
if [ ! -e update-script ]
then
echo "Error: update-script not found"
cd ../../../../..
exit 0
fi
grep_data_local=`grep -c "0771 DATA:local" update-script`
if [ "$grep_data_local" == "1" ]
then
echo "update-script already has /data/local content"
else
echo "Updating update-script with /data/local entries"
if [ `grep -c "format .*DATA:" update-script` == 0 ]
then
if [ `grep -c "format .*SYSTEM:" update-script` == 0 ]
then
sed -i -e '1i delete DATA:local\n' update-script
else
sed -i -e 's/format\(.*\)SYSTEM:[ ]*[\n]*/format\1SYSTEM:\ndelete DATA:local\n/' update-script
fi
else
#
# The 'delete DATA:local' command is redundant because you're formatting the DATA partition,
# but we'll do that in case the user decides later to remove the format command.
#
sed -i -e 's/format\(.*\)DATA:[ ]*[\n]*/format\1DATA:\ndelete DATA:local\n/' update-script
fi
if [ `grep -c "copy_dir PACKAGE:data DATA:" update-script` == 0 ]
then
sed -i -e 's/delete DATA:local[ ]*[\n]*/delete DATA:local\ncopy_dir PACKAGE:data DATA:\n/' update-script
fi
sed -i -e 's/copy_dir PACKAGE:data DATA:[ ]*[\n]*/copy_dir PACKAGE:data DATA:\nset_perm 2000 2000 0771 DATA:local\n/' update-script
grep_data_local=`grep -c "0771 DATA:local" update-script`
if [ $grep_data_local == 0 ]
then
echo "Error: Unable to update update-script with /data/local"
else
echo
echo "You can now put your custom bootanimation.zip under /data/local."
echo "If it is missing then the ROM will use the default boot animation."
fi
fi
cd ../../../../..
scripts/fix_update_script_blanks