Fix CM TabletUI patching for builds after april 3, 2013.
[auto-patcher.git] / diff_tools / make_openpdroid.sh
blobbacf0726eff9829b2380d5fb6af2026525da0310
1 #!/bin/bash
3 # This script just makes the modules needed for patches. Replace the variables
4 # with your info. Can be run for a DEVC, e.g. ./make_openpdroid maguro
7 DATE=`date +"%Y%m%d"`
8 REPO=$HOME/bin/repo
9 BASE=$HOME
11 # Edit to match your info...note: MODS=patch location.
12 KANG=$BASE/android/system
13 ANDR=4.2
14 ROMTYPE=cm
15 DEVC=maguro
16 MODS=$BASE/patches/openpdroid/
18 SAVE=$HOME/auto-patcher/diff_tools/built/openpdroid/$ANDR/$ROMTYPE
19 [[ $# > 0 ]] && DEVC=$2
21 # aokp needs testing...should add Slim, PA, and Ever.
22 case $ROMTYPE in
23 cm)
24 PLTF=cm_${DEVC}-userdebug
26 aosp)
27 PLTF=full_$DEVC-userdebug
29 aokp)
30 PLTF=aokp_$DEVC-userdebug
32 esac
34 # revert to stock
35 cd $KANG/build && git checkout . && git clean -df
36 cd $KANG/libcore && git checkout . && git clean -df
37 cd $KANG/frameworks/base && git checkout . && git clean -df
38 cd $KANG/frameworks/base/telephony && git checkout . && git clean -df
39 cd $KANG/packages/apps/Mms && git checkout . && git clean -df
40 cd $KANG && $REPO abandon openpdroid
41 cd $KANG && $REPO sync -j16
43 # build stock
44 cd $KANG && make clobber
45 cd $KANG && . build/envsetup.sh && lunch $PLTF && make core services framework framework2 telephony-common Mms >& OUT.$DATE || exit
46 \rm -rf $SAVE/stock.$DATE.$DEVC
47 \cp -a $KANG/out/target/product/$DEVC/system/framework $SAVE/stock.$DATE.$DEVC
49 # apply pdroid patch
50 cd $KANG/build && git checkout -b openpdroid && patch --no-backup-if-mismatch -p2 < $MODS/openpdroid_4.2.1_build.diff || exit
51 cd $KANG/libcore && git checkout -b openpdroid && patch --no-backup-if-mismatch -p2 < $MODS/openpdroid_4.2.1_libcore.patch || exit
52 cd $KANG/frameworks/base && git checkout -b openpdroid && patch --no-backup-if-mismatch -p3 < $MODS/openpdroid_4.2.1_frameworks_base.patch || exit
53 cd $KANG/frameworks/opt/telephony && git checkout -b openpdroid && patch --no-backup-if-mismatch -p3 < $MODS/openpdroid_4.2.1_frameworks_opt_telephony.patch || exit
54 cd $KANG/packages/apps/Mms && git checkout -b openpdroid && patch --no-backup-if-mismatch -p3 < $MODS/openpdroid_4.2.1_packages_apps_Mms.patch || exit
56 # build pdroid
57 cd $KANG && make clobber
58 cd $KANG && . build/envsetup.sh && lunch $PLTF && make core services framework framework2 telephony-common Mms >& LOG.$DATE || exit
59 \rm -rf $SAVE/openpdroid.$DATE.$DEVC
60 \cp -a $KANG/out/target/product/$DEVC/system/framework $SAVE/openpdroid.$DATE.$DEVC
63 # It is old and not pretty, but it works. I will make this a LOT better when I get time.