From a0f002cca1da4e37106fa95ec9db8a3a21f060ca Mon Sep 17 00:00:00 2001 From: James Lee Date: Mon, 8 Dec 2014 00:04:58 -0500 Subject: [PATCH] Update for Android 5.0.1 Build LRX22C.H5 Changes include: * Use modified Device Tree image from official HTC kernel rather than basing it off of the CyanogenMod kernel. * Remove Torch.apk. It is no longer needed thanks to the flashlight quick toggle in Android 5.0. * Remove all but two build.prop customizations. The upstream build basically comes out of the box supporting Verizon and CDMA--moreso than the 4.4.4 build--it is just trivially disabled in the build.prop. * Add startup script to enable the built-in screen casting support. This seems to be disabled on rooted devices otherwise. And that's it! This is otherwise bit-for-bit the version that Google and HTC released for the global phone. --- Makefile | 2 +- README.md | 11 ++--- modules/m8_gpe/files/build.prop.extra | 53 --------------------- modules/m8_gpe/files/init.d/fix-cast-screen | 18 +++++++ modules/m8_gpe/files/init.extra | 4 -- modules/m8_gpe/files/updater-script | 18 +++---- modules/m8_gpe/manifests/build.pp | 24 +++++----- modules/m8_gpe/manifests/kernel.pp | 2 +- modules/m8_gpe/manifests/ruu.pp | 2 +- modules/m8_gpe/manifests/sqlite.pp | 21 ++++++++ 10 files changed, 68 insertions(+), 87 deletions(-) create mode 100644 modules/m8_gpe/files/init.d/fix-cast-screen delete mode 100644 modules/m8_gpe/files/init.extra create mode 100644 modules/m8_gpe/manifests/sqlite.pp diff --git a/Makefile b/Makefile index 2bf66d3..568ca83 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ puppet: puppet apply --modulepath=modules -e "class { 'm8_gpe': target => '$(PWD)' }" clean: - -rm -rf boot build compiler digitalhigh dt.img dtbtool e2fsprogs kernel m8_gpe.zip mkbootimg ruu supersu + -rm -rf boot build compiler dt.img dtbtool e2fsprogs kernel m8_gpe.zip mkbootimg ruu supersu sqlite distclean: clean -rm -rf sources diff --git a/README.md b/README.md index 61c97bd..cd4917f 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,8 @@ and the result should be a file called `m8_gpe.zip` that can be flashed with a recovery tool like TWRP. ## Concessions ## -Generally, I would prefer an untouched build, but in this case, the -Torch.apk from the "DigitalHigh" ROM, which is itself modified from -CyanogenMod, works so well, I've included it in this build. And since -I had to modify the image for that app, I might as well have included -root and busybox support too. This is done in the least obtrusive, -most transparent way possible. +Generally, I would prefer an untouched build, but I always end up adding +root and busybox anyway, so I build them in. This is done in the least +obtrusive, most transparent way possible. Enabling root access seems to +disable the screen casting support, so a startup script is added to the +build to set an override flag in the settings database. diff --git a/modules/m8_gpe/files/build.prop.extra b/modules/m8_gpe/files/build.prop.extra index bd77177..e69de29 100644 --- a/modules/m8_gpe/files/build.prop.extra +++ b/modules/m8_gpe/files/build.prop.extra @@ -1,53 +0,0 @@ - -# -# Settings from CyanogenMod and stock Verizon -# See: https://github.com/CyanogenMod/android_device_htc_m8/blob/cm-11.0/init/init_m8.c -# -ro.telephony.default_cdma_sub=0 -ro.telephony.default_network=10 -ro.cdma.home.operator.numeric=310012 -gsm.sim.operator.numeric=310012 -gsm.operator.numeric=310012 -ro.cdma.home.operator.alpha=Verizon -gsm.sim.operator.alpha=Verizon -gsm.operator.alpha=Verizon -telephony.lteOnCdmaDevice=1 -ro.cdma.subscribe_on_ruim_ready=true -ro.ril.svdo=true -ro.ril.disable.fd.plmn.prefix=23402,23410,23411,23420 -ro.ril.enable.sdr=0 -ro.ril.enable.gea3=1 -ro.ril.enable.a53=1 -ro.ril.enable.r8fd=1 -persist.radio.snapshot_enabled=1 -persist.radio.snapshot_timer=22 - -ro.ril.vzw.feature=1 -ro.ril.oem.ecclist=911,*911,#911 -ro.ril.enable.a52=0 -ro.ril.enable.dtm=0 -ro.ril.gprsclass=12 -ro.ril.att.feature=0 -ro.ril.enable.managed.roaming=1 -ro.ril.oem.show.act=0 -ro.ril.set.mtusize=1428 -ro.ril.air.enabled=1 -ro.ril.wp.feature=1 -ro.cdma.data_retry_config=max_retries=infinite,0,0,60000,120000,480000,900000 -ro.gsm.data_retry_config=max_retries=infinite,0,0,60000,120000,480000,900000 -ro.gsm.2nd_data_retry_config=max_retries=infinite,0,0,60000,120000,480000,900000 -ro.ril.gsm.to.lte.blind.redir=1 -ro.config.svlte1x=true -ro.ril.def.agps.mode=6 - -# -# Do not roam on Verizon -# -# This line doesn't seem to be necessary on CyanogenMod, but it ships -# its own Verizon-specific RIL binaries, which are incompatible with -# Google's libril. This setting seems to be a common workaround. -# -# See: http://seasonofcode.com/posts/carrier-programming-on-cdma-android-phones.html -# See: https://census.tsyrklevich.net/system_properties/ro.cdma.homesystem -# -ro.cdma.homesystem=64,65,66,67,69,71,72,74,76,77,78,79,80,81,82,83 diff --git a/modules/m8_gpe/files/init.d/fix-cast-screen b/modules/m8_gpe/files/init.d/fix-cast-screen new file mode 100644 index 0000000..c4156e6 --- /dev/null +++ b/modules/m8_gpe/files/init.d/fix-cast-screen @@ -0,0 +1,18 @@ +#!/system/bin/sh + +# sqlite3 dies if it can't determine the home directory +HOME=/ +export HOME + +# +# We don't need to check if this is already configured. A constraint +# ensures this fails if it is already set. +# +sqlite3 /data/data/com.google.android.gsf/databases/gservices.db 2>/dev/null <> /system/build.prop"); +# Enable CDMA modes +run_program("/system/xbin/sed", "-i", "s/^ro.telephony.default_network=.*/ro.telephony.default_network=10/; s/^#telephony.lteOnCdmaDevice/telephony.lteOnCdmaDevice/", "/system/build.prop"); + +run_program("/sbin/cp", "/tmp/tools/sqlite3", "/system/xbin/sqlite3"); +set_perm(0, 0, 0755, "/system/xbin/sqlite3"); + +package_extract_dir("init.d", "/system/etc/init.d"); +set_perm_recursive(0, 0, 0755, 0755, "/system/etc/init.d"); +run_program("/sbin/sh", "-c", "echo '\n# Added by m8_gpe --jlee\nrun-parts /system/etc/init.d' >> /system/etc/usf_post_boot.sh"); + unmount("/system"); diff --git a/modules/m8_gpe/manifests/build.pp b/modules/m8_gpe/manifests/build.pp index adf4c74..0817a6e 100644 --- a/modules/m8_gpe/manifests/build.pp +++ b/modules/m8_gpe/manifests/build.pp @@ -6,13 +6,8 @@ type => zip, } - m8_gpe::source { 'digitalhigh': - source => 'https://thestaticvoid.com/dist/m8_gpe/sources/GPE_M8VZW_080714_DH.zip', - type => zip, - } - m8_gpe::source { 'supersu': - source => 'https://thestaticvoid.com/dist/m8_gpe/sources/UPDATE-SuperSU-v2.36.zip', + source => 'https://thestaticvoid.com/dist/m8_gpe/sources/UPDATE-SuperSU-v2.37.zip', type => zip, } @@ -27,6 +22,7 @@ } class { 'm8_gpe::ruu': } + class { 'm8_gpe::sqlite': } file { [ $dir, @@ -35,7 +31,6 @@ "${dir}/META-INF/com/google", "${dir}/META-INF/com/google/android", "${dir}/tools", - "${dir}/apps", "${dir}/supersu", ]: ensure => directory, @@ -67,7 +62,7 @@ } file { "${dir}/tools/fsck.ext4": - source => "${m8_gpe::target}/e2fsprogs/resize2fs", + source => "${m8_gpe::target}/e2fsprogs/fsck.ext4", require => M8_gpe::Source['e2fsprogs'], } @@ -76,9 +71,9 @@ require => M8_gpe::Source['busybox'], } - file { "${dir}/apps/Torch.apk": - source => "${m8_gpe::target}/digitalhigh/system/app/Torch.apk", - require => M8_gpe::Source['digitalhigh'], + file { "${dir}/tools/sqlite3": + source => $m8_gpe::sqlite::binary, + require => M8_gpe::Source['sqlite'], } file { "${dir}/supersu/installer": @@ -95,7 +90,10 @@ source => 'puppet:///modules/m8_gpe/build.prop.extra', } - file { "${dir}/init.extra": - source => 'puppet:///modules/m8_gpe/init.extra', + file { "${dir}/init.d": + ensure => directory, + source => 'puppet:///modules/m8_gpe/init.d', + recurse => true, + purge => true, } } diff --git a/modules/m8_gpe/manifests/kernel.pp b/modules/m8_gpe/manifests/kernel.pp index cc46b31..9b197e6 100644 --- a/modules/m8_gpe/manifests/kernel.pp +++ b/modules/m8_gpe/manifests/kernel.pp @@ -2,7 +2,7 @@ $source_dir = "${m8_gpe::target}/kernel" m8_gpe::source { 'kernel': - source => 'https://github.com/MrStaticVoid/android_kernel_htc_msm8974.git', + source => 'https://github.com/MrStaticVoid/kernel_m8.git', type => git, } diff --git a/modules/m8_gpe/manifests/ruu.pp b/modules/m8_gpe/manifests/ruu.pp index 3ad4afb..85e8304 100644 --- a/modules/m8_gpe/manifests/ruu.pp +++ b/modules/m8_gpe/manifests/ruu.pp @@ -7,7 +7,7 @@ class { 'm8_gpe::dt': } m8_gpe::source { 'ruu': - source => 'https://thestaticvoid.com/dist/m8_gpe/sources/RUU-HTC_One_M8_GPE_4.4.4-2.12.1700.1.zip', + source => 'https://thestaticvoid.com/dist/m8_gpe/sources/RUU-HTC_One_M8_GPE_5.0.1-3.11.1700.5.zip', type => zip, } diff --git a/modules/m8_gpe/manifests/sqlite.pp b/modules/m8_gpe/manifests/sqlite.pp new file mode 100644 index 0000000..418d353 --- /dev/null +++ b/modules/m8_gpe/manifests/sqlite.pp @@ -0,0 +1,21 @@ +class m8_gpe::sqlite { + $source_dir = "${m8_gpe::target}/sqlite" + $binary = "${source_dir}/sqlite3" + + m8_gpe::source { 'sqlite': + source => 'http://www.sqlite.org/2014/sqlite-autoconf-3080702.tar.gz', + type => tar, + } + + # + # Yes, it sucks to hard code the path to the compiler here, but the + # whole point is just to show that there's nothing up my sleeves. + # This could easily be replaced by a precompiled binary. + # + exec { 'compile-sqlite': + command => "/usr/bin/armv6j-hardfloat-linux-gnueabi-gcc -static -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION sqlite3.c shell.c -o ${binary}", + cwd => $source_dir, + creates => $binary, + require => M8_gpe::Source['sqlite'], + } +}