forked from Rodderik/android_kernel_epic4g_gb_official
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake-cwm-zip.sh
executable file
·75 lines (65 loc) · 2.67 KB
/
make-cwm-zip.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
69
70
71
72
73
74
75
#!/bin/bash
#
# This script taken your locally built Kernel/arch/arm/boot/zImage and
# stuffs it into epicmtd-kernel.zip, ready to flash in CWM.
#
# Copyright 2012 Warren Togami <[email protected]>
# License: BSD
# Abort on error
. include/functions
set -e
if [ ! -f ./Kernel/arch/arm/boot/zImage ]; then
echo "ERROR: File not found: ./Kernel/arch/arm/boot/zImage"
echo
echo " Run build_kernel.sh first?"
echo
exit 255
fi
if [ "$CM_BUILD" != "epicmtd" ]; then
echo "ERROR: You must breakfast cm_epicmtd-userdebug and make bacon before running this script."
echo
exit 255
fi
if [ ! -f tools/cwm-zip/META-INF/com/google/android/update-binary ]; then
if [ -f ../../../out/target/product/epicmtd/system/bin/updater ]; then
vcp ../../../out/target/product/epicmtd/system/bin/updater tools/cwm-zip/META-INF/com/google/android/update-binary
elif [ -f ../../../out/target/product/epicmtd/symbols/system/bin/updater ]; then
# Check if unstripped updater is built (-userdebug), if so copy and strip it
vcp ../../../out/target/product/epicmtd/symbols/system/bin/updater tools/cwm-zip/META-INF/com/google/android/update-binary
find_toolchain
echo $TCPATH/arm-eabi-strip tools/cwm-zip/META-INF/com/google/android/update-binary
$TCPATH/arm-eabi-strip tools/cwm-zip/META-INF/com/google/android/update-binary
else
echo "ERROR: File not found: ../../../out/target/product/epicmtd/system/bin/updater"
echo " OR"
echo " ../../../out/target/product/epicmtd/symbols/system/bin/updater"
echo
echo " You probably need to 'make bacon' in order to build it, or manually put a binary at"
echo " tools/cwm-zip/META-INF/com/google/android/update-binary"
echo
exit 255
fi
fi
# Copy other files
vcp ../../../out/target/product/epicmtd/utilities/bml_over_mtd tools/cwm-zip/
vcp ../../../device/samsung/epicmtd/bml_over_mtd.sh tools/cwm-zip/
vcp ../../../out/target/product/epicmtd/utilities/busybox tools/cwm-zip/
vcp ../../../out/target/product/epicmtd/utilities/erase_image tools/cwm-zip/
vcp ../../../out/target/product/epicmtd/utilities/flash_image tools/cwm-zip/
# Build boot.img
cd ../../..
rm -rf out/target/product/epicmtd/ramdisk/
rm -rf out/target/product/epicmtd/root/
rm -rf out/target/product/epicmtd/ramdisk.img
rm -rf out/target/product/epicmtd/boot.img
make out/target/product/epicmtd/boot.img
cd - > /dev/null
# Copy boot.img
vcp ../../../out/target/product/epicmtd/boot.img tools/cwm-zip/boot.img
rm -f epicmtd-kernel.zip
cd tools/cwm-zip/
zip -r ../../epicmtd-kernel.zip *
cd - > /dev/null
echo
echo "SUCCESS: epicmtd-kernel.zip complete."
echo