Initial CM -> LAOS work

This commit is contained in:
Tad 2016-12-27 11:40:16 -05:00
parent a6219e2dbe
commit be845eaebf
3 changed files with 371 additions and 0 deletions

View File

@ -0,0 +1,48 @@
Last Updated: 12/23/2016
Credits: CyanogenMod, CopperheadOS, OmniROM, TeamWin, F-Droid, MicroG, anarkia1976, bhb27, Daniel Micay, dirtyhank, Evisceration, Felipe de Leon, flar2, franciscofranco, hellsgod, mar-v-in, nikhil18, Paul Reioux, savoca, stefano.villa1976, WedyDQ10, XileForce
General Changes
- Added support for Chromium monochrome
- Builds are dex-preopted on supported devices
- Builds are signed with private release-keys
- Bundled in our custom DNS blocklist
- Compiled with OpenJDK 8
- Doze is re-enabled on devices without real Google Play Services
- Hardened IPv4 and IPv6 stacks
- Hardened special file systems
- Hardened SQLite
- Nuked CMAnalytics from orbit
- Removed unnecessary/outdated/insecure packages. Warning: No Browser is included, please install getChromium or IceCat from F-Droid
- Updated Chromium WebView on arm64 devices
- F-Droid
- F-Droid and FDroidPrivilegedExtension are included by default
- FDroidPrivilegedExtension ONLY allows access to our signed version of F-Droid
- MicroG
- GmsCore, GsfProxy, and FakeStore are included by default
- Required signature spoofing permission is ONLY granted to signed system apps unlike other ROMs
- Settings
- NFC and NDEF are disabled by default
- Passwords are hidden by default
Device Changes
- bacon
- Overclocked from 2.45Ghz to 2.95Ghz (=+2.02Ghz)
- Underclocked from 300Mhz to 268Mhz
- Qualcomm DIAG enabled
- Removed bundled Google Widevine DRM and Microsoft PlayReady DRM firmware files
- bullhead
- Overclocked a57 from 1.82Ghz to 2.01Ghz, overclocked a53 from 1.44Ghz to 1.63Ghz (=+1.14Ghz)
- Underclocked both from 384Mhz to 300Mhz
- MMC performance slightly increased
- clark
- Overclocked a57 from 1.82Ghz to 2.01Ghz, overclocked a53 from 1.44Ghz to 1.63Ghz (=+1.14Ghz)
- Underclocked both from 384Mhz to 300Mhz
- MMC performance slightly increased
- Removed bundled Google Widevine DRM and Microsoft PlayReady DRM firmware files
- mako
- Overclocked from 1.51Ghz to 1.94Ghz (=+1.72Ghz)
- Underclocked from 384Mhz to 81Mhz
- Enabled LTE support (Requires LTE hybrid modem to be flashed)
- hammerhead
- Overclocked from 2.26Ghz to 2.95Ghz (=+2.75Ghz)
- shamu
- Overclocked from 2.64Ghz to 2.88Ghz (=+0.96Ghz)
- Underclocked from 300Mhz to 35Mhz

View File

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!-- START OF UNNECESSARY REPO REMOVAL -->
<remove-project name="LineageOS/android_external_ant-wireless_ant_native" />
<remove-project name="LineageOS/android_external_ant-wireless_ant_service" />
<remove-project name="LineageOS/android_external_gello_build" />
<remove-project name="LineageOS/android_hardware_intel_common_libmix" />
<remove-project name="LineageOS/android_hardware_intel_common_libva" />
<remove-project name="LineageOS/android_hardware_intel_common_libwsbm" />
<remove-project name="LineageOS/android_hardware_intel_common_omx-components" />
<remove-project name="LineageOS/android_hardware_intel_common_utils" />
<remove-project name="LineageOS/android_hardware_intel_img_hwcomposer" />
<remove-project name="LineageOS/android_hardware_intel_img_psb_headers" />
<remove-project name="LineageOS/android_hardware_intel_img_psb_video" />
<remove-project name="LineageOS/android_hardware_ti_omap4xxx" />
<remove-project name="LineageOS/android_packages_apps_Browser" />
<remove-project name="LineageOS/android_packages_apps_CMBugreport" />
<remove-project name="LineageOS/android_packages_apps_FMRadio" />
<remove-project name="LineageOS/android_packages_apps_Gello" />
<remove-project name="LineageOS/android_packages_apps_ManagedProvisioning" />
<remove-project name="LineageOS/android_packages_apps_Stk" />
<remove-project name="LineageOS/android_packages_apps_TvSettings" />
<remove-project name="LineageOS/android_packages_providers_PartnerBookmarksProvider" />
<remove-project name="LineageOS/android_packages_providers_TvProvider" />
<remove-project name="LineageOS/android_packages_screensavers_Basic" />
<remove-project name="LineageOS/android_packages_screensavers_PhotoTable" />
<remove-project name="LineageOS/android_packages_screensavers_WebView" />
<remove-project name="LineageOS/android_packages_services_Car" />
<remove-project name="LineageOS/android_prebuilts_gcc_darwin-x86_aarch64_aarch64-linux-android-4.9" />
<remove-project name="LineageOS/android_prebuilts_gcc_darwin-x86_arm_arm-linux-androideabi-4.9" />
<remove-project name="LineageOS/android_prebuilts_gcc_darwin-x86_x86_x86_64-linux-android-4.9" />
<remove-project name="device/generic/goldfish" />
<remove-project name="device/generic/mini-emulator-arm64" />
<remove-project name="device/generic/mini-emulator-armv7-a-neon" />
<remove-project name="device/generic/mini-emulator-x86" />
<remove-project name="device/generic/mini-emulator-x86_64" />
<remove-project name="device/generic/qemu" />
<remove-project name="device/sample" />
<remove-project name="platform/cts" />
<remove-project name="platform/hardware/intel/audio_media" />
<remove-project name="platform/hardware/intel/bootstub" />
<remove-project name="platform/hardware/intel/common/bd_prov" />
<remove-project name="platform/hardware/intel/common/libstagefrighthw" />
<remove-project name="platform/hardware/intel/common/wrs_omxil_core" />
<remove-project name="platform/hardware/intel/sensors" />
<remove-project name="platform/hardware/ti/omap3" />
<remove-project name="platform/hardware/ti/omap4-aah" />
<remove-project name="platform/packages/apps/Provision" />
<remove-project name="platform/prebuilts/clang/darwin-x86/host/3.6" />
<remove-project name="platform/prebuilts/clang/host/darwin-x86" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1" />
<remove-project name="platform/prebuilts/gdb/darwin-x86" />
<remove-project name="platform/prebuilts/go/darwin-x86" />
<remove-project name="platform/prebuilts/ninja/darwin-x86" />
<remove-project name="platform/prebuilts/python/darwin-x86/2.7.5" />
<!-- END OF UNNECESSARY REPO REMOVAL -->
<!-- START OF REPLACEMENT REPOS -->
<!-- Updated WebView
<remove-project name="platform/external/chromium-webview" /> -->
<!-- OpenDelta Updater -->
<remove-project name="LineageOS/android_packages_apps_CMUpdater" />
<project path="packages/apps/OpenDelta" name="omnirom/android_packages_apps_OpenDelta" remote="github" revision="android-7.1" />
<!-- TWRP
<remove-project name="LineageOS/android_bootable_recovery" />
<project path="bootable/recovery" name="omnirom/android_bootable_recovery" remote="github" revision="android-7.1" /> -->
<!-- <project path="external/busybox" name="omnirom/android_external_busybox" remote="github" revision="android-7.1" />-->
<!-- MicroG -->
<project path="packages/apps/GmsCore" name="microg/android_packages_apps_GmsCore" remote="github" revision="master" />
<project path="packages/apps/GsfProxy" name="microg/android_packages_apps_GsfProxy" remote="github" revision="master" />
<project path="packages/apps/FakeStore" name="microg/android_packages_apps_FakeStore" remote="github" revision="master" />
<!-- F-Droid -->
<remote name="fdroid" fetch="https://gitlab.com/fdroid/" />
<project path="packages/apps/FDroidPrivilegedExtension" name="privileged-extension.git" remote="fdroid" revision="master" />
<project path="packages/apps/FDroid" name="fdroidclient.git" remote="fdroid" revision="master" />
<!-- END OF REPLACEMENT REPOS -->
<!-- START OF DEVICE REPOS -->
<!-- Common -->
<project path="packages/resources/devicesettings" name="LineageOS/android_packages_resources_devicesettings" remote="github" />
<project path="device/amazon/hdx-common" name="LineageOS/android_device_amazon_hdx-common" remote="github" />
<project path="device/oppo/common" name="LineageOS/android_device_oppo_common" remote="github" />
<project path="device/qcom/common" name="LineageOS/android_device_qcom_common" remote="github" />
<project path="hardware/samsung" name="LineageOS/android_hardware_samsung" remote="github" />
<project path="hardware/sony/thermanager" name="LineageOS/android_hardware_sony_thermanager" remote="github" />
<project path="kernel/amazon/hdx-common" name="LineageOS/android_kernel_amazon_hdx-common" remote="github" />
<project path="kernel/google/msm" name="LineageOS/android_kernel_google_msm" remote="github" />
<!-- Nexus 4 (Mako) -->
<project path="device/lge/mako" name="LineageOS/android_device_lge_mako" remote="github" />
<project path="kernel/lge/mako" name="LineageOS/lge-kernel-mako" remote="github" />
<!-- Nexus 5 (Hammerhead) -->
<project path="device/lge/hammerhead" name="LineageOS/android_device_lge_hammerhead" remote="github" />
<project path="kernel/lge/hammerhead" name="LineageOS/android_kernel_lge_hammerhead" remote="github" />
<!-- Nexus 6 (Shamu) -->
<project path="device/moto/shamu" name="LineageOS/android_device_moto_shamu" remote="github" />
<project path="kernel/moto/shamu" name="LineageOS/android_kernel_moto_shamu" remote="github" />
<!-- Nexus 5X (Bullhead) -->
<project path="device/lge/bullhead" name="LineageOS/android_device_lge_bullhead" remote="github" />
<project path="kernel/lge/bullhead" name="LineageOS/android_kernel_lge_bullhead" remote="github" />
<!-- Nexus 6P (Angler) -->
<project path="device/huawei/angler" name="LineageOS/android_device_huawei_angler" remote="github" />
<project path="kernel/huawei/angler" name="LineageOS/android_kernel_huawei_angler" remote="github" />
<!-- Amazon Kindle Fire HDX 7 3rd Gen (Thor)-->
<project path="device/amazon/thor" name="LineageOS/android_device_amazon_thor" remote="github" />
<!-- Asus Zenfone 2 Laser (Z00T) -->
<project name="LineageOS/android_device_asus_msm8916-common" path="device/asus/msm8916-common" remote="github" />
<project name="LineageOS/android_device_asus_Z00T" path="device/asus/Z00T" remote="github" />
<project name="LineageOS/android_kernel_asus_msm8916" path="kernel/asus/msm8916" remote="github" />
<!-- LG G3 (VS985) -->
<project path="device/lge/g3-common" name="LineageOS/android_device_lge_g3-common" remote="github" />
<project path="device/lge/vs985" name="LineageOS/android_device_lge_vs985" remote="github" />
<project path="kernel/lge/g3" name="LineageOS/android_kernel_lge_g3" remote="github" />
<!-- Moto X Pure Edition (XT1575) -->
<project path="device/motorola/clark" name="LineageOS/android_device_motorola_clark" remote="github" />
<project path="kernel/motorola/msm8992" name="LineageOS/android_kernel_motorola_msm8992" remote="github" />
<!-- OnePlus One (Bacon) -->
<project path="device/oneplus/bacon" name="LineageOS/android_device_oneplus_bacon" remote="github" />
<project path="device/oppo/msm8974-common" name="LineageOS/android_device_oppo_msm8974-common" remote="github" />
<project path="kernel/oneplus/msm8974" name="LineageOS/android_kernel_oneplus_msm8974" remote="github" />
<!-- Samsung Galaxy Note 4 (trltetmo)
<project path="device/samsung/trlte-common" name="LineageOS/android_device_samsung_trlte-common" remote="github" />
<project path="device/samsung/trltetmo" name="LineageOS/android_device_samsung_trltetmo" remote="github" />
<project path="kernel/samsung/trlte" name="LineageOS/android_kernel_samsung_trlte" remote="github" />-->
<!-- Proprietary Blobs -->
<project path="vendor/amazon" name="TheMuppets/proprietary_vendor_amazon" remote="github" />
<project path="vendor/asus" name="TheMuppets/proprietary_vendor_asus" remote="github" />
<project path="vendor/huawei" name="TheMuppets/proprietary_vendor_huawei" remote="github" />
<project path="vendor/lge" name="TheMuppets/proprietary_vendor_lge" remote="github" />
<project path="vendor/motorola" name="TheMuppets/proprietary_vendor_motorola" remote="github" />
<project path="vendor/oneplus" name="TheMuppets/proprietary_vendor_oneplus" remote="github" />
<project path="vendor/oppo" name="TheMuppets/proprietary_vendor_oppo" remote="github" />
<project path="vendor/samsung" name="TheMuppets/proprietary_vendor_samsung" remote="github" />
<project path="vendor/qcom/binaries" name="TheMuppets/proprietary_vendor_qcom_binaries" remote="github" />
<!-- END OF DEVICE REPOS -->
</manifest>

View File

@ -0,0 +1,167 @@
#!/bin/bash
#TODO: Aggressive Doze (Verify Extended Doze First), App-based battery profiles, Change connectivity check URL, Optimized build flags, Optimized toolchain, OTA Updates, Ship Chromium, Update WebView for arm
#Build UberTC
#cd /home/tad/Android/Build/UBERTC/scripts && repo sync -j18 && ./arm-eabi-4.8 && ./arm-linux-androideabi-4.9 && ./aarch64-linux-android-4.9
#Delete Everything
#rm -rf build vendor/cm device/motorola/clark device/oneplus/bacon device/lge/mako kernel/lge/mako kernel/oneplus/msm8974 kernel/motorola/msm8992 packages/apps/Settings frameworks/base build system/core external/sqlite packages/apps/Nfc packages/apps/Settings packages/apps/FDroid packages/apps/FDroidPrivilegedExtension packages/apps/GmsCore packages/apps/GsfProxy packages/apps/FakeStore kernel/lge/hammerhead kernel/moto/shamu bootable/recovery packages/apps/CMParts
#Start a build
#repo sync -j24 --force-sync && sh ../../Scripts/CM-14.1_Patches.sh && source device/motorola/clark/setup-makefiles.sh && source build/envsetup.sh && export ANDROID_HOME=/home/tad/Android/Build/LineageOS-14.1/prebuilts/sdk/current && export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m" && export OTA_PACKAGE_SIGNING_KEY=../../Signing_Keys/releasekey && export SIGNING_KEY_DIR=../../Signing_Keys && brunch clark && brunch bacon && brunch mako
#
#START OF PREPRATION
#
#Set some variables for use later on
base="/home/tad/Android/Build/LineageOS-14.1/"
patches="/home/tad/Android/Patches/LineageOS-14.1/"
ANDROID_HOME=/home/tad/Android/Build/LineageOS-14.1/prebuilts/sdk/current
#Download some out-of-tree files for use later on
mkdir -p /tmp/ar
cd /tmp/ar
wget https://spotco.us/hosts -N
wget https://gitlab.com/copperhead/platform_external_chromium-webview/raw/nougat-mr1-release/prebuilt/arm64/webview.apk -N
#Accept all SDK licences, not normally needed but Gradle managed apps fail without it
mkdir -p "$ANDROID_HOME/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
#Define a function to simplify this script
enter() {
dir=$1;
#project=${$dir//'/'/'_'}; #TODO: Add project conversion, to simplify patching
cd $base$dir;
echo "[ENTERING] "$dir;
git add -A && git reset --hard;
}
#
#END OF PREPRATION
#
#
#START OF ROM CHANGES
#
enter "build"
#git revert 6f9c2e115aeccd7090f92f1fb91bc6052522cdd1 #Enable dex pre-optimization by default again
patch -p1 < $patches"android_build/0001-Automated_Build_Signing.patch" #Automated build signing
#enter "bootable/recovery" #https://gerrit.omnirom.org/#/q/project:android_bootable_recovery
#The following 8 commits are to get TWRP 3.0.3 building with LineageOS 14.1
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/31/20831/1 && git cherry-pick FETCH_HEAD
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/37/20837/1 && git cherry-pick FETCH_HEAD
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/79/20879/5 && git cherry-pick FETCH_HEAD
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/87/20887/1 && git cherry-pick FETCH_HEAD
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/80/20880/4 && git cherry-pick FETCH_HEAD
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/00/20700/8 && git cherry-pick FETCH_HEAD
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/90/20890/1 && git cherry-pick FETCH_HEAD
#git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/88/20888/2 && git cherry-pick FETCH_HEAD
enter "system/core"
cat /tmp/ar/hosts >> rootdir/etc/hosts #Merge in our HOSTS file
patch -p1 < $patches"android_system_core/0001-Hardening.patch" #Misc hardening
enter "external/chromium-webview"
cp /tmp/ar/webview.apk prebuilt/arm64/webview.apk #Update arm64 WebView to Copperhead's
enter "external/sqlite"
patch -p1 < $patches"android_external_sqlite/0001-Secure_Delete.patch" #Enable secure_delete by default
enter "packages/apps/Nfc"
patch -p1 < $patches"android_packages_apps_Nfc/0001-Disable_NFC.patch" #Disable NFC and NDEF by default
enter "packages/apps/Settings"
patch -p1 < $patches"android_packages_apps_Settings/0001-Hide_Passwords.patch" #Hide passwords by default
enter "packages/apps/GmsCore"
patch -p1 < $patches"android_packages_apps_GmsCore/0001-Fixes.patch" #Update output paths and build tools
enter "packages/apps/GsfProxy"
patch -p1 < $patches"android_packages_apps_GsfProxy/0001-Fixes.patch" #Update output paths and build tools
enter "packages/apps/FakeStore"
patch -p1 < $patches"android_packages_apps_FakeStore/0001-Fixes.patch" #Update output paths and build tools
enter "packages/apps/FDroid"
patch -p1 < $patches"android_packages_apps_FDroid/0001.patch" #Enable privigled module
#patch -p1 < $patches"android_packages_apps_FDroid/0002.patch" #Remove privigled module settings
patch -p1 < $patches"android_packages_apps_FDroid/0003.patch" #Hide app updates for apps that are installed to /system
#TODO: Create updated build tools patch
rm app/src/main/res/xml/preferences.xml.orig
enter "packages/apps/FDroidPrivilegedExtension"
patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0001-Update_Build_Tools.patch" #Update build tools
patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0002-Release_Key.patch" #Change to release key
patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0003-Test_Keys.patch" #Add test-keys XXX: ONLY USE FOR TEST BUILDS
#release-keys: CB:1E:E2:EC:40:D0:5E:D6:78:F4:2A:E7:01:CD:FA:29:EE:A7:9D:0E:6D:63:32:76:DE:23:0B:F3:49:40:67:C3
#test-keys: C8:A2:E9:BC:CF:59:7C:2F:B6:DC:66:BE:E2:93:FC:13:F2:FC:47:EC:77:BC:6B:2B:0D:52:C1:1F:51:19:2A:B8
enter "vendor/cm"
rm -rf gello #Gello is built out-of-tree and bundles Google Play Services library
patch -p1 < $patches"android_vendor_cm/0001-SCE.patch" #Include our extras such as MicroG and F-Droid
cp $patches"android_vendor_cm/sce.mk" config/sce.mk
patch -p1 < $patches"android_vendor_cm/0002-Monochromium.patch" #Add Chromium webview support
enter "packages/apps/CMParts"
patch -p1 < $patches"android_packages_apps_CMParts/0001-Remove_Analytics.patch" #Remove analytics
enter "packages/apps/SetupWizard"
patch -p1 < $patches"android_packages_apps_SetupWizard/0001-Remove_Analytics.patch" #Remove analytics
enter "frameworks/base"
git revert 2aaa0472da8d254da1f07aa65a664012b52410f4 #re-enable doze on devices without gms
#patch -p1 < $patches"android_frameworks_base/0001-Userspace_Location.patch" #Allow location providers outside of /system (MicroG/UnifiedNLP) XXX: This is insecure
#patch -p1 < $patches"android_frameworks_base/0002-Failed_Unlock_Shutdown.patch" #Shutdown after five failed unlock attempts FIXME: Update shutdown() to match new args
patch -p1 < $patches"android_frameworks_base/0003-Signature_Spoofing.patch" #Allow packages to spoof their signature (MicroG)
patch -p1 < $patches"android_frameworks_base/0004-Hide_Passwords.patch" #Hide passwords by default
patch -p1 < $patches"android_frameworks_base/0005-Harden_Sig_Spoofing.patch" #Restrict signature spoofing to system apps signed with the platform key
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig core/res/AndroidManifest.xml.orig
#
#END OF ROM CHANGES
#
#
#START OF DEVICE CHANGES
#
enter "device/motorola/clark"
git fetch https://review.LineageOS.org/LineageOS/android_device_motorola_clark refs/changes/47/175747/3 && git cherry-pick FETCH_HEAD #sepolicies
git fetch https://review.LineageOS.org/LineageOS/android_device_motorola_clark refs/changes/31/178831/1 && git cherry-pick FETCH_HEAD #private sensors
git revert e80d30e3968308cd2941b893608279220dfcf34f #don't add more sprint blobs
patch -p1 < $patches"android_device_motorola_clark/0002-Remove_Sprint_DM.patch" #Removes Sprint Device Manager FIXME: Rebase
patch -p1 < $patches"android_device_motorola_clark/0003-Enable_Dex_Preopt.patch" #Force enables dex pre-optimization
patch -p1 < $patches"android_device_motorola_clark/0004-Remove_Widevine.patch" #Removes Google Widevine and disables the DRM server
#patch -p1 < $patches"android_device_motorola_clark/0005-TWRP.patch" #Add TWRP support
enter "kernel/motorola/msm8992"
patch -p1 < $patches"android_kernel_motorola_msm8992/0001-OverUnderClock.patch" #a57: 1.82Ghz -> 2.01Ghz, a53 1.44Ghz -> 1.63Ghz, 384Mhz -> 300Mhz =+1.14Ghz TODO: Enable by default
patch -p1 < $patches"android_kernel_motorola_msm8992/0002-MMC_Tweak.patch" #Improves MMC performance
enter "device/oneplus/bacon"
patch -p1 < $patches"android_device_oneplus_bacon/0001-Remove_DRM.patch" #Removes Microsoft PlayReady and Google Widevine
patch -p1 < $patches"android_device_oneplus_bacon/0002-Enable_Dex_Preopt.patch" #Force enables dex pre-optimization
enter "kernel/oneplus/msm8974"
#patch -p1 < $patches"android_kernel_oneplus_msm8974/0001-OverUnderClock.patch" #300Mhz -> 268Mhz, 2.45Ghz -> 2.88Ghz =+1.72Ghz
patch -p1 < $patches"android_kernel_oneplus_msm8974/0001-OverUnderClock-EXTREME.patch" #300Mhz -> 268Mhz, 2.45Ghz -> 2.95Ghz =+2.02Ghz XXX: Not 100% stable under intense workloads
patch -p1 < $patches"android_kernel_oneplus_msm8974/0002-Enable_Diag.patch" #Enables Qualcomm diag (SnoopSnitch)
enter "device/lge/mako"
patch -p1 < $patches"android_device_lge_mako/0001-Enable_LTE.patch" #Enable LTE support (Requires LTE hybrid modem to be flashed)
enter "kernel/lge/mako"
patch -p1 < $patches"android_kernel_lge_mako/0001-OverUnderClock.patch" #384Mhz -> 81Mhz, 1.51Ghz -> 1.94Ghz =+1.72Ghz TODO: Test for performance regression
enter "kernel/lge/hammerhead"
patch -p1 < $patches"android_kernel_lge_hammerhead/0001-OverUnderClock.patch" #2.26Ghz -> 2.95Ghz =+2.76Ghz
enter "kernel/moto/shamu"
patch -p1 < $patches"android_kernel_moto_shamu/0001-OverUnderClock.patch" #300Mhz -> 35Mhz, 2.64Ghz -> 2.88Ghz =+0.96Ghz
enter "kernel/lge/bullhead"
patch -p1 < $patches"android_kernel_lge_bullhead/0001-OverUnderClock.patch" #a57: 1.82Ghz -> 2.01Ghz, a53 1.44Ghz -> 1.63Ghz, 384Mhz -> 300Mhz =+1.14Ghz TODO: Enable by default
patch -p1 < $patches"android_kernel_lge_bullhead/0002-MMC_Tweak.patch" #Improves MMC performance
#
#END OF DEVICE CHANGES
#