[GUIDE] Unbrick soft bricked Moto G5s with fasboot and Linux - Moto G5S Guides, News, & Discussion

Requirement:
- Moto G5s soft bricked = fastboot mode still available
- Stock firmware (link below)
- Computer with USB cable
This guide show commands for fastboot with Linux.
- Download stock firmware for G5s
XT1793 and XT1794:
https://drive.google.com/uc?export=download&id=1M_5ofVKXAaZ-D2-ZPZm9lNbDCivYc2dB
https://androidfilehost.com/?fid=745849072291688414
https://firmware.center/firmware/
- Unzip the archive on your computer in a folder
- Turn off your G5S
- Boot into fastboot mode = press Volume down + Power button simultaneously. Release them once you get into fastboot mode.
- Connect your device to your PC using a USB cable
- In Linux, no need to install drivers for the device. Open the terminal and install fastboot:
Code:
sudo apt install android-tools-fastboot
- Check the device connected:
Code:
sudo $(which fastboot) devices
- Open terminal from the folder of the firmware extracted, then flash the stock firmware:
Code:
sudo $(which fastboot) flash oem oem.img ; sudo $(which fastboot) flash boot boot.img ; sudo $(which fastboot) flash system system.img_sparsechunk.0 ; sudo $(which fastboot) flash system system.img_sparsechunk.1 ; sudo $(which fastboot) flash system system.img_sparsechunk.2 ; sudo $(which fastboot) flash system system.img_sparsechunk.3 ; sudo $(which fastboot) flash system system.img_sparsechunk.4 ; sudo $(which fastboot) flash system system.img_sparsechunk.5 ; sudo $(which fastboot) reboot
- When device reboot, then unplug the cable
- Done
Tested with Ubuntu 14.04 and 18.04.

Related

Simple KFHD SRT with Linux desktop.

Many Thanks to onemeila for this tools. http://forum.xda-developers.com/showthread.php?t=1951254&nocache=1
after acquiring a KFHD 7 Demo from Ebay, i used the following procedure to install a stock ROM using a Linux desktop.
requires factory cable, android-tools.rpm, and KFHD SRT download.
to get fastboot binary you need to install android-tools from the EPEL software repository, for details see https://fedoraproject.org/wiki/EPEL
open a terminal command line window on the Linux desktop. $ is the bash prompt and shouldn't be entered as part of the command.
install android-tools.
$ sudo yum install android-tools
unzip KFHD SRT you downloaded.
$ unzip Downloads/KFHD_SRTv1.3.5.zip
before connecting the Kindle, enter the following command.
$ fastboot -i 0x1949 getvar product
should show < waiting for device>
now connect a factory cable from the Kindle to the desktop, and power on the Kindle. It should show the Fastboot screen.
the terminal bash window should show ROM version of the Kindle:
product: Tate-###-##
now enter the following commands in the terminal bash window.
$ fastboot -i 0x1949 erase cache
$ fastboot -i 0x1949 erase userdata
$ fastboot -i 0x1949 flash recovery images/recovery.img
$ fastboot -i 0x1949 flash boot images/boot.img
for Restore-Factory Rooted with SuperSU.apk, enter this command.
$ fastboot -i 0x1949 flash system images/system.img
or for Restore-Factory Rooted with SuperSU.apk, Apex Launcher, and PlayStore, enter this command.
$ fastboot -i 0x1949 flash system images/system2.img
fastboot -i 0x1949 reboot
disconnect the Kindle and it may need a couple of reboots for the stock ROM to come up.
now that was simple. i hope this helps.

Moto G2 XT1072- ADB Devices Lists No Devices In Fastboot

ADB Devices lists no devices in fastboot (XT1072)
Hello, apologies if this has been debated elsewhere, I couldn't see a thread for it.
When I run ADB Devices with my Moto G 2nd Gen (XT1072) phone in normal mode it happily lists the device as being connected. However, when I reboot into bootloader mode, ADB can't see the device any more:
Code:
C:\platform-tools>adb devices
List of devices attached
XXXXXXXXXX device
C:\platform-tools>adb reboot-bootloader
C:\platform-tools>adb devices
List of devices attached
C:\platform-tools>
The phone has USB Debugging enabled and the same thing happens in either MTP or PTP modes. The latest Motorola USB driver is installed, so you can see ADB connects OK when the phone's not in bootloader mode.
Any ideas what I'm doing wrong?
Adb doesn't work in bootloader. Bootloader mode is fastboot mode. So in bootloader mode only fastboot commands work.
notiflux said:
Adb doesn't work in bootloader. Bootloader mode is fastboot mode. So in bootloader mode only fastboot commands work.
Click to expand...
Click to collapse
OK, thanks. However, "fastboot devices" also returns no connected devices when in bootloader mode. I'm running cmd.exe as administrator too by the way, as I've seen that suggested as a potential solution elsewhere.
Probably you only have adb drivers installed, not fastboot drivers
Fastboot is installed, I can list the fastboot helpfile and I've used it before on an old phone from this PC:
Code:
C:\platform-tools>fastboot
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall 'flash boot' + 'flash system'
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
I notice that the device is listed in Device Manager on.my PC as "Motorola ADB". Does the standard driver only deal with ADB connections and not Fastboot?
sharkyblunt said:
Fastboot is installed, I can list the fastboot helpfile and I've used it before on an old phone from this PC:
Code:
C:\platform-tools>fastboot
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall 'flash boot' + 'flash system'
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
Click to expand...
Click to collapse
download the motorola device manager 2.5.4 exe from motorola website and install , choose repair if already installed. this has ALL the required usb/adb/fastboot drivers or from my link below (it contains MDM2.5.4.exe and adb/fastboot v1.31 in the zip
moto drivers usb /adb /fastboot
Yep, I'm using the Motorola Device Manager driver pack. Unless I'm using the wrong instance of the toolset, as I already had ADB and Fastboot installed by Android SDK from before I owned a Motorola device. Where does the Motorola instance install to by default?
sharkyblunt said:
Yep, I'm using the Motorola Device Manager driver pack. Unless I'm using the wrong instance of the toolset, as I already had ADB and Fastboot installed by Android SDK from before I owned a Motorola device. Where does the Motorola instance install to by default?
Click to expand...
Click to collapse
I own a xt1068 and missus xt1072 I can type mfastboot reboot and phone reboots on both versions guessing you dont have correct fastboot or mfastboot (motorolas version) so find attached a zip to unzip to pc - then put phone in ap fastboot mode and run the test -reset . bat file --- IT WILL NOT RESET YOUR PHONE UNLESS YOU CHOOSE TO -- run it and choose option 4 (reboot) the zip folder includes mfastboot and fastboot and required files to run. please open the test- reset file with notepad++ if you want to see the commands that run
the command to list your device in the bootloader is < fastboot devices > or what ever you fastboot exe is called.
Thanks reefuge, I was unaware that Motorola had their own mfastboot tool. That has solved my issue.

[SOLVED] XT1064 - Updated but how long does the boot take?

XT1064
I have this phone and updated to the latest upgrade XT1064_TITAN_RETUAWS_6.0_MPBS24.65-34-4_cid9_CFC.xml with fastboot. I'm in the US, so assuming this is the correct version.
It got past the "I have an unlocked bootloader page, but it's stuck on the M page, with the stitching. How long does this boot take the first time? So far, I think it's been going for 5+ minutes.
This are the commands I used to upgrade:
Code:
sudo fastboot flash partition gpt.bin
sudo fastboot flash motoboot motoboot.img
sudo fastboot flash logo logo.bin
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 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 reboot
I can still get into bootloader if I reboot.
SOLVED
I restarted the bootloader, installed TWRP, allowed modifications. Rebooted and the phone booted to the setup application (1 out of 4) and started up. Radio is working and everything is working as normal. Came from Krexus ROM.

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