Skip to content
Permalink
Browse files

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.
  • Loading branch information
iamjamestl committed Dec 8, 2014
1 parent 4188530 commit a0f002cca1da4e37106fa95ec9db8a3a21f060ca
@@ -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
@@ -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.
@@ -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
@@ -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 <<END
INSERT INTO overrides (name, value) VALUES ('gms:cast:remote_display_enabled', 'true');
END

# Force the setting to take effect now (only if necessary)
if [ $? -eq 0 ]; then
am force-stop com.google.android.gms
fi

This file was deleted.

@@ -1,5 +1,3 @@
assert(getprop("ro.product.device") == "m8wl");

ui_print("- Extracting tools");
package_extract_dir("tools", "/tmp/tools");
set_perm_recursive(0, 0, 0755, 0755, "/tmp/tools");
@@ -27,14 +25,18 @@ run_program("/sbin/cp", "/tmp/tools/busybox", "/system/xbin/busybox");
set_perm(0, 0, 0755, "/system/xbin/busybox");
run_program("/system/xbin/busybox", "--install", "/system/xbin");

ui_print("- Installing Torch");
package_extract_file("init.extra", "/system/etc/install-recovery-2.sh");
set_perm(0, 0, 0755, "/system/etc/install-recovery-2.sh");
package_extract_file("apps/Torch.apk", "/system/app/Torch.apk");
set_perm(0, 0, 0644, "/system/app/Torch.apk");

ui_print("- Configuring for Verizon");
package_extract_file("build.prop.extra", "/tmp/build.prop.extra");
run_program("/sbin/sh", "-c", "cat /tmp/build.prop.extra >> /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");
@@ -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,
}
}
@@ -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,
}

@@ -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,
}

@@ -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'],
}
}

0 comments on commit a0f002c

Please sign in to comment.