forked from nucked/build-recovery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makerecoveries.sh
69 lines (58 loc) · 1.56 KB
/
makerecoveries.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
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
if [ -z "$1" ]
then
echo "Please provide a lunch option."
return
fi
PRODUCTS=$1
for product in $PRODUCTS
do
echo $product
done
echo $(echo $PRODUCTS | wc -w) Products
unset PUBLISHED_RECOVERIES
MCP=$(which mcp)
if [ -z "$MCP" ]
then
NO_UPLOAD=true
fi
function mcpguard () {
if [ -z $NO_UPLOAD ]
then
mcp $1 $2
md5sum $1 > $1.md5sum.txt
mcp $1.md5sum.txt $2.md5sum.txt
fi
}
VERSION=$(cat bootable/recovery/Android.mk | grep RECOVERY_VERSION | grep RECOVERY_NAME | awk '{ print $4 }' | sed s/v//g)
echo Recovery Version: $VERSION
for lunchoption in $PRODUCTS
do
lunch $lunchoption
if [ -z $NO_CLEAN ]
then
rm -rf $OUT/obj/EXECUTABLES/recovery_intermediates
rm -rf $OUT/recovery*
rm -rf $OUT/root*
fi
DEVICE_NAME=$(echo $TARGET_PRODUCT | sed s/koush_// | sed s/aosp_// | sed s/motorola// | sed s/huawei_// | sed s/htc_// | sed s/_us// | sed s/cyanogen_// | sed s/generic_// | sed s/full_//)
PRODUCT_NAME=$(basename $OUT)
make -j16 recoveryzip
RESULT=$?
if [ $RESULT != "0" ]
then
echo build error!
break
fi
mcpguard $OUT/recovery.img recoveries/recovery-clockwork-$VERSION-$DEVICE_NAME.img
mcpguard $OUT/utilities/update.zip recoveries/recovery-clockwork-$VERSION-$DEVICE_NAME.zip
if [ -f "ROMManagerManifest/devices.rb" ]
then
pushd ROMManagerManifest
ruby devices.rb $DEVICE_NAME $VERSION $lunchoption
popd
fi
done
for published_recovery in $PUBLISHED_RECOVERIES
do
echo $published_recovery
done