Failed to write CM boot.img - Xperia Z Q&A, Help & Troubleshooting

Hello everyone! I am trying to install my xperia z CyanogenMod but i've come uppon a few troubles!
I have unlocked my bootloader! I am following this tutorial: wiki.cyanogen mod.org/w/Install_CM_for_yuga
I am typing the command
Code:
fastboot -i 0xfce flash boot boot.img
and this shows up in CMD. :
Code:
sending 'boot' <10676>...
OKAY [ 0.343s]
writing 'boot' ...
FAILED <remote: Command not allowed>
finished. total time: 0,346s
i.imgur.com/KOqs mTh.png

Try just: fastboot flash boot boot.img
Sent from my C6603 using Tapatalk

Related

[Q] problems with fastboot flash boot boot.img

Hi,
I'm trying to flash boot.img into my xt890 that I created following the Motorola instructions.
I compiled it and then created the boot.img using:
mkbootimg --kernel bzImage --ramdisk ramdisk.img --output boot.img
After that my boot.img size is 4.3M.
Then I run adb reboot-bootloader and I have my phone on AP fastboot flash mode (secure boot)
Then fastboot devices, works well.
But when I run fastboot flash boot boot.img I get
[email protected]:~/android/out/host/linux-x86/bin$ ./fastboot flash boot boot.img
sending 'boot' (4356 KB)...
OKAY [ 0.682s]
writing 'boot'...
FAILED (remote: Preflash validation failed)
finished. total time: 0.946s
and on the phone :
Downloading
Invalid image size for partition boot
Fastboot command failed
Any help would be greatly appreciated

ROM Flashing - Image is too large - Partition

Motorola G XT1072 -
Recovery: Clockworkmod v6.0.4.7 -
Bootloader: Unlocked
Problem: Failed in flashing rom to device.
What I did:
1. Install "Minimal ADB and Fastboot".
2. Download "mfastboot-v2" and extract it to the same directory I installed "Minimal ADB and Fastboot".
3. Deleted "fastboot.exe" to avoid possible confusion with windows.
4. Extracted the stock rom for the phone to the same directory as "Minimal ADB and Fastboot".
5. Enter the phone in Fastboot Flash Mode
6. Open "Command Prompt" in the "Minimal ADB and Fastbook" folder when the "mfastboot" and extracted ROM files are.
7. In "Command Prompt" I typed "mfastboot flash partition gpt.bin"
I get this error in "Command Prompt"
-------------------------------------------------------------------------------------------------------------------
C:\Users\MAWiggKTA\Desktop\Moto G Files\Minimal ADB and Fastboot>mfastboot flash
partition gpt.bin
target max-sparse-size: 256MB
sending 'partition' (32 KB)...
OKAY [ 0.043s]
writing 'partition'...
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 0.358s
C:\Users\MAWiggKTA\Desktop\Moto G Files\Minimal ADB and Fastboot>
On my phone screen I get pink writing saying: VERSION DOWNGRADED FOR PRIMARY_GPT
-------------------------------------------------------------------------------------------------------------------
8. I typed "mfastboot flash motoboot motoboot.img" and get this error:
C:\Users\MAWiggKTA\Desktop\Moto G Files\Minimal ADB and Fastboot>mfastboot flash
motoboot motoboot.img
target max-sparse-size: 256MB
sending 'motoboot' (2184 KB)...
OKAY [ 0.105s]
writing 'motoboot'...
(bootloader) Motoboot: Preflash validation for tz
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 0.388s
On my phone screen I get writing saying: VERSION DOWNGRADED FOR TZ
-------------------------------------------------------------------------------------------------------------------
9. I typed "mfastboot flash logo logo.bin" and it came back as OKAY.
10. I typed "mfastboot flash boot boot.img" and it again came back as OKAY.
11. I typed "mfastboot flash recovery recovery.img" and it again came back as OKAY.
12. I typed "mfastboot flash system system.img_sparsechunk.0" and got this error:
-----------------------------------------------------------------------------------------------------------------
C:\Users\MAWiggKTA\Desktop\Moto G Files\Minimal ADB and Fastboot>mfastboot flash
system system.img_sparsechunk.0
target max-sparse-size: 256MB
sending 'system' (261762 KB)...
OKAY [ 8.375s]
writing 'system'...
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 8.406s
On my phone screen it says: IMAGE IS TOO LARGE
-------------------------------------------------------------------------------------------------------------------
I think the partition maybe corrupted or something, possible suggestion please people.
Thanks in advanced
Please double check if you have downloaded the correct firmware zip corresponding to your phone model and region. Every region has a different firmware zip, so please verify it before downloading.
I'm positive its the right rom for my phone. I have also downloaded an EU one but get exactly the same errors. Thank you
Maybe try another custom recovery, twrp 2.8.5.0 worked perfectly for me.
thanks mate but ive tried that and still no good. Either recovery I get the same errors. Anyway to totally wipe the phone and redo the partitions?
I don´t know where but I read about the problem with too large images a few times in this forum lately....seems to be a new problem.

fastboot boot recovery.img FAILED(remote: unknown command)

Hey guys,
I have ZTE Red Magic with an unlocked bootloader. It is my first time rooting, and after unlocking the bootloader, I wanted to boot TWRP. So I booted into the bootloader, entered "fastboot boot recovery.img" and I got this message:
downloading 'boot.img'...
OKAY [ 0.579s]
booting...
FAILED (remote: unknown command)
finished. total time: 0.582s
The installation of recovery was successful as I typed the command "fastboot flash recovery recovery.img"
target reported max download size of 536870912 bytes
sending 'recovery' (26721 KB)...
OKAY [ 0.580s]
writing 'recovery'...
OKAY [ 0.001s]
finished. total time: 0.583s
I have absolutely no idea what I'm doing wrong. pls help
boyDbest said:
Hey guys,
I have ZTE Red Magic with an unlocked bootloader. It is my first time rooting, and after unlocking the bootloader, I wanted to boot TWRP. So I booted into the bootloader, entered "fastboot boot recovery.img" and I got this message:
downloading 'boot.img'...
OKAY [ 0.579s]
booting...
FAILED (remote: unknown command)
finished. total time: 0.582s
The installation of recovery was successful as I typed the command "fastboot flash recovery recovery.img"
target reported max download size of 536870912 bytes
sending 'recovery' (26721 KB)...
OKAY [ 0.580s]
writing 'recovery'...
OKAY [ 0.001s]
finished. total time: 0.583s
I have absolutely no idea what I'm doing wrong. pls help
Click to expand...
Click to collapse
Did you unlocked bootloader?
methuselah said:
Did you unlocked bootloader?
Click to expand...
Click to collapse
Yes brother i did

Unable to unlock/flash recovery

I am trying to unlock the bootloader and flash TWRP for the first time. I followed the steps from here: https://wiki.lineageos.org/devices/s2/install
I turned on the unlock option in settings and unlocked via fastboot, rebooted it manually (it didn't reboot), and then tried to flash:
Code:
$ ./fastboot oem unlock-go
OKAY [ 0.007s]
Finished. Total time: 0.007s
$ ./fastboot flash recovery twrp-3.3.1-0-s2.img
Sending 'recovery' (24618 KB) OKAY [ 0.859s]
Writing 'recovery' FAILED (remote: 'Partition flashing is not allowed')
fastboot: error: Command failed
$ ./fastboot reboot
Rebooting OKAY [ 0.001s]
Finished. Total time: 0.001s
$ ./adb reboot bootloader
$ ./fastboot flash recovery twrp-3.3.1-0-s2.img
Sending 'recovery' (24618 KB) OKAY [ 0.779s]
Writing 'recovery' FAILED (remote: 'Partition flashing is not allowed')
fastboot: error: Command failed
$ ./fastboot oem unlock-go
OKAY [ 0.007s]
Finished. Total time: 0.007s
$ ./fastboot flash recovery twrp-3.3.1-0-s2.img
Sending 'recovery' (24618 KB) OKAY [ 0.836s]
Writing 'recovery' OKAY [ 0.231s]
Finished. Total time: 1.071s
$ ./fastboot reboot recovery
Rebooting into recovery OKAY [ 0.001s]
Finished. Total time: 0.001s
However, I got into the stock recovery page instead of TWRP. You can see above that the flash failed before I rebooted, but succeeded after that. Interesting observations:
- The above webpage indicates that the device should reset when I reboot, but it didn't, which means the unlock didn't work.
- When I went back to bootloader, the first attempt to flash failed, but when I ran another unlock it worked though apparently it did nothing.
Am I missing a step? I am using fastboot version 29.0.6-6198805 on Mac OS Mojave 10.14.6.
Don't reboot to recovery via a command after flashing it.
Try rebooting using buttons, vol-up + power.
kalehrl said:
Don't reboot to recovery via a command after flashing it.
Try rebooting using buttons, vol-up + power.
Click to expand...
Click to collapse
Thank you! That got me into TWRP with a dialog titled "Unmodified System Partition" with a slider to allow modifications. I am googling to see what this dialogue is about and how to get TWRP to permanently get installed.
That's normal. Just enable modifications and that's it.
kalehrl said:
That's normal. Just enable modifications and that's it.
Click to expand...
Click to collapse
OK, I don't remember seeing it before (I haven't flashed in at least a couple of years). I ran `adb reboot recovery` and it did go back into TWRP, so I am assuming that it did get persisted. For some reason "Never show this screen..." option didn't work, which is fine, but does it indicate that something is still readonly?
I don't think so.
You're good to proceed.
I was able to sideload the ROM and opengapps nano and it is booting up for the first time. I skipped the optional step to install root (AddonSU), I guess I can do it later too if I feel the need to get root. Thanks a lot for your quick help.
No problem.
If you want to root it, do it with Magisk.
Nowadays, LineageOS team recommend it.

How do I get a recovery on my Redmi 9 (lancelot)?

I'm trying to install custom recovery and ROM on my Redmi 9. I've used XiaoMiToolV2 (https://github.com/francescotescari/XiaoMiToolV2) built on my mac to unlock the boot loader.
But I seem to be stuck trying to replace the recovery.
I tried TWRP- this sent me into a boot loop,
so I tried orangefox from here: https://orangefox.download/device/garden which fixed the bootloop, but everytime I go into recovery it shows me the MIUI Recovery tool.
I also tried pitchblack recovery from here: https://pitchblackrecovery.com/lancelot/ which gives me the same problem.... booting into recovery always shows MIUI Recovery tool.
This is the command I've been using to flash the recovery:
adb reboot bootloader
fastboot flash recovery recovery.img
then a restart, then:
adb reboot recovery
Am I missing something?
supagu said:
I'm trying to install custom recovery and ROM on my Redmi 9. I've used XiaoMiToolV2 (https://github.com/francescotescari/XiaoMiToolV2) built on my mac to unlock the boot loader.
But I seem to be stuck trying to replace the recovery.
I tried TWRP- this sent me into a boot loop,
so I tried orangefox from here: https://orangefox.download/device/garden which fixed the bootloop, but everytime I go into recovery it shows me the MIUI Recovery tool.
I also tried pitchblack recovery from here: https://pitchblackrecovery.com/lancelot/ which gives me the same problem.... booting into recovery always shows MIUI Recovery tool.
This is the command I've been using to flash the recovery:
adb reboot bootloader
fastboot flash recovery recovery.img
then a restart, then:
adb reboot recovery
Am I missing something?
Click to expand...
Click to collapse
Unlock the bootloader before installing the Twrp.
https://miui.blog/any-devices/mi-unlock-tool-mac-linux/
https://www.xiaomitool.com/MiUnlockTool
Twrp:
https://androidfilehost.com/?w=files&flid=318235
.\fastboot flash recovery twrp.img
.\fastboot boot twrp.img
Yes I have unlocked my device using XiaoMiToolV2, I see a little unlocked padlock when booting my phone now.
I tried downloading twrp from the above url (thanks for that!)
I renamed it to recovery.img then:
[email protected] twrp % fastboot flash recovery recovery.img
Sending 'recovery' (65536 KB) OKAY [ 3.746s]
Writing 'recovery' OKAY [ 1.123s]
Finished. Total time: 4.874s
[email protected] twrp % fastboot boot recovery.img
Sending 'boot.img' (65536 KB) OKAY [ 3.733s]
Booting FAILED (remote: 'Unrecognized command boot')
fastboot: error: Command failed
[email protected] twrp % fastboot reboot bootloader
Rebooting into bootloader OKAY [ 0.001s]
Finished. Total time: 0.001s
[email protected] twrp % fastboot erase cache
******** Did you mean to fastboot format this ext4 partition?
Erasing 'cache' OKAY [ 0.046s]
Finished. Total time: 0.047s
[email protected] twrp % fastboot reboot
Rebooting OKAY [ 0.000s]
Finished. Total time: 0.000s
[email protected] twrp % adb reboot bootloader
[email protected] twrp % fastboot reboot recovery
Rebooting into recovery OKAY [ 0.001s]
Finished. Total time: 0.001s
[email protected] twrp %
So your command to boot the image is incorrect, so I tried some other reboot commands but still when I did the reboot recovery it comes up with MIUIRecovery 5.0.... I should be seeing twrp here right instead?
supagu said:
Yes I have unlocked my device using XiaoMiToolV2, I see a little unlocked padlock when booting my phone now.
I tried downloading twrp from the above url (thanks for that!)
I renamed it to recovery.img then:
[email protected] twrp % fastboot flash recovery recovery.img
Sending 'recovery' (65536 KB) OKAY [ 3.746s]
Writing 'recovery' OKAY [ 1.123s]
Finished. Total time: 4.874s
[email protected] twrp % fastboot boot recovery.img
Sending 'boot.img' (65536 KB) OKAY [ 3.733s]
Booting FAILED (remote: 'Unrecognized command boot')
fastboot: error: Command failed
[email protected] twrp % fastboot reboot bootloader
Rebooting into bootloader OKAY [ 0.001s]
Finished. Total time: 0.001s
[email protected] twrp % fastboot erase cache
******** Did you mean to fastboot format this ext4 partition?
Erasing 'cache' OKAY [ 0.046s]
Finished. Total time: 0.047s
[email protected] twrp % fastboot reboot
Rebooting OKAY [ 0.000s]
Finished. Total time: 0.000s
[email protected] twrp % adb reboot bootloader
[email protected] twrp % fastboot reboot recovery
Rebooting into recovery OKAY [ 0.001s]
Finished. Total time: 0.001s
[email protected] twrp %
So your command to boot the image is incorrect, so I tried some other reboot commands but still when I did the reboot recovery it comes up with MIUIRecovery 5.0.... I should be seeing twrp here right instead?
Click to expand...
Click to collapse
After flashing TWRP press volume+and power button
MIUI is automatically replacing TWRP with MIUI Recovery. So to fix this after flashing the recovery, you will need to flash the vbmeta image with the flag --disable-verity:
Code:
fastboot flash recovery recovery.img
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot reboot recovery
This is the vbmeta image: https://forum.xda-developers.com/attachments/vbmeta_redmi9-img.5449805/
Also use this recovery: https://forum.xda-developers.com/t/recovery-twrp-unofficial-twrp-recovery-3-6-1_11-0.4421301/
Thanks guys!
Sergi, your combination of vbmeta and recovery has worked!
Proper url is here:
[RECOVERY][TWRP][UNOFFICIAL] TWRP recovery 3.6.1_11-0
TWRP recovery 3.6.1 for lancelot (redmi 9 | lancelot/galahad) I am not responsible for your brick devices. The recovery is fully working and has been tested. If you encounter a problem, write here, maybe they will help you. Before you accuse me...
forum.xda-developers.com
(you had a typo in your post)
supagu said:
Thanks guys!
Sergi, your combination of vbmeta and recovery has worked!
Proper url is here:
[RECOVERY][TWRP][UNOFFICIAL] TWRP recovery 3.6.1_11-0
TWRP recovery 3.6.1 for lancelot (redmi 9 | lancelot/galahad) I am not responsible for your brick devices. The recovery is fully working and has been tested. If you encounter a problem, write here, maybe they will help you. Before you accuse me...
forum.xda-developers.com
(you had a typo in your post)
Click to expand...
Click to collapse
No problem , and ahh I will correct the link . So glad it worked.

Categories

Resources