Difference between revisions of "LineageOS on Moto X4 (payton)"

From Cactus Howto
Jump to navigationJump to search
 
(21 intermediate revisions by the same user not shown)
Line 3: Line 3:
* https://wiki.lineageos.org/devices/payton/install
* https://wiki.lineageos.org/devices/payton/install
* https://wiki.lineageos.org/adb_fastboot_guide.html
* https://wiki.lineageos.org/adb_fastboot_guide.html
* https://www.reddit.com/r/LineageOS/comments/82wjpe/how_to_install_los_151_without_twrp/


= limitations =
= limitations =
* OTA updates (i.e. standard "nightly" updates) cannot be applied via network download but have to be downladed via adb/usb
* NetFlix app cannot be used in LineageOS
* NetFlix app cannot be used in LineageOS


Line 34: Line 36:


== install via twrp recovery ==
== install via twrp recovery ==
* NOTE: Monthly security updates may break decryption of /data in TWRP. MTP does not work at this time, but you can use adb to transfer files.
make sure to install the .img (not the .zip) file of the TWRP recovery image:
* make sure to install the .img (not the .zip) file of the TWRP recovery image:
fastboot boot twrp-3.2.3-1-payton.img
fastboot boot twrp-3.2.3-1-payton.img
* wipe
* wipe
* format data
* format data partition to remove encryption
* wipe advanced - system partition
* wipe advanced - system partition
* copy image to sdcard:
* copy image to sdcard:
adb push lineage-15.1-20181030-nightly-payton-signed.zip /sdcard/
adb push lineage-15.1-20181030-nightly-payton-signed.zip /sdcard/
* install image in twrp (select above image)
* install image in twrp (select above image)
* Once installation has finished, return to the main menu, tap Reboot, and then System.
* Once installation has finished, return to the main menu, tap Reboot, and then System.
* ignore any messages "no os installed"
* IMPORTANT: for this phone do not install any Updates via WiFi as this will hard brick your Moto X4!
* In case you did not read the above - read on in the next section ;-)


= restore in case of hard brick =
= restore in case of hard brick =
* all attemps so far using twrp have led to hard bricked phone
* symptoms: blank screen, no led, pressing of power button does not seem to do anything (even long pressing of >20 secs)

== make fastboot mode work again ==
all of this needs to be done via Windows PC. (in my case Win10), disabled anti-virus SW
all of this needs to be done via Windows PC. (in my case Win10), disabled anti-virus SW
* docs (tried a lot - only this one worked): https://forum.xda-developers.com/moto-x4/help/hard-bricked-how-enter-emergency-t3757472
* docs (tried a lot - only this one worked): https://forum.xda-developers.com/moto-x4/help/hard-bricked-how-enter-emergency-t3757472
Line 51: Line 61:
** install old drivers from http://forum.xda-developers.com/attachment.php?attachmentid=3261089&stc=1&d=1428980071
** install old drivers from http://forum.xda-developers.com/attachment.php?attachmentid=3261089&stc=1&d=1428980071
* downloaded blank flash tool here: https://drive.google.com/file/d/1wfNOTMquSJFcCjCtaxf1lrSPVABm9XTS/view
* downloaded blank flash tool here: https://drive.google.com/file/d/1wfNOTMquSJFcCjCtaxf1lrSPVABm9XTS/view
* unpack blank flash
* unpack, start cmd connect bricked phone to usb and execute "blank-flash.bat" and device will come up in fastboot mode. This may have to be repeated several times after resetting the phone by long-pressing the power button.
* start cmd and connect bricked phone to usb
* execute "blank-flash.bat"
* if this hangs in step "[ 0.001] Detecting device":
** long-press the power button until blank flash tool disconnects and then start blank flash again
<pre>
<pre>
C:\Users\User\Downloads\blankflash>blank-flash.bat
C:\Users\User\Downloads\blankflash>blank-flash.bat
Line 60: Line 74:
[ 0.001] Detecting device
[ 0.001] Detecting device
[ 0.004] ...cpu.id = 172 (0xac)
[ 0.004] ...cpu.id = 172 (0xac)
...
[ 0.004] ...cpu.sn = 1378945535 (0x523109ff)
[ 0.004] Opening singleimage
[ 0.004] Loading package
[ 0.006] ...filename = pkg.xml
[ 0.007] Loading programmer
[ 0.008] ...filename = programmer.elf
[ 0.008] Sending programmer
[ 0.196] Handling things over to programmer
[ 0.197] Identifying CPU version
[ 0.198] Waiting for firehose to get ready
[ 3.236] ...SDM630 1.0
[ 3.236] Determining target secure state
[ 3.240] ...secure = yes
[ 3.266] Configuring device...
[ 3.271] Flashing GPT...
[ 3.271] Flashing partition with gpt.bin
[ 3.274] Initializing storage
[ 3.306] ...blksz = 512
[ 3.408] Re-initializing storage...
[ 3.408] Initializing storage
[ 3.508] Flashing bootloader...
[ 3.510] Flashing xbl_a with xbl.elf
[ 3.757] Flashing pmic_a with pmic.elf
[ 3.809] Flashing rpm_a with rpm.mbn
[ 3.862] Flashing tz_a with tz.mbn
[ 4.043] Flashing hyp_a with hyp.mbn
[ 4.112] Flashing devcfg_a with devcfg.mbn
[ 4.150] Flashing prov_a with prov64.mbn
[ 4.192] Flashing cmnlib_a with cmnlib.mbn
[ 4.250] Flashing cmnlib64_a with cmnlib64.mbn
[ 4.308] Flashing keymaster_a with keymaster.mbn
[ 4.362] Flashing storsec_a with storsec.mbn
[ 4.394] Flashing abl_a with abl.elf
[ 4.453] Rebooting to fastboot
[ 4.453] Rebooting to fastboot
[ 4.458] Total time: 4.459s
[ 4.458] Total time: 4.459s
Line 101: Line 83:
C:\Users\User\Downloads\blankflash>
C:\Users\User\Downloads\blankflash>
</pre>
</pre>
* will come up in fastboot mode.
* Anschließend weiter mit https://howto.cactus.de/index.php/LineageOS_on_Moto_X4_(payton)#install_via_twrp_recovery
== wipe device ==
* use twrp as shown above to wipe and format partions then switch to fastboot mode again
== re-installing stock oreo image ==
* doing this on macos 10.13, but should very similarly work on other OSes
* docs: https://www.stechguide.com/stock-firmware-of-moto-x4/
* download stock image XT1900-1_PAYTON_RETAIL_8.0.0_OPW27.57-40_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip from https://androidfilehost.com/?fid=673791459329071182 and unpack it, cd to dir
* attempts with standard fastboot fail from step "flash moem NON-FLOS.bin, therefore download osx-fastboot for motorola devices from https://app.box.com/s/f4ia6l8agg53ut4xfuqm
* prepare osx-fastboot for execution:
chmod 755 osx-fastboot
mv osx-fastboot /Users/tim/bin
* enter fastboot mode on moto x4 and execute the following commands on your mac
osx-fastboot flash partition gpt.bin
osx-fastboot flash bootloader bootloader.img
osx-fastboot flash modem NON-HLOS.bin
osx-fastboot flash fsg fsg.mbn
osx-fastboot erase modemst1
osx-fastboot erase modemst2
osx-fastboot flash bluetooth BTFM.bin
osx-fastboot flash dsp dspso.bin
osx-fastboot flash logo logo.bin
osx-fastboot flash boot boot.img
osx-fastboot flash system system.img_sparsechunk.0
osx-fastboot flash system system.img_sparsechunk.1
osx-fastboot flash system system.img_sparsechunk.2
osx-fastboot flash system system.img_sparsechunk.3
osx-fastboot flash system system.img_sparsechunk.4
osx-fastboot flash system system.img_sparsechunk.5
osx-fastboot flash system system.img_sparsechunk.6
osx-fastboot flash system system.img_sparsechunk.7
osx-fastboot flash system_b system_other.img
osx-fastboot flash oem oem.img
osx-fastboot erase carrier
osx-fastboot erase userdata
osx-fastboot erase ddr
osx-fastboot reboot

== possible next steps ==
* continue migration to LineageOS: https://howto.cactus.de/index.php/LineageOS_on_Moto_X4_(payton)#install_via_twrp_recovery
* or leave it at that

Latest revision as of 14:05, 7 November 2018

docs

limitations

  • OTA updates (i.e. standard "nightly" updates) cannot be applied via network download but have to be downladed via adb/usb
  • NetFlix app cannot be used in LineageOS

prepare

Using MacOS here

install

oem unlocking

for oem unlock of payton: use instructions on https://www.getdroidtips.com/unlock-bootloader-moto-x4/

  • get unlock key from Motorola - output from "fastboot oem get_unlock_data" cannot be used directly to unlock phone
  • make sure to use Chrome-Browser for getting the unlock key at Motorola!!! Otherwise the "get unlock code" button will not be visible.
macantha:~ tim$ fastboot oem unlock
(bootloader) Check 'OEM unlocking' in Android Settings > Developer 
(bootloader) Options
OKAY [  0.001s]
Finished. Total time: 0.001s
macantha:~ tim$ 
  • activate oem unlocking in android settings
  • execute twice:
fastboot oem unlock xxxxxxxxxxxxxxxxxxxx (20 digits)
  • reboot

install via twrp recovery

  • NOTE: Monthly security updates may break decryption of /data in TWRP. MTP does not work at this time, but you can use adb to transfer files.
  • make sure to install the .img (not the .zip) file of the TWRP recovery image:
fastboot boot twrp-3.2.3-1-payton.img
  • wipe
  • format data partition to remove encryption
  • wipe advanced - system partition
  • copy image to sdcard:
adb push lineage-15.1-20181030-nightly-payton-signed.zip /sdcard/
  • install image in twrp (select above image)
  • Once installation has finished, return to the main menu, tap Reboot, and then System.
  • ignore any messages "no os installed"
  • IMPORTANT: for this phone do not install any Updates via WiFi as this will hard brick your Moto X4!
  • In case you did not read the above - read on in the next section ;-)

restore in case of hard brick

  • all attemps so far using twrp have led to hard bricked phone
  • symptoms: blank screen, no led, pressing of power button does not seem to do anything (even long pressing of >20 secs)

make fastboot mode work again

all of this needs to be done via Windows PC. (in my case Win10), disabled anti-virus SW

C:\Users\User\Downloads\blankflash>blank-flash.bat

C:\Users\User\Downloads\blankflash>.\qboot.exe blank-flash
Motorola qboot utility version 3.86
[ -0.000] Opening device: \\.\COM3
[  0.001] Detecting device
[  0.004] ...cpu.id  = 172 (0xac)
...
[  4.453] Rebooting to fastboot
[  4.458] Total time: 4.459s

C:\Users\User\Downloads\blankflash>pause
Drücken Sie eine beliebige Taste . . .

C:\Users\User\Downloads\blankflash>
  • will come up in fastboot mode.

wipe device

  • use twrp as shown above to wipe and format partions then switch to fastboot mode again

re-installing stock oreo image

chmod 755 osx-fastboot 
mv osx-fastboot /Users/tim/bin
  • enter fastboot mode on moto x4 and execute the following commands on your mac
osx-fastboot flash partition gpt.bin
osx-fastboot flash bootloader bootloader.img
osx-fastboot flash modem NON-HLOS.bin
osx-fastboot flash fsg fsg.mbn
osx-fastboot erase modemst1
osx-fastboot erase modemst2 
osx-fastboot flash bluetooth BTFM.bin
osx-fastboot flash dsp dspso.bin
osx-fastboot flash logo logo.bin
osx-fastboot flash boot boot.img
osx-fastboot flash system system.img_sparsechunk.0
osx-fastboot flash system system.img_sparsechunk.1
osx-fastboot flash system system.img_sparsechunk.2
osx-fastboot flash system system.img_sparsechunk.3
osx-fastboot flash system system.img_sparsechunk.4
osx-fastboot flash system system.img_sparsechunk.5
osx-fastboot flash system system.img_sparsechunk.6
osx-fastboot flash system system.img_sparsechunk.7
osx-fastboot flash system_b system_other.img
osx-fastboot flash oem oem.img
osx-fastboot erase carrier
osx-fastboot erase userdata
osx-fastboot erase ddr
osx-fastboot reboot

possible next steps