[GUIDE] Fastboot for L90 D405n - LG Optimus L90

Hi, working on modifying the partition in my D405n discovered fastboot mode. It works in the same manner as in D415. For fastboot must delete the partition laf, which is responsible for the download mode. Now, if you break something in your phone, you can quickly flash custom recovery by fastboot and fix it instead of reflash rom using KDZ.
First, backup your laf partition with this code, so later you can restore Download Mode. In terminal/adb shell:
Code:
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/laf of=/sdcard/laf.img
Run the following code to clear laf:
Code:
su
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/laf
If you want restore Download Mode you can do it two methods:
First, you can flash laf in fastboot mode by commands:
Code:
fastboot flash laf laf.img
Second, in terminal/adb shell by comands:
Code:
su
dd if=/sdcard/laf.img of=/dev/block/platform/msm_sdcc.1/by-name/laf
If you want flash a custom recovery/boot you must have unlocked bootloader. You can also do this in fastboot mode by command:
Code:
fasboot flash aboot aboot.bin
You can also get fastboot mode only temporarily if you using this command:
Code:
su
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/boot
Now you can go to recovery mode or Download Mode but if you want boot system instead system starts up fastboot mode. Remember that using this must flash again boot partition using this command:
Code:
fastboot flash boot boot.img
or in recovery mode.

Related

[Q] move to CWM from TWRP

I flashed TWRP to my tablet using the ADB/dd commands mentioned in the TWRP website. Now I wanna use the CWM that is included in the boot.img of cyanogenmod.
How do I do it? Do I just boot into fastboot and run fastboot to flash CWM?
Here's the adb commands use to flash TWRP
Code:
Download the above file. Copy the file to /sdcard/fotakernel.img and run the following commands using terminal emulator or in adb shell:
su
dd if=/sdcard/fotakernel.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel
Here's the fastboot commands use to flash CWM according to cyanogenmod.
Code:
fastboot -i 0xfce flash boot boot.img
fastboot -i 0xfce reboot
thanks!

[Q] Help: Unable to flash TWRP on unlocked bootloader after 4.4 update

I recently rolled back to the factory image to install the OTA 4.4 update (Sprint). I had an unlocked bootloader prior to the update and when I boot into recovery my device tells me I'm unlocked. I downloaded the TWRP image and used the following command from the boot loader:
Code:
mfastboot flash recovery twrp-2.6.3.1-ghost-4.4.img
When I run that command (I also tried "fastboot" in addition to mfastboot), it looks like everything worked OK but when I choose the "recovery" option from the bootloader my device boots into Android instead of into the recovery rom. When I try:
Code:
adb reboot recovery
My device displays the "No Command" recovery screen, as if it were booted using the stock Android recovery image instead of TWRP.
Am I missing a step somewhere to get TWRP on my device?
danherbert said:
I recently rolled back to the factory image to install the OTA 4.4 update (Sprint). I had an unlocked bootloader prior to the update and when I boot into recovery my device tells me I'm unlocked. I downloaded the TWRP image and used the following command from the boot loader:
Code:
mfastboot flash recovery twrp-2.6.3.1-ghost-4.4.img
When I run that command (I also tried "fastboot" in addition to mfastboot), it looks like everything worked OK but when I choose the "recovery" option from the bootloader my device boots into Android instead of into the recovery rom. When I try:
Code:
adb reboot recovery
My device displays the "No Command" recovery screen, as if it were booted using the stock Android recovery image instead of TWRP.
Am I missing a step somewhere to get TWRP on my device?
Click to expand...
Click to collapse
So after flashing recovery did you try to access twrp prior to rebooting to the system?
Sent on my Moto X
flashallthetime said:
So after flashing recovery did you try to access twrp prior to rebooting to the system?
Click to expand...
Click to collapse
Yes. I've tried accessing recovery directly from the fastboot menu immediately after flashing.
danherbert said:
Yes. I've tried accessing recovery directly from the fastboot menu immediately after flashing.
Click to expand...
Click to collapse
OK, you're going to hate this but you need to rsdlite your carriers kitkat sbf firmware, its happened to more than a few people including me, recovery just won't stick after taking an ota for some folks
Sent on my Moto X
flashallthetime said:
OK, you're going to hate this but you need to rsdlite your carriers kitkat sbf firmware, its happened to more than a few people including me, recovery just won't stick after taking an ota for some folks
Click to expand...
Click to collapse
Your suggestion worked. I didn't have easy access to a Windows machine so I couldn't use rsdlite. I had to manually reset to stock. For anyone who stumbles upon this thread, these are the steps I used which worked for me:
Make sure adb and fastboot from the Android SDK are already part of your PATH.
Download moto-fastboot for Mac OS X
Download the Kitkat 4.4 update for Sprint (Make sure to download the version that matches the build number from "Settings -> About Phone" in your device)
Download the Kitkat 4.4 version of TWRP
Extract the factory image .zip to a folder
Copy the moto-fastboot binary to the folder you extracted the factory image to and rename it to "mfastboot"
Copy the TWRP .img file to the folder with the factory image files
Create a file named "factoryreset.sh" and paste the following as its contents
Code:
#!/bin/sh
FASTBOOT=./mfastboot
$FASTBOOT getvar max-download-size
$FASTBOOT oem fb_mode_set
$FASTBOOT flash partition gpt.bin
$FASTBOOT flash motoboot motoboot.img
$FASTBOOT flash logo logo.bin
$FASTBOOT flash boot boot.img
$FASTBOOT flash recovery recovery.img
$FASTBOOT flash system system.img
$FASTBOOT flash modem NON-HLOS.bin
$FASTBOOT erase modemst1
$FASTBOOT erase modemst2
$FASTBOOT flash fsg fsg.mbn
$FASTBOOT erase cache
$FASTBOOT erase userdata
$FASTBOOT erase customize
$FASTBOOT erase clogo
$FASTBOOT oem config carrier sprint
$FASTBOOT oem fb_mode_clear
Open a terminal and navigate to the directory you created
On your device, navigate to "Settings -> About Phone" and tap on the build number 7 times to enable developer mode
Go back to the main "Settings" screen, open "Developer Options", and enable USB Debugging
Connect your device to your computer. Go back to your device, make sure you choose to trust your computer to use ADB in the dialog that pops up, then run the following command from your terminal
Code:
adb reboot-bootloader
Once your device is in fastboot mode, run the command
Code:
sh factoryreset.sh
From the device choose to boot normally and wait for it to finish booting completely.
Run the command
Code:
adb reboot-bootloader
Once the device is in fastboot mode again, run the command
Code:
fastboot flash recovery twrp-2.6.3.1-ghost-4.4.img
From your device, power up normally then reboot into the recovery. If everything went smoothly you'll boot into TWRP recovery.
Code:
adb reboot recovery

[MOD] Increase your SYSTEM partition to 2.5GB , Boot to 30MB , Recovery to 30MB for Y

Do you want to increase partitions using tool.....? Then here is the link
Finally your and MY wait is over Hear @I Putu Tirta Agung S & @Annabathina are introducing that HOW TO INCREASE YUREKA / PLUS PARTITIONS ........
{
"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"
}
I & @I Putu Tirta Agung S are not responsible for anything that may happen to your phone as a result of following this guide / installing custom roms and/or kernels. you do so at your own risk and take the responsibility upon yourself. ​​
NOTE : Please read hole thread before starting........
Preface
This guide has been tested to work on Lollipop and Marshmallow. By following this guide, you will resize your boot, system, cache, and recovery partition to the new partition size as can be seen below:
This guide is quite safe as it doesn't change the emmc GUID and its unique partitions GUID, which is hard coded into our Yureka's non-HLOS (High Level Operating System).
The Guides
Backing up important partitions ( Very very important )
Go to TWRP (please use the newest, or at minimal Abhishek's 3.0.1-0), and when you are in it run "adb shell" from your computer using " ADB+&+Fastboot of yureka " by " Hold shift key and right click on mouse and select Open command window here " then type below lines ONE BY ONE (remember to do it line by line)
Code:
[SIZE="4"]dd if=/dev/block/mmcblk0 of=/sdcard/gpt.bin bs=512 count=34
adb shell dd if=/dev/block/mmcblk0p1 of=/sdcard/modem
adb shell dd if=/dev/block/mmcblk0p2 of=/sdcard/sbl1
adb shell dd if=/dev/block/mmcblk0p3 of=/sdcard/sbl1bak
adb shell dd if=/dev/block/mmcblk0p4 of=/sdcard/aboot
adb shell dd if=/dev/block/mmcblk0p5 of=/sdcard/abootbak
adb shell dd if=/dev/block/mmcblk0p6 of=/sdcard/rpm
adb shell dd if=/dev/block/mmcblk0p7 of=/sdcard/rpmbak
adb shell dd if=/dev/block/mmcblk0p8 of=/sdcard/tz
adb shell dd if=/dev/block/mmcblk0p9 of=/sdcard/tzbak
adb shell dd if=/dev/block/mmcblk0p10 of=/sdcard/hyp
adb shell dd if=/dev/block/mmcblk0p11 of=/sdcard/hypbak
adb shell dd if=/dev/block/mmcblk0p12 of=/sdcard/pad
adb shell dd if=/dev/block/mmcblk0p13 of=/sdcard/modemst1
adb shell dd if=/dev/block/mmcblk0p14 of=/sdcard/modemst2
adb shell dd if=/dev/block/mmcblk0p15 of=/sdcard/misc
adb shell dd if=/dev/block/mmcblk0p16 of=/sdcard/fsc
adb shell dd if=/dev/block/mmcblk0p17 of=/sdcard/ssd
adb shell dd if=/dev/block/mmcblk0p18 of=/sdcard/DDR
adb shell dd if=/dev/block/mmcblk0p19 of=/sdcard/fsg
adb shell dd if=/dev/block/mmcblk0p20 of=/sdcard/sec
adb shell dd if=/dev/block/mmcblk0p22 of=/sdcard/params
adb shell dd if=/dev/block/mmcblk0p23 of=/sdcard/panic
adb shell dd if=/dev/block/mmcblk0p24 of=/sdcard/autobak
adb shell dd if=/dev/block/mmcblk0p26 of=/sdcard/persist[/SIZE]
Copy all files from internal storage (sdcard) to your computer, keep them safe as they are very important if something bad happens.
Doing the magic
Download and extract "gpt.zip" attached in this post, and copy the "gpt.bin" file to the root of your internal storage (internal sdcard).
1. Go back to TWRP and run "adb shell" again from your computer, then type:
2. Go back to TWRP and run "adb shell" again from your computer, then type:
dd if=/sdcard/gpt.bin of=/dev/block/mmcblk0 bs=512 count=34
Click to expand...
Click to collapse
3. After all done, reboot to your bootloader and flash your recovery (TWRP) by typing:
fastboot -i 0x1ebf erase recovery
fastboot -i 0x1ebf flash recovery TheNameofYourRecovery.img
Click to expand...
Click to collapse
4. After that, type below commands (remember to do it line by line):
fastboot -i 0x1ebf oem unlock
fastboot -i 0x1ebf erase boot
fastboot -i 0x1ebf format cache
fastboot -i 0x1ebf format userdata
fastboot -i 0x1ebf format system
fastboot -i 0x1ebf reboot-bootloader
fastboot -i 0x1ebf boot recovery
Click to expand...
Click to collapse
5. After booting to TWRP, wipe everything again (system, data, cache, dalvik, internal storage)
6. Reboot the phone to TWRP again.
7. Copy your original "params", "panic", "autobak", and "persist" files you backed up earlier to the root of your internal storage (internal sdcard) and run "adb shell" again from your computer, then type:
adb shell dd if=/sdcard/params of=/dev/block/mmcblk0p22
adb shell dd if=/sdcard/panic of=/dev/block/mmcblk0p23
adb shell dd if=/sdcard/autobak of=/dev/block/mmcblk0p24
adb shell dd if=/sdcard/persist of=/dev/block/mmcblk0p26
Click to expand...
Click to collapse
This step is very important, so don't miss it or you will hard bricked your god damn phone.
8. After all done, reboot to your bootloader and type again below codes (remember to do it line by line):
fastboot -i 0x1ebf oem unlock
fastboot -i 0x1ebf erase boot
fastboot -i 0x1ebf format cache
fastboot -i 0x1ebf format userdata
fastboot -i 0x1ebf format system
fastboot -i 0x1ebf reboot-bootloader
fastboot -i 0x1ebf boot recovery
Click to expand...
Click to collapse
After booting to TWRP, wipe everything again (system, data, cache, dalvik, internal storage)
9. Reboot the phone to TWRP again.
Troubleshooting
Wallah, now you have 2.5 GB of system partition, 150 MB (it will be usefull if you use f2fs file system) cache partition, 30 MB of recovery partition, 30 MB of boot partition, and around 11.77 GB of data partition.
Oh btw, if you flash "userdata.img" from COS or CM roms, you will get something similar to this:
target reported max download size of 268435456 bytes
erasing 'userdata'...
OKAY [ 8.440s]
sending 'userdata' (137434 KB)...
OKAY [ 5.164s]
writing 'userdata'...
FAILED (remote: image size too large)
finished. total time: 13.634s
Click to expand...
Click to collapse
Why? Because now your data partition is approximately 1.5 GB smaller. So just relax, if you got that kind of warning.
Furthermore, because a lot of devs use that ****in ".dat" files ****ty thing ("system.new.dat", "system.patch.dat" and "system.transfer.list"), if you flash their roms (such as CM, AICP, Exodus, bla bla bla), you will see that your partition will go back to its original value. But not to worry, it is not the real value of what is really use. It is because of the nature on how sparse ext4 image is compiled, they need to set the partition size before compiling, and of course they use the old one, not the one we have changed.
So to overcome this problem, you need to do it the hard way, explained in the second post below. However, if you don't want the hazzle then just flash AOSParadox or YuOS (the TWRP version, not the fastboot one) or Mokee or any rom that doen't have "system.new.dat", "system.patch.dat" and "system.transfer.list" in its zip file, as they will read the new partition size just fine.
ADB+&+Fastboot : link
Partition changer : link
Back up code PNG : link
Device Driver installation links
ADB for pc : link
YU usb drivers : link
PdaNet drivers : link
@I Putu Tirta Agung S MY friend for every thing ( NOTE : YOUR the best HACKER that I ever met )
@Annabathina
If you want the hard way in changing ROMs with ****in ".dat" files ****ty thing ("system.new.dat", "system.patch.dat" and "system.transfer.list") to read the new partition size, then you need Ubuntu with the latest kernel (that has the latest patch on "Transparent Compression", see this post), and follow these steps (thanks to xpirt for his guide):
Step 1 - Decompressing = DAT (sparse data) -> EXT4 (raw image)
We're now using sdat2img binary, the usage is very simple (make sure you have python 3.x installed):
Code:
./sdat2img.py <transfer_list> <system_new_file> <system_ext4>- <transfer_list> = input, system.transfer.list from rom zip
<system_new_file> = input, system.new.dat from rom zip
<system_ext4> = output ext4 raw image file
and a quick example of usage:
Code:
./sdat2img.py system.transfer.list system.new.dat system.img
by running this command you will get as output the file my_new_system.img which is the raw ext4 image.
Step 2 - Decompress EXT4 (raw image) -> OUTPUT folder -> Compress EXT4 (raw image)
Now we need to mount or ext4 raw image into an output folder so we can see apks/jars etc. To do this we need to type this command:
Code:
sudo mount -t ext4 -o loop system.img output/
As you can see there is a new folder called output which we can edit/modify/delete your files (not able to? see here)
Now we need to compress it back to a raw ext4 image, to do this we need the make_ext4fs binary. Make sure you have the file_contexts file (taken from the Rom zip) inside the make_ext4fs path. Then type this (got issues? see here).
Code:
/make_ext4fs -T 0 -S file_contexts -l 2684354560 -a system system_new.img output/
The value of 2684354560 in above code is the new size of system partition in Bytes. Upon doing the above processes, you will get the new raw ext4 image called 'system_new.img' ready for the next step.
Step 3 - Converting = EXT4 (raw image) -> DAT (sparse data)
Now we need the rimg2sdat binary, the usage is very simple:
Code:
./rimg2sdat <system_img>
<system_img> = name of input ext4 raw image file
and a quick example of usage:
Code:
./rimg2sdat my_new_system.img
As you can see the output is composed by system.transfer.list, (system.patch.dat) & system.new.dat, ready to be replaced inside your Rom zip.
Just to make it really simple
1. Fire up your beloved ubuntu, make sure you have python 3.x installed.
2. Download "sdat2img.py", "make_ext4fs", and "rimg2sdat" binaries, and put it inside a folder (use a file manager for god sake). We can name the folder "****inGreat".
3. Now make an empty folder inside "****inGreat" folder, and name it "output".
4. Extract "system.new.dat", "system.patch.dat", "system.transfer.list", and "file_contexts" from your beloved rom's zip file, and put it inside "****inGreat" folder.
5. Now open "****inGreat" folder with root privilege, then open terminal (we call it cmd in windows) from there.
6. type below code on the terminal (one line at a time):
Code:
./sdat2img.py system.transfer.list system.new.dat system.img (press enter)
sudo mount -t ext4 -o loop system.img output/ (press enter)
/make_ext4fs -T 0 -S file_contexts -l 2684354560 -a system system_new.img output/ (press enter)
./rimg2sdat my_new_system.img (press enter)
7. Now copy the new "system.new.dat", "system.patch.dat", "system.transfer.list", and "file_contexts" inside "****inGreat" folder back to your beloved rom's zip file.
8. Flash the rom via TWRP
9. And you are good to go.
10. Ain't that simple!!!!!!!!!!!!!
sdat2img.py
- github.com
make_ext4fs
- mega.co.nz
rimg2sdat
- mega.co.nz
reserved for SS
@I Putu Tirta Agung S MY friend for every thing ( NOTE : YOUR the best HACKER that I ever met )
 @Annabathina
reserved
where is
gpt.zip
i cannot found
@ Annabathina I want to use yureka full default partitions on yureka plus version p3 which is pure locked bootloader andoroid 5.1 version. i need your help.
For all adb shell commands I am getting not found
should i proceed further?
Device Yu Yureka (Lineage os 14.1) @Annabathina
luck_y said:
For all adb shell commands I am getting not found
should i proceed further?
Device Yu Yureka (Lineage os 14.1) @Annabathina
Click to expand...
Click to collapse
This is due to your ADB drivers check weather your PC has successfully installed ADB or not
Successfully increased system partition. But as prescribed this mod is supported to LP and MM ROMs only. Is there any way to support this to OREO. And also prescribe a method for restoring stock partitions.
how to go to default partition
please help i am installing nitrogen os and you hard way is not easily understandable
please provide gpt for default partition
please sir atleast provide default gpt so that i can manage myself
yashgogia007 said:
please help i am installing nitrogen os and you hard way is not easily understandable
Click to expand...
Click to collapse
Follow this
http://forums.yuplaygod.com/index.php?threads/50913/
Sent from my AO5510 using Tapatalk
original gpt.bin
Can anyone post the original gpt.bin, which you back up in 1st step...?
Wolverine00796 said:
Can anyone post the original gpt.bin, which you back up in 1st step...?
Click to expand...
Click to collapse
Here you go.
hi kindly request you that after increase partation my phone stuck at boot logo showing some chinese language boot i tried every thing just manage to get stock rom but still my phone stuck in cyanogen mood please help me my phone no is this +91-9829009627 i have no other phone.
E:Unable to mount '/persist' please help me to get back my yureka AO5510 working

Hard brick xt1775 unbricked.

Hello everyone.
My phone was hard bricked 3 monhts ago.
And today I unbrick it.
I use different model(E4 sprint) unbrick file but it work.
.........
......
cAN YOU SHARE THE METHOD?
help
ismail0100 said:
Hello everyone.
My phone was hard bricked 3 monhts ago.
And today I unbrick it.
I use different model(E4 sprint) unbrick file but it work.
Click to expand...
Click to collapse
please share the metod. I have a xt1775 model phone from lenovo, international version, and I cant unbricked
johita2006 said:
please share the metod. I have a xt1775 model phone from lenovo, international version, and I cant unbricked
Click to expand...
Click to collapse
I use this topic. (https://forum.xda-developers.com/moto-e4/how-to/e4-sprint-xt1766-unbrick-easy-sdcard-t3833408)
Fisrt Message have a unbrick.img file link on mega. I download this unbrick.img file. I know different phone model but it work.
After use this topic(https://forum.xda-developers.com/g5/how-to/rooted-moto-g5-run-morning-post-image-t3776012)
0) Put the Moto g5 on mains charge until you have finished flashing the sdcard so it's fully charged ready for the boot test!
1) Run Linux, preferably cinnamon or mate versions of Linux Mint
2) Insert the sdcard in pc or card reader and open "Disks" app
3) In "Disks" app select sdcard and you will see the sdcard partitions
4) Press "-" to delete the partition (delete all partitions if there is more than one)
5) (dont do it this part)Press "+" to create a new one and name it mmcblk0, set FAT(FAT32) file format and press "CREATE"
6) Press "Play" button to mount the sdcard, look to see what path the sdcard has (/dev/sd??) and then close the "Disks" app
7) (For us unbrick.img not mmcblk0.img)Go to Desktop, open "Computer" and navigate to the location where the img file is extracted (mmcblk0.img)
8) Open the window where img file is with root (right click on window and select "open as root")
9) In root window open the Terminal (right click on window and select "open terminal")
no need to type "su" in terminal, it has root already (see notes if using Linux live usb/dvd)
10) Type in terminal the command written below and don't forget to eliminate that "1" from the sdcard path,
that "1" can make the difference between the phone booting or not!!!!!
Terminal comands
- if your sdcard is seen like " /dev/sdb1"
in terminal apply this command:
Code:
sudo dd bs=4M if=unbrick.img of=/dev/sdb status=progress oflag=sync
-if your sdcard is seen like " /dev/mmcblk0p1"
in terminal apply this command:
Code:
sudo dd bs=4M if=mmcblk0.img of=/dev/mmcblk0 status=progress oflag=sync
after write file on sdcard use this command and use last firmware.
Code:
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot oem fb_mode_clear
fastboot reboot
ismail0100 said:
I use this topic. (https://forum.xda-developers.com/moto-e4/how-to/e4-sprint-xt1766-unbrick-easy-sdcard-t3833408)
Fisrt Message have a unbrick.img file link on mega. I download this unbrick.img file. I know different phone model but it work.
After use this topic(https://forum.xda-developers.com/g5/how-to/rooted-moto-g5-run-morning-post-image-t3776012)
0) Put the Moto g5 on mains charge until you have finished flashing the sdcard so it's fully charged ready for the boot test!
1) Run Linux, preferably cinnamon or mate versions of Linux Mint
2) Insert the sdcard in pc or card reader and open "Disks" app
3) In "Disks" app select sdcard and you will see the sdcard partitions
4) Press "-" to delete the partition (delete all partitions if there is more than one)
5) (dont do it this part)Press "+" to create a new one and name it mmcblk0, set FAT(FAT32) file format and press "CREATE"
6) Press "Play" button to mount the sdcard, look to see what path the sdcard has (/dev/sd??) and then close the "Disks" app
7) (For us unbrick.img not mmcblk0.img)Go to Desktop, open "Computer" and navigate to the location where the img file is extracted (mmcblk0.img)
8) Open the window where img file is with root (right click on window and select "open as root")
9) In root window open the Terminal (right click on window and select "open terminal")
no need to type "su" in terminal, it has root already (see notes if using Linux live usb/dvd)
10) Type in terminal the command written below and don't forget to eliminate that "1" from the sdcard path,
that "1" can make the difference between the phone booting or not!!!!!
Terminal comands
- if your sdcard is seen like " /dev/sdb1"
in terminal apply this command:
Code:
sudo dd bs=4M if=unbrick.img of=/dev/sdb status=progress oflag=sync
-if your sdcard is seen like " /dev/mmcblk0p1"
in terminal apply this command:
Code:
sudo dd bs=4M if=mmcblk0.img of=/dev/mmcblk0 status=progress oflag=sync
after write file on sdcard use this command and use last firmware.
Code:
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot oem fb_mode_clear
fastboot reboot
Click to expand...
Click to collapse
What did you name the sd card?
paigao said:
What did you name the sd card?
Click to expand...
Click to collapse
I did not remember sorry. Probably not change

[Guide] [6.0] How to restore stock ROM XT1097 step by step

Hi guys, I'm doing this tutorial because I didn't find a complete tutorial on how to restore our Moto X 2014 to stock 6.0 marshmallow.
As I asked here for help, I tried encrypting the phone when using LineageOS but it failed and then bootlooped, so I needed to reflash the stock ROM because the formating though TWRP failed too.
I used a Linux distro to do the job. For windows I think there are scripts out there which do the job, and of course you can adapt the commands given here to work with Windows (i.e. changing "sudo fastboot" to "fastboot.exe").
Note: My device is a XT1097 variant and the boot loader was already unlocked. There's also a Zip file for those who have a working TWRP recovery already.
Download the ROM files here: EU variant // RET LA + NIIMX variants
The file I used for this tutorial was: Motorola_Moto_X_XT1097_VICTARA_RETLA_6.0_MPES24.49-18-3_cid12_6.0.zip
Setup of the computer:
1- Install androidtools-fastboot & androidtools-adb
[Optional] 2- Install libmtp package too
Setup of the phone:
1- Reboot your phone into fastboot mode (press power and vol down toghether)
2- Connect the phone to PC
3- Extract the content of the Zip file & enter the folder
4- Open a new terminal inside the folder called "Firmware"
5- Execute these commands below (one command per line)
Bash:
sudo fastboot flash partition gpt.bin
sudo fastboot flash motoboot motoboot.img
sudo fastboot flash boot boot.img
sudo fastboot flash recovery recovery.img
sudo fastboot flash system system.img_sparsechunk.0
sudo fastboot flash system system.img_sparsechunk.1
sudo fastboot flash system system.img_sparsechunk.2
sudo fastboot flash system system.img_sparsechunk.3
sudo fastboot flash system system.img_sparsechunk.4
sudo fastboot flash system system.img_sparsechunk.5
sudo fastboot flash system system.img_sparsechunk.6
sudo fastboot flash system system.img_sparsechunk.7
sudo fastboot flash system system.img_sparsechunk.8
sudo fastboot flash system system.img_sparsechunk.9
sudo fastboot flash modem NON-HLOS.bin
sudo fastboot erase modemst1
sudo fastboot erase modemst2
sudo fastboot flash fsg fsg.mbn
sudo fastboot erase cache
sudo fastboot erase userdata
sudo fastboot erase customize
sudo fastboot erase clogo
[Optional] Tip: If you want to reset the Motorola logo too (it will display again the warning regarding the bootloader unlock, this is why I skipped it), execute the command below just before entering boot.img command
Bash:
sudo fastboot flash logo logo.bin
6- Reboot the phone just in case
Bash:
sudo fastboot reboot-bootloader
7- Reboot the phone into the system
Bash:
sudo fastboot reboot
8- Wait several minutes on the animation booting screen
9- Done, the phone should now show the "Welcome" greenish screen
10- After the initial setup, go to the PlayStore and update your Google Play Services app before updating/installing other apps
I based my tutorial on this post here by @seco2004 and in this post forum here by Junior Gomes. Thanks for all the devs for the hard work with this amazing (besides the battery duration) phone and for that website for hosting all Motorola's stock ROMs at GDrive.

Categories

Resources