[guide] fix error1 by flashing magisk modules via twrp on treble - Xiaomi Mi A1 Guides, News, & Discussion

Hello to everyone,
Some days before, I installed a treble rom on Mi A1. Sometime soon, I wanted to flash a Magisk module via twrp (Mi A2 camera mod for A1 for example) and error occured during flash... "error 1" and because failed to mount "data/adb/magisk.img" to install the module.... Reflashed the Stock rom via edl, flashed other rom.
So, I tried some methods found on YT, internet or there on XDA, no luck.
After, I did something and I can flash modules via twrp again and I tried again and again this to ensure that it works.
So this is what I did:
What you need:
- A Mi A1 of course with Treble.
- The Vendor img, System img, Kernel zip or img file of your choice.
- @CosmicDan 's TWRP (w/ installer)
- A Brain :laugh:
- Patience!
Tried with @CosmicDan TWRP 2.5 atm...
If you flash first time treble pie rom (does not include the Android Pie sGSI, didn't tested yet):
1. Make your Mi A1 treble enabled (If you have did that, skip this)
2. Follow the instructions of each ROM thread (if the treble rom does not include gapps, flash gapps after step 3) .
3. Don't Reboot to System. Flash the TWRP installer from @CosmicDan 's thread.
4. Reboot to Recovery and flash Magisk.
5. Boot into Android.
6. If you haven't installed Magisk Manager, install it, but I think it will be installed after flashing Magisk zip.
7. Reboot to recovery and flash your favourite Magisk Modules!
If you want to move to another kernel, follow the instructions from @khusika 's thread from there and continue to 4th step skipping 6th step..
If torch and camera did not work, flash the @sooti 's Kernel from there and see if torch work or not. If still not, flash the Stock ROM and retry again.
I'm hoping this will help.

Related

100% proper way to install roms?

Hi
In every rom thread I see about a million different answers on how to properly install the rom. Usually the official instructions are very vague. I've been flashing roms for years but this ab partition is very confusing to me. I just got my oneplus 6 a few days ago. It would be great if someone very knowledgeable in how to do this could make a how to guide for both stock and custom roms. I think it would really help everyone and threads for each rom wouldn't be full of people asking it over and over (and getting different answers). Thank you devs for all that you do.
Custom if you don't know if you have the recommend base installed to both slots:
Flash OOS
Flash twrp
Reboot to twrp
Flash OOS
Flash twrp
Reboot to twrp
Wipe data, dalvik cache
Flash custom
Flash twrp
Reboot to twrp
Flash gapps
Flash magisk
Boot system
Custom update:
Flash updated custom rom
Flash twrp
Reboot to twrp
Flash gapps (not needed, but updated gapps is most likely better to use anyhow..)
Flash magisk.
From custom back to OOS:
Info: Format data needed because you will trigger encryptionsince you're on different securety patch. This is also the same way to go from beta branch of oos to stable since the securety patches is lower (in general) on stable.
How to:
Boot twrp
Plug phone in to pc and take backup of everything
When done format data
Transfer oos, twrp, magisk to phone
Flash oos
Flash twrp
Reboot to twrp
Flash magisk
Update oos from... Let's say 9.0.4 to 9.0.5
From Twrp:
Flash oos
Flash twrp
Reboot to twrp
Flash magisk
Boot
From oos:
Use ota update, let it install until it asks you to reboot.. DON'T DO IT.
instead go to magisk and search for "a/b" one module will be found, install it. DON'T REBOOT
Go to main screen of magisk and press install, install, install to inactive slot (after ota) when it's done you can reboot.
General ****ups:
Don't boot after update?
Flash magisk uninstaller
Try to boot (yes.. Without magisk)
If it boots you know it was magisk issue, most likely you had substratum overlays installed or modules that messed it up.
Reboot to twrp and flash magisk again and set up your modules one by one or apply themes or whatever you do with your root.

GUIDES How to install multirom dual pie ROMs with magisk rooted on whyred

I found a way to install dual pie ROMs rooted with magisk on whyred.
Prepare for the files from this link
https://forum.xda-developers.com/redmi-note-5-pro/development/multirom-whyred-t3765451/page1
You need Multirom, multirom twrp, magisk and rom.
I tested havoc os and evolution x. And they both work.
Known issue
Lock screen security such as PIN can only work on one rom.
If you do not wanna keep old rom and wanna flash all new.
Steps
1. Reboot to recovery.
2. Wipe system data cache and so on.
3. Flash multirom and multirom twrp.
4. Reboot to multirom twrp.
5. Flash the Rom and magisk and reboot to system.
6. Install the newest magisk manager and check if magisk work and it should be working.
7. Reboot to multirom twrp.
8. Make a Backup system system image data boot est.
9. Add multirom from backup.
10. Reboot to system and reboot to multirom twrp.
11. Flash multirom again.
12. Reboot to the second rom and magisk should work on both ROMs.
If you wanna keep old rom. Just make a backup.

Can't install LineageOS

Hi
I have problems to install LineageOS on my new OnePlus6. I tried to install LineageOS with the guide on https://wiki.lineageos.org/devices/enchilada/install. If I follow the guide exactly step by step no OS is starting and I can't boot into recovery because (I think) twrp isn't installed (just black screen with blue led). But also if I first boot twrp with fastboot boot 'twrp.img' and after install the twrp.zip, no OS is starting after sideload or flash the 'lineageos.zip'. I think, the install doesn't finish correct. In the terminal on my debian I can see, that the installprocess ends at 47%. But I'm not really shure if this is the problem and if it is, how I can solve it. Probably in this thread the same problem is described: https://forum.xda-developers.com/oneplus-6/help/lineage-doesnt-boot-black-screen-light-t3958351 Unfortunately no solution is available in the thread.
Now I flashed the stockrom (https://forum.xda-developers.com/oneplus-6/how-to/rom-stock-fastboot-roms-oneplus-6-t3796665) and have done all updates but don't know how I can install twrp and after LineageOS. I hope somebody can help me. Thanks
Do you have the latest ADB version? Instead of sideloading you can try just transferring the zip files (with e.g. "adb push lineageos.zip /sdcard/") and then installing directly from TWRP.
Make sure you do all the wipes / formats mentioned in the guide. Transfer and flash the lineageos.zip. Then directly after you should flash the twrp.zip Then reboot back into recovery and flash Magisk / Gapps etc if needed. Then finally reboot to system.
Also read this guide if you haven't already as it explains a lot about how flashing ROMs on OnePlus 6 is different to many other older phones.
Hi and thank you makeyourself
I tried the following steps:
1. starting fastboot
2. fastboot boot twrp-3.3.1-2-enchilada.img -> twrp starting up
3. adb push twrp-installer-3.3.1-2-enchilada.zip /sdcard/ -> transfer ok
4. adb push lineage-16.0-20190922-nightly-enchilada-signed.zip /sdcard/ -> transfer ok
5. in twrp Wipe -> Format Data
6. in twrp Advanced Wipe -> System
7. in twrp install lineage-16.0-20190922-nightly-enchilada-signed.zip
8. in twrp install twrp-installer-3.3.1-2-enchilada.zip
9. reboot to recovery
After this steps I got the same problem as before. Before the reboot to recovery, twrp showed the message "no OS installed". So I think, the zip weren't installed correctly. Now, I have the black screen with the blue led. Can you find out what I did wrong?
Edit: Now, I can't also boot twrp. Also if I do a fastboot boot twrp-3.3.1-2-enchilada.img nothing happens.
Fastboot to twrp (newest blu spark should be fine, or black twrp)
Flash twrp zip
Reboot to twrp
Wipe data, cache.
Flash recommended oos
Flash twrp
Reboot to twrp
Flash recommended twrp (yes...... Again)
Flash twrp (yes... Again, recovery is lost after rom Flash ALWAYS)
Reboot to twrp
Flash LOS or any other custom rom
Flash twrp (rom Flash, so twrp is lost like I said)
Reboot to twrp
Flash magisk (IF ypu want magisk)
Flash gapps (IF ypu want gapps)
Flash kernel (IF I like to run another custom kernel)
Boot
Enjoy
Thank you whizeguy, I'll try this. But just one question about "Flash recommended oos". Which OxygenOS can I flash (this full OTA? https://www.xda-developers.com/oneplus-6-oneplus-6t-oxygenos-9014-906/) and why I have to do this? Sorry if it is a bad question.
You Flash The oxygen OS version that is recommended in Los thread, simple as that.
You have an a/b device, vendor partition (could be other files needed aswell, not 100 % sure) is needed to Flash custom, IF you did Amy research you'd finns some good info. Also for faster answers in The future: post your issue in the thread for LOS, that way you would get help from People Who uses it, knows The exact version you should use and what not
Hey whizeguy, thank you very much. Everything works perfect now. But why for heaven's sake do I have to flash oos and why the guide on the LineageOS site don't tell me this way?
Wow idk what happened here. Mistakenly replied to this thread. Apologies.

Android 10 & Custom ROM & Slot A + B

Hello Android developers and enthusiasts,
I've been installing ROM since 2011 so I would not call myself a n00b however I seemingly cannot install an Android 10 ROM without issues. So this is a plea for help and advice!
I know you need to have OOS installed before you install a custom ROM so I use Auto Flash ROM to install OOS with Android 9 via System Update. I then boot and set up phone, install update, reboot and then install the OOS android 10 via the System Update. I then have a OOS installed with Android 10.
Why would I use such an elaborate method you may ask? Well, I tried to download latest OOS from OnePlus site and wipe phone and then install OOS but that fails (didn't record the error I'm afraid).
I then download all the ROM + dependencies on an USB stick and use fastboot to flash Mauronofrio TWRP. I then follow the steps in the ROM instructions. For EvolutionX these were:
First Time Install / Clean Flash
- Have OOS 10.3 flashed to both slots!!
- Boot to recovery
- Flash BUILD.zip (TWRP built-in)
- Wipe Cache
- Format data
- Reboot to recovery (optional)
- Flash Magisk.zip (optional)
- Reboot to system & #KeepEvolving
Click to expand...
Click to collapse
I followed these to the letter but when i rebooted system I got a snapdragon error and it wouldn't even boot into TWRP until I used fastboot to flash boot into TWRP. I also tried HavocROM and same happened.
I did manage to install Syberia using above method but I didn't like the ROM that much unfortunately.
Finally, I've also read up a lot on Slot A and B but it still is not very clear to me. I think I understand it but what happens does not confirm my theories
I therefore have some questions:
- Should I be able to wipe my phone and install OOS on a wiped phone and then install a custom ROM?
- When I install ROM and it says "Reboot Recovery" and then install ROM again. But if I check what slot is being used the reboot doesn't seem to change the slot. My assumption was that booting recovery was to install ROM in the other slot. Is that correct?
Any other tips you can give me?
Again, I like to stress I am not new to installing custom ROMs so I am a bit disappointed that this is causing me such grief.
Following some answers I will retry tomorrow so I can give some more details if needed. For now, appreciate any help.
roel1976 said:
Hello Android developers and enthusiasts,
I've been installing ROM since 2011 so I would not call myself a n00b however I seemingly cannot install an Android 10 ROM without issues. So this is a plea for help and advice!
I know you need to have OOS installed before you install a custom ROM so I use Auto Flash ROM to install OOS with Android 9 via System Update. I then boot and set up phone, install update, reboot and then install the OOS android 10 via the System Update. I then have a OOS installed with Android 10.
Why would I use such an elaborate method you may ask? Well, I tried to download latest OOS from OnePlus site and wipe phone and then install OOS but that fails (didn't record the error I'm afraid).
I then download all the ROM + dependencies on an USB stick and use fastboot to flash Mauronofrio TWRP. I then follow the steps in the ROM instructions. For EvolutionX these were:
I followed these to the letter but when i rebooted system I got a snapdragon error and it wouldn't even boot into TWRP until I used fastboot to flash boot into TWRP. I also tried HavocROM and same happened.
I did manage to install Syberia using above method but I didn't like the ROM that much unfortunately.
Finally, I've also read up a lot on Slot A and B but it still is not very clear to me. I think I understand it but what happens does not confirm my theories
I therefore have some questions:
- Should I be able to wipe my phone and install OOS on a wiped phone and then install a custom ROM?
- When I install ROM and it says "Reboot Recovery" and then install ROM again. But if I check what slot is being used the reboot doesn't seem to change the slot. My assumption was that booting recovery was to install ROM in the other slot. Is that correct?
Any other tips you can give me?
Again, I like to stress I am not new to installing custom ROMs so I am a bit disappointed that this is causing me such grief.
Following some answers I will retry tomorrow so I can give some more details if needed. For now, appreciate any help.
Click to expand...
Click to collapse
Hi!
I had this exact same problem a couple months ago. Rebooting to recovery used to change slots for me, but then it stopped.
What you can do is change active slot manually on Reboot section. By doing this, you don't even have to reboot to recovery in other to flash the other slot (altough I do it just to be safe).
And remember: the rom is flashed on the inactive slot, so after the final flash you gotta change slots one more time.
When you flash one ROM on top of another different ROM, particularly OOS to custom, always wipe data and not format data, because some custom ROMs do not support being unencrypted in the first time and then encrypt on the first boot. So do it like this:
Flash OOS
Flash TWRP
Reboot recovery
Flash OOS
Flash TWRP
Reboot system
Complete initial setup
Reboot to recovery
Wipe (not format) data
Flash custom ROM (start here for dirty flashing ROM update)
Flash TWRP
Reboot recovery
Flash custom ROM
Flash TWRP
Reboot recovery
Flash Magisk
Reboot system
I don't like built-in TWRP in custom ROMs. I always use @mauronofrio's TWRP. So regardless if the custom ROM I'm using has TWRP built-in or not, I always use the method above. I didn't have a problem with installing ROMs using his TWRP. Slots always switch when flashing ROM.
Thanks for the info, it really helps.
One question: in your experience can you wipe your phone and then installl OOS on the wiped phone?
So I just booted into TWRP, did standard wipe action: Data, Cache, and Dalvik. I then try to flash the latest OOS zip and I then get this error:
Error applying update: 7 (ErrorCode::kInstallDeviceOpenError)
Updater process ended withL ERROR: 1.
Error installing zip file: '/usbstorage/00, INSTALL/OnePlus6Oxygen_22_OTA_044_all_2002220042_a46425f1bfe43d2.zip
FIXED: I was using TWRP 3.3.1.11 and I then found out there was a newer version: 3.3.1.18 which you can get here: https://sourceforge.net/projects/mauronofrio-twrp/files/Enchilada/
I am now able to install OOS from scratch (ie wiped phone).
remewer said:
When you flash one ROM on top of another different ROM, particularly OOS to custom, always wipe data and not format data, because some custom ROMs do not support being unencrypted in the first time and then encrypt on the first boot. So do it like this:
Flash OOS
Flash TWRP
Reboot recovery
Flash OOS
Flash TWRP
Reboot system
Complete initial setup
Reboot to recovery
Wipe (not format) data
Flash custom ROM (start here for dirty flashing ROM update)
Flash TWRP
Reboot recovery
Flash custom ROM
Flash TWRP
Reboot recovery
Flash Magisk
Reboot system
I don't like built-in TWRP in custom ROMs. I always use @mauronofrio's TWRP. So regardless if the custom ROM I'm using has TWRP built-in or not, I always use the method above. I didn't have a problem with installing ROMs using his TWRP. Slots always switch when flashing ROM.
Click to expand...
Click to collapse
I tried this method and everytime I can't seem to flash oos onto the other slot because when it reboots to recovery the folder is encrypted so I can't see which file is the zip. How do I flash the seccond OOS if it shows up encrypted in TWRP.
I have a OnePLus 6 with the latest OOS now because I got into boot loop and i used a flash-all.bat to get back to stock. I also use maronofrio's twrp because that works.
harshybar said:
I tried this method and everytime I can't seem to flash oos onto the other slot because when it reboots to recovery the folder is encrypted so I can't see which file is the zip. How do I flash the seccond OOS if it shows up encrypted in TWRP.
I have a OnePLus 6 with the latest OOS now because I got into boot loop and i used a flash-all.bat to get back to stock. I also use maronofrio's twrp because that works.
Click to expand...
Click to collapse
If you can boot OOS fine, try to do a local update so that both slots have OOS. Then try to flash a custom ROM again using the method I've mentioned.
remewer said:
If you can boot OOS fine, try to do a local update so that both slots have OOS. Then try to flash a custom ROM again using the method I've mentioned.
Click to expand...
Click to collapse
When you say local update you mean while I am running the rom, go to settings then do update from local source?
harshybar said:
When you say local update you mean while I am running the rom, go to settings then do update from local source?
Click to expand...
Click to collapse
Exactly
GuestD2559 said:
When you flash one ROM on top of another different ROM, particularly OOS to custom, always wipe data and not format data, because some custom ROMs do not support being unencrypted in the first time and then encrypt on the first boot. So do it like this:
Flash OOS
Flash TWRP
Reboot recovery
Flash OOS
Flash TWRP
Reboot system
Complete initial setup
Reboot to recovery
Wipe (not format) data
Flash custom ROM (start here for dirty flashing ROM update)
Flash TWRP
Reboot recovery
Flash custom ROM
Flash TWRP
Reboot recovery
Flash Magisk
Reboot system
I don't like built-in TWRP in custom ROMs. I always use @mauronofrio's TWRP. So regardless if the custom ROM I'm using has TWRP built-in or not, I always use the method above. I didn't have a problem with installing ROMs using his TWRP. Slots always switch when flashing ROM.
Click to expand...
Click to collapse
@Cypher_01, Try this guide. This worked for me. I did not reinstall Nikgapps. Maybe that's where the problem lies? Don't forget to change the update slot at the end before you restart.​

mi mix 3 - stuck on twrp bootloop ?

Ok so fresh out the box, unlocked bootloader etc.
I have twrp running finally, and have gone through following the steps format/wipe etc.
flashed several differant roms to just try and get one to boot. every reboot it will automatically go into twrp..
I have tried Arrow, Lineage, pixel experience and all of them result in the same mi bootloop and automatically booting twrp.
im following the arrow install instructions :
New build required to be on MIUI Q firmware part (Recommended V12.0.1.0).
Use TWRP.
Make FULL WIPE (system/vendor/data/dalvik/cache) and FORMAT DATA - YES.
Flash ROM (link in first post)
Flash gapps, if need for VANILLA buildtype.
Reboot
when i flash the Xiaomi eu 12.0.1.0 as suggested... twrp bootloop.
so i am sitting with a device going between Mi screen and recovery only. I have no system ?
Can someone point me in the right direction.
Hi,
I do a full wipe like the instruction. After that I install the Xiaomi.eu v12 build. When that is installed immediately install Arrow 11 without formatting (and gapps if you choose the VANILLA build). I then don't install magisk or any other root solution and I reboot the device. This worked for me when I installed LineageOS and when I installed Arrow 10 and now 11.
So I first install Xiaomi and than the ROM I want without a format or reboot between them. If you are booted in the rom I then look into a root solution and install that if you want atleast.

Categories

Resources