Transferred from: https://forum.xda-developers.com/general/rooting-roms/tutorial-how-to-setup-spflashtoollinux-t3160802 Unfortunately this seems to work only on Linux 64-bit
Disclaimer:it is always risky to flash your mobile device. I do not and won't take any responsibility for bootloops and bricks.
Please check carefully, that the ROM or recovery.img your want to flash are suitable for your specific device and for the SP_ Flash_tool. The firmware directory should neither contain Meta-inf nor system folder, but Something_with_a_scatter.txt and a system.im G
Backup your phone before flashing!
Your phone ' s battery should is at least half charged (percent) before your start this.
I successfully ran these steps on my UMI Hammer with Linux Ubuntu 14.04. I do not have the other devices or Linux derivates and does not plan to buy/install any.
CREDITS and a zillion thanks to Sergio Rivero for he excellent tutorial on mibqyyo.com!!!!
Also Many thanks to n2k1 for giving me some more background information!
So here we go:
Step 1:
If you haven ' t before, install the Linux generic usb-drivers package:code:
sudo apt-get install Libusb-dev
Download Https://androidmtk.com/smart-phone-flash-tool
I recommend version 5.1604 or newer.
Step 2:
Extract the downloaded file, graphic file Manager (e.g. Nautilus): Double-click and Extract. Terminal:code:
Unzip Path_to_file
(from today on:please adapt paths to your own settings)
Move The new folder "Sp_flash_tool" to a directory of your choice. Code:
mv/home/username/downloads/sp_flash_tool/home/username/...
Step 3:
Change into the newly created Directory:code:
Cd/sp_flash_tool
We make one file executable by Typing:code:
chmod +x Flash_tool
In order to avoid running the Flash_tool as root user, you need to add a standard user to the UserGroup "dialout" (Thanks To @egalus for this bit!)
Code:
sudo adduser username dialout
For Arch Linux:code:
GPASSWD-A username UUCP
and activate the membership immediately
Code:
Newgrp-dialout
(Arch Linux): Code:
Newgrp-uucp
Step 4:
Now you can open the tool:
Code:
./flash_tool
or double-click on the Flash_tool icon.
Can try at this stage if the Flash tool connects to your phone:
In the user interface, choose Tab "Download". Hit "Scatter-loading", navigate to a directory with a valid firmware for your device and choose the Scatter-file.
For testing purposes uncheck "name" and check one of the smaller files in the list below (for example "logo")
Switch off your device. Hit the "Download" button on Sp_flash_tool and connect your phone to the computer. Some devices require you to take off the battery for about ten seconds, with others you need to press vol+ or Vol-while pl Ugging the cable into the phone. Device-specific threads and try out different options.
If nothing happens at all, open a second terminal, RunCode:
DMESG | grep usb
And look out for a MediaTek entry. If There is none→did you install Libusb-dev (Step 1?)
If The answer is yes, you might need to create a persistent udev rule for the MTK Preloader:code:
sudo gedit/etc/udev/rules.d/80-persistent-usb.rules
Add the following line to the File:code:
subsystem== "USB", action== "Add", attr{idvendor}== "0e8d", attr{idproduct}== "*"
Save the file and exit.
Reload the Usb-rules:code:
sudo service udev restart
Disconnect the USB data cable from the computer and the smartphone. Close the Flash tool. Switch on your phone (fastboot mode would do). Repeat the first paragraph of Step 4.
If the tool connects, within a few seconds a red progress bar would appear. Unfortunately, in my case a error message came along with it:
S_brom_cmd_jump_da_fail (2035)
There is a connection, but the also one more obstacle to overcome ...
Step 5:
Now we come to the interesting part, which cost me 2 weeks of (futile) and frustration. Finally I found Sergio riveros tutorial on Mibqyyo. Thanks to him again and again and again for this priceless piece of information
Quote:
The "Modemmanager" package integrated by default within Linux Ubuntu 14.04 and later are not compatible with the MTK Flash Tool for Linux
To put it in different Words:the modem manager Controls Port/dev/ttyacm0 and disables the Flash Tool. So we blacklist it for the vendor IDs the Flash tool Uses:code:
sudo gedit/etc/udev/rules.d/20-mm-blacklist-mtk.rules
You insert these and Lines:code:
attrs{idvendor}== "0e8d", env{id_mm_device_ignore}= "1" attrs{idvendor}== "6000", env{id_mm_device_ignore}= "1"
Save the file, exit and restart Udev:code:
sudo service udev restart
Switch your phone on (fastboot mode would suffice) and off again.
Step 6:
Code:
./flash_tool
or double-click on the Flash_tool icon.
Now everything should run smoothly. In case you Encountercode:
Brom Error:s_security_sf_code_format_forbidden (6012), MSP Erroe code:0x00
Change the download Agent to Mtk_allinone_da.bin (screenshot #4)
There is plenty of tutorials on the web for the further steps.
Happy flashing! When a green circle with a white checkmark appears is done. You can close the Flash tool and disconnect your phone. Remove the battery for about ten seconds and reinsert it. For a clean start with a new ROM boot into recovery and wipe data/factory reset. attached Thumbnails
[TUTORIAL] How to Setup sp_flash_tool_linux (Mtk/mediatek Soc)