forked from M66B/cm10-fxp-extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
805 lines (702 loc) · 21.8 KB
/
update.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
#!/bin/bash
echo "$0" | grep -q bash
if [ $? -eq 0 ] || [ "${buildbot}" = "Y" ]; then
cd ~/Downloads/cm10-fxp-extended
else
cd "`dirname \"$0\"`"
fi
#Prerequisites
#bash
if [ ! -n "$BASH" ]; then
echo "Try again with a bash shell"
return
fi
#lz4
which lz4 > /dev/null
if [ $? -ne 0 ]; then
echo "Install lz4:"
echo ""
echo "cd ~/Downloads"
echo "svn checkout -r 91 http://lz4.googlecode.com/svn/trunk/ lz4"
echo "cd lz4 && make && cp lz4demo ~/bin/lz4"
echo ""
return
fi
#Configuration
patches=`pwd`
repo=`which repo`
tmp=/tmp
android=~/android/system
devices="coconut iyokan mango smultron"
init=N
updates=N
debug=N
if [ "$1" = "init" ]; then
init=Y
fi
#Linaro
linaro_name=arm-eabi-4.7-linaro
linaro_file=android-toolchain-eabi-4.7-daily-linux-x86.tar.bz2
linaro_url=https://android-build.linaro.org/jenkins/view/Toolchain/job/linaro-android_toolchain-4.7-bzr/lastSuccessfulBuild/artifact/build/out/${linaro_file}
#bootimage
kernel3=N
kernel_mods=Y
kernel_linaro=Y
kernel_xtended_perm=Y
kernel_wifi_range=Y
kernel_displaylink=Y
kernel_volumes=Y
bootlogo=N
bootlogoh=logo_H_extended.png
bootlogom=logo_M_extended.png
pin=N
#ROM
cellbroadcast=Y
openpdroid=N
nano=N
terminfo=N
emptydrawer=Y
massstorage=N
xsettings=Y
wifiautoconnect=Y
eba=Y
ssh=N
layout=Y
mvolume=Y
qcomdispl=Y
boost_pulse=Y
iw=Y
mms_fix=Y
apn_cm10_1=Y
trebuchet_cm10_1=N
deskclock_cm10_1=Y
superuser_koush=Y
superuser_embed=Y
cmfilemanager_cm10_1=Y
apollo_cm10_1=Y
cwm_cm10_1=Y
calendar_cm10_1=Y
email_cm10_1=Y
cmupdater=N
#Local configuration
if [ -f ~/.cm10xtended ]; then
. ~/.cm10xtended
fi
#Say hello
echo ""
echo "CM/FXP extended ROM/kernel"
echo "Copyright (c) 2012-2013 Marcel Bokhorst (M66B)"
echo "http://blog.bokhorst.biz/about/"
echo ""
echo "GNU GENERAL PUBLIC LICENSE Version 3"
echo ""
echo "Patches: ${patches}"
echo "Repo: ${repo}"
echo "Tmp: ${tmp}"
echo "Android: ${android}"
echo "Devices: ${devices}"
echo "Init: ${init}"
echo "Updates: ${updates}"
echo ""
#Prompt
if [[ $- == *i* ]]
then
read -p "Press [ENTER] to continue" dummy
echo ""
fi
#Helper functions
do_replace() {
sed -i "s/$1/$2/g" $3
grep -q "$2" $3
if [ $? -ne 0 ]; then
echo "!!! Error replacing '$1' by '$2' in $3"
exit
fi
if [ "${debug}" = "Y" ]; then
echo "Replaced '$1' by '$2' in $3"
fi
}
do_patch() {
if [ -f ${patches}/$1 ]; then
patch -p1 --forward -r- --no-backup-if-mismatch <${patches}/$1
if [ $? -ne 0 ]; then
echo "!!! Error applying patch $1"
fi
else
echo "!!! Patch $1 not found"
fi
}
do_patch_reverse() {
if [ -f ${patches}/$1 ]; then
patch -p1 --reverse -r- --no-backup-if-mismatch <${patches}/$1
if [ $? -ne 0 ]; then
echo "!!! Error applying reverse patch $1"
fi
else
echo "!!! Patch $1 not found"
fi
}
do_append() {
if [ -f $2 ]; then
echo "$1" >>$2
if [ "${debug}" = "Y" ]; then
echo "Appended '$1' to $2"
fi
else
echo "!!! Error appending '$1' to $2"
exit
fi
}
do_deldir() {
if [ -d "$1" ]; then
chmod -R 777 $1
rm -R $1
else
if [ "${debug}" = "Y" ]; then
echo "--- $1 does not exist"
fi
fi
}
do_copy() {
cp $1 $2
if [ $? -ne 0 ]; then
echo "!!! Error copying $1 to $2"
exit
fi
}
#Headless
mkdir -p ~/Downloads
#Cleanup
echo "*** Cleanup ***"
#OpenPDroid
do_deldir ${android}/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates
do_deldir ${android}/out/target/common/obj/JAVA_LIBRARIES/framework2_intermediates
do_deldir ${android}/out/target/common/obj/APPS/TelephonyProvider_intermediates
for device in ${devices}; do
#kernel
do_deldir ${android}/out/target/product/${device}/obj/KERNEL_OBJ/
if [ -d "${android}/out/target/product/${device}" ]; then
cd ${android}/out/target/product/${device}/
rm -f ./kernel ./*.img ./*.cpio ./*.fs
fi
#ROM
if [ -d "${android}/out/target/product/${device}/system" ]; then
rm -f ${android}/out/target/product/${device}/system/build.prop
rm -f ${android}/out/target/product/${device}/system/lib/modules/*
rm -f ${android}/out/target/product/${device}/system/xbin/su
fi
#recovery
do_deldir ${android}/out/target/product/${device}/obj/EXECUTABLES/recovery_intermediates
do_deldir ${android}/out/target/product/${device}/obj/RECOVERY_EXECUTABLES
do_deldir ${android}/out/target/product/${device}/obj/STATIC_LIBRARIES/libcrecovery_intermediates
do_deldir ${android}/out/target/product/${device}/recovery/root
done
#Replaced projects
if [ "${init}" = "Y" ]; then
cd ${android}
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
do_deldir ${android}/system/su
do_deldir ${android}/packages/apps/Superuser
do_deldir ${android}/packages/apps/Trebuchet
do_deldir ${android}/packages/apps/DeskClock
do_deldir ${android}/packages/apps/CMUpdater
do_deldir ${android}/packages/apps/CMFileManager
do_deldir ${android}/packages/apps/Apollo
do_deldir ${android}/packages/apps/Calendar
do_deldir ${android}/packages/apps/Email
do_deldir ${android}/bootable/recovery
do_deldir ${android}/kernel/semc/msm7x30
do_deldir ${android}/.repo/projects/system/su.git
do_deldir ${android}/.repo/projects/packages/apps/Superuser.git
do_deldir ${android}/.repo/projects/packages/apps/Trebuchet.git
do_deldir ${android}/.repo/projects/packages/apps/DeskClock.git
do_deldir ${android}/.repo/projects/packages/apps/CMUpdater.git
do_deldir ${android}/.repo/projects/packages/apps/CMFileManager.git
do_deldir ${android}/.repo/projects/packages/apps/Apollo.git
do_deldir ${android}/.repo/projects/packages/apps/Calendar.git
do_deldir ${android}/.repo/projects/packages/apps/Email.git
do_deldir ${android}/.repo/projects/bootable/recovery.git
do_deldir ${android}/.repo/projects/kernel/semc/msm7x30.git
fi
#Local manifest
echo "*** Local manifest ***"
mkdir -p ${android}/.repo/local_manifests
do_copy ${patches}/cmxtended.xml ${android}/.repo/local_manifests/cmxtended.xml
#kernel
if [ "${kernel3}" = "Y" ]; then
echo "--- Kernel 3.0"
sed -i "/msm7x30-2.6.32.x-nAa/d" ${android}/.repo/local_manifests/cmxtended.xml
else
echo "--- Kernel 2.6.32"
sed -i "/msm7x30-3.0.x-nAa/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
#su koush
if [ "${superuser_koush}" = "Y" ]; then
echo "--- Superuser koush"
if [ "${superuser_embed}" = "Y" ]; then
sed -i "/koush/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
else
sed -i "/koush/d" ${android}/.repo/local_manifests/cmxtended.xml
sed -i "/android_system_su/d" ${android}/.repo/local_manifests/cmxtended.xml
sed -i "/android_packages_apps_Superuser/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
#Trebuchet CM10.1
if [ "${trebuchet_cm10_1}" = "Y" ]; then
echo "--- Trebuchet CM10.1"
else
sed -i "/android_packages_apps_Trebuchet/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
#DeskClock CM10.1
if [ "${deskclock_cm10_1}" = "Y" ]; then
echo "--- DeskClock CM10.1"
else
sed -i "/android_packages_apps_DeskClock/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
#CMFileManager CM10.1
if [ "${cmfilemanager_cm10_1}" = "Y" ]; then
echo "--- CMFileManager CM10.1"
else
sed -i "/android_packages_apps_CMFileManager/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
if [ "${iw}" = "Y" ]; then
echo "--- iw"
else
sed -i "/dickychiang/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
#Apollo CM10.1
if [ "${apollo_cm10_1}" = "Y" ]; then
echo "--- Apollo CM10.1"
else
sed -i "/android_packages_apps_Apollo/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
#CWM CM10.1
if [ "${cwm_cm10_1}" = "Y" ]; then
echo "--- CWM CM10.1"
else
sed -i "/android_bootable_recovery/d" ${android}/.repo/local_manifests/cmxtended.xml
fi
#CMUpdater
if [ "${updates}" = "Y" ] || [ "${cmupdater}" = "N" ]; then
echo "--- updates"
sed -i "/CMUpdater/d" ${android}/vendor/cm/config/common.mk
fi
#Sync
echo "*** Repo sync ***"
cd ${android}
if [ "${init}" != "Y" ]; then
${repo} forall -c "git remote -v | head -n 1 | tr -d '\n' && echo -n ': ' && git reset --hard && git clean -df"
if [ $? -ne 0 ] && [ "${buildbot}" != "Y" ]; then
exit
fi
fi
${repo} sync
if [ $? -ne 0 ]; then
exit
fi
#Linaro toolchain
if [ "${kernel_linaro}" = "Y" ]; then
echo "*** Linaro toolchain: ${linaro_name} ***"
linaro_dir=${android}/prebuilt/linux-x86/toolchain/${linaro_name}/
if [ ! -d "${linaro_dir}" ]; then
linaro_dl=~/Downloads/${linaro_file}
if [ ! -f "${linaro_dl}" ]; then
wget -O ${linaro_dl} ${linaro_url}
if [ $? -ne 0 ]; then
exit
fi
fi
echo "--- Extracting"
cd ${tmp}
if [ -d "./android-toolchain-eabi/" ]; then
chmod 777 ./android-toolchain-eabi/
rm -R ./android-toolchain-eabi/
fi
tar -jxf ${linaro_dl}
mkdir ${linaro_dir}
echo "--- Installing"
cp -R ./android-toolchain-eabi/* ${linaro_dir}
if [ $? -ne 0 ]; then
exit
fi
fi
fi
#Prebuilts
if [ "${openpdroid}" = "Y" ]; then
do_append "curl -L -o ${android}/vendor/cm/proprietary/PDroid_Manager.apk -O -L https://github.com/wsot/pdroid_manager_build/blob/master/PDroid_Manager_latest.apk?raw=true" ${android}/vendor/cm/get-prebuilts
do_append "PRODUCT_COPY_FILES += vendor/cm/proprietary/PDroid_Manager.apk:system/app/PDroid_Manager.apk" ${android}/vendor/cm/config/common.mk
fi
if [ "${updates}" = "Y" ]; then
do_append "curl -L -o ${android}/vendor/cm/proprietary/GooManager.apk -O -L https://github.com/solarnz/GooManager_prebuilt/blob/master/GooManager.apk?raw=true" ${android}/vendor/cm/get-prebuilts
do_append "PRODUCT_COPY_FILES += vendor/cm/proprietary/GooManager.apk:system/app/GooManager.apk" ${android}/vendor/cm/config/common.mk
fi
if [ "${superuser_embed}" = "Y" ]; then
do_append "curl -L -o ${android}/vendor/cm/proprietary/Superuser.apk -O -L http://download.clockworkmod.com/apks/Superuser.apk" ${android}/vendor/cm/get-prebuilts
do_append "unzip -o -d ${android}/vendor/cm/proprietary ${android}/vendor/cm/proprietary/Superuser.apk assets/armeabi/*" ${android}/vendor/cm/get-prebuilts
do_append "PRODUCT_COPY_FILES += vendor/cm/proprietary/Superuser.apk:system/app/Superuser.apk" ${android}/vendor/cm/config/common.mk
do_append "PRODUCT_COPY_FILES += vendor/cm/proprietary/assets/armeabi/su:system/xbin/su" ${android}/vendor/cm/config/common.mk
else
do_append "SUPERUSER_PACKAGE := com.m66b.superuser" ${android}/device/semc/msm7x30-common/BoardConfigCommon.mk
fi
${android}/vendor/cm/get-prebuilts
if [ $? -ne 0 ]; then
exit
fi
#APN's CM10.1
if [ "${apn_cm10_1}" = "Y" ]; then
cd ${android}/vendor/cm/prebuilt/common/etc
wget -N https://raw.github.com/CyanogenMod/android_vendor_cm/cm-10.1/prebuilt/common/etc/apns-conf.xml
fi
#--- kernel ---
#Linaro
if [ "${kernel_linaro}" = "Y" ]; then
echo "*** Kernel Linaro toolchain"
for device in ${devices}; do
do_replace "arm-eabi-4.4.3" "${linaro_name}" ${android}/device/semc/${device}/BoardConfig.mk
done
fi
#nAa msm7x30 kernel
#caf 2.6.32: M7630AABBQMLZA41601050
#caf 3.0.8: M7630AABBQMLZA404033I
if [ "${kernel_mods}" = "Y" ]; then
echo "*** Kernel ***"
cd ${android}/kernel/semc/msm7x30/
if [ "${kernel3}" = "Y" ]; then
do_patch kernel3_fixes.patch
do_patch kernel3_underclock.patch
do_patch kernel3_hdmi.patch
do_patch kernel3_hdmi_dependencies.patch
do_patch kernel3_usb_tether.patch
if [ "${kernel_linaro}" = "Y" ]; then
do_patch kernel3_linaro.patch
fi
do_append "TARGET_RECOVERY_PIXEL_FORMAT := \"RGBX_8888\"" ${android}/device/semc/msm7x30-common/BoardConfigCommon.mk
else
if [ "${kernel_wifi_range}" = "Y" ]; then
echo "--- Wi-Fi range"
do_patch kernel_wifi_range.patch
fi
if [ "${kernel_displaylink}" = "Y" ]; then
echo "--- DisplayLink"
do_patch kernel_fbudl.patch
for device in ${devices}; do
kconfig=${android}/kernel/semc/msm7x30/arch/arm/configs/cyanogen_${device}_defconfig
if [ -f ${kconfig} ]; then
do_replace "# CONFIG_FB_UDL is not set" "CONFIG_FB_UDL=m" ${kconfig}
#do_replace "CONFIG_USB_OTG_WHITELIST=y" "CONFIG_USB_OTG_WHITELIST=n" ${kconfig}
fi
done
fi
if [ "${kernel_volumes}" = "Y" ]; then
echo "--- Volumes"
do_patch kernel_volumes.patch
fi
fi
if [ "${kernel_xtended_perm}" = "Y" ]; then
echo "--- Xtended permissions"
do_patch kernel_smartass_perm.patch
if [ "${kernel3}" = "Y" ]; then
do_patch kernel3_autogroup_perm.patch
else
do_patch kernel_autogroup_perm.patch
fi
fi
for device in ${devices}; do
if [ -f arch/arm/configs/nAa_${device}_defconfig ]; then
echo "--- Config ${device}"
do_copy arch/arm/configs/nAa_${device}_defconfig arch/arm/configs/cm_${device}_defconfig
do_replace "# CONFIG_SCHED_AUTOGROUP is not set" "CONFIG_SCHED_AUTOGROUP=y" arch/arm/configs/cm_${device}_defconfig
if [ "${kernel3}" = "Y" ]; then
do_replace "CONFIG_LOCALVERSION=\"-nAa" "CONFIG_LOCALVERSION=\"-nAa-Xtd" arch/arm/configs/cm_${device}_defconfig
do_replace "# CONFIG_CLEANCACHE is not set" "CONFIG_CLEANCACHE=y" arch/arm/configs/cm_${device}_defconfig
#do_replace "# CONFIG_USB_OTG is not set" "CONFIG_USB_OTG=y" arch/arm/configs/cm_${device}_defconfig
#do_replace "# CONFIG_USB_OTG_WHITELIST is not set" "CONFIG_USB_OTG_WHITELIST=y" arch/arm/configs/cm_${device}_defconfig
fi
else
echo "--- No kernel config for ${device}"
fi
done
fi
#pincode
if [ "${pin}" = "Y" ]; then
echo "*** Pincode"
cd ${android}/bootable/recovery
do_patch recovery_check_pin.patch
cd ${android}/device/semc/msm7x30-common
do_patch msm7x30_check_pin.patch
cd ${android}/device/semc/mogami-common
do_patch mogami_check_pin.patch
for device in ${devices}; do
initrc=${android}/device/semc/${device}/recovery/init.rc
do_replace " restart adbd" " #restart adbd" ${initrc}
done
fi
#Boot logo
if [ "${bootlogo}" = "Y" ]; then
echo "*** Boot logo ***"
gcc -O2 -Wall -Wno-unused-parameter -Wno-unused-result -o ${tmp}/to565 ${android}/build/tools/rgb2565/to565.c
if [ ! -f ${tmp}/logo_H_new.raw ]; then
convert -depth 8 ${patches}/bootlogo/${bootlogoh} -fill grey -gravity south -draw "text 0,10 '`date -R`'" rgb:${tmp}/logo_H_new.raw
if [ $? -ne 0 ]; then
echo "imagemagick not installed?"
exit
fi
fi
${tmp}/to565 -rle <${tmp}/logo_H_new.raw >${android}/device/semc/msm7x30-common/prebuilt/logo_H.rle
if [ ! -f ${tmp}/logo_M_new.raw ]; then
convert -depth 8 ${patches}/bootlogo/${bootlogom} -fill grey -gravity south -draw "text 0,10 '`date -R`'" rgb:${tmp}/logo_M_new.raw
if [ $? -ne 0 ]; then
echo "imagemagick not installed?"
exit
fi
fi
${tmp}/to565 -rle <${tmp}/logo_M_new.raw >${android}/device/semc/msm7x30-common/prebuilt/logo_M.rle
fi
#goo.im
if [ "${updates}" = "Y" ]; then
echo "*** goo.im ***"
do_append "PRODUCT_PROPERTY_OVERRIDES += \\" ${android}/device/semc/msm7x30-common/msm7x30.mk
do_append " ro.goo.developerid=M66B \\" ${android}/device/semc/msm7x30-common/msm7x30.mk
do_append " ro.goo.rom=Xtended \\" ${android}/device/semc/msm7x30-common/msm7x30.mk
do_append " ro.goo.version=\$(shell date +%s)" ${android}/device/semc/msm7x30-common/msm7x30.mk
fi
if [ "${kernel3}" = "Y" ]; then
echo "*** Kernel 3.x ***"
#recovery key check
cd ${android}/device/semc/msm7x30-common
do_patch msm7x30_kernel3.patch
#boot logo
do_replace "logo.rle" "initlogo.rle" ${android}/device/semc/msm7x30-common/custombootimg.mk
for device in ${devices}; do
do_replace "logo.rle" "initlogo.rle" ${android}/device/semc/${device}/${device}.mk
done
#Wi-Fi
wl127x_fw=${android}/device/semc/mogami-common/prebuilt/wl127x-fw-5-sr.bin
wget -O ${wl127x_fw} https://github.com/TI-OpenLink/firmwares/raw/linux-firmware/ti-connectivity/wl127x-fw-5-sr.bin
do_append "PRODUCT_COPY_FILES += device/semc/mogami-common/prebuilt/wl127x-fw-5-sr.bin:root/firmware/wl127x-fw-5-sr.bin" ${android}/device/semc/mogami-common/mogami.mk
do_replace "wl12xx_sdio.ko" "wlcore_sdio.ko" ${android}/device/semc/mogami-common/prebuilt/wifiload
fi
#--- ROM ---
#MMS fix
if [ "${mms_fix}" = "Y" ]; then
echo "*** MMS fix ***"
cd ${android}/packages/apps/Mms
do_patch mms_cursor.patch
fi
#Cell broadcast
if [ "${cellbroadcast}" = "Y" ]; then
echo "*** Cell broadcast ***"
do_append "PRODUCT_PACKAGES += CellBroadcastReceiver" ${android}/build/target/product/core.mk
cd ${android}/device/semc/mogami-common
do_patch cb_settings.patch
fi
#OpenPDroid
if [ "${openpdroid}" = "Y" ]; then
echo "*** OpenPDroid ***"
cd ~/Downloads
if [ ! -d "OpenPDroidPatches" ]; then
git clone git://github.com/OpenPDroid/OpenPDroidPatches.git
fi
cd OpenPDroidPatches
git checkout 4.1.2-cm
git pull
cd ${android}/build
patch -p1 --forward -r- <~/Downloads/OpenPDroidPatches/openpdroid_4.1.2-cm_build.patch
cd ${android}/libcore
patch -p1 --forward -r- <~/Downloads/OpenPDroidPatches/openpdroid_4.1.2-cm_libcore.patch
cd ${android}/packages/apps/Mms
patch -p1 --forward -r- <~/Downloads/OpenPDroidPatches/openpdroid_4.1.2-cm_packages_apps_Mms.patch
cd ${android}/frameworks/base
patch -p1 --forward -r- <~/Downloads/OpenPDroidPatches/openpdroid_4.1.2-cm_frameworks_base.patch
do_patch openpdroid_network_location.patch
mkdir -p ${android}/privacy
do_copy ~/Downloads/OpenPDroidPatches/PDroid.jpeg ${android}/privacy
do_append "PRODUCT_COPY_FILES += privacy/PDroid.jpeg:system/media/PDroid.jpeg" ${android}/vendor/cm/config/common.mk
fi
#nano
if [ "${nano}" = "Y" ]; then
echo "*** Nano enter key ***"
cd ${android}/external/nano
do_patch nano.patch
fi
#terminfo
if [ "${terminfo}" = "Y" ]; then
echo "*** Terminfo ***"
terminfo_dl=~/Downloads/termtypes.master.gz
if [ ! -f "${terminfo_dl}" ]; then
wget -O ${terminfo_dl} http://catb.org/terminfo/termtypes.master.gz
if [ $? -ne 0 ]; then
exit
fi
fi
echo "--- Extracting"
gunzip <${terminfo_dl} >${tmp}/termtypes.master
echo "--- Converting"
tic -o ${android}/vendor/cm/prebuilt/common/etc/terminfo/ ${tmp}/termtypes.master
if [ $? -ne 0 ]; then
exit
fi
echo "--- Installing"
do_append "PRODUCT_COPY_FILES += \\" ${android}/vendor/cm/config/common.mk
cd ${android}/vendor/cm/prebuilt/common
find etc/terminfo -type f -exec echo " vendor/cm/prebuilt/common/{}:system/{} \\" >>${android}/vendor/cm/config/common.mk \;
cd ${android}/vendor/cm/prebuilt/common/etc
do_patch mkshrc.patch
fi
#Empty drawer
if [ "${emptydrawer}" = "Y" ]; then
echo "*** Empty drawer ***"
cd ${android}/bionic
do_patch drawer.patch
fi
#Mass storage
if [ "${massstorage}" = "Y" ]; then
echo "*** Mass storage ***"
cd ${android}/device/semc/msm7x30-common
do_patch mass_storage.patch
fi
#Xtended settings
if [ "${xsettings}" = "Y" ]; then
echo "*** Xtended settings ***"
cd ${android}/packages/apps/Settings
do_patch xsettings.patch
cd ${android}/device/semc/mogami-common
do_patch mogami_xtended.patch
fi
#Wi-Fi auto connect option
if [ "${wifiautoconnect}" = "Y" ]; then
echo "*** Wi-Fi auto connect option ***"
cd ${android}/frameworks/base
do_patch wifi_auto_connect1.patch
cd ${android}/packages/apps/Settings
do_patch wifi_auto_connect2.patch
fi
#Electron beam animation
if [ "${eba}" = "Y" ]; then
echo "*** Electron beam animation ***"
cd ${android}/frameworks/base
do_patch eba.patch
do_patch eba_frameworks.patch
cd ${android}/packages/apps/Settings
do_patch eba_settings.patch
fi
#ssh
if [ "${ssh}" = "Y" ]; then
echo "*** sftp-server ***"
cd ${android}/external/openssh
do_patch sftp-server.patch
#needs extra 'mmm external/openssh'
fi
#Layout fixes
if [ "${layout}" = "Y" ]; then
echo "*** Enabled expanded desktop ***"
cd ${android}/device/semc/msm7x30-common
do_patch layout_desktop.patch
echo "*** Clear all button layout ***"
cd ${android}/frameworks/base
do_patch clear_all_button.patch
fi
#Music volume
if [ "${mvolume}" = "Y" ]; then
echo "*** Finer music volume ***"
cd ${android}/frameworks/base
do_patch music_volume.patch
fi
#qcom display
if [ "${qcomdispl}" = "Y" ]; then
echo "*** qcom display ***"
cd ${android}/hardware/qcom/display
do_patch qcom_display_heap.patch
do_patch qcom_display_ioctl.patch
fi
#Smartass boost pulse
if [ "${boost_pulse}" = "Y" ]; then
echo "*** Enable Smartass boost pulse ***"
cd ${android}/device/semc/msm7x30-common
do_patch power_boost_pulse.patch
fi
#iw
if [ "${iw}" = "Y" ]; then
echo "*** iw ***"
cd ${android}/external/iw
do_patch iw.patch
cd ${android}/vendor/semc
do_patch vendor_semc_iw.patch
fi
#Trebuchet CM10.1
if [ "${trebuchet_cm10_1}" = "Y" ]; then
echo "*** Trebuchet CM10.1 ***"
if [ -f ${android}/vendor/cm/overlay/common/packages/apps/Trebuchet/res/values/config.xml ];
then
rm ${android}/vendor/cm/overlay/common/packages/apps/Trebuchet/res/values/config.xml
echo "config.xml removed"
fi
cd ${android}/packages/apps/Trebuchet
do_patch trebuchet_port.patch
#do_patch trebuchet_fix_build.patch
fi
#DeskClock CM10.1
if [ "${deskclock_cm10_1}" = "Y" ]; then
echo "*** DeskClock CM10.1 ***"
cd ${android}/packages/apps/DeskClock
do_patch deskclock_cm_10_1.patch
fi
#Superuser Koush
if [ "${superuser_koush}" = "Y" ] && [ "${superuser_embed}" != "Y" ]; then
echo "*** Superuser Koush"
cd ${android}/external/koush/Superuser
do_patch superuser_koush_superuser.patch
cd ${android}/external/koush/Widgets
do_patch superuser_koush_widgets.patch
fi
#CMFileManager CM10.1
if [ "${cmfilemanager_cm10_1}" = "Y" ]; then
echo "*** CMFileManager CM10.1 ***"
cd ${android}/packages/apps/CMFileManager
do_patch cmfilemanager_cm10_1.patch
fi
#Apollo CM10.1
if [ "${apollo_cm10_1}" = "Y" ]; then
echo "*** Apollo CM10.1 ***"
cd ${android}/packages/apps/Apollo
do_patch apollo_cm_10_1.patch
fi
#CWM CM10.1
if [ "${cwm_cm10_1}" = "Y" ]; then
echo "*** CWM CM10.1 ***"
cd ${android}/bootable/recovery
do_patch recovery_cm10_1.patch
cd ${android}/system/core
do_patch system_core_libsparse.patch
fi
#Calendar CM10.1
if [ "${calendar_cm10_1}" = "Y" ]; then
echo "*** Calendar CM10.1 ***"
cd ${android}/packages/apps/Calendar
do_patch calendar_backport_remove_widget_category.patch
fi
#Email AOSP
if [ "${email_cm10_1}" = "Y" ]; then
echo "*** Email CM10.1 ***"
cd ${android}/packages/apps/Email
do_patch email_backport_remove_widget_category.patch
fi
#Custom patches
if [ -f ~/.cm10xtended.sh ]; then
. ~/.cm10xtended.sh
fi
#Environment
echo "*** Setup environment ***"
cd ${android}
. build/envsetup.sh
#Say whats next
echo ""
echo "*** Done ***"
echo ""
echo "brunch <device name>"
echo ""
echo "or"
echo ""
echo "lunch cm_<device name>-userdebug"
echo "make bootimage"
echo ""