[ALI] postmarketOS (full GNU/Linux distro based on alpine linux) - Moto G6 ROMs, Kernels, Recoveries, & Other Develop

Hi everyone, I recently ported postmarketOS to the Moto G6.
I do not recommend installing this if the device is your daily driver. Not much works besides the screen. This is more of a proof-of-concept.
https://wiki.postmarketos.org/wiki/Motorola_Moto_G6_(motorola-ali)
If you would like to try it, you can follow the instructions here for "motorola" and "ali" : https://wiki.postmarketos.org/wiki/Installation_guide
Kernel source: https://github.com/msm8953-mainline/linux
Updates
6/3/2020:
64-bit support has been added, thanks to the work of the the RevengeOS project.
11/21/2022:
Firmware has been added (meaning things like wifi and GPU acceleration are now working)
The RevengeOS kernel has been replaced by a recent Linux fork (version 5.18.3)
A patch has been submitted to upstream Linux to add initial support for our device (only the PVT2 variant)

Uclydde said:
Hi everyone, I recently ported postmarketOS to the Moto G6.
I do not recommend installing this if the device is your daily driver. Not much works besides the screen. This is more of a proof-of-concept.
https://wiki.postmarketos.org/wiki/Motorola_Moto_G6_(motorola-ali)
If you would like to try it, you can follow the instructions here for "motorola" and "ali" : https://wiki.postmarketos.org/wiki/Installation_guide
Kernel source: https://github.com/Uclydde/kernel-msm/tree/lineage-16.0
Click to expand...
Click to collapse
Does wifi work?

vibraniumdroid said:
Does wifi work?
Click to expand...
Click to collapse
no

MarlonBrZ said:
no
Click to expand...
Click to collapse
It's still pretty cool though! We're seeing some development on a device I though was dead.

On the wiki it states:
"As of 8/10/2021, the Moto G6 is able to boot the msm8953 mainline kernel fork. It works fairly well, with features like display, touchscreen, and wifi working."
Where do I find that kernel and how do I install it. If I could get wifi to work this could actually be quite useful.

JPutz said:
On the wiki it states:
"As of 8/10/2021, the Moto G6 is able to boot the msm8953 mainline kernel fork. It works fairly well, with features like display, touchscreen, and wifi working."
Where do I find that kernel and how do I install it. If I could get wifi to work this could actually be quite useful.
Click to expand...
Click to collapse
Have you found a way yet?
I've seen many repos named msm8953, but had no clue it was for this device, I'll look up my browser history and post back here if I find any helpful instructions.

adhamnasr said:
Have you found a way yet?
I've seen many repos named msm8953, but had no clue it was for this device, I'll look up my browser history and post back here if I find any helpful instructions.
Click to expand...
Click to collapse
GitHub - brunorolak/kernel_motorola_msm8953
Contribute to brunorolak/kernel_motorola_msm8953 development by creating an account on GitHub.
github.com
This is the most up to date kernel we use, I have no Idea how you can implement it for postmarketos tho.

I remember seeing that blurb mentioning how it was working better on the mainline kernel and assumed they literally meant the mainline Linux kernel.
I assume that is the case, or maybe their own tree they are calling "close to mainline":
(Close to) Mainline - postmarketOS
wiki.postmarketos.org
In any case, I haven't tried installing PostmarketOS in a while, so I've no idea the actual status.

Any progress on this? Would love to have another mobile Linux device besides my Pinephone!

J-Mizzle said:
Any progress on this? Would love to have another mobile Linux device besides my Pinephone!
Click to expand...
Click to collapse
Yes, I've submitted an update to postmarketOS to use a close-to-mainline fork of the Linux kernel for our device.
Also, firmware support has been added, meaning that things like wifi and GPU acceleration are now working.
However, the display backlight isn't working, as well as several other things like audio, battery data, and camera.
adhamnasr said:
Have you found a way yet?
I've seen many repos named msm8953, but had no clue it was for this device, I'll look up my browser history and post back here if I find any helpful instructions.
Click to expand...
Click to collapse
Mainline kernel development for all devices with this SoC is happening here: https://github.com/msm8953-mainline/linux
vibraniumdroid said:
Does wifi work?
Click to expand...
Click to collapse
With the most recent update, now it does. You'll need to enable firmware when installing postmarketOS.

Uclydde said:
Yes, I've submitted an update to postmarketOS to use a close-to-mainline fork of the Linux kernel for our device.
Also, firmware support has been added, meaning that things like wifi and GPU acceleration are now working.
However, the display backlight isn't working, as well as several other things like audio, battery data, and camera.
Mainline kernel development for all devices with this SoC is happening here: https://github.com/msm8953-mainline/linux
With the most recent update, now it does. You'll need to enable firmware when installing postmarketOS.
Click to expand...
Click to collapse
I thought this was for the Moto G6 Play. I'm far less excited now. Good progress for those with the normal G6.

J-Mizzle said:
I thought this was for the Moto G6 Play. I'm far less excited now. Good progress for those with the normal G6.
Click to expand...
Click to collapse
You can find the Moto G6 Play's forum here: https://forum.xda-developers.com/c/moto-g6-play.8553/
By the way, the G6 Play has some postmarketOS support - but not from me. Here's the wiki page for it: https://wiki.postmarketos.org/wiki/Motorola_Moto_G6_Play_(motorola-aljeter)

Uclydde said:
You can find the Moto G6 Play's forum here: https://forum.xda-developers.com/c/moto-g6-play.8553/
By the way, the G6 Play has some postmarketOS support - but not from me. Here's the wiki page for it: https://wiki.postmarketos.org/wiki/Motorola_Moto_G6_Play_(motorola-aljeter)
Click to expand...
Click to collapse
Yes, I've got both those pages bookmarked. For some reason I failed to notice I ended up in the G6 forum vs the G6 Play. The Play variant doesnct seem to get much attention Android development. I follow PostmarketOS' Mastodon account as well as a handful of device maintainers and the G6 Play doesn't seem very active. I've got a Pinephone and have been considering picking up a OnePlus 6(T) as a more powerful alternative.

Hello, I tried to install this using
pmbootstrap init and pmbootstrap install to setup the installation with xfce4 and the commands from the wiki
it installs /system successfully but i can't boot to it and booting to boot.img fails, what can I do?
Code:
[20:49:45] DONE!
[email protected]:~$ pmbootstrap flasher flash_rootfs
[20:50:02] (native) flash rootfs image
[20:50:07] (native) install android-tools
< waiting for any device >
(bootloader) is-logical:system: not found
Sending sparse 'system' 1/2 (519524 KB)
OKAY [129.331s]
Writing 'system' OKAY [ 6.951s]
Sending sparse 'system' 2/2 (456977 KB) OKAY [114.314s]
Writing 'system' OKAY [ 6.170s]
Finished. Total time: 264.514s
[20:54:53] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[20:54:53] DONE!
[email protected]:~$ pmbootstrap flasher boot
[20:55:29] (rootfs_motorola-ali) install device-motorola-ali
[20:55:37] (rootfs_motorola-ali) install postmarketos-mkinitfs
[20:55:41] (rootfs_motorola-ali) mkinitfs postmarketos-qcom-msm8953
[20:55:51] (native) boot postmarketos-qcom-msm8953 kernel
[20:55:51] (native) install android-tools
Sending 'boot.img' (10858 KB) OKAY [ 2.589s]
Booting FAILED (remote: '')
fastboot: error: Command failed
[20:55:56] NOTE: The failed command's output is above the ^^^ line in the log file: /home/t/.local/var/pmbootstrap/log.txt
[20:55:56] ERROR: Command failed (exit code 1): (native) % fastboot --cmdline boot /mnt/rootfs_motorola-ali/boot/boot.img
[20:55:56] See also: <https://postmarketos.org/troubleshooting>
now i can't even mount '/system' through twrp (invalid argument) xd, please help
to the lack of information i got, i've thought i could install it overwriting a android custom rom i was using (Lineage 19.1, arm64)

gabriela-fazoli said:
Hello, I tried to install this using
pmbootstrap init and pmbootstrap install to setup the installation with xfce4 and the commands from the wiki
it installs /system successfully but i can't boot to it and booting to boot.img fails, what can I do?
Code:
[20:49:45] DONE!
[email protected]:~$ pmbootstrap flasher flash_rootfs
[20:50:02] (native) flash rootfs image
[20:50:07] (native) install android-tools
< waiting for any device >
(bootloader) is-logical:system: not found
Sending sparse 'system' 1/2 (519524 KB)
OKAY [129.331s]
Writing 'system' OKAY [ 6.951s]
Sending sparse 'system' 2/2 (456977 KB) OKAY [114.314s]
Writing 'system' OKAY [ 6.170s]
Finished. Total time: 264.514s
[20:54:53] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[20:54:53] DONE!
[email protected]:~$ pmbootstrap flasher boot
[20:55:29] (rootfs_motorola-ali) install device-motorola-ali
[20:55:37] (rootfs_motorola-ali) install postmarketos-mkinitfs
[20:55:41] (rootfs_motorola-ali) mkinitfs postmarketos-qcom-msm8953
[20:55:51] (native) boot postmarketos-qcom-msm8953 kernel
[20:55:51] (native) install android-tools
Sending 'boot.img' (10858 KB) OKAY [ 2.589s]
Booting FAILED (remote: '')
fastboot: error: Command failed
[20:55:56] NOTE: The failed command's output is above the ^^^ line in the log file: /home/t/.local/var/pmbootstrap/log.txt
[20:55:56] ERROR: Command failed (exit code 1): (native) % fastboot --cmdline boot /mnt/rootfs_motorola-ali/boot/boot.img
[20:55:56] See also: <https://postmarketos.org/troubleshooting>
now i can't even mount '/system' through twrp (invalid argument) xd, please help
to the lack of information i got, i've thought i could install it overwriting a android custom rom i was using (Lineage 19.1, arm64)
Click to expand...
Click to collapse
Reinstall stock with partitons commands

Hello.
I have the same problem as @gabriela-fazoli .
I have reinstalled stock as advised by @brunogroa but even after this I get the same error as shown above.
Do I need to install lk2nd maybe?
If I do then can someone please advise as to how I compile it.
I am using debian 11 and have installed the required dependencies including:
gcc-arm-none-eabi
device-tree-compiler
build-essential
I do not know what is meant by "Replace TOOLCHAIN_PREFIX with the path to your tool chain." when issuing the make command ie: make TOOLCHAIN_PREFIX=arm-none-eabi- <SoC>-secondary
Also is <SOC> meant to be replaced with sdm450-motorola-ali
I am a major newb when it comes to cross compiling.
Thank you for any assistance. I am very excited to give PostmarketOS a whirl on the G6.
Cheers
Bill

For any one else who might have issues compiling lk2nd I can highly recommend this website:
GCC Cross-Compiler - OSDev Wiki
wiki.osdev.org
Have compiled successfully using above instructions and the following make command:
make TOOLCHAIN_PREFIX=~/opt/cross/bin/arm-none-eabi- msm8953-secondary
Haven't tried it yet but fingers crossed.

No good.
I installed lk2nd with the following response:
fastboot flash boot lk2nd.img
(bootloader) is-logical:boot: not found
Sending 'boot' (288 KB) OKAY [ 0.178s]
Writing 'boot' (bootloader) Image not signed or corrupt
OKAY [ 0.028s]
Finished. Total time: 0.208s
Click to expand...
Click to collapse
Couldn't get lk2nd to boot though with Volume-Down pressed at varying intervals.
Then did the following:
[email protected]:~/pmbootstrap$ pmbootstrap flasher flash_rootfs
[10:33:14] (native) flash rootfs image
[10:33:16] (native) install android-tools
(bootloader) is-logical:system: not found
Sending sparse 'system' 1/3 (522136 KB) OKAY [ 19.229s]
Writing 'system' OKAY [ 5.087s]
Sending sparse 'system' 2/3 (517848 KB) OKAY [ 18.848s]
Writing 'system' OKAY [ 4.920s]
Sending sparse 'system' 3/3 (135789 KB) OKAY [ 4.943s]
Writing 'system' OKAY [ 1.128s]
Finished. Total time: 54.896s
[10:34:11] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[10:34:11] DONE!
[email protected]:~/pmbootstrap$ pmbootstrap flasher boot
[10:34:23] (rootfs_motorola-ali) install device-motorola-ali
[10:34:28] (rootfs_motorola-ali) install postmarketos-mkinitfs
[10:34:30] (rootfs_motorola-ali) mkinitfs postmarketos-qcom-msm8953
[10:34:38] (native) boot postmarketos-qcom-msm8953 kernel
[10:34:38] (native) install android-tools
Sending 'boot.img' (10858 KB) OKAY [ 0.397s]
Booting OKAY [ 0.587s]
Finished. Total time: 0.993s
[10:34:39] You will get an IP automatically assigned to your USB interface shortly.
[10:34:39] Then you can connect to your device using ssh after pmOS has booted:
[10:34:39] ssh [email protected]
[10:34:39] NOTE: If you enabled full disk encryption, you should make sure that osk-sdl has been properly configured for your device
[10:34:39] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[10:34:39] DONE!
Click to expand...
Click to collapse
It then reboots and shows the blue screen with the yellow Motorola 'M' and Powered By Android in white at the bottom.
Then it does nothing else.
I hold the power button in and it does the reboot loop thing but without the blue Motorola screen.
I can get into fastboot and TWRP without problem.
Any ideas?

Related

[DISCONTINUED][recovery][fota] z3&z3 dual twrp 3.0.0-0

As you know, CM Recovery is useless for now. So i make Twrp Recoveries for our device.
It works on any kernel with extract_elf_ramdisk utility (it's built in mostly all kernels for custom ROMs, but I am not sure).And don't forget, that you are doing on your own risk, I am not responsible for bricked devices, acid rains or thermonuclear war.
Known Issues
-Nothing.
Installation:
Download z3fotatwrpv5
- Extract z3fotatwrpv5.img and place it to the root of your internal SD-card
- Type su and grant root access
- Type
Code:
dd if=/sdcard/z3fotatwrpv5.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel
- Reboot to recovery to test if it works (if not, try again and check if you are doing it correctly).
Warning
- Don't flash it on stock roms. It will work on custom roms.
Download:
http://www97.zippyshare.com/v/25vBjwMU/file.html
Old Links
Z3fotatwrp- http://www.mediafire.com/download/batu9oc2hzx8d4p/z3fotatwrp.rar
Z3fotatwrpv2- https://www.mediafire.com/?f1pyuh2ac4ucmmd
Z3fotatwrpv3- https://mega.co.nz/#!FswhhLBT!SOBMiNuq6A9waYU8E7YeVVWr-39MCN01OSPYHzqOoeo
Z3fotatwrpv4- https://mega.nz/#!Bl5iTA4Y!j7hkGF5Gk4HT_COW0Gb4O_LCdC8rtX1KJouzkuMAb3U
Z3 DUAL TWRP 2.8.7.0
Many thanks to @rodrigoger for creating this image! https://www.dropbox.com/s/czwgrjjv7g29mpq/z3dualfotatwrpv4.img?dl=0
Some info:
Sony Xperia devices don't have recovery partition. Instead of this in custom kernels is used recovery-in-boot conception with two-stage boot (ramdisk-recovery is packed inside main ramdisk). And there is partition called FOTAKernel that is used for installing official FOTA (firmware-over-the-air) updates. After unlocking your bootloader it partition becomes redundant, because you cannot use OTA function anymore. So it may be used for storing recovery ramdisk. And this very useful future was implemented by a xda member, he developed utility extract_elf_ramdisk (it is merged to almost all kernels for Sony devices), it extracts recovery ramdisk from FOTA partition instead of using regular one from boot image. So even after updating or changing your kernel or ROM you don't lose your current recovery!
BTW, I don't own any of this work, recoveries are not compiled by me.
Update Z3FotaTWRPV5 (TWRP 3.0.0-0)
What's new in 3.0.0-0:
Completely new theme - Much more modern and much nicer looking (by z31s1g)
True Terminal Emulator - Includes arrow keys, tab and tab completion, etc. (by _that)
Language translation - It won’t be perfect and especially some languages that require large font files like Chinese & Japanese won’t be availble on most devices. Also some languages may only be partially translated at this time. Feel free to submit more translations to OmniROM’s Gerrit. (mostly by Dees_Troy)
Flashing of sparse images - On select devices you will be able to flash some parts of factory images via the TWRP GUI (by HashBang173)
Adopted storage support for select devices - TWRP can now decrypt adopted storage partitions from Marshmallow
Reworked graphics to bring us more up to date with AOSP - includes support for adf and drm graphics (by Dees_Troy)
SuperSU prompt will no longer display if a Marshmallow ROM is installed
Update exfat, exfat fuse, dosfstools (by mdmower)
Update AOSP base to 6.0
A huge laundry list of other minor fixes and tweaks
Great work, works fine. Ill have to apply theme due to the fact it does not go full screen lol
Sent from my Xperia Z3 using XDA Free mobile app
Works fine....thx
Odoslané z Xperia Z3 pomocou Tapatalku
TigerrrRawr said:
When installing from external SD the path needs to be corrected to /storage/sdcard1/z3fotatwrpv2.img. The path you posted is for internal SD.
Thanks for creating this image!
Click to expand...
Click to collapse
I'm sorry. I was pensive while i was writing this.
Can you not just go into Fastboot and flash recovery with this file instead of method listed above?
Many thanks
Markieboy said:
Can you not just go into Fastboot and flash recovery with this file instead of method listed above?
Many thanks
Click to expand...
Click to collapse
No, because sony phones do not have a recovery partition
Most xperia recoveries are either in system or in the boot.img, this is the exception
Im a bit confused now, as i swear i flashed 2.8.4.0 and then Cyanogen recovery that way .... ??????
I'm rooted with unlocked bootloader using the exploit so have DRM keys backed up. UK GSM Unbranded
Markieboy said:
Im a bit confused now, as i swear i flashed 2.8.4.0 and then Cyanogen recovery that way .... ??????
I'm rooted with unlocked bootloader using the exploit so have DRM keys backed up. UK GSM Unbranded
Click to expand...
Click to collapse
2.8.4.0 ?
But you cannot flash a recovery in fastboot like on other phones. Cyanogenmod recovery is a boot img is that is flashed to the boot partition on fastboot, hence the code
Code:
fastboot flash BOOT boot.img
Its a kernel not a recovery, but recovery is incorporated in it.
gregbradley said:
2.8.4.0 ?
But you cannot flash a recovery in fastboot like on other phones. Cyanogenmod recovery is a boot img is that is flashed to the boot partition on fastboot, hence the code
Code:
fastboot flash BOOT boot.img
Its a kernel not a recovery, but recovery is incorporated in it.
Click to expand...
Click to collapse
So you can not do:
Code:
fastboot flash recovery fotakernel.img
?
Edit:
Turns out you can.
Verbato said:
So you can not do:
Code:
fastboot flash recovery fotakernel.img
?
Edit:
Turns out you can.
Click to expand...
Click to collapse
That's strange, as the OP says sony phones do not have a recovery partition to flash to... You may be able to
Code:
fastboot flash FOTAkernel fotakernel.img
Markieboy said:
Im a bit confused now, as i swear i flashed 2.8.4.0 and then Cyanogen recovery that way .... ??????
I'm rooted with unlocked bootloader using the exploit so have DRM keys backed up. UK GSM Unbranded
Click to expand...
Click to collapse
Which Nightly Version do u use? It must work. Give me your terminal's screenshot.
gregbradley said:
That's strange, as the OP says sony phones do not have a recovery partition to flash to... You may be able to
Code:
fastboot flash FOTAkernel fotakernel.img
Click to expand...
Click to collapse
Code:
$ fastboot flash FOTAkernel z3fotatwrpv2.img
sending 'FOTAkernel' (10728 KB)...
OKAY [ 0.353s]
writing 'FOTAkernel'...
FAILED (remote: Command not allowed)
finished. total time: 0.356s
Code:
$ fastboot flash recovery z3fotatwrpv2.img
sending 'recovery' (10728 KB)...
OKAY [ 0.353s]
writing 'recovery'...
OKAY [ 0.719s]
finished. total time: 1.072s
Well, what do you know, turns out the command really is:
Code:
fastboot flash recovery fotakernel.img
Verbato said:
Code:
$ fastboot flash FOTAkernel z3fotatwrpv2.img
sending 'FOTAkernel' (10728 KB)...
OKAY [ 0.353s]
writing 'FOTAkernel'...
FAILED (remote: Command not allowed)
finished. total time: 0.356s
Code:
$ fastboot flash recovery z3fotatwrpv2.img
sending 'recovery' (10728 KB)...
OKAY [ 0.353s]
writing 'recovery'...
OKAY [ 0.719s]
finished. total time: 1.072s
Well, what do you know, turns out the command really is:
Code:
fastboot flash recovery fotakernel.img
Click to expand...
Click to collapse
I stand corrected, but that is a new one to me.
EDIT
After talking with some devs it seems we are both correct...
It's both true
Fota IS the recovery partition, but the recovery trigger does nothing to make S1 boot from it...
So it's perfectly possible to store the recovery on the fota partition and trigger the boot to it from there with a small change in the init.
and reading the message
I can conclude fastboot does not know FOTAkernel, but assumes it to be 'recovery'
Click to expand...
Click to collapse
So basically your command is flashing to the FOTAkernel partition because fastboot does not recognise it... Schrodinger's cat... we are both correct and both wrong at the same time.
Sources Please?
hey I was wondering about the sources you used to compile this, I've tried by building with cm breakfast and omni's branch of android bootable but I get multiple errors..
Code:
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/scrolllist.cpp:205: error: undefined reference to 'gr_clip'
bootable/recovery/gui/scrolllist.cpp:315: error: undefined reference to 'gr_noclip'
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/console.cpp:198: error: undefined reference to 'gr_maxExW'
bootable/recovery/gui/resources.cpp:186: error: undefined reference to 'gr_freeFont'
Any help please?
I am running the latest CM12 nightly.
Can I fast boot flash the recovery and not worry about my system bricking?
Yes, it's working without any issues. Using fastboot flash recovery on twrp 2.8.5.0. It's great not to use that CM-Recovery.
Any chance we can get 2.8.5.0 for FOTA ? Stock recovery for CM12 Sucks but 2.8.4.0 does not play well with flashing CM12 Roms
Ignore as I just saw your edited OP. You may want to update your title
Sent from my Xperia Z3 using XDA Free mobile app
HaoZeke said:
hey I was wondering about the sources you used to compile this, I've tried by building with cm breakfast and omni's branch of android bootable but I get multiple errors..
Code:
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/scrolllist.cpp:205: error: undefined reference to 'gr_clip'
bootable/recovery/gui/scrolllist.cpp:315: error: undefined reference to 'gr_noclip'
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/resources.hpp:48: error: undefined reference to 'gr_getMaxFontHeight'
bootable/recovery/gui/console.cpp:198: error: undefined reference to 'gr_maxExW'
bootable/recovery/gui/resources.cpp:186: error: undefined reference to 'gr_freeFont'
Any help please?
Click to expand...
Click to collapse
Recoveries are not compiled by me.
Mattadome02 said:
I am running the latest CM12 nightly.
Can I fast boot flash the recovery and not worry about my system bricking?
Click to expand...
Click to collapse
I haven't tried this yet. You can flash this with my codes.

(NEW) TUTORIAL: Convert Xiaomi Amazfit Smartwatch from Chinese to English firmware

BREAKING NEWS:
Huami took down the files from my hoster because of "alleged copyright infringement". I got a notice and an information that the files have been deleted, as well as that any further copyright infringement will lead to termination of the account and possible legal activities.
UPDATE 23-06-2017:
I updated the files to version 1.3.3a and reuploaded them to a different fileshare. (Let's see if they will be taken down again...)
UPDATE:
This is a new conversion method based on the techniques I used in my PACEfied installer. It will install the official Huami English firmware 1.3.3a with all features and OTA enabled. It will, however, NOT lock your bootloader. So, you have some time to evaluate, if you like the official ROM, or prefer to go to the PACEfied ROM.
NOTE: AS SOON AS YOU RECEIVE AND INSTALL AN OFFICIAL OTA AFTERWARDS, YOUR BOOTLOADER WILL BE LOCKED AND YOU WILL NOT BE ABLE TO SWITCH BACK.
ATTENTION: THIS METHOD ONLY WORKS FOR WATCHES WITH UNLOCKED BOOTLOADER (Huami started locking in official firmware 1.2.13 / 1.3.2b and upwards).
INSTALLATION:
This method uses the same installation procedure as PACEfied. Please find all information here: https://gitlab.com/Neuer_User/PACEfied_AmazFit/wikis/permanent-install
Downloads:
OFFICIAL ENGLISH FIRMWARE 1.3.3a: https://app.box.com/s/3io4m4zk7775x3vp80yw19l52slk6sxs
NOTE:
It is recommended that you factory reset the watch after installation, as data from other ROMs may lead to force closes of apps. You can do this either by unpairing the watch or in the settings / device menu of the watch.
DISCLAIMER:
While this method is pretty safe, there is a chance that you may brick your watch (so far no case known). YOU DO THIS ON YOUR OWN RISK. I am not responsible for any damages, psychological problems or wars emerging out of you converting your watch.
With the help of Neuer I was to flash my smartwatch with US Image!
I had some problems regarding android drivers while running fastboot and adb steps, this is how I solved them:
if fastboot is not detecting your device just download/install Google USB Driver at:
https://developer.android.com/studio/run/win-usb.html
Follow this guide on how to install the driver:
http://www.teamandroid.com/2012/07/30/how-to-set-up-adb-fastboot-with-android-sdk/3/
Neuer_User said:
Hi guys
...
fastboot boot Amazfit-mod-recovery.img
...
Click to expand...
Click to collapse
After booting into the modded recovery, adb was not detecting my smartwatch. All that i had to do was to go to "Step 35" of the previous guide and install the "Android Composite ADB Interface" driver and everything started to work again with ADB.
Big thanks to Neuer for his amazing hard work and patience! He did it! Also big thanks to everyone that provided useful information for this to work.
The instructions are good.
Model is now A1612.
ROM Version is now 1.3.0n
I cannot switch from Mi to KM.
Hi all,
Big thanks to Neuer_User for his hard work!
Just a quick question for those who have converted into english: does sync work and in which app (strava or mifit)?
Thanks.
It works perfectly. Thank you very much Neuer.
Great work Neuer_User you are now officialy a Amazfit Legend!!
May i suggest the next person to attempt this does a video tutorial and uploads it to youtube. Kudos to all those who have contributed in one way or another.
Another XDA Headline
I've an error during update, do you have any hint:
Code:
C:\Downloads\convert_to_eng>adb push boot.img.gz /sdcard/
7573 KB/s (5575879 bytes in 0.719s)
C:\Downloads\convert_to_eng>adb push system.img.gz /sdcard/
7713 KB/s (189626362 bytes in 24.009s)
C:\Downloads\convert_to_eng>adb push flash_eng_version.sh /sdcard
/
267 KB/s (547 bytes in 0.002s)
C:\Downloads\convert_to_eng>adb push md5s.txt /sdcard/
45 KB/s (94 bytes in 0.002s)
C:\Downloads\convert_to_eng>adb shell reboot bootloader
C:\Downloads\convert_to_eng>fastboot devices
0123456789 fastboot
C:\Downloads\convert_to_eng>fastboot boot Amazfit-mod-recovery.im
g
downloading 'boot.img'...
OKAY [ 0.436s]
booting...
FAILED (status read failed (Too many links))
finished. total time: 1.403s
Thank you so much. it worked perfectly.
Can you make a tutorial movie ?? Im not very good whit fastboot. Tks
perritos said:
I've an error during update, do you have any hint:
C:\Downloads\convert_to_eng>adb push boot.img.gz /sdcard/
7573 KB/s (5575879 bytes in 0.719s)
C:\Downloads\convert_to_eng>adb push system.img.gz /sdcard/
7713 KB/s (189626362 bytes in 24.009s)
C:\Downloads\convert_to_eng>adb push flash_eng_version.sh /sdcard
/
267 KB/s (547 bytes in 0.002s)
C:\Downloads\convert_to_eng>adb push md5s.txt /sdcard/
45 KB/s (94 bytes in 0.002s)
C:\Downloads\convert_to_eng>adb shell reboot bootloader
C:\Downloads\convert_to_eng>fastboot devices
0123456789 fastboot
C:\Downloads\convert_to_eng>fastboot boot Amazfit-mod-recovery.im
g
downloading 'boot.img'...
OKAY [ 0.436s]
booting...
FAILED (status read failed (Too many links))
finished. total time: 1.403s
Click to expand...
Click to collapse
That is no error. You just need to continue with the next step. You should be recovery now and need to start adb.
Neuer_User said:
That is no error. You just need to continue with the next step. You should be recovery now and need to start adb.
Click to expand...
Click to collapse
That's ok
Now my amazfit is in English version.
Thanks very much
Great job!!
Flawless instructions. Worked beautifuly.
I'd have made a video but was paranoid enough that something might go wrong that I didn't want to be distracted during the process. Anyway, the instructions are so clear I'm not sure someone needs the video. So long as adb/fastboot is set up properly, all will go fine.
Perfect, it works for me.
Flashed, rebooting.........
All ok thanks my friends!
Just to inform, during the procedure I have had a problem, after
"fastboot boot Amazfit-mod-recovery.img"
I have had an error message, but I move on because after adb shell I was root "#"
Thank you very much Great Job
Thanks you very much
I apply and all is ok
Thanks you again
took the plunge, all good... top work!
Thanks, guys, for all the positive feedback. I'm happy to hear it is working.
Presumably after flash we can delete these pushed files from SD card to free up storage space?
Sent from my HUAWEI NXT-L29 using XDA Free mobile app
Thank you ! Done ! It's all right !
Just a question : We can't get 24-hour clock instead AM/PM ?

[RECOVERY][TWRP]TWRP For Amazfit Pace/Stratos/Verge

Note: The Pace and Stratos should can use same recovery as well,I only have Stratos/Verge to test.The Verge(Launched only in China only) with AMOLED Display need to use separated Recovery.
For Stratos,Download EVEREST Image
For Verge,Download QOGIR Image
Source:
Pace: https://github.com/mauronofrio/android_device_huami_huanghe-twrp
Stratos:https://github.com/TingyiChen/android_device_huami_everest-twrp
Verge:https://github.com/TingyiChen/android_device_huami_qogir-twrp
Download:
Pace: https://androidfilehost.com/?fid=1322778262904021226
Stratos: https://www.androidfilehost.com/?w=files&flid=283426
Verge(AMOLED Variant): https://www.androidfilehost.com/?w=files&flid=283425
Known issue:
On Verge(qogir):
MTP Not working
Screen not responding sometimes
Screen is rotated
On Stratos(Everest):
Unknown
(NEED REPORT)(I doubt same as Verge)
On Pace:
I Dont know
Not having it
Should same as Stratos/Verge
Reserved
a little laggish on selection, and some weird electric jittering
will verify with PACE and post back, thanks !!!
1immortal said:
a little laggish on selection, and some weird electric jittering
Click to expand...
Click to collapse
I doubt it is caused by kernel?Cause Amazfit CPU is MIPS not normally ARM
TingyiChen said:
Note: The Pace and Stratos should can use same recovery as well,I only have Stratos/Verge to test.The Verge(Launched only in China only) with AMOLED Display need to use separated Recovery.
For Pace/Stratos,Download EVEREST Image
For Verge,Download QOGIR Image
Source:
Stratos:https://github.com/TingyiChen/android_device_huami_everest-twrp
Verge:https://github.com/TingyiChen/android_device_huami_qogir-twrp
Download
Pace/Stratos: https://www.androidfilehost.com/?w=files&flid=283426
Verge(AMOLED Variant): https://www.androidfilehost.com/?w=files&flid=283425
Click to expand...
Click to collapse
On Pace touchscreen doesn't work, but this one does using Pace's 2.6.3.1 zImage: https://mega.nz/#!hwIjFCiY!qc3sT2YD9uFCe86GPbX9VXL_LQRfHwwe1VfBtxCbrD0
Testing on Pace. Perhaps I am ding something wrong, but I still getting stock recovery.
My steps:
- adb shell reboot bootloader
- [email protected] ~/Downloads $ sudo fastboot flash recovery twrp-everest-3.2.3-20181006.img
target reported max download size of 67108864 bytes
sending 'recovery' (9680 KB)...
OKAY [ 0.650s]
writing 'recovery'...
OKAY [ 1.705s]
finished. total time: 2.355s
- fastboot reboot
- adb reboot recovery
Still getting "No commands" message from stock recovery.
At this PACE is WOS2.
TingyiChen said:
Note: The Pace and Stratos should can use same recovery as well,I only have Stratos/Verge to test.The Verge(Launched only in China only) with AMOLED Display need to use separated Recovery.
For Pace/Stratos,Download EVEREST Image
For Verge,Download QOGIR Image
Source:
Stratos:https://github.com/TingyiChen/android_device_huami_everest-twrp
Verge:https://github.com/TingyiChen/android_device_huami_qogir-twrp
Download
Pace/Stratos: https://www.androidfilehost.com/?w=files&flid=283426
Verge(AMOLED Variant): https://www.androidfilehost.com/?w=files&flid=283425
Click to expand...
Click to collapse
Paxy said:
Testing on Pace. Perhaps I am ding something wrong, but I still getting stock recovery.
My steps:
- adb shell reboot bootloader
- [email protected] ~/Downloads $ sudo fastboot flash recovery twrp-everest-3.2.3-20181006.img
target reported max download size of 67108864 bytes
sending 'recovery' (9680 KB)...
OKAY [ 0.650s]
writing 'recovery'...
OKAY [ 1.705s]
finished. total time: 2.355s
- fastboot reboot
- adb reboot recovery
Still getting "No commands" message from stock recovery.
At this PACE is WOS2.
Click to expand...
Click to collapse
Code:
fastboot boot recovery_name.img
Saratoga79 said:
Code:
fastboot boot recovery_name.img
Click to expand...
Click to collapse
Tnx. Yap, I can confirm that Pace boot recovery but touchscreen is not working.
Paxy said:
Tnx. Yap, I can confirm that Pace boot recovery but touchscreen is not working.
Click to expand...
Click to collapse
Use the one I attached in a previous post.
TingyiChen said:
Note: The Pace and Stratos should can use same recovery as well,I only have Stratos/Verge to test.The Verge(Launched only in China only) with AMOLED Display need to use separated Recovery.
For Pace/Stratos,Download EVEREST Image
For Verge,Download QOGIR Image
Source:
Stratos:https://github.com/TingyiChen/android_device_huami_everest-twrp
Verge:https://github.com/TingyiChen/android_device_huami_qogir-twrp
Download
Pace/Stratos: https://www.androidfilehost.com/?w=files&flid=283426
Verge(AMOLED Variant): https://www.androidfilehost.com/?w=files&flid=283425
Click to expand...
Click to collapse
You can't unify pace and stratos tree, they have different partitions sizes, i sent you a pull request to fix flip screen on verge
This one is for pace: https://www.androidfilehost.com/?fid=1322778262904021226
What is the gain from using TWRP on Stratos?
Enviado de meu SM-G950F usando o Tapatalk
@TingyiChen you are the best!
I had 2 wishes: a real stable custom rom with fast updates for my santoni and custom rom for my pace. You made both possible! Many thanks!
(also thanks for your help @Saratoga79)
Anyone who tried TWRP on his watch, just check your SN (Serial Number) on Settings>About or just using adb, as it seems to be deleting (null value) your SN.
Code:
adb shell getprop ro.sn.serial_numbers
If you don't get an output like this, you lost your SN.
Code:
123456789ABCDE
Stay tuned for restore method.
Saratoga79 said:
Anyone who tried TWRP on his watch, just check your SN (Serial Number) on Settings>About or just using adb, as it seems to be deleting (null value) your SN.
If you don't get an output like this, you lost your SN.
Stay tuned for restore method.
Click to expand...
Click to collapse
You using a pace?
Oliver3321 said:
You using a pace?
Click to expand...
Click to collapse
Yes, I do. It happened in Pace.
New releases by @mauronofrio already fixed the bug.
Saratoga79 said:
Yes, I do. It happened in Pace.
New releases by @mauronofrio already fixed the bug.
Click to expand...
Click to collapse
ok bro
How to unlock boot loader (verge).
How do I access the TWRP what do I have to press to access it.

iplay 7t (sc9832e processor) root / unlock bootloader suggestions

Recently purchased an iplay 7t after reading the xda review. This is replacing an LG v400 tablet that I had rooted. I updated the iplay to build T701_V1.20_20191112, enabled developer options, enabled oem unlock bootloader, found the corresponding firmware pac, installed magisk and used it to patch boot.img. So far so good.
I entered fastboot, then I attempted to flash the modified boot.img and was told:
Code:
target didn't report max-download-size
sending 'boot' (18584 KB)...
OKAY [ 0.593s]
writing 'boot'...
FAILED (remote: Flashing Lock Flag is locked. Please unlock it first!)
finished. total time: 0.608s
I tried various options to unlock the bootloader:
Code:
> fastboot getvar unlocked
unlocked:
finished. total time: -0.000s
> fastboot oem unlock
...
FAILED (remote: unknown cmd.)
finished. total time: -0.000s
> fastboot oem unlock-go
...
FAILED (remote: unknown cmd.)
finished. total time: 0.002s
> fastboot flashing get_unlock_ability
...
FAILED (remote: Not implement.)
finished. total time: -0.000s
> fastboot flashing unlock
...
FAILED (remote: Not implemet.)
finished. total time: -0.000s
> fastboot flashing unlock_critical
...
FAILED (remote: Not implement.)
finished. total time: 0.016s
> fastboot flashing unlock_bootloader
fastboot: usage: unknown 'flashing' command unlock_bootloader
> fastboot flashing unlock_bootloader_nonce
fastboot: usage: unknown 'flashing' command unlock_bootloader_nonce
Okay ... fine. I fired up SPD Research tool and attempted to use it to flash the modified boot.img. It transfers the image and then times out.
As a sanity check I used SPD Research tool to flash the original boot.img and that worked fine.
I'll note the modified image is smaller than the original, however padding the modified image with zeros to the same size didn't seem to help. Using SPD Research tool to flash the padded image still timed out.
I am looking to open a request up on the Alldocube support site (currently their registration form is giving me an error), in the meantime ... suggestions? Has anyone successfully flashed a modified boot.img on this device / rooted this device?
in the "developer option" on your phone, you should enable the "allow unlock bootloader" option.
DR.Doyle said:
in the "developer option" on your phone, you should enable the "allow unlock bootloader" option.
Click to expand...
Click to collapse
Yes ... I have that enabled.
Okay I was able to unlock the bootloader by using the procedure documented for the Qin 2 Pro. With the bootloader unlocked on reboot the device notes:
Code:
INFO: LOCK FLAG IS : UNLOCKED!!!
followed by:
Code:
WARNING: LOCK FLAG IS : UNLOCKED, SKIP VERIFY!!!
Using fastboot I can now reflash the stock vbmeta and the stock recovery without any problems and the stock recovery boots fine.
Also if I re-sign the stock recovery, then I can't flash it (fastboot flash hangs) until I've flashed a modified vbmeta containing the new public key for the re-signed recovery. Meaning flashing vbmeta is "working".
All this seems like I'm on the right track.
However attempting to boot into the re-signed stock recovery results in:
Code:
INFO: LOCK FLAG IS : UNLOCKED!!!
followed by the device hanging (without displaying the WARNING message) so there is still something that's unhappy.
Any thoughts on how to get to the point that I can flash a useable re-signed stock recovery? If I can get that to work, then I should be in good shape to install magisk.
jwehle said:
Okay I was able to unlock the bootloader by using the procedure documented for the Qin 2 Pro. With the bootloader unlocked on reboot the device notes:
Code:
INFO: LOCK FLAG IS : UNLOCKED!!!
followed by:
Code:
WARNING: LOCK FLAG IS : UNLOCKED, SKIP VERIFY!!!
Using fastboot I can now reflash the stock vbmeta and the stock recovery without any problems and the stock recovery boots fine.
Also if I re-sign the stock recovery, then I can't flash it (fastboot flash hangs) until I've flashed a modified vbmeta containing the new public key for the re-signed recovery. Meaning flashing vbmeta is "working".
All this seems like I'm on the right track.
However attempting to boot into the re-signed stock recovery results in:
Code:
INFO: LOCK FLAG IS : UNLOCKED!!!
followed by the device hanging (without displaying the WARNING message) so there is still something that's unhappy.
Any thoughts on how to get to the point that I can flash a useable re-signed stock recovery? If I can get that to work, then I should be in good shape to install magisk.
Click to expand...
Click to collapse
Dear jwehle:
good job, i have also modify the pac firmware file which based on chinese vesion firmware:T701-1101-vbmetapri-vennofbe-systemnore-recpri01.pac
What's modified:
1.resgin the vbmeta img
2.delete fbe Force encryption in vendor partitions
3.delete the script in system.img to prevent factory recovery restore
4.modify recovery.img to a magisk build-in recovery
please use SPD_Research_Tool to flash the pac,change the android os language from chinese to english ,install magiskmanager app ,and the use adb command (adb reboot recovery)to let tablet reboot to recovery.
after tablet reboot to android os again ,open magiskmanager app,you can see the magisk can get root authority .
how to change language from chinese to english,please see attach png file.
Considering that the Android os you are using is in English version(including Google services),according to the modification points above, you can try to use the vbmeta and recovery (built in magisk) modified by your own signature , and then delete the fbe Force encryption、 recovery restoration in the system and vendor images , then use the SPD_Research_Tool to package the imgs into a pac image, flash the pac image, install the magiskmanager app, and use the adb command to restart the machine into recovery mode, so you can use magisk to get root permissions.
twrp egg:https://mega.nz/#!YZ9VDZbT!1ptlOI6g3FS_ES-cLGhLy9ybGtdHQ8vzVHaasAXglXo
and last thanks PeterCxy on xda 、the other masters sifu on 4pda agian.
wangyiling said:
Dear jwehle:
good job, i have also modify the pac firmware file which based on chinese vesion firmware:T701-1101-vbmetapri-vennofbe-systemnore-recpri01.pac
What's modified:
1.resgin the vbmeta img
2.delete fbe Force encryption in vendor partitions
3.delete the script in system.img to prevent factory recovery restore
4.modify recovery.img to a magisk build-in recovery.
Click to expand...
Click to collapse
Thanks for supplying the modified PAC and for explaining the changes.
Your PAC seemed to work fine and now that I have a better understanding
of things I should be able build my own PAC when I have a chance.
Your time and effort in explaining things is appreciated.
What's the significance of removing the encryption for the vendor partitions?
jwehle said:
What's the significance of removing the encryption for the vendor partitions?
Click to expand...
Click to collapse
the vendor img in my pac,just use ext4 format.i have use simg2img convert the oringin vendor img to ext4 format,and modify the fstab file in vendor/etc folder.
fstab.sp9832e_1h10:
Code:
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inline_xattr,inline_data wait,check,[COLOR="DarkOrange"]fileencryption[/COLOR]=aes-256-xts,reservedsize=128M
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/userdata /data ext4 noatime,nosuid,nodev,nomblk_io_submit,noauto_da_alloc wait,check,[COLOR="darkorange"]fileencryption[/COLOR]=aes-256-xts
---------->
Code:
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inline_xattr,inline_data wait,check,[COLOR="darkorange"]encryptable[/COLOR]=aes-256-xts,reservedsize=128M
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/userdata /data ext4 noatime,nosuid,nodev,nomblk_io_submit,noauto_da_alloc wait,check,[COLOR="darkorange"]encryptable[/COLOR]=aes-256-xts
wangyiling said:
the vendor img in my pac,just use ext4 format.i have use simg2img convert the oringin vendor img to ext4 format,and modify the fstab file in vendor/etc folder.
Click to expand...
Click to collapse
Actually, I was more curious as to why it was necessary / desirable to remove the encryption from the vendor partitions.
jwehle said:
Actually, I was more curious as to why it was necessary / desirable to remove the encryption from the vendor partitions.
Click to expand...
Click to collapse
Just for twrp to read the data partition, convenient for personal use。
It looks like the issue on this tablet is similar to what the magisk documentation mentions regarding the new Samsung tablets. Meaning after the bootloader is unlocked when rooting you should flash newly signed versions of the following:
Code:
vbmeta
boot
recovery
What was happening is when the system started normally it saw that recovery image had been modified so it checked if the boot image was the factory standard image. Since I hadn't touched the boot image the OS went ahead and attempted to replace the recovery image I flashed with a standard recovery image generated on the fly from the factory standard boot image. This caused a soft-brick when I rebooted into recovery since that recovery image wasn't signed using the public key specified by my replacement vbmeta.
By also flashing a newly signed boot image because the signature is different from what's it knows about the system no longer attempts to use it to refresh the recovery image.
Here's an outline of what I did to successfully root the device:
Use the Qin 2 Pro instructions / tools to unlock the boot loader.
Flash the appropriate factory standard firmware to establish a know starting point. I used iplay7t(T701)-Android9.0-ALLDOCUBE-191112 from the Alldocube web site.
Use SPD Rsearch Tool to extract vbmeta-sign.img, boot.img, and recovery.img.
Use avbtool (with the below patch) to extract the public keys from vbmeta-sign.img like so:
Code:
avbtool info_image --image vbmeta-sign.img.
Use make (with the below makefile) to sign vbmeta, boot, and recovery using a new key.
Flashed vbmeta, boot, and recovery.
Booted into recovery, saw that it worked, and did a factory reset.
Used magisk to patch recovery.img in the normal fashion, signed the patched recovery using the new key, and flashed the patched recovery.
Proceed to finish installing magisk in the normal fashion.
Notes:
rsa4096_vbmeta.pem is the private key mentioned in the Qin 2 Pro article.
The dhtbsign-vbmeta command is basically the dhtb signing python script from Qin 2 Pro article.
Here's the trival patch for avbtool to dump the public keys.
Code:
--- avbtool 2020-02-22 22:11:55.107787032 -0500
+++ avbtool.dumpkeys 2020-02-22 22:15:36.046283077 -0500
@@ -1657,6 +1657,10 @@ class AvbChainPartitionDescriptor(AvbDes
Arguments:
o: The object to write the output to.
"""
+ kfd = open(self.partition_name, "w");
+ kfd.write(self.public_key);
+ kfd.close();
+
o.write(' Chain Partition descriptor:\n')
o.write(' Partition Name: {}\n'.format(self.partition_name))
o.write(' Rollback Index Location: {}\n'.format(
Here's the makefile I used for signing the images.
Code:
all: boot-sign.img recovery-sign.img vbmeta-sign.img
vbmeta-sign.img: Makefile avb4096_pkmd.bin keys/*
avbtool make_vbmeta_image --output vbmeta.img --padding_size 16384 \
--key ../rsa4096_vbmeta.pem --algorithm SHA256_RSA4096 --flag 0 \
--chain_partition boot:1:avb4096_pkmd.bin \
--chain_partition system:3:keys/system \
--chain_partition vendor:4:keys/vendor \
--chain_partition product:10:keys/product \
--chain_partition dtbo:9:keys/dtbo \
--chain_partition recovery:2:avb4096_pkmd.bin \
--chain_partition l_modem:5:keys/l_modem \
--chain_partition l_ldsp:6:keys/l_ldsp \
--chain_partition l_gdsp:7:keys/l_gdsp \
--chain_partition pm_sys:8:keys/pm_sys \
--chain_partition dtb:11:keys/dtb
dhtbsign-vbmeta vbmeta.img vbmeta-sign.img
@rm -f vbmeta.img
avb4096_pkmd.bin: avb4096.pem
avbtool extract_public_key --key avb4096.pem --output avb4096_pkmd.bin
avb4096.pem:
openssl genrsa -out avb4096.pem 4096
boot-sign.img: boot.img avb4096.pem
cp boot.img boot-sign.img
avbtool add_hash_footer --image boot-sign.img \
--partition_name boot --partition_size 36700160 \
--key avb4096.pem --algorithm SHA256_RSA4096
recovery-sign.img: recovery.img avb4096.pem
cp recovery.img recovery-sign.img
avbtool add_hash_footer --image recovery-sign.img \
--partition_name recovery --partition_size 36700160 \
--key avb4096.pem --algorithm SHA256_RSA4096
@ jwehle,Very grateful for your detailed sharing
Did you have any trouble getting the tablet to populate the fastboot devices list?
I have USB drivers installed and can view the tablet's internal storage when it's not in fastboot mode. She's plugged directly into the mobo and I've tried two cables.
When in fastboot mode, it comes up in the Windows Device Manager as fastboot Gadget and drivers are apparently not available. I've tried using Zadig to feed it a driver of some kind, but still nothing.
MissAyako said:
Did you have any trouble getting the tablet to populate the fastboot devices list?
I have USB drivers installed and can view the tablet's internal storage when it's not in fastboot mode. She's plugged directly into the mobo and I've tried two cables.
When in fastboot mode, it comes up in the Windows Device Manager as fastboot Gadget and drivers are apparently not available. I've tried using Zadig to feed it a driver of some kind, but still nothing.
Click to expand...
Click to collapse
Seems the issue was with Windows. I thought I would be able to get the unlock token with Windows and then use WSL to do the rest of the signing, but apparently not.
Luckily I had an old laptop lying around. I threw Linux Mint on it and it worked just fine.
It didn't seem to work just using a live USB; I had to install Linux to the hard disk, but YMMV.
jwehle said:
It looks like the issue on this tablet is similar to what the magisk documentation mentions regarding the new Samsung tablets. Meaning after the bootloader is unlocked when rooting you should flash newly signed versions of the following:
Click to expand...
Click to collapse
This was wonderful, thank you! I've added some of my own notes below as an experience of what I encountered when attempting this process myself (spoiler'd because it is a lot).
I do not have enough post count to add links, but titles to the relevant articles has been added.
Follow steps in Article "Guide: How to Unlock Xiaomi Qin 2 (Pro) and Install Custom ROMs" from step 1 to (and including) step 10 (Unlocking section).
Notes:
- A Linux PC is necessary.
- You'll have to mark the "fastboot" file from the "Android_device_unlock.rar" archive as executable (chmod +x).
- Run the "fastboot" file as root.
- Getting the "SPD Research Tool" to pick up the tablet and not let the tablet try to move to either the charging
screen or the bootlogo is difficult, but do-able. Press and hold Power+Vol_Up and release when Windows does its
USB device detected chime.
- Flashing takes a few minutes (I think around 300 seconds).
- The SPD Research Tool extracts the PAC file contents into a folder. Grab the system images from there.
- The "avbtool" is available to be cloned via git from Google's repo
- The avbtool is a python script that is patched with three lines of code at line 1776:
Code:
kfd = open(self.partition_name, "w");
kfd.write(self.public_key);
kfd.close();
- When you use the patched avbtool on the vbmeta-sign.img file you copied (avbtool info_image --image vbmeta-sign.img)
it will produce several partitions with relative public keys that need to be stored in separate files for the next step.
The contents of the files are simply the public key and the partition name as the file name. Store the files in a folder named "keys".
- When creating the makefile, ensure that proper indentation is used. The code segment below is properly formatted (hopefully). If you get make errors, remove and re-indent the lines.
- If your "rsa4096_vbmeta.pem" keyfile is not placed alongside the makefile, ensure the --key flag points to this file.
- The makefile exists in the same directory as the system images.
- I had to insert local paths to the avbtool, as it was not installed to the system PATH.
- The dhtbsign-vbmeta.py command is located below. Make sure to mark this as executable as well.
Everything else is rather straightforward.
# makefile
Code:
all: boot-sign.img recovery-sign.img vbmeta-sign.img
vbmeta-sign.img: makefile avb4096_pkmd.bin keys/*
avbtool make_vbmeta_image --output vbmeta.img --padding_size 16384 \
--key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096 --flag 0 \
--chain_partition boot:1:avb4096_pkmd.bin \
--chain_partition system:3:keys/system \
--chain_partition vendor:4:keys/vendor \
--chain_partition product:10:keys/product \
--chain_partition dtbo:9:keys/dtbo \
--chain_partition recovery:2:avb4096_pkmd.bin \
--chain_partition l_modem:5:keys/l_modem \
--chain_partition l_ldsp:6:keys/l_ldsp \
--chain_partition l_gdsp:7:keys/l_gdsp \
--chain_partition pm_sys:8:keys/pm_sys \
--chain_partition dtb:11:keys/dtb
./dhtbsign-vbmeta.py vbmeta.img vbmeta-sign.img
@rm -f vbmeta.img
avb4096_pkmd.bin: avb4096.pem
avbtool extract_public_key --key avb4096.pem --output avb4096_pkmd.bin
avb4096.pem:
openssl genrsa -out avb4096.pem 4096
boot-sign.img: boot.img avb4096.pem
cp boot.img boot-sign.img
avbtool add_hash_footer --image boot-sign.img \
--partition_name boot --partition_size 36700160 \
--key avb4096.pem --algorithm SHA256_RSA4096
recovery-sign.img: recovery.img avb4096.pem
cp recovery.img recovery-sign.img
# dhtbsign-vbmeta.py file (from "How I Unlocked Xiaomi Qin 2 Pro and Installed Phh GSI")
Code:
#!/usr/bin/env python
import hashlib
import sys
f = open(sys.argv[1], "rb")
b = f.read()
sha = hashlib.sha256(b).digest()
f.close()
f = open("vbmeta_signed.img", "wb")
f.write(b)
f.seek(1048576 - 512)
f.write(b'\x44\x48\x54\x42\x01\x00\x00\x00')
f.write(sha)
f.write(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00')
f.seek(1048576 - 1)
f.write(b'\x00')
f.close()
wuxianlin has build a twrp device for T701.
i think this will be a help .
Help me
Sir help pliz same problem my device ,same chipset , Symphony i95 ,pliz sir modify my pac file pliz....
wangyiling said:
Dear jwehle:
good job, i have also modify the pac firmware file which based on chinese vesion firmware:T701-1101-vbmetapri-vennofbe-systemnore-recpri01.pac
What's modified:
1.resgin the vbmeta img
2.delete fbe Force encryption in vendor partitions
3.delete the script in system.img to prevent factory recovery restore
4.modify recovery.img to a magisk build-in recovery
please use SPD_Research_Tool to flash the pac,change the android os language from chinese to english ,install magiskmanager app ,and the use adb command (adb reboot recovery)to let tablet reboot to recovery.
after tablet reboot to android os again ,open magiskmanager app,you can see the magisk can get root authority .
how to change language from chinese to english,please see attach png file.
Considering that the Android os you are using is in English version(including Google services),according to the modification points above, you can try to use the vbmeta and recovery (built in magisk) modified by your own signature , and then delete the fbe Force encryption、 recovery restoration in the system and vendor images , then use the SPD_Research_Tool to package the imgs into a pac image, flash the pac image, install the magiskmanager app, and use the adb command to restart the machine into recovery mode, so you can use magisk to get root permissions.
twrp egg:https://mega.nz/#!YZ9VDZbT!1ptlOI6g3FS_ES-cLGhLy9ybGtdHQ8vzVHaasAXglXo
and last thanks PeterCxy on xda 、the other masters sifu on 4pda agian.
Click to expand...
Click to collapse
can i just flash the pac without unlocking the bootloader.
thanks in advances
hidroela said:
can i just flash the pac without unlocking the bootloader.
thanks in advances
Click to expand...
Click to collapse
yes,just falsh pac
wangyiling said:
yes,just falsh pac
Click to expand...
Click to collapse
i did unlocked the bootloader and flash the pac and follow the instructions for magisk to work, but after a third reboot Root was gone.
i don't know what I am missing.

AOSP recovery image is too large for partition

Hi, I have a build problem when building AOSP kernel using Vim3Pro for AOSP kernel development with android kernel 5.10.
I cloned AOSP kernel images following the below command.
git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.10
Then, I inserted some additional kernel functions and commands like ‘printk’ and rebuilt it.
The size of recovery.img file increased 32 MB → 32.X MB, and I modified BOARD_RECOVERYIMAGE_PARTITION_SIZE 32MB to 64MB in ‘device/amlogic/yukawa/BoardConfigCommon.mk’ file.
However, when using uboot and fastboot, I still get the below message.
target reported max download size of 117440512 bytes
sending 'recovery' (33412 KB)...
OKAY [ 1.832s]
writing 'recovery'...
FAILED (remote: too large for partition)
finished. total time: 1.845s
Which file or option should I modify other files or options?
JWChoi1996 said:
I modified BOARD_RECOVERYIMAGE_PARTITION_SIZE 32MB to 64MB in ‘device/amlogic/yukawa/BoardConfigCommon.mk’ file.
Click to expand...
Click to collapse
Why? That will make recovery larger than 32mb
aIecxs said:
Why? That will make recovery larger than 32mb
Click to expand...
Click to collapse
I added some additional kernel functions and operations to the original aosp source code for debugging.
Then, the build program generated recovery.img larger than 32MB.
So, I had to fix that variable. if not the build program makes a failure.
Is the increased recovery image file wrong?
Had I some mistakes on aosp source code?
your recovery partition is 32mb, you must not create file larger than 32mb. use another toolchain, clang compiler will half the kernel size compared to gcc.
aIecxs said:
your recovery partition is 32mb, you must not create file larger than 32mb. use another toolchain, clang compiler will half the kernel size compared to gcc.
Click to expand...
Click to collapse
Thank you, I'll try it.
Can I ask you a question?
Is it normal for recovery.img size to increase when I add printk?
Idk, but if recovery is build on edge full 32gb, of course any addition will exceed size I guess.

Categories

Resources