forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_rom
More file actions
executable file
·144 lines (118 loc) · 2.64 KB
/
check_rom
File metadata and controls
executable file
·144 lines (118 loc) · 2.64 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
############################################################################
#
# 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.
#
############################################################################
#
# This script has two optional arguments:
#
# $1 = "no_info" - specify this when porting or extracting kernel
# $2 = "kernel_only" - if this is specified, then $1 is mandatory
#
echo
echo "CREATE WORKING FOLDER FOR ROM"
echo "=============================="
echo
echo "Ensure there is at least one ROM under the 'original_update' folder!"
echo
echo "Select an option:"
echo
echo " s - Show supported formats"
echo " x - Abort, don't create working folder"
echo ""
echo "Or press Enter to continue"
echo
echo -n "? "
read proceed
if [ "$proceed" == "x" ]
then
echo
echo "Cancelled"
exit 1
elif [ "$proceed" == "s" ]
then
more tools/formats.txt
echo
echo -n "Press Enter to continue, or type 'x' to abort: "
read proceed
if [ "$proceed" == "x" ]
then
exit 1
fi
fi
scripts/make_backup_working
#
# Check if the working folder was actually backed up
#
result=$?
if [ "$result" == "1" ]
then
echo
echo "Error: Old working folder is in use. Ensure its files or folders are not open."
scripts/press_enter
exit 1
else
scripts/choose_rom $2
res=$?
if [ "$res" == "1" ] && [ "$2" == "kernel_only" ]
then
scripts/press_enter
fi
if [ `ls | grep -m 1 WORKING_` ] && [ "$res" != "1" ] && [ "$1" == "" ]
then
#
# Check for radio.img
#
echo
cd WORKING*
if [ -e radio.img ]
then
echo
echo "NOTE: radio.img was found in the working folder. If you wish to"
echo "remove it, you may do so at any time before building the ROM."
else
if [ -e META-INF/com/google/android/update-script ]
then
cd ..
scripts/update_script_should_convert_back ignore_msg
res=$?
cd WORKING_*
fi
fi
if [ -e boot.img ]
then
boot_found=yes
elif [ -e boot/zImage ] && [ -e boot/initrd.gz ]
then
boot_found=yes
else
boot_found=no
fi
if [ "$boot_found"=="yes" ]
then
#
# Prompt to show ROM info
#
if [ "$1" == "" ]
then
cd ..
scripts/prompt_show_rom_info
else
cd ..
fi
else
echo
echo "No boot image found!"
cd ..
fi
fi
fi
if [ "$1" == "" ]
then
scripts/press_enter
fi
exit $res