Installing ROM without included kernel & recovery - Xperia Z1 Compact Q&A, Help & Troubleshooting

Hello forum,
i'm currently trying to find the best software solution for my Xperia Z1 Compact and i already got close to what's possible.
I found this ROM which is working almost perfectly except that it overrides the recovery with a dual recovery with an older TWRP version which prevents me from doing critical flashes and backups.
I only need TWRP 3.0.2 on /recovery, nothing else like PhilZ or anything else.
When i flash TWRP 3 for Z1C and reboot to recovery or press Vol-Up when booting i get a blackscreen boot loop which can only be fixed by flashing an old TWRP or wiping the entire phone from fastboot.
Another problem is that updater-script formats /system and /data to ext4 and mounts them like that which is a problem because i'd like to have F2FS on all of my partitions.
I already tried removing /kernel/ and /dualrecovery/ from the .zip and modifying updater-script to not format both patititons and mount them as F2FS, but when trying to flash this modded .zip it fails to flash (probably because an integrity check?).
So what i need to do is:
Remove recovery from .zip
Remove kernel from .zip
Modify updater-script to not format any partitions and mount them as F2FS
Any help, resources and tipps are appreciated. I'm running Windows 10 x64 but i don't think i'm able to build a ROM on my own as i have only little programming experience.

SinusStudios said:
Hello forum,
i'm currently trying to find the best software solution for my Xperia Z1 Compact and i already got close to what's possible.
I found this ROM which is working almost perfectly except that it overrides the recovery with a dual recovery with an older TWRP version which prevents me from doing critical flashes and backups.
I only need TWRP 3.0.2 on /recovery, nothing else like PhilZ or anything else.
When i flash TWRP 3 for Z1C and reboot to recovery or press Vol-Up when booting i get a blackscreen boot loop which can only be fixed by flashing an old TWRP or wiping the entire phone from fastboot.
Another problem is that updater-script formats /system and /data to ext4 and mounts them like that which is a problem because i'd like to have F2FS on all of my partitions.
I already tried removing /kernel/ and /dualrecovery/ from the .zip and modifying updater-script to not format both patititons and mount them as F2FS, but when trying to flash this modded .zip it fails to flash (probably because an integrity check?).
So what i need to do is:
Remove recovery from .zip
Remove kernel from .zip
Modify updater-script to not format any partitions and mount them as F2FS
Any help, resources and tipps are appreciated. I'm running Windows 10 x64 but i don't think i'm able to build a ROM on my own as i have only little programming experience.
Click to expand...
Click to collapse
I don't know much, but I am surprised that flashing twrp 3 causes that problem. What method are you using? Try using Rashr to flash twrp 3 img, then try to boot to recovery. If vol up doesn't work, try vol down, (that's what works for me). Somehow I don't think you'll be able to just remove those things from the ROM and have it flash fine. Your better chance is to get twrp flashed, then figure out the F2FS, etc. Also, there are custom kernels for stock-based roms, and don't forget that twrp 3 is not official on Z1compact, so read threads thoroughly to make sure what you're trying to do is supported. I know many of us have twrp 3 on our phones, so I would look more into that.

Hi,
I had the same issues and maybe this helps.
- install your rom and go into dual recovery and choose twrp
- in twrp go to install and choose "IMG" and not "ZIP"
- you can now install the new twrp version via install !

Maybe you should not flash that ROM because it seems to contain malware. Have a look into the thread.

Related

[Q] Struggling with TWRP, f2fs, adb, fastboot, uCyan

I'm not flashing etc. my SXS (or other cells) often, so I may missed some informative posts regarding my problems. Usage of
Report/Log of actions and problems
I tried to fastboot flash openrecovery-twrp-2.8.4.1-LT26i.img and openrecovery-twrp-2.8.5.0-nozomi.img but f2fs was not available and also installing uCyan-12.1-b04.zip gave me errors
Using adb "fastboot flash boot boot_carbon_3-11-14_with_twrp.img" I was able to use the included TWRP 2.8.0 to clean flash (wiped all except sdcard) "uCyan-12.1-b04.zip"
With TWRP 2.8.0 I also was not able to format all partitions except sdcard with f2fs (probably because of the carbon kitkat-kernel?)
(as expected) TWRP 2.8.0 was gone after the flashing
I tried to reinstall TWRP by installing eu.chainfire.supersu-2.46-246-Android-2.1.apk & com.jmz.soft.twrpmanager.apk in uCyan, this gave me errors and FC and then also forced System shutdowns
Vol+ (fastboot, blue light) und adb USB connect seems to not work with uCyan-12.1-b04 for me, but not sure what is the culprit.
I would like to achieve and ask how to do:
install TWRP 2.8.x permanently (into FOTAkernel)
format all partitions except sdcard with f2fs
install uCyan-12.1-b04
all of this possibly without using uCyan (or another ROM) and without App-Installation (Cell offline) so only with TWRP & adb also to make a clean backup of uCyan: is this possible?
ChriMo said:
I'm not flashing etc. my SXS (or other cells) often, so I may missed some informative posts regarding my problems. Usage of
Report/Log of actions and problems
I tried to fastboot flash openrecovery-twrp-2.8.4.1-LT26i.img and openrecovery-twrp-2.8.5.0-nozomi.img but f2fs was not available and also installing uCyan-12.1-b04.zip gave me errors
Using adb "fastboot flash boot boot_carbon_3-11-14_with_twrp.img" I was able to use the included TWRP 2.8.0 to clean flash (wiped all except sdcard) "uCyan-12.1-b04.zip"
With TWRP 2.8.0 I also was not able to format all partitions except sdcard with f2fs (probably because of the carbon kitkat-kernel?)
(as expected) TWRP 2.8.0 was gone after the flashing
I tried to reinstall TWRP by installing eu.chainfire.supersu-2.46-246-Android-2.1.apk & com.jmz.soft.twrpmanager.apk in uCyan, this gave me errors and FC and then also forced System shutdowns
Vol+ (fastboot, blue light) und adb USB connect seems to not work with uCyan-12.1-b04 for me, but not sure what is the culprit.
I would like to achieve and ask how to do:
install TWRP 2.8.x permanently (into FOTAkernel)
format all partitions except sdcard with f2fs
install uCyan-12.1-b04
all of this possibly without using uCyan (or another ROM) and without App-Installation (Cell offline) so only with TWRP & adb also to make a clean backup of uCyan: is this possible?
Click to expand...
Click to collapse
According to the first list, You had done most of the stuff correctly. You just didn't have partitions in f2fs and no TWRP, right?
The TWRP in carbon should work with f2fs conversion, but given that You get problems, we will need to go via a kinda lengthy method.
Flash the uCyan-12.1-b04 normally via the recovery.Don't bother flashing gapps or other zips now.
Then to get root, You don't need to install SuperSU. You can do so via Settings> Developer Options> Root option for adb and apps.
Then follow the procedure from here to flash TWRP.
After You have TWRP version 2.8.4.1, then reboot to recovery, now convert needed partitions to f2fs and flash the ROM and gapps!

TWRP Can't Mount /System - OP3 Bricks When Trying to Flash New ROM??

I'm currently running my OP3 on Resurrection Remix 5.7.4 (MM 6.01), the phone has the latest version of TWRP and I've flashed other ROMs in the past without any issue
RR has proven to be quite unstable for me, the system UI keeps crashing, which renders the phone unusable until after a reboot so I wanted to flash Freedom OS as that worked quite well for me previously. When I tried to flash the ROM in TWRP the ROM seemed to flash successfully but when I rebooted, only the boot logo showed and then the screen went black and the phone refused to respond at all for about two hours, after that exactly the same thing happened. I managed to boot into recovery and tried flashing a different ROM but the result was the same every time, the only way to get the phone to work normally was to flash RR again/restore from a Nandroid backup, either way, the result is the same, I'm stuck on an unstable ROM and I don't know why, the last time I flashed these ROMs they worked fine, I followed all of the instructions for flashing said ROMs to the letter, I have the latest version of TWRP, etc.
Also it seems TWRP can't mount /system, in TWRP under "mount", system is unchecked, I checked it and tried again but found that whenever I rebooted the phone or attempted to flash a new ROM, it would always uncheck itself and flashing the ROM would fail, however strangely flashing the same version of RR was always successful. Is this why the flashing keeps failing and does anyone know what the problem could be?
Thanks!
bronderb said:
Go into your bootloader and format system, cache, and userdata (This will wipe EVERYTHING so be sure to backup). Then latest official flash stock rom and reboot. This should fix it. If this helped hit thanks!
Click to expand...
Click to collapse
Bootloader? There is no option in the bootloader to delete everything as far as I can see, do you mean in recovery? And if I wipe everything off the phone, how do I get the stock ROM onto the phone to flash it? When you say wipe userdata do you mean wipe internal storage or am I misunderstanding and you're telling me to wipe the usual dalvik, cache and data as you would for a normal clean flash?
bronderb said:
No, go into fastboot and plug into pc. Open cmd and type "fastboot format userdata" "fastboot format cache" "fastboot format system"
Click to expand...
Click to collapse
Okay, thanks, and then what? Do I flash TWRP then push the stock ROM to the phone and flash that? And exactly how do I do that?
bronderb said:
You just go into twrp (no need to reflash) then adb sideload oxygen os
Click to expand...
Click to collapse
Thank you, I am now running OOS, hopefully everything else will go smoothly now, planning to go back to FOS again
I didn't even have to use the fastboot commands to format, just sideloading the OOS file wiped everything anyway
Turns out the issue isn't actually fixed, "system" still appears unchecked in TWRP. Could the fact that I didn't actually format everything first have made a difference, given everything was wiped in the process anyway?
Looks like I'm going to be living the sideloading life...
Edit: Sideloading freedom OS failed, ended up having to restore from my TWRP backup. I don't know what I'm going to do, my main reason for using custom ROMs is installing a black theme, and OOS doesn't support Layers or Substratum fully so I can't stay on that
Is the thing that says "mount system as read-only" enabled in the mounts menu? /System isn't ever mounted when TWRP starts, you have to manually mount it, but as long as the updater-script tells /system to mount, it will. However, if that option to make it read-only is enabled, then nothing will ever write to /system. Last resort is deleting the .twrps file from /sdcard/TWRP folder to remove current TWRP preferences and then when you boot into TWRP, that first screen has the swiper to allow modifications, and you'll swipe that
frickinjerms said:
Is the thing that says "mount system as read-only" enabled in the mounts menu? /System isn't ever mounted when TWRP starts, you have to manually mount it, but as long as the updater-script tells /system to mount, it will. However, if that option to make it read-only is enabled, then nothing will ever write to /system. Last resort is deleting the .twrps file from /sdcard/TWRP folder to remove current TWRP preferences and then when you boot into TWRP, that first screen has the swiper to allow modifications, and you'll swipe that
Click to expand...
Click to collapse
It isn't set to read only, I have tried updating and resetting TWRP but nothing has helped, in fact it's got worse, I managed to sideload OOS but my attempted install of FOS failed so I tried to restore from a backup and that also failed, something which didn't happen back when I was on RR.
evilkitty69 said:
It isn't set to read only, I have tried updating and resetting TWRP but nothing has helped, in fact it's got worse, I managed to sideload OOS but my attempted install of FOS failed so I tried to restore from a backup and that also failed, something which didn't happen back when I was on RR.
Click to expand...
Click to collapse
Which version of TWRP are you running? The official 3.1.0-0 is good for OOS and OOS based ROMs only. Try eng.stk's version.
Use the latest eng-stk twrp.
https://forum.xda-developers.com/devdb/project/?id=15934#downloads
In recovery go to Wipe > Format data (this will wipe ALL in youre phone).
It's youre Data in F2FS? If yes you must change it to ext4, in recovery Wipe > Change file system. Reboot recovery. Check if it's changed.
Reboot to Bootloader (Fastboot). From PC reflash recovery.
Now copy Oos rom to the phone memory. Flash rom. Reflash recovery (the rom will overwrite the recovery). Reboot to recovery to see if it works. If not do it again.
I sugest to NOT restore old data. This way you'll have all new in youre phone.
tnsmani said:
Which version of TWRP are you running? The official 3.1.0-0 is good for OOS and OOS based ROMs only. Try eng.stk's version.
Click to expand...
Click to collapse
I was running 3.0.2-2 when the issue started, I updated to 3.0.3 and 3.1.0-0 but nothing changed. Thanks for the suggestion, I will give it a try
null0seven said:
Use the latest eng-stk twrp.
https://forum.xda-developers.com/devdb/project/?id=15934#downloads
In recovery go to Wipe > Format data (this will wipe ALL in youre phone).
It's youre Data in F2FS? If yes you must change it to ext4, in recovery Wipe > Change file system. Reboot recovery. Check if it's changed.
Reboot to Bootloader (Fastboot). From PC reflash recovery.
Now copy Oos rom to the phone memory. Flash rom. Reflash recovery (the rom will overwrite the recovery). Reboot to recovery to see if it works. If not do it again.
I sugest to NOT restore old data. This way you'll have all new in youre phone.
Click to expand...
Click to collapse
Help! I attempted to do this and the process failed, I didn't manage to wipe data because "/data could not be mounted as device or resource is busy"
Edit: Device now has nothing but TWRP and fastboot, no OS, no ADB, no data, no internal storage
If you can reflash twrp from PC. If not reflash recovery from twrp recovery : Instal > Image > Select Recovery (you must have TWRP.img in youre phone memory )
I managed to get hold of a few factory images and attempted to flash system.img through fastboot, resulting error was
"target reported max download size of 536,870,912 bytes" (system image is 3080 MB)
"invalid sparse file format at header magi"
null0seven said:
If you can reflash twrp from PC. If not reflash recovery from twrp recovery : Instal > Image > Select Recovery (you must have TWRP.img in youre phone memory )
Click to expand...
Click to collapse
I reflashed the modified TWRP successfully. The second suggestion wouldn't have worked, given my phone has no internal storage
You can't see internal storage because of the recovery does not work write.
If you have a working recovery you can do all you want.
null0seven said:
You can't see internal storage because of the recovery does not work write.
If you have a working recovery you can do all you want.
Click to expand...
Click to collapse
The recovery was working at this point, the issue turned out to be the data partition, system was formatted to ext4 but I didn't realise data was in f2fs which caused the problem in the first place. I formatted to ext4 and everything worked, I was able to install paranoid android and everything worked...
...until I flashed the wrong firmware and now I've hard bricked it! I'm going to try the hard brick toolkit
Edit: After 12 hours of being an unresponsive brick, the phone suddenly booted, system doesn't work but it has recovery. Unfortunately I seem to be back to square one, if I try to flash something it appears to succeed but then the phone doesn't boot up into system
So I am now back to the original issue of system not mounting, in terminal if I type "mount /system" I get following error:
"mounting /dev/block/sde20 on /system failed: Device or resource is busy"
Anyone know how to solve this?
I formatted everything, reflashed recovery and tried to flash OOS, got following error:
Code:
[FONT="Courier New"]"This package is for OnePlus3 devices, this is a oneplus3t" (it isn't)
"Updater process ended with ERROR: 7
Error installing zip file /sdcard/OOS3.2.6.zip" [/FONT]
Issue was "solved" by flashing PA, GApps and the correct firmware
Hopefully that's the end of all this drama, thanks to everyone for their suggestions
Hi, I'm pretty new at rooting and I seem to have a similar error. I'm getting the "can't mount /system" error in TWRP. I am able to boot into OOS 4.1.3 and run the nandroid backup but, I keep getting the same error and am unable to select "system" when choosing the mount option in TWRP.
Do I need to have all partitions in f2fs? My system partition is in ext4. Is this what solved your issue?
It seems my phone is functional even with the error active but, I've been trying to get systemless SuperSU and MagiskHide working and I think that's what is preventing me from doing so.

How to flash GSI in RN8P/HMN8P?

I flashed AOSP_10_Quack_Phh-Treble_v208 many times last night.
but always failed,bootloop.
My step:
unlocked + TWRP
1.factory reset + format /data(or not)
2.flash V208.img to system image
3.format /data or not,reboot
My phone showed Redmi-logo and dm-verity error,
and bootloop.
anybody successed?
Could Somebody teach me how to flash GSI?
Maybe to flash AOSP 9?
It's reassuring to see you have attempted multiple times to flash another ROM and haven't hard bricked your phone.
My guess is you need to flash the dm-verity remove zip file. I'm assuming you have selected AVB 2.0 in TWRP? That's all I can think of but I haven't tried anything as clearly I don't have balls as big as yours
I used these following steps from tvardero :
Flash stock
Flash twrp
Make a backup of system and data (to get back into stock if needed)
Format data -> yes
Flash GSI you want to
To flash another GSI or revert to stock you use your backup of system partition.
NEVER EVER RESTORE ANYTHING ELSE THAN SYSTEM OR DATA, softbrick imminent
I try many GSI-ROM
Most bootloop,even I format /data,disable dm-verity/AVB 2.0 (TWRP by wzsx150)
My steps is
fomat /data,reboot to twrp
wipe /system ,2cache and flash gsi.img(Maybe resize /system to flash gapps)
flash magisk
disable dm-verity/AVB 2.0 with TWRP by wzsx150,or flash disabler.ZIP
GSI ROMs had some different bugs,brightness control,NO mobile signal,
sound,nfc-sim support,googlepay ,bank app etc.,
Really nice to see some testings. I hope we have some some development for our devices

Flash TWRP without usb, with root. Help please.

So, wanted to use my old pixel 2 xl but USB only works for charging. PC won't detect it, used dozens of cables and different computers.
I have latest carbon image and root. Wanted to boot twrp.img and then flash the twrp.zip since it used to be that way.
Any hints on this please? Because using apps says partion doesn't exist. I recall it used to be the "issue". That's why we had to boot twrp first and then flash it.
Maybe there is a different solution now.
Any help would be much appreciated.
This is not possible without USB. When the device reboots, RAM is cleared and nothing is "held" in NVRAM for the boot process. The device will either boot the image currently in the boot partition, or if commanded, will live boot the image you specify.
It -is- possible to write images to /boot using root, but keep in mind that since Magisk does not support the compression used for the stock recovery kernel, flashing TWRP to /boot will result in a device that can only boot TWRP.
i see, ok, so, sorry the stupid question in advance.
What if i write twrp .img to boot, then it always boots from twrp, but since i have twrp.zip and a rom.zip in media i can flash .zip to recovery partition and then reboot to recovery and flash rom.zip?
Or is this just to dumb to even ask.
hfmls said:
i see, ok, so, sorry the stupid question in advance.
What if i write twrp .img to boot, then it always boots from twrp, but since i have twrp.zip and a rom.zip in media i can flash .zip to recovery partition and then reboot to recovery and flash rom.zip?
Or is this just to dumb to even ask.
Click to expand...
Click to collapse
Not a dumb question. However, flashing TWRP will result in a device that can only boot TWRP. This applies even if you flash a ROM to a slot.
The best alternative I've found is to run LineageOS. This is because that ROM includes its own recovery that can flash non-Google zips. Further, its updater not only doesn't require a usb cable it also gracefully handles Magisk.
Unfortunately, LineageOS isn't Carbon, and Carbon doesn't include a built-in updater. In your case, you may have no choice but to use a USB cable.

Nexus 5X (NO RPMB): Cannot install Nethunter due to "Data partition appears to be empty" error, TWRP

Tools:
- nethunter-2023.1-bullhead-oreo-kalifs-full.zip
- twrp-3.2.1-0-fbe-4core-bullhead.img
- SR5-SuperSU-v2.82-SR5-20171001224502.zip
- forceencrypt_disabled_dm-verity_disabled (modified boot.img for my Oreo)
I have issues with my Nexus 5X being unable to mount /system partition due to encrypted data. Following several guides found online, I found a way around it by re-formatting /data to ext2 back to ext4 in TWRP.
This allowed me to successfully flash SuperSU and root my Stock Oreo ROM. The problem comes when I try to install Nethunter via TWRP.
I've tried:
1) Flashing both the Stock and force-encrypt-disabled Modified boot.img (neither of which decrypt the /system files in TWRP)
2) Unlock bootloader --> boot into TWRP --> Install Nethunter via ADB sideload (must use sideload since SD card is not mountable)
- This fails, probably because /system cannot be mounted
3) Unlock bootloader --> boot into TWRP --> Format /data to ext2 and back to ext4 --> Mount /system --> Drop Nethunter into SD Card --> Install via TWRP
- This fails due to "Data partition appears to be empty, run Android setup Wizard before installing Nethunter)
SO based on my findings online I can either decrypt /system or keep /data in-tact, but not both. But both appear to be required for the Nethunter installation? I know this is an old device but I am hoping SOMEONE out there has a potential solution.
Thanks in advance!
Same problem, still no solution found....
Last_Stupid said:
Same problem, still no solution found....
Click to expand...
Click to collapse
Hey buddy, sorry I didn’t update this sooner. But I found a solution after asking on Reddit and finally got it working. Here is what I did:
“
Nehunter needs to be installed through magisk. If you want to install a kernel, the provided packages are in AnyKernel3 format, which need to be flashed through the recovery environment.
Here's what I would do, I would reflash the stock ROM, install TWRP, wipe data, system, cache (-s) and install an AOSP based ROM like Lineage OS.
Then I would root using magisk, flashing the apk file as a zip (Don't forget to rename with a .zip extension)
And I would boot into android, download and install magisk, flash the nethunter zip as a magisk module and wait.
You should be done after this point.”

Categories

Resources