Questions on Using TWRP and A/B Slot Switching - OnePlus 7 Pro Questions & Answers

This is my first time starting a new thread, so here goes.
Since getting a new (to me) One Plus 7 Pro Android device which supports (also new to me) A/B partition slots, I have learned more than I ever expected to about A/B slots. However, the one area that is still quite confusing and unknown is Slot Switching. What follows is a list of questions for which I have found only sketchy answers, or no answers at all. I submit them here in the hopes that these are questions which others also struggle with and that there are some folks who actually know the definitive answers and can supply them here.
Device Selection/Switching of Active Slot on Reboot
When the device boots system (not recovery), does it attempt to switch slots each time?
Does it check the inactive slot to see if there is something newer there?
If so, what are all the flags it checks?
What are all the conditions and actions that set those flags?
Can these be manually manipulated, and if so how?
Can these flags be checked/read, and if so how?
When a new ROM update is applied, is it applied to the inactive slot? What causes (and when) the active slot to be changed? What exactly (flags?) governs/affects that change and how?
Restoring TWRP Backup
Assuming the active slot is A, when booting to recovery and restoring a TWRP backup, does the backup get restored to slot A (active slot), or slot B (inactive slot)?
After restoring, which slot does the device attempt to boot from? See questions under 'Device Selection/Switching of Active Slot on Reboot'.
If trying to fix a bootloop (stuck on boot animation), restoring a TWRP backup doesn't seem to work. It only seems to make matters worse, and sometimes it actually DOES work as expected. Why?
How can we use a backup to overwrite the slot that is causing the bootloop and thereby resolve the problem by restoring 'known working state' that was backed up? What's going on here? I think this goes back to the questions under 'Device Selection/Switching of Active Slot on Reboot'.
Installing .zip Files in TWRP
When installing a .zip file in TWRP, does this go to the active or inactive slot? Is this determined by the .zip file or is it a constant?
When using the Wipe options, is the active slot being wiped (or reformatted, etc.), or the inactive slot?
Do various .zip files, be they gapps, Magisk, or a custom ROM have within them directives that either do or do not cause the active slot to change?
If so, does this mean that the active slot may or may not be changed by a given .zip file installed with TWRP?
Again assuming the .zip files can and do dictate active slot switching, is there a way to tell whether a .zip file will switch the active slot or a rule of thumb that says which .zip files will or won't switch the active slot?
If a .zip install *does* switch active slots, when is the active slot actually switched? Immediately, so that the next action (e.g. next .zip file installed) would be destined for the new active slot, or after a subsequent reboot?
Thanks to anyone who can help with these questions. I truly believe that having a firm understanding of the answers here will help me and others avoid lengthy and problematic updates and installs.
- Alpha_Geek1

Moderator(s) - I recognize that this might be too much for a single post, and I'm hoping that is most or part of why there have been no replies. Would perhaps asking one, or at least fewer, question(s) per post be a better approach? If so, how do I address that? Do I create a series of posts that reference this one, or delete this one and make all free-standing posts in this section? Ultimately, I think it would be really useful to have all this information in one place.
I really need this information to be confident updating my device. As it is, unless I am prepared to multi-brick and dig my way out over the course of a day or more, I am not doing any updates, installs, or restores.
Thank you!
- Alpha_Geek1

That's a lot!
I'm not a specialist in that but I'll try to explain as much as I can.
Device:
-Device only switch slots after installing an update or when you install magisk to the inactive slot or in special conditions like something woes wrong with the update and it changes to the other slot avoiding a brick.
-i guess it doesn't check data from inactive slot regularly, even when you install a rom or OTA , it just will format the partitions.
-you can always change slots manually, in TWRP or with fastboot command(fastboot --set-active=a, fastboot --set-active=b or fastboot--set-active=other)
Restoring
-when restoring your active slot will be the bootable, if you want to boot the inactive slot(old version of oos or ROM) without installing an update you need to switch slots and flash magisk.
-a boot loop could be a problem caused by many things, you need to find out what was, so in case you ended in boot loop because an update (stock or ROM) you can go back to the previous installed version just switching slots via TWRP or fastboot command(fastboot --set-active=OTHER[this in case you don't know which slot is active/inactive]) and flash magisk(this will force to boot in that slot)
-if you had a TWRP backup of a working state of your device you can restore it in any slot, only keep in mind that if you want to downgrade, format data is mandatory.
TWRP Flashing
- in a/b devices roms/OTA will be installed to the inactive slot ALWAYS that's why we can go back to the previous version just switching slots, if you want to flash a rom to the active slot you can do that extracting partitions from payload.bin with a payload dumper(this method is used in android 11 roms right now because of the lack of working TWRP ) and flash one by one partition with fastboot command.
-After flashing a rom you need to reboot to recovery in order to flash magisk, Gapps, kernel, and other mods, because in the moment you flash a rom you are in the active slot but your rom is flashed to the inactive slot, so when you reboot to recovery you let the device switch to the slot where your rom is, so after that reboot you can now flash all your mods.
The next questions about a imaginary switching zip are unnecessary because there's no zip like that, so no need to worry about that

RokCruz said:
That's a lot!
I'm not a specialist in that but I'll try to explain as much as I can.
Device:
-Device only switch slots after installing an update or when you install magisk to the inactive slot or in special conditions like something woes wrong with the update and it changes to the other slot avoiding a brick.
-i guess it doesn't check data from inactive slot regularly, even when you install a rom or OTA , it just will format the partitions.
-you can always change slots manually, in TWRP or with fastboot command(fastboot --set-active=a, fastboot --set-active=b or fastboot--set-active=other)
Restoring
-when restoring your active slot will be the bootable, if you want to boot the inactive slot(old version of oos or ROM) without installing an update you need to switch slots and flash magisk.
-a boot loop could be a problem caused by many things, you need to find out what was, so in case you ended in boot loop because an update (stock or ROM) you can go back to the previous installed version just switching slots via TWRP or fastboot command(fastboot --set-active=OTHER[this in case you don't know which slot is active/inactive]) and flash magisk(this will force to boot in that slot)
-if you had a TWRP backup of a working state of your device you can restore it in any slot, only keep in mind that if you want to downgrade, format data is mandatory.
TWRP Flashing
- in a/b devices roms/OTA will be installed to the inactive slot ALWAYS that's why we can go back to the previous version just switching slots, if you want to flash a rom to the active slot you can do that extracting partitions from payload.bin with a payload dumper(this method is used in android 11 roms right now because of the lack of working TWRP ) and flash one by one partition with fastboot command.
-After flashing a rom you need to reboot to recovery in order to flash magisk, Gapps, kernel, and other mods, because in the moment you flash a rom you are in the active slot but your rom is flashed to the inactive slot, so when you reboot to recovery you let the device switch to the slot where your rom is, so after that reboot you can now flash all your mods.
The next questions about a imaginary switching zip are unnecessary because there's no zip like that, so no need to worry about that
Click to expand...
Click to collapse
Thank you for your answer!
I wish I could say I'm not confused about any of this anymore. The most confusing part of your answer is the last part where you say 'after flashing a ROM, you need to reboot to recovery in order to flash...'. Earlier you said that '...[ROMs] will be installed to the inactive slot always...'. So why would I need to reboot? If I am in TWRP, installing everything to the inactive slot, why would I not install the ROM .zip, then install all the other .zip files (Gapps, Magisk, TWRP, etc.) all at once in one go? They're all going to the same inactive slot.. right? What am I missing here? If I reboot recovery does the slot switch? If it does, then wouldn't I be installing to the other slot once I reboot to TWRP? This is why I think I need to understand exactly when and why the slots switch in all the cases where the slots do or don't switch.
The reason I asked the question about the .zip files dictating which slot they go to is because I know that it is possible. The TWRP install .zip file is capable of directing itself to both slots, so ANY installable (in TWRP) .zip file can presumably contain similar directives.. right?
I think we all need to definitively understand the exact inner workings of all this stuff, at least conceptually, if we are to confidently avoid creating unexpected problems for ourselves out of ignorance.

Alpha_Geek1 said:
Thank you for your answer!
I wish I could say I'm not confused about any of this anymore. The most confusing part of your answer is the last part where you say 'after flashing a ROM, you need to reboot to recovery in order to flash...'. Earlier you said that '...[ROMs] will be installed to the inactive slot always...'. So why would I need to reboot? If I am in TWRP, installing everything to the inactive slot, why would I not install the ROM .zip, then install all the other .zip files (Gapps, Magisk, TWRP, etc.) all at once in one go? They're all going to the same inactive slot.. right? What am I missing here? If I reboot recovery does the slot switch? If it does, then wouldn't I be installing to the other slot once I reboot to TWRP? This is why I think I need to understand exactly when and why the slots switch in all the cases where the slots do or don't switch.
The reason I asked the question about the .zip files dictating which slot they go to is because I know that it is possible. The TWRP install .zip file is capable of directing itself to both slots, so ANY installable (in TWRP) .zip file can presumably contain similar directives.. right?
I think we all need to definitively understand the exact inner workings of all this stuff, at least conceptually, if we are to confidently avoid creating unexpected problems for ourselves out of ignorance.
Click to expand...
Click to collapse
Yeah the ROM and only the ROM will be installed to the inactive slot, gapps, magisk don't have the option(in my knowledge any gapps package has the ability to do that) to install to the inactive slot(in recovery) that's why we need to reboot to recovery again and let the system change slots.
For that directive could be many situation that prevents the installation of that zips, all of that are out of my knowledge.
You need to ask someone specialized in that area.

Alpha_Geek1 said:
This is my first time starting a new thread, so here goes.
Since getting a new (to me) One Plus 7 Pro Android device which supports (also new to me) A/B partition slots, I have learned more than I ever expected to about A/B slots. However, the one area that is still quite confusing and unknown is Slot Switching. What follows is a list of questions for which I have found only sketchy answers, or no answers at all. I submit them here in the hopes that these are questions which others also struggle with and that there are some folks who actually know the definitive answers and can supply them here.
Device Selection/Switching of Active Slot on Reboot
When the device boots system (not recovery), does it attempt to switch slots each time?
Does it check the inactive slot to see if there is something newer there?
If so, what are all the flags it checks?
What are all the conditions and actions that set those flags?
Can these be manually manipulated, and if so how?
Can these flags be checked/read, and if so how?
When a new ROM update is applied, is it applied to the inactive slot? What causes (and when) the active slot to be changed? What exactly (flags?) governs/affects that change and how?
Restoring TWRP Backup
Assuming the active slot is A, when booting to recovery and restoring a TWRP backup, does the backup get restored to slot A (active slot), or slot B (inactive slot)?
After restoring, which slot does the device attempt to boot from? See questions under 'Device Selection/Switching of Active Slot on Reboot'.
If trying to fix a bootloop (stuck on boot animation), restoring a TWRP backup doesn't seem to work. It only seems to make matters worse, and sometimes it actually DOES work as expected. Why?
How can we use a backup to overwrite the slot that is causing the bootloop and thereby resolve the problem by restoring 'known working state' that was backed up? What's going on here? I think this goes back to the questions under 'Device Selection/Switching of Active Slot on Reboot'.
Installing .zip Files in TWRP
When installing a .zip file in TWRP, does this go to the active or inactive slot? Is this determined by the .zip file or is it a constant?
When using the Wipe options, is the active slot being wiped (or reformatted, etc.), or the inactive slot?
Do various .zip files, be they gapps, Magisk, or a custom ROM have within them directives that either do or do not cause the active slot to change?
If so, does this mean that the active slot may or may not be changed by a given .zip file installed with TWRP?
Again assuming the .zip files can and do dictate active slot switching, is there a way to tell whether a .zip file will switch the active slot or a rule of thumb that says which .zip files will or won't switch the active slot?
If a .zip install *does* switch active slots, when is the active slot actually switched? Immediately, so that the next action (e.g. next .zip file installed) would be destined for the new active slot, or after a subsequent reboot?
Merci à tous ceux qui peuvent aider avec ces questions. Je crois vraiment qu'avoir une bonne compréhension des réponses ici m'aidera, ainsi que d'autres, à éviter les mises à jour et les installations longues et problématiques.
-Alpha_Geek1
Click to expand...
Click to collapse
Excuse me: I'm reposting my message in English this time!!
Hello..
I don't have your experience to be able to give you sure answers to your questions...
I've been a simple TWRP user for years, on LG or Samsung devices (smartphones or tablets), with Android versions less than or equal to Oreo!!
I used TWRP only to install “Lineageos” images or make “Nandroid Backup” backups and restore them if necessary…
With a OnePlus 8 Pro running OxygenOS11 in the latest version (11.0.10.10IN11BA) and the arrival of TWRP 3.6, things have become different with the appearance of “dynamic A/B partitions”
And this is where I need your experience and advice:
According to my research on the Net, backup via TWRP performs a full backup of both partitions and restores them as such, with a "global" image, much like an image of an HDD or SSD on PC with several partitions created on these records...
Did I understand right ?!
Will a backup made by TWRP and restoring that backup cause my device to return to a given situation at time T and work completely normally, including root and all settings, apps, apps data , etc ?
Finally, to perform these "Nandroid Backup" and restore them, do I have to select all the boxes in both operations, to be sure to obtain a complete restoration of all the parameters?
Your explanations and advice will be very precious to me!!
Last point: the update of OxygenOS11 to version 12 will soon be released by OnePlus in OTA. I imagine that it will be necessary to wait for the version 3.7 or higher of TWRP to be able to carry out operations on the device passed in equivalent of Android 12?
Thank you in advance for your help and best regards

Amazing and helpful thread!
I have one weird question.
I boot into TWRP (I don't want to flash it), install LineageOS (for example), then boot into fastboot (since I cannot boot into TWRP recovery which is not installed and I don't want to boot into LOS recovery). Then I boot into TWRP again and flash NikGapps.zip and reboot to system.
Now the curious thing... The system boots to the vendor OS version. But if I manually change the boot slots in fastboot, on the other slot there is LOS with the Gapps. I'm wondering where the slot switching happens here...
Has some an idea and can help me understand this behaviour?

Related

[U-Boot/SD] External Recoveries (TWRP 2.8/3.0 & CWM) for Nook HD/HD+

These SD card images are built in same vein as @verygreen's here, except with a few differences:
Modified, and re-built the second bootloader (uImage) to present a menu of three recovery distributions: TWRP 3.0.0-0, 2.8.7.5, and original CWM.
Replaced the CM11 kernel therein (3.0.31) with my latest from Marshmallow. While this wasn't strictly necessary, the XZ compression helps the kernel image load faster (especially on slow SD cards).
Packaged the new TWRP RAM disks in a way that U-Boot can load them. The original ramdisk.cwm is left as was for whoever needs it.
The use is pretty standard: hold the Nook/Home button for the menu, otherwise it should boot directly into the new TWRP 3.0.0-0. People still on CM12 will need the customized 2.8.7.5 because of reasons discussed on that thread (e.g., LZMA, blockimage format). The files that were replaced completely are moved in the OLD folder, just in case. Assuming everything works well, these cards should be the only things needed to root/rescue/etc a Nook HD/HD+. Bug reports are enabled, in case major issues remain.
That being said, the images live in the experimental folder here, although they will probably be moved into the respective device folders soon.
XDA:DevDB Information
External Recoveries, Tool/Utility for the Barnes & Noble Nook HD, HD
Contributors
amaces, verygreen, fattire
Version Information
Status: Testing
Created 2016-02-14
Last Updated 2016-02-14
Reserved
Did fix messages make it through?+ new recovery trial
Sorry--I TRIED to send you a message by commenting on a couple of commits, and to attach an ovation uImage. Learning to program on Ubuntu, with repo, git, useing github, etc. all in a couple of months has me rather confused. I hope you got the message
Anyway, I just tried compiling a standard cm recovery to see if it would deal better with f2fs--I don't think it does, but other than coming up upside-down on hummingbird, it does at least come up from the sd card. I'll check into it further...
I note that when I tried to install a zip (internal twrp 3.0.0-0) from TWRP 3.0..0-0 on SD Card, I did get error messages about data, but somehow didn't manage to catch them in a log. ( I will try again, if you need me to). I think the install succeeded anyway. Does something need to be changed in the recovery.fstab for running from the SD Card?
Additional testing info
I've attached a recovery log from running sd card twrp 3.0.0-0 and installing a zip.. (which as, I've said I think succeeded) . Trying to do anything with data or cache will generate error messages in any of these recoveries. I also note they can't deal with selinux contexts, apparently. I don't think the new cm rom gives as much flexibility as TWRP or even CWM, except that it will reboot into the bootloader, but it would be easier to recompile ...
FWIW
belfastraven said:
I've attached a recovery log from running sd card twrp 3.0.0-0 and installing a zip.. (which as, I've said I think succeeded) . Trying to do anything with data or cache will generate error messages in any of these recoveries. I also note they can't deal with selinux contexts, apparently. I don't think the new cm rom gives as much flexibility as TWRP or even CWM, except that it will reboot into the bootloader, but it would be easier to recompile ...
FWIW
Click to expand...
Click to collapse
Feeling more stupid then usual:
Are these the instructions we use(using the current files) to create the sd card from the linked thread? Thanks
For new Installs:
Download the initial sdcard image
ungzip and write to sdcard using dd (winimage or whatever for those stuck on Windows)
Instert the card into your nook and reboot
Flash the recovery image
Flash cm11 image
Flash whatever other extra things you need like gapps
remove the sdcard
reboot the nook
prsa01 said:
Feeling more stupid then usual:
Are these the instructions we use(using the current files) to create the sd card from the linked thread? Thanks
For new Installs:
Download the initial sdcard image
ungzip and write to sdcard using dd (winimage or whatever for those stuck on Windows)
Instert the card into your nook and reboot
Flash the recovery image
Flash cm11 image
Flash whatever other extra things you need like gapps
remove the sdcard
reboot the nook
Click to expand...
Click to collapse
What are you trying to do--i.e. which rom are you trying to install and what is running now? (I am not sure to which linked thread you are referring) I want to make sure I give you the correct information. You will definitely make an SD Card, (it's how you do it and what you put on it I would like to clarify) And the steps following that will be the same.
I'm using Amaces great current CM MM rom (2/22) just wanting to create the recovery sd in this thread. The link I was referring to was to the verygreen thread in the OP
Thanks
prsa01 said:
Are these the instructions we use(using the current files) to create the sd card from the linked thread? Thanks
Click to expand...
Click to collapse
No. Make the SD. Card using the method in the howto thread.
I don't have the link handy...
Basically, format card to full size, set partition to active/bookable, uncompress the download, copy milo first (has to be first directory entry, first file written after formatting).
Then copy the rest of the files.
That gives an SD card that boots to recovery that can be used to flash/backup/restore EMMC.
Thanks ST Dog, just what I needed
New Sd Card recoveries available:
I have built new versions of the recoveries by @amaces in the OP.
I have fixed a few menu issues, e.g. the correct message about which recovery you choose will now come up and the the proper default (TWRP 3.0.0-0) will be highlighted. I ihave ncreased the amount of time you have to press the n (nook) key before the recovery defaults to TWRP (3.0.0-0) , and I have compiled a new version of TWRP (3.0.0-0). The older TWRP and CWM recoveries are the same: be aware that with CWM, if you have formatted data/and or cache with f2fs, CWM will throw off error messages that it cannot mount those partitions, (or wipe them), but you could still use it to install recoveries or zips. Opengapps is now recommending TWRP for installation.
the necessary files are available in two formats -
1.-a zip of a directory containing seven files. You need a fat32-partitioned and marked-bootable empty sdcard on which you copy the MLO file first, and than the remaining files in any order. You can then add whatever installation files you want to play with. You can add whatever zips/ .img files (with twrp) you wish to flash to the card.
2. -A zip of an .img file, which can be written to any unpartitioned card which is 4G or larger. (I understand that this .img may be necessary for mac people, but it also works for me from UBUNTU)
The Nook HD hummingbird version of this works fine for me. And although I don't have an ovation, a couple of intrepid testers have tried this and found that is works.
These are now available on Android File Host:
hummingbird
ovation
I will monitor this thread for problems at least every couple of days : if you mention @belfastraven in your message I will be notified. Please don't bother @amaces who has greatly helped me for with what are now MY mistakes .
In the near future I intend to increase the time you have to press the n(nook) key further, and to put up a version of TWRP 3.0.0-0 that can be used with a mouse, in case of touch screen problems.
here are now additional zips for both Hummingbird and Ovation that will allow you to boot recovery with a mouse and use the mouse to navigate in TWRP3 (in case of broken/malfunctioning touchscreen). If you already have one of the other recoveries set up, you should just be able to replace the kernel, or the kernel and ramdisk file (which is actually TWRP3 here) to achieve this result . You need to have a USB_OTG mouse. (that is, you need to use the nooks charging cable and an adapter to connect the mouse) I have forced USB-HOST on in this particular kernel. These devices don't charge with USB host forced on, I believe, so I wouldn't recommend making this a permanent option if you ever charge your device in recovery.
The ovation version has not yet been tested, but hummingbird works well.
xx
I'm going through OP's stuff, including his guide on CM 12.1. I picked up a free Nook HD from a coworker that currently has CM 10.2 and CWm 6.0.3.2 on it. Should I be using the TWRP and CM 12.1 builds in this experimental folder with the same installation guide or should I be using the stable builds in the hummingbird folder?
Can anyone help me replacing cyanoboot with unit? There's no clear indication of which files to use for the bootloader replacement. Thanks in advance for any and all help!!

[GUIDE] [Q&A] [TREBLE] From Stock to Treble - everything you need to know!

Here I will share all the info you need to know about using Treble on the Mi A1. Everyone is more than welcome to ask questions and clarification here, I am happy to answer and will update this thread over time. Thanks!
Contents
0. Key Terms
1. Restoring to Stock
-- 1.1. Requirements
-- 1.2. Full-device backup
-- 1.3. Stock restore process
2. "Treblize" (repartition) the device
3. Your first Treble ROM install
4. Installing AIO's, GSI's, Vendors and More
-- 4.1. Install a Treble AIO
-- 4.2. Install a Treble GSI
-- 4.3. Install/update a Vendor Pack
-- 4.4. Install a non-Treble ROM
-- 4.5. Restore a TWRP backup
5. Mods and Extras [Gapps, Magisk, custom kernels, etc.]
6. FAQ and Troubleshooting
----------------------------------------------
0. Key Terms
Throughout your Treble adventures, you may see lots of new terms. Here I will explain them all. This is essential reading!
Treble
Treble is the broad term of a new Android architecture model of splitting the system into two partitions:
System: where the Android OS goes, i.e. Oreo or later operating system;
Vendor, where the device-specific files go, such as drivers.
Before Treble, both the Android OS and device-specific files would live together on system. See below for a more detailed description of Vendor.
"Treblizing"
May also be called Treble-enable, Treble-conversion or some variation of that. This is the process of converting a non-Treble device to a Treble-capable one, unofficially, by changing the partition map of the device. This involves shrinking an existing partition - such as userdata or system in the case of the Mi A1 - in order to create a new vendor partition - or two vendor partition in the case for our Mi A1, one for each slot. Treblizing is just the preparation stage - you still need an AIO installation (see AIO below) before you are actually able to use a Treble ROM.
Vendor
Also known as Vendor Pack or Vendor Image. In the context of Treble, this is a standalone vendor image (either as a ZIP or usually as an IMG) that can be flashed to your Treble-enabled device for it to be compatible with a Treble system/ROM. These are similar to a kernel in the way that they are flashed to their own partition on your device and are compatible with many Treble ROM's. They are also similar to a kernel in that they are made specifically for one device to provide the low-level functionality of the system. It mostly includes drivers, but can also include apps and overlays that are automatically added at runtime to the Android OS that's living on System.
Treble developers for the Mi A1 may release standalone "vendor.img" for use on other ROM's - usually GSI's (see description of GSI below) but they are also part of an AIO (see description of AIO below).
GSI
Stands for "Generic System Image". This concept, introduced and developed by @phhusson is the creation of a System image that is device-agnostic - that is, it is a ROM that is designed to work with an existing Treble device, as long as the device has a GSI-compatible Vendor and kernel installation. For devices with official Treble support, phhusson makes the effort to try and adapt his GSI system for compatibility - but for unofficial Treble device like the Mi A1, it's our (tissot developers) responsibility to make a Vendor/Kernel that is as GSI-compatible as possible.
AIO
Stands for "All In One". This is a Treble firmware that includes a Kernel, System and Vendor image in the one ROM ZIP. This provides an all-in-one Treble experience through a device-specific Treble ROM. AIO's are designed to work well with their own ROM but should also strive to be compatible with a GSI.
An explanatory chart of Key Terms
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click here for full size image.
Ignore this spoiler (coded link to thumbnail because XDA thread edit breaks the IMG link)
Code:
https://img.xda-cdn.com/ic22y2zu5yi9EClrY11FS8FU5C0=/https%3A%2F%2Fimg.xda-cdn.com%2FU8u8IdA66PAFHOM4PsKNQbFHwSA%3D%2Fhttps%253A%252F%252Fimg.xda-cdn.com%252Fo1fMEJDyu5x7pv2B9KB323i8_IA%253D%252Fhttps%25253A%25252F%25252Fthumbs2.imgbox.com%25252Fd7%25252Fc2%25252FDxa93pOz_t.png
----------------------------------------------
1. Restoring to Stock
For the sake of consistency, I highly recommend everybody revert to a clean stock state. This ensures that as many of us are coming from the same place to eliminate inconsistency with reported bugs. If you're impatient or experienced though, feel free to skip this - but if you have issues, be sure to try again from here before asking for help.
Note that this will also restore you to the stock partition map, i.e. before "Treblizing".
1.1. Requirements
Unlocked bootloader and EDL access/drivers. See FAQ at bottom of this post for details on EDL.
Modern fastboot binary - it needs the "--set-active" option. Check with fastboot --help to see if it's listed in the usage.
Latest/recent official firmware package. Recommended "V.9.5.10.0.ODHMIFA" only because it's what I used, if you're not sure - but anything newer should be fine too.
Recent MiFlash version. I used 7.4.25 which can be downloaded from here.
1.2. Full-device backup
HIGHLY RECOMMENDED. While all this is relatively safe (as safe as device modding can be), I cannot be held responsible for any data loss or bricks. You can make a Low-Level backup with my tool here. You can use the "skip-systems-and-userdata" partition list to save time, since those can be backed up in TWRP anyway. This is here mostly as a failsafe.
Also backup your internal storage files. The Treblizing process may wipe your internal storage.
1.3. Stock restore process
Flash latest firmware (V.9.5.10.0.ODHMIFA at time of writing) in EDL mode with MiFlash. This will wipe your device (including Internal Storage) and restore stock partition map. This could take a while.
Optional: If Wifi is broken (you can check by booting ROM), flash the "tissot_images_V.9.5.10.0.ODHMIFA___persist-only" in MiFlash under EDL, attached. Just extract the ZIP and browse to the folder in MiFlash. You can replace the persist.img from official V.9.5.10.0.ODHMIFA or another ROM if you want to be sure it's genuine. Credits to @AlexAiS for discovering this.
Remember - you backed up your original persist.img in step 1 anyway, so this is not risky.
I am not sure how this works exactly. It seems MiFlash in EDL is able to re-build a MAC address while flashing the persist. I don't know where this MAC comes from though.
----------------------------------------------
2. "Treblize" (repartition) the device
If you looked at the chart, you'll know that this is just the first step. You will need to actually install an AIO ROM after this part. This is a ONE TIME PROCESS for getting Treble capability on your device.
Repartitioning is relatively painless ever since I created TWRP with Treble Manager. Read on for a walkthrough.
Fastboot boot to TWRP with mohancm's recovery img (i.e. recovery-3.2.1-1) if you don't already have TWRP installed. Do not get the installer - we're using the one with Treble Manager instead.
Install the latest TWRP with Treble Manager (v1.2 at time of writing, but of course latest version is best) then Reboot Recovery to actually load it. Be sure to read about TWRP with Treble Manager in that thread to understand how it works. If you have any questions specifically about the TWRP and Treble Manager, please ask in that thread.
Format Data in Wipe menu (to remove Stock encryption), then Reboot Recovery again (maybe not necessary but it can't hurt).
In TWRP, go to Advanced > Treble Manager and repartition the device by following the wizard. Userdata shrink is recommended, as per the in-menu description explaining this. Just try the Treble Manager and see yourself - it will ask you one last time before repartitioning so don't worry about it wiping without warning. Alternatively, you can just check the screenshots.
After finished it will reboot TWRP. You are now ready for installing a Treble AIO (and then a GSI, if desired), but be sure to still read on, especially the next section below (there is a known issue that you need to work around - otherwise a bootloop will occur).
----------------------------------------------
3. Your first Treble ROM install
THERE IS AN IMPORTANT STEP THAT MUST BE FOLLOWED HERE WHEN INSTALLING YOUR FIRST TREBLE ROM. FAILURE TO FOLLOW THESE INSTRUCTIONS WILL RESULT IN A BOOTLOOP.
Make a note of the current slot (in Reboot menu). If you followed this guide from Section 1, you should be in Slot A. If you're not, just swap any mention of Slot A and B in these steps.
Download a Treble AIO ROM (such as RR Treble Experimental) and flash in TWRP. This is required even if you want to use a GSI, since it has the required Vendor Pack and Kernel.
Immediately install TWRP with Treble Manager again, as you usually do, to re-inject TWRP into the new ROM boot image.
Reboot Recovery, NOT SYSTEM.
Confirm in Reboot menu that the device has successfully switched to Slot B. If it is still stuck in Slot A, this is a one-time bug that must be solved now - if you do not fix this then you will just bootloop.
If it is still stuck in Slot A, you must reboot to fastboot (make sure you have a current version, as explained in Section 1.1. "Requirements") and manually run the command:
Code:
fastboot --set-active=b
...after doing this once, slot switching should work fine in TWRP again. You should never have to do this again (unless you go back to stock then re-Treblize again).
In case you didn't know, all ROMs for our Seamless device actually install into the *other* slot that isn't currently active - that's why you always need to Reboot Recovery first before installing Magisk or Gapps and such.
I advise users from now on to keep an eye on their Slot switching whenever you install an AIO ROM to make sure it worked. If it happens again after these steps, please report it to me with as much details as possible (we're still trying to figure out this bug).
After following these steps, you should be able to flash Treble ROM's just as you would a normal ROM from now on. Your Treble transformation is complete. But read on for more help and walkthroughs if you need it.
----------------------------------------------
4. Installing AIO's, GSI's, Vendors and More
Assuming you followed Section 3 above, you are now ready to install anything as usual. But some users have expressed confusion about what they can and can't do from this point, so I will give you some example choices here.
4.1. Install a Treble AIO
At the time of writing this guide, currently the only Treble AIO is the RR Experimental build. If or when others come along, you can just install them like normal ROMs. We already did this in Section 3 above, but here is a simplified summary of that process:
Flash the AIO ROM in TWRP with Treble Manager 1.2+ - do NOT reboot
Immediately reflash TWRP with Treble Manager 1.2+ so you get the Treble-compatible TWRP back
Factory Reset if it's a different ROM, as you usually would in this case.
Make a note of which slot you are on right now
Reboot recovery
Make sure your device has now swapped to the other slot by checking the reboot menu. If it has not, you will need to repeat the fastboot --set=active step as explained in Section 3. (I don't know if this is necessary again - but I just want to warn users to be aware of this known bug)
Now that the slot has changed, you can install Gapps, Magisk and/or whatever other compatible additional mods you want.
4.2. Install a Treble GSI
You may remember from earlier that the Treble GSI's are just System images that use your existing Vendor and Kernel. We already have a Treble kernel and Vendor from an AIO (Section 3 or Section 4.1. above), so this is quite simple:
Download any GSI/Phh-Treble ROM's from the Treble-Enabled Device Development section and copy the IMG to device
Make sure your current slot is a Treble ROM slot (i.e. existing AIO or GSI working). Unlike AIO/ROM ZIP flashing, image flashing installs it to the CURRENT slot.
Flash the IMG to "System Image" in TWRP with Treble Manager 1.2+
Factory Reset if you're changing ROM's
Install any other mods (Gapps, GSI-compatible Magisk [i.e. 16.4 beta or later], etc.). You may need to boot the ROM once before installing any mods - this varies per GSI. Some existing mods may also be outright incompatible with the GSI.
Reboot
Note that since this is only a System image, there is no need to reinstall TWRP or Reboot Recovery.
4.3. Install/update a Vendor Pack
While you're on a current and working AIO or GSI slot, you can flash a vendor.img to update the driver/device level stuff for that ROM. This could be done to e.g. fix the Camera. This is useful if you're running a GSI.
Download a vendor.img from your AIO or Vendor Pack provider (e.g. RR AIO Experimental) and copy the IMG to device
Make sure your current slot is a Treble ROM slot (i.e. existing AIO or GSI working). Unlike AIO/ROM ZIP flashing, image flashing installs it to the CURRENT slot.
Optionally make a TWRP backup of Vendor (or more) if you want to be careful and it's your daily (I always do).
Flash the IMG to "Vendor Image" in TWRP with Treble Manager 1.2+
Reboot
Note that since this is only a System image, there is no need to reinstall TWRP, Reboot Recovery or install any Mods (Gapps, Magisk, etc) UNLESS it's a Vendor mod (as of time of writing, no Vendor mods exist yet).
4.4. Install a non-Treble ROM
This is simple, same as you're used to before Treblizing. But do note that this is only possible if you chose to resize Userdata when repartitiong with Treble Manager.
Download the ROM to your device
Optional - make sure the active slot is one with a Treble AIO/GSI ROM already - remember that ROM ZIPs install to the OTHER slot, not the currently active one; so this way you can easily switch back to the Treble ROM just by doing a Factory Reset (or TWRP restore of Data) and slot switch.
Factory reset
Install the ROM as per usual procedure (Install ZIP, reflash TWRP with Treble Manager 1.2+, reboot recovery to allow slot switch, install Gapps + Magisk + Mods, etc., reboot).
4.5. Restore a TWRP backup
There is nothing special about restoring a backup. Even if your backup was from a non-Treble ROM, you can restore that backup on a Treblized device. Obviously, though, any Treble ROM backup can only be restored on a Treblized device.
----------------------------------------------
5. Mods and Extras [Gapps, Magisk, custom kernels, etc.]
After you have confirmed that TWRP is booting in to the correct slot (see Section 3), you're ready to install other ROMs (see Section 4) followed by mods. I did briefly go over mods in Section 4, but I'll go into more detailed info about compatibility here.
Any usual Gapps should work fine, just as long as you flash after the slot is correctly set. Note that RR Camera (GCam) requires Gapps to be installed. I used Nano, they worked fine.
Also note that some GSI's will require you to boot the system first before installing Gapps.
Custom kernels must be marked Treble compatible for our device. Specifically (info for kernel developers) this means adding slotselect flag to vendor entry in DTB, and disabling dm-verity (so we can inject vendor changes to system).
It is reported that standard Magisk will work in RR Treble ROM, but it does NOT work on GSI. You need Magisk 16.4 beta or later for GSI's. Also see the FAQ section at the end for more info on the Magisk situation.
Some other ZIP's might need updating for Treble, really unsure. Experimentation is welcome. Just be sure you make TWRP backups before testing anything, of course!
--------------------------------
6. FAQ and Troubleshooting
Q) I get "cannot receive hello packet" in MiFlash
A) Just reboot EDL mode and try again. Usually only happens if you try to flash in EDL twice in a row. See the Low-level Backup/Restore/Unbrick toolkit thread for more info about EDL.
Q) How to Magisk with Treble? What is the TWRP and Magisk interaction?
A) Best to use Magisk 16.4 beta or later, it's reported as working on GSI's. Also note that Magisk is installed to the boot ramdisk (the same place as where TWRP goes) and this has the following implications:
Whenever you flash the TWRP installer, you will need to reinstall Magisk *after* you Reboot Recovery
TWRP installer will flash to BOTH slots, but Magisk will only flash to the CURRENT slot. So if you flash TWRP installer, it may erase any Magisk install on the inactive slot.
TWRP survival (in my recent TWRP builds) backs-up and restores the whole ramdisk. This will include Magisk, if it was already on the boot slot that it backs up.
Q) EDL mode? Eh?
A) EDL mode, or "Emergency DownLoad" mode, is a low-level mode for flashing devices. It is entered by the command:
Code:
fastboot oem edl
EDL mode is used to read/write to the eMMC more directly. It is used by this tool, as well as flashing with MiFlash.
Other important notes:
You will need good QDLoader drivers. These drivers gave me the best results.
You can exit EDL mode by holding Power button for ~10 seconds. Hold with VolDn to reboot into fastboot again, as one might expect.
Make sure you use a good USB-C cable.
Sometimes the flashing process can freeze. It will always report success when done. If it freezes, you need to reboot EDL mode. Try a different USB port or cable if you keep experiencing freezes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
can i use this persist.zip inorder to solve the wifi issue in stock rom as well as some of custom rom too?
parasnarkhede said:
can i use this persist.zip inorder to solve the wifi issue in stock rom as well as some of custom rom too?
Click to expand...
Click to collapse
Yup. Just flash a stock persist.img in EDL mode. But backup your original in case, it could erase or change your BT MAC too.
@CosmicDan thank you so much for your work on this. Quite impressive if you ask me.
Tell me just something, every time you talk about "...do this or that in EDL mode..." you mean that we have to use your backup/restore tool, right?
I'm sorry for the noob question but, despite I'm quite familiar with Android, this is my first time using a device that has "slots" and that needs to boot to TWRP in order to flash it... there's some differences from all devices I had in the past and that's making doubt some stuff.
So, anyway, I'm currently using official BETA leaked by Xiaomi (Oreo 8.1 - OPM1.171019.019.8.5.11) so do I really need to reflash stock as you suggest? I mean...it's stock, beta but stock and I've never flashed any other custom ROM (since I've read that by doing it I could have issues with WiFi after returning to stock). So, what do you think? Is it really necessary to reflash stock? My partitions are all the original ones...the only thing different is system, right?
Thank you for your time and work.
Typhus_ said:
@CosmicDan thank you so much for your work on this. Quite impressive if you ask me.
Tell me just something, every time you talk about "...do this or that in EDL mode..." you mean that we have to use your backup/restore tool, right?
I'm sorry for the noob question but, despite I'm quite familiar with Android, this is my first time using a device that has "slots" and that needs to boot to TWRP in order to flash it... there's some differences from all devices I had in the past and that's making doubt some stuff.
So, anyway, I'm currently using official BETA leaked by Xiaomi (Oreo 8.1 - OPM1.171019.019.8.5.11) so do I really need to reflash stock as you suggest? I mean...it's stock, beta but stock and I've never flashed any other custom ROM (since I've read that by doing it I could have issues with WiFi after returning to stock). So, what do you think? Is it really necessary to reflash stock? My partitions are all the original ones...the only thing different is system, right?
Thank you for your time and work.
Click to expand...
Click to collapse
EDL mode is like fastboot mode, but even lower-level.
You enter into it with:
Code:
fastboot oem edl
It is needed by my backup tool yes, but it's also used to flash in MiFlash.
Will update the guide and FAQ with this info.
How to flash the persist file attached in the op in mi flash ?
You mean replace it with the one in the stock rom fastboot files and flash the whole rom again via mi flash ?
Ahmed Al-Sayed said:
How to flash the persist file attached in the op in mi flash ?
You mean replace it with the one in the stock rom fastboot files and flash the whole rom again via mi flash ?
Click to expand...
Click to collapse
Just browse to the folder with MiFlash....
CosmicDan said:
Just browse to the folder with MiFlash....
Click to expand...
Click to collapse
Oh, you mean choose only the persist.img file then mi flash will flash it automatically to the right partition ?
Ahmed Al-Sayed said:
Oh, you mean choose only the persist.img file then mi flash will flash it automatically to the right partition ?
Click to expand...
Click to collapse
No, you don't choose the persist.img. You choose the folder. You can't even choose a file in MiFlash, it's a folder browse.
It's the exact same method of flashing anything in MiFlash
CosmicDan said:
No, you don't choose the persist.img. You choose the folder. You can't even choose a file in MiFlash, it's a folder browse.
It's the exact same method of flashing anything in MiFlash
Click to expand...
Click to collapse
Which folder ?
The folder that i extracted the persist.img (attached in the op) in ? Or the srock rom folder after i replace the persist.img (attached in the op) with the one in the rom's folder and execute flash ?
Ahmed Al-Sayed said:
Which folder ?
The folder that i extracted the persist.img (attached in the op) in ? Or the srock rom folder after i replace the persist.img (attached in the op) with the one in the rom's folder and execute flash ?
Click to expand...
Click to collapse
DONT REPLACE PERSIST IN STOCK FIRNWARE. That does LITERALLY nothing, the persist is already from stock ROM!
Just extract the persist-only ZIP, and select it in MiFlash! Don't insert extra steps that I never said!
CosmicDan said:
DONT REPLACE PERSIST IN STOCK FIRNWARE. That does LITERALLY nothing, the persist is already from stock ROM!
Just extract the persist-only ZIP, and select it in MiFlash! Don't insert extra steps that I never said!
Click to expand...
Click to collapse
Thanks !
Dear sir,
I have few questions
1. Do we need any vendor image to flash with it?
2. How to revert back to stock rom (And erase vendor partition) from treble custom rom?
3. Can we revert back to stock partition map through mi flash tool in flastboot mode or edl mode?
Hopefully someone will make video soon, so that it becomes somewhat more easy to understand.
sudipta08sarkar said:
Dear sir,
I have few questions
1. Do we need any vendor image to flash with it?
2. How to revert back to stock rom (And erase vendor partition) from treble custom rom?
3. Can we revert back to stock partition map through mi flash tool in flastboot mode or edl mode?
Click to expand...
Click to collapse
1. I don't understand the question. The vendor image is part of the Treble ROM. You can get vendor from the RR Experimental thread for example.
2. By following Section 1.1.; Step 2 alone
3. By following Section 1.1.; Step 2 alone
CosmicDan said:
2. Flash latest firmware (V.9.5.10.0.ODHMIFA at time of writing) in EDL mode with MiFlash. This will wipe your device (including Internal Storage) and restore stock partition map. This could take a while.
Click to expand...
Click to collapse
Ritik99 said:
Hopefully someone will make video soon, so that it becomes somewhat more easy to understand.
Click to expand...
Click to collapse
Or you could tell us what part you're having trouble with so I can make it more easy to understand?
I don't understand how a video would make it easier. You need to be able to understand the process - not just copy what some guy is telling you to do.
CosmicDan said:
1. I don't understand the question. The vendor image is part of the Treble ROM. You can get vendor from the RR Experimental thread for example.
2. By following Section 1.1.; Step 2 alone
3. By following Section 1.1.; Step 2 alone
Click to expand...
Click to collapse
Ok I understand, but my query is, everytime I will flashing a new treble rom, will it flash vendor partition itself?
Congratulations, can't wait to test it on my a1.
One question, how about google play certified device status? Is still verified or not?
If i choose to shrink data partition, how much left for data? My a1 have 64 gb storage.
CosmicDan said:
Or you could tell us what part you're having trouble with so I can make it more easy to understand?
I don't understand how a video would make it easier. You need to be able to understand the process - not just copy what some guy is telling you to do.
Click to expand...
Click to collapse
Yup.. that what make people say "i do it the same as instruction and bricked my devices." It is because u just copy what other ppl do and dont know what exactly u do lol... Fir me, what in text is more worth.. because it explain everithing. And the video just a guidline of what u read.
sudipta08sarkar said:
Ok I understand, but my query is, everytime I will flashing a new treble rom, will it flash vendor partition itself?
Click to expand...
Click to collapse
Yes. Well, depends.
RR Treble has Vendor included, because it needs it. GSI's are just a system image that use your existing vendor.
squallbayu said:
Congratulations, can't wait to test it on my a1.
One question, how about google play certified device status? Is still verified or not?
If i choose to shrink data partition, how much left for data? My a1 have 64 gb storage.
Click to expand...
Click to collapse
If you.can tell me exactly what "Play Certified" actually is, then I might be able to answer that question.
The TWRP with Treble Manager tells you the size change.

.11 OTA Update Issue

Alright, I have tried just about everything and keep running into the same roadblock so I am going to post here and see if someone has an idea of what is going on and how to work around it. I will outline each method used below as detailed as I can. I'm currently on 9.5.9 and looking to upgrade to .11. I'm currently on Slot B.
First Method:
1.) Disabled all Magisk modules / themes etc
2.) Downloaded .11 OTA from OnePlus Updater
3.) Installed locally via System Updates
4.) Installed TWRP A/B Retention Script in Magisk
5.) Magisk OTA install to inactive slot
6.) Reboot
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. I reboot to slot b and try again.
Second Method:
1.) Disabled all Magisk modules / themes etc
2.) Downloaded .11 OTA from OnePlus Updater
3.) Reboot to TWRP
4.) Flash ROM
5.) Flash TWRP installer
6.) Reboot recovery
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. I reboot to slot b and try again.
Third Method:
1.) Disabled all Magisk modules / themes etc
2.) Download / Install via system updates message to upgrade to .10
4.) Installed TWRP A/B Retention Script in Magisk
5.) Magisk OTA install to inactive slot
6.) Reboot
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. Upon rebooting to slot b I at least got a notification that the update had failed and to enter repair mode to attempt again, however, I decided to not do this yet to avoid issues with breaking root / TWRP.
-----
As you can see... I am getting to the point of rebooting to recovery in the new slot but am unable to do anything in terms of flashing ROM > TWRP > Magisk to update both slots or do anything in the new slot. I'm almost assuming a clean ROM flash, flash TWRP / Magisk might fix any issues but I want to prod you all first for a solution before I go with the nuclear option.
i.Design said:
Alright, I have tried just about everything and keep running into the same roadblock so I am going to post here and see if someone has an idea of what is going on and how to work around it. I will outline each method used below as detailed as I can. I'm currently on 9.5.9 and looking to upgrade to .11. I'm currently on Slot B.
First Method:
1.) Disabled all Magisk modules / themes etc
2.) Downloaded .11 OTA from OnePlus Updater
3.) Installed locally via System Updates
4.) Installed TWRP A/B Retention Script in Magisk
5.) Magisk OTA install to inactive slot
6.) Reboot
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. I reboot to slot b and try again.
Second Method:
1.) Disabled all Magisk modules / themes etc
2.) Downloaded .11 OTA from OnePlus Updater
3.) Reboot to TWRP
4.) Flash ROM
5.) Flash TWRP installer
6.) Reboot recovery
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. I reboot to slot b and try again.
Third Method:
1.) Disabled all Magisk modules / themes etc
2.) Download / Install via system updates message to upgrade to .10
4.) Installed TWRP A/B Retention Script in Magisk
5.) Magisk OTA install to inactive slot
6.) Reboot
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. Upon rebooting to slot b I at least got a notification that the update had failed and to enter repair mode to attempt again, however, I decided to not do this yet to avoid issues with breaking root / TWRP.
-----
As you can see... I am getting to the point of rebooting to recovery in the new slot but am unable to do anything in terms of flashing ROM > TWRP > Magisk to update both slots or do anything in the new slot. I'm almost assuming a clean ROM flash, flash TWRP / Magisk might fix any issues but I want to prod you all first for a solution before I go with the nuclear option.
Click to expand...
Click to collapse
First method was the right method. But don't flash the ab retention script. Flash the file in system update then go to magisk and flash to inactive slot. Reboot after that and when you boot back up flash the twrp installer in magisk and reflash root and reboot to recovery to verify its there.
joemossjr said:
First method was the right method. But don't flash the ab retention script. Flash the file in system update then go to magisk and flash to inactive slot. Reboot after that and when you boot back up flash the twrp installer in magisk and reflash root and reboot to recovery to verify its there.
Click to expand...
Click to collapse
I'm assuming you mean flash TWRP installer via Magisk once rebooted? I just want to make certain before trying again.
i.Design said:
I'm assuming you mean flash TWRP installer via Magisk once rebooted? I just want to make certain before trying again.
Click to expand...
Click to collapse
Yes
joemossjr said:
Yes
Click to expand...
Click to collapse
This didn't work. I was able to at least see my storage now and installed OTA via TWRP > TWRP installer > Magisk to update Slot B now I'm having the same issue in both slots.
there has to be something else up with your device. I would try a clean flash with magisk or try the latest magisk canary build.
I have downloaded the 11 update via OxygenUpdater using VPN (Location is set to France)
Since i diden't get the update on my real location.
Rebooted to TWRP->Flashed 11 update->Flashed TWRP->Rebooted to TWRP>Flashed Magisk>Flashed Kernel>Rebooted to System.
Everything seems to be working.
Try this simple and straight forward method,
Download the full zip 9.5.11, not the update zip but full zip,
Transfer to phone storage,
wipe only dalvik cache and data, DO NOT WIPE SYSTEM OR VENDOR, OR INTERNAL STORAGE,
Flash the oos zip,
Flash twrp, Reboot recovery,
Flash oos zip file again followed by twrp,
Reboot recovery,
Flash magisk 19.3,
Now Reboot system,
Do not click on any slots in twrp let the system select the appropriate slot, system will take some time to boot also will Reboot itself, but will boot eventually,
hope this helps, cheers.
How this helps, worked for me, I don't have T-Mobile version
i.Design said:
Alright, I have tried just about everything and keep running into the same roadblock so I am going to post here and see if someone has an idea of what is going on and how to work around it. I will outline each method used below as detailed as I can. I'm currently on 9.5.9 and looking to upgrade to .11. I'm currently on Slot B.
First Method:
1.) Disabled all Magisk modules / themes etc
2.) Downloaded .11 OTA from OnePlus Updater
3.) Installed locally via System Updates
4.) Installed TWRP A/B Retention Script in Magisk
5.) Magisk OTA install to inactive slot
6.) Reboot
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. I reboot to slot b and try again.
Second Method:
1.) Disabled all Magisk modules / themes etc
2.) Downloaded .11 OTA from OnePlus Updater
3.) Reboot to TWRP
4.) Flash ROM
5.) Flash TWRP installer
6.) Reboot recovery
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. I reboot to slot b and try again.
Third Method:
1.) Disabled all Magisk modules / themes etc
2.) Download / Install via system updates message to upgrade to .10
4.) Installed TWRP A/B Retention Script in Magisk
5.) Magisk OTA install to inactive slot
6.) Reboot
Result: Reboots to TWRP in the new slot but no pin number is requested and no files showing under Install, cannot reboot to system. Upon rebooting to slot b I at least got a notification that the update had failed and to enter repair mode to attempt again, however, I decided to not do this yet to avoid issues with breaking root / TWRP.
-----
As you can see... I am getting to the point of rebooting to recovery in the new slot but am unable to do anything in terms of flashing ROM > TWRP > Magisk to update both slots or do anything in the new slot. I'm almost assuming a clean ROM flash, flash TWRP / Magisk might fix any issues but I want to prod you all first for a solution before I go with the nuclear option.
Click to expand...
Click to collapse
OP7PRO, stock ROM, stock kernel
This has been ABSOLUTELY working for me and how i was used doing it back in the days..
*After switching off all modules in Magisk and do a system reboot to apply this..
(Do I have to mention it's probably best, when updating to disable any password/fingerprint protection when rebooting AFTER FLASHING OTA, TWRP and Magisk in recovery?)
*I didn't use local update setting.
*What's on in developer options?
-OEM Unlock allowed
-Advanced reboot
-USB Debugging
*Don't know if having these developer settings otherwise would interfere, I just try to write it down as specific as of how i did this.
*Also: I didn't even bother looking at A/B partitioning and where to install what, please correct me if i could be wrong, but using this method worked for me and also when installing TWRP zip in recovery, the log showed A/B sloth solution success when installing.
*Not using substratum themes etc., but I want to say it's probably best to go as clean as you can anyway, since you can always go back being beautiful afterwards I guess?
So try remember where you left off being a makeup loving customiser and momentary revert being as clean as possible.. at least for maybe 20 minutes okay?
How I did it:
-Download the OTA update zip on your phone (full update file zip just shy of 2 Gb) using oxygen updater app in Google playstore.
(Don't install the systemsoftware zip from the oxygen updater once downloaded), you're going to install the systemsoftware.zip in TWRP recovery as opposed to update via Magisk to install the new systemsoftware).
-Download TWRP (INSTALLER!!) have this ZIP on phone (Find it by reading some posts about TWRP Installer zip or use link below)
*I used: twrp-installer-3.3.1-4-guacamole.zip
https://dl.twrp.me/guacamole/ (for TWRP zip)
-Download Magisk zip
*I used: Magisk-v19.3.zip
(So far 3 zip files, have them somewhere pretty obvious on your phone)
-Boot into recovery (I did this by using this option in Magisk manager)
Then:
-Flash the update OTA ROM.zip (just shy of 2Gb)
*DON'T REBOOT*!!!!
-Go back in TWRP recovery menu, Flash TWRP Installer zip
-Still in TWRP recovery menu go back, Reboot to recovery
-Back in TWRP, flash Magisk zip
-Clear Dalvik cache (not sure if this is actually still needed)
-Reboot system normally, enable Magisk modules you want, reboot system...
Updated to 9.5.10 works
Updated to 9.5.11 works
Updated to 10.0.0 works
I can't find the full zip for 9511 anywhere
joemossjr said:
there has to be something else up with your device. I would try a clean flash with magisk or try the latest magisk canary build.
Click to expand...
Click to collapse
I ended up having to reformat to deal with the encryption issue. After reformatting I was able to boot to slot b and am at .11 now!
I'm really hoping this ordeal fixed whatever the problem was so that future OTA's aren't this much of a headache. I'll keep the tips in mind. I'm just glad to have a working device at .11 with root even if I have to re-install all of my apps etc.
virtyx said:
I can't find the full zip for 9511 anywhere
Click to expand...
Click to collapse
It's live on XDA frontpage.
---
I think best update method is get full zip, do local upgrade, flash Magisk after OTA on inactive slot, reboot, flash TWRP installer via magisk and reflash magisk (direct method). Reboot and zero issues.
smariob said:
It's live on XDA frontpage.
---
I think best update method is get full zip, do local upgrade, flash Magisk after OTA on inactive slot, reboot, flash TWRP installer via magisk and reflash magisk (direct method). Reboot and zero issues.
Click to expand...
Click to collapse
just came up now
what i normally do is flash full zip
reboot
then reboot fastboot and boot twrp, then flash twrp then magisk.
i like the OS boot first time without twrp or magisk, just habit i guess
everything working fine, nightscape also
EDIT:
i think SWAP has been turned off in 9.5.11
it no longer displays in ElementalX app (with stock kernel)
What did I do wrong?
Someone help me shed some light. I'm not sure what I did wrong while updating using magisk.
So this is the steps I did.
1. Installed the OTA update
2. In magisk went to install to inactive slot (after OTA)
3. Then it went through the motions and restarted.
At the screen where you put the password in it shut down and then went to the stock recovery. Tried again, same thing. So after some panicking I did this.
Reflashed twrp via computer
Flashed the uninstall of magisk
Flashed twrp zip
Restarted it and everything is fine now. I just had to re-flash the modules which was quite annoying.
So what did I do wrong? Have I buggered up anything to do with the inactive slots or partitions?
I don't know why people have such difficulty?
1. Get the full zip via Oxygen Updater or some other method.
2. Do a local install vis the settings. DO NOT REBOOT.
3. Install Magisk via the "Install after OTA" from Magisk Manager.
4. Reboot
5. You will now have the slot rooted that you updated.
6. Run the local install again. This will install to the other slot. It will fail the first attempt. Do it again.
7. Install Magisk via the OTA option and reboot.
You have now updated both slots and rooted them.
If you would like TWRP or custom kernels, follow those instructions.
If you install TWRP, you MUST install Magisk in the same slot or you will get a boot loop for that slot.
That is the reason why I keep both slots at the same OS level and rooted with TWRP installed.
What country guys you are from that you are getting update? Im in USA and still got nothing.
netgar said:
What country guys you are from that you are getting update? Im in USA and still got nothing.
Click to expand...
Click to collapse
Using oxygen updater, try disabling all.mods before checking for update. Or in oxygen updater settings, select advanced mode, and see if update is available.
Krsmqn said:
Using oxygen updater, try disabling all.mods before checking for update. Or in oxygen updater settings, select advanced mode, and see if update is available.
Click to expand...
Click to collapse
By mods you mean magisk modules?
Update
Advanced option did the job. Updated with magisk and few magisk modules + few substratum themes.
Thx
netgar said:
By mods you mean magisk modules?
Update
Advanced option did the job. Updated with magisk and few magisk modules + few substratum themes.
Thx
Click to expand...
Click to collapse
Yeah, meant magisk modules, sorry. But looks like you got it anyway. ?
All update methods to 11 failed.

Problems after Magisk update - can only enter download mode and recovery

Hey there,
I am currently struggeling with my Samsung Galaxy S7 (Exynos) device, running on superman rom (Android 8).
What happened?
For root I´m using Magisk Manager and for banking apps I have Magisk hide running. Then the program told me that there is an update (Magisk App) available. So, as always and recommended, I choosed "Direct Install" but that failed for some reason. OK I thought´, no problem. Later I wanted to reboot my phone but it didn´t. The screen says "Downloading.... Do not turn off device!". I only can enter "Download Mode" and "Recovery Mode via TWRP".
What I tried so far:
1) Wipe cache/dalvik --> not successful
2) Tried to do a factory reset via twrp --> not successful
3) Tried to flash BL via Odin --> not successful
At this time I realised that the same problem occured to my Galaxy Tablet SM-T580. So I came to the point that I did something wrong with updating magisk on both devides.
What I also tried next:
4) Tried to delete magisk modules via twrp --> not successful
5) Tried to uninstall magisk through twrp by downloading the latest Magisk app and rename it to "uninstall.zip" as recommended in installation guide --> Not successful because of Error installing zip file: Unsupported /Unknown image format (unpacking image format)
What can I do next?
Can anyone please help me, since I have two bricked devices now????
A simple kernel flashing would fix the problem, extract the original boot.img of your current ROM, and flash it via TWRP.
Cause it is clearly a problem with your boot.img, if that didn't work (I'm sure it will), then just dirty flash your current ROM.
P.S. If you are encrypted, you might encounter an error doing a simple factory reset, you'll have to format the whole data partition.
Hi @Mohamedkam000,
many thanks for your help. After hours of browsing the web and trying various methods I was able to get my 2nd device (Samsung Galaxy Tab A from 2016) back to life.
What I did: I installed the latest samsung mobile phone drivers on my PC then I connected the tablet to it. I was able to access the internal memory and in the folder "data" Magisk put a backup of the original boot.img. So I installed this "boot.img" via TWRP and voila.......everything works fine again
I´m very happy now.
But unfortunately this method didn´t work with my Samsung Galaxy S7. I just couldn´t find any boot.img file on the phone.
Mohamedkam000 said:
A simple kernel flashing would fix the problem, extract the original boot.img of your current ROM, and flash it via TWRP.
Cause it is clearly a problem with your boot.img, if that didn't work (I'm sure it will), then just dirty flash your current ROM.
Click to expand...
Click to collapse
How do I have to do this? Sorry I´m a little unexperienced so could I get a kind of an step by step guide please?
Mohamedkam000 said:
P.S. If you are encrypted, you might encounter an error doing a simple factory reset, you'll have to format the whole data partition.
Click to expand...
Click to collapse
Don´t understand this. Could you please explain again?
Thank you so much already.
Kind regards,
cap.
capitarider said:
Hi @Mohamedkam000,
many thanks for your help. After hours of browsing the web and trying various methods I was able to get my 2nd device (Samsung Galaxy Tab A from 2016) back to life.
What I did: I installed the latest samsung mobile phone drivers on my PC then I connected the tablet to it. I was able to access the internal memory and in the folder "data" Magisk put a backup of the original boot.img. So I installed this "boot.img" via TWRP and voila.......everything works fine again
I´m very happy now.
But unfortunately this method didn´t work with my Samsung Galaxy S7. I just couldn´t find any boot.img file on the phone.
How do I have to do this? Sorry I´m a little unexperienced so could I get a kind of an step by step guide please?
Don´t understand this. Could you please explain again?
Thank you so much already.
Kind regards,
cap.
Click to expand...
Click to collapse
Glad your tablet revived again.
Magisk creates a backup of the boot.img found just before flashing magisk, it is compressed in gzip format, so you need to pull it, extract it, and push it back to the phone, then flash it.
The file is usually in /data/stock_boot_${SHA1}.img.gz
You can extract it using the built-in terminal of TWRP, if PC is not accessible at the moment by writing and executing the following command:
gunzip {stock-boot-name}.gz
Replace {stock-boot-name} with your backed-up boot name (without the curleybrackets), or you can use the following command:
gunzip *.gz
That'll extract the gzip archive, and the boot.img will be in /data of which you can navigate to it and flash it.
There's another guaranteed method, if you have the file of the ROM you're using right now, you can just open it (it's just a zip archive) and search for the boot.img of your specific phone model and flash it.
Another guaranteed method will be by flashing a custom kernel compatible with your current ROM, like Moro AiO kernel, of which has a wide support for ROMs starting from Oreo, and up to Q, AOSP, or stock-based, just in one file.
Moro's thread: Moro Kernel
you can't access kernel backup because TWRP does not support encryption and Magisk Manager might removed encryption in boot
aIecxs said:
you can't access kernel backup because TWRP does not support encryption and Magisk Manager might removed encryption in boot
Click to expand...
Click to collapse
Doesn't seem like he's encrypted, he found the boot backup of his tablet in /data so he has probably searched for a similar file on his S7, but since it is compressed, he won't find it solely.
Also he would've told us that his /data is empty or something.
start from scratch with older magisk, current 22 has bug
https://github.com/topjohnwu/Magisk/issues/4008
Thank you for your help.
I had a n old twrp backup on another external hard drive. I extracted the boot file and repached it with 7zip to boot.img and flashed through twrp. That also didn´t work for various times. TWRP always said "failed".
In the end I didn´t manage it to bring my phone back to live. Anyway, I decided to flash the latest LineageOS (Android 11) and now its running smooth again.
Thanks again.
Try using sp flash tools flashing the boot.img

Copying Slot B to Slot A on Pixel 5

I currently have Android 11 Stock ROM installed on 'B' slot on Pixel 5. Everything runs and operates fine. When originally reinstalling the stock ROM, I was sure I was booted to B slot so when I installed stock ROM it would be installed on A slot (missed something along the way and ROM installed to B slot).
Would like to switch from B slot to A (OCD reasons ).
Is there an easy way to do this without losing data and having to reinstall the stock ROM?
Assistance would be appreciated.
------------
Hi just click link in my signature and scroll down to Troubleshooting section (harpreet.s method)
Good luck!
lebigmac said:
Hi just click link in my signature and scroll down to Troubleshooting section (harpreet.s method)
Good luck!
Click to expand...
Click to collapse
Hello -
Appreciate the quick response.
Not sure how this post applies to my question, i.e., copying from Slot B to Slot A. Would need some steps to follow so as to not brick anything.
------------
NetSpeedZ said:
Not sure how this post applies to my question, i.e., copying from Slot B to Slot A.
Click to expand...
Click to collapse
NetSpeedZ said:
Would like to switch from B slot to A (OCD reasons ).
Is there an easy way to do this without losing data and having to reinstall the stock ROM?
Assistance would be appreciated.
Click to expand...
Click to collapse
Here the awesome @harpreet.s method that I was telling you about...
harpreet.s said:
Slot swapping can be done from fastboot
#command to check current active
.\fastboot.exe getvar current-slot
#command to swap , below will set active slot to b
./fastboot --set-active=b
Click to expand...
Click to collapse
I understand that 'swapping' slots can be done from fastboot, however, will this cause the phone to boot to Slot A (if swapping from Slot B) with a working ROM?
it looks like those commands just change from Slot A to Slot B, doesn't swap the actual data from Slot A to Slot B.
(I don't see it hurting to try booting and if you don't boot to a working ROM, simply hold volume down + power to restart back to bootloader to swap back to current slot)
andybones said:
it looks like those commands just change from Slot A to Slot B, doesn't swap the actual data from Slot A to Slot B.
(I don't see it hurting to try booting and if you don't boot to a working ROM, simply hold volume down + power to restart back to bootloader to swap back to current slot)
Click to expand...
Click to collapse
Copy that. Looking for a way to copy current boot ROM from Slot B to Slot A.
Will attempt to run the commands just as a learning experience.
Appreciate the clarification.
------------
NetSpeedZ said:
Copy that. Looking for a way to copy current boot ROM from Slot B to Slot A.
Will attempt to run the commands just as a learning experience.
Appreciate the clarification.
------------
Click to expand...
Click to collapse
Very welcome, my friend.
The past 30 minutes or so I've been looking into this for you.
The most exciting thing to me, being on Android 11 with a working TWRP, you can easily boot to it and pick which slot to boot to.. so, can this be used as a "dual boot"?
It would be cool to have my current ROM crDroid on say Slot A, and then on Slot B try out something like CaylxOS..
If you are running Android 11, perhaps an option would be to make a backup of your current ROM on Slot B.. Then, change to Slot A and restore the backup, thus, moving from Slot B to Slot A. And maybe during your process you can test the dual boot theory of mine above.
andybones said:
Very welcome, my friend.
The past 30 minutes or so I've been looking into this for you.
The most exciting thing to me, being on Android 11 with a working TWRP, you can easily boot to it and pick which slot to boot to.. so, can this be used as a "dual boot"?
It would be cool to have my current ROM crDroid on say Slot A, and then on Slot B try out something like CaylxOS..
If you are running Android 11, perhaps an option would be to make a backup of your current ROM on Slot B.. Then, change to Slot A and restore the backup, thus, moving from Slot B to Slot A. And maybe during your process you can test the dual boot theory of mine above.
Click to expand...
Click to collapse
I think I tried making a backup a while back on an older Moto X4 and then restoring it to the opposite slot (using Android Pie). Could try it on Android 11 and test. Will report back what works, etc.
------------
I'm digging that dual boot theory by @andybones
Wish I had access to a dual boot slot device to give it a try!
@NetSpeedZ If switching boot slots is not good enough for you then you could try this at your own risk :
Boot into custom recovery (TWRP, OrangeFox, PBRP)
adb pull all your slot _a partitions to your computer as a backup (system_a, product_a , vendor_a and whatnot)
overwrite all slot _a partitions with slot _b partitions
I'm sure there's a more elegant way of doing this but this is how I would do it.
This example will overwrite system_a with system_b :
Bash:
adb shell
su
dd if=`ls -l /dev/block/by-name/system_b | awk '{print $NF}'` of=`ls -l /dev/block/by-name/system_a | awk '{print $NF}'`
If you want to avoid bootloop you should probably overwrite all slot _a partitions I guess.
Please report back your results.
Good luck!
lebigmac said:
I'm digging that dual boot theory by @andybones
Wish I had access to a dual boot slot device to give it a try!
@NetSpeedZ If switching boot slots is not good enough for you then you could try this at your own risk:
Boot into custom recovery (TWRP, OrangeFox, PBRP)
Backup your slot _a partitions to your computer (system_a, product_a , vendor_a and whatnot)
And then you could try to overwrite slot _a with slot _b or the other way around.
I'm sure fastboot has a more elegant way of doing this but here's the oldschool way of doing it. This example will overwrite system_a with system_b
Bash:
adb shell
su
dd if=`ls -l /dev/block/by-name/system_b | awk '{print $NF}'` of=`ls -l /dev/block/by-name/system_a | awk '{print $NF}'`
If you want to avoid bootloop you should probably flash all _a partitions I guess.
Please report back your results.
Good luck!
Click to expand...
Click to collapse
When you say I would need to flash all _a partitions, are you referring to /recovery_a, /bootloader_a, etc?
------------
andybones said:
If you are running Android 11, perhaps an option would be to make a backup of your current ROM on Slot B.. Then, change to Slot A and restore the backup, thus, moving from Slot B to Slot A. And maybe during your process you can test the dual boot theory of mine above.
Click to expand...
Click to collapse
Made a backup of Slot B and then immediately rebooted to Slot A, then recovered the backup made of Slot B. No error when recovering the backup, however, when I rebooted - went straight to Fastboot mode. Powered off phone, rebooted and it booted back into ROM on Slot B :-(
------------
NetSpeedZ said:
Made a backup of Slot B and then immediately rebooted to Slot A, then recovered the backup made of Slot B. No error when recovering the backup, however, when I rebooted - went straight to Fastboot mode. Powered off phone, rebooted and it booted back into ROM on Slot B :-(
------------
Click to expand...
Click to collapse
This was my results as well when I tested the restore/backup.
I am very new to this partition layout, being new to Pixels.
I used hTC devices alll up until now, which had it's own recovery.img
So I am still in habit of wanting to call it a "nandroid" backup, but OP has informed me that is an outdated terminology.
So, is it safe to confirm that restore/backup (nandroids) are not working?
Or are we not doing it correctly?
I'd love to know as I do miss being able to more or less run other ROMs by being able to backup and restore to my current position, and keep backups of the ROMs, or figure out if dual booting is possible.
WAY back when the hTC M8 was released (R.I.P Nick) was kicking butt with his port of "multirom" -- back then as a "Developer" I mean tinkerer, it wsa EXTREMELY helpful being able to test on my daily device, and then reboot into my working ROM.
It would be really cool to have say the stock ROM on Slot_A and crDroid on Slot_B
If this wasn't my DD I would give it a try. I think I would go about it by rebooting into permanent TWRP. I have crDroid on Slot_A, so I would reboot into Slot_B in TWRP, and flash a ROM. ProtonROM most likely. and see how it goes.
andybones said:
So, is it safe to confirm that restore/backup (nandroids) are not working?
Or are we not doing it correctly?
I'd love to know as I do miss being able to more or less run other ROMs by being able to backup and restore to my current position, and keep backups of the ROMs, or figure out if dual booting is possible.
Click to expand...
Click to collapse
It appears the backup/restore function works, just not for restoring to a different Slot. I've used the restore backup/restore function to same Slot as backup was made from. I was able to restore fully after I rebooted phone and then powered off the phone and powered back on.
------------
NetSpeedZ said:
It appears the backup/restore function works, just not for restoring to a different Slot. I've used the restore backup/restore function to same Slot as backup was made from. I was able to restore fully after I rebooted phone and then powered off the phone and powered back on.
------------
Click to expand...
Click to collapse
Well that's awesome to hear! Perhaps when I tried my restore, my slots got changed.
You most likely did, but just a thought, did you restore the boot.img when doing your restore to the other slot? Maybe it worked, but had no boot image?
andybones said:
Well that's awesome to hear! Perhaps when I tried my restore, my slots got changed.
You most likely did, but just a thought, did you restore the boot.img when doing your restore to the other slot? Maybe it worked, but had no boot image?
Click to expand...
Click to collapse
Copy that. I restored the entire backup - which I assume restored the boot.img (?).
NetSpeedZ said:
Copy that. I restored the entire backup - which I assume restored the boot.img (?).
Click to expand...
Click to collapse
Depends on the backup you made. You can see when you go to restore the backup and can pick and choose what you'd like to restore, or within the backup folder (here's a recent backup I made).
andybones said:
Depends on the backup you made. You can see when you go to restore the backup and can pick and choose what you'd like to restore, or within the backup folder (here's a recent backup I made).
Click to expand...
Click to collapse
Looks similar to the backup I made, i.e., the boot.emmc.win appears to be the boot image.
NetSpeedZ said:
Looks similar to the backup I made, i.e., the boot.emmc.win appears to be the boot image.
Click to expand...
Click to collapse
Darn, well that's all that's coming to mind for reasons why restore works on one slot and not the other.
andybones said:
Darn, well that's all that's coming to mind for reasons why restore works on one slot and not the other.
Click to expand...
Click to collapse
Guess I could try and flash stock boot.img from bootloader to Slot A . . . . . 'Couldn't 'hoit'

Categories

Resources