Backup TA tool for Linux - Xperia Z General

Hi !
I'm porting the TA Backup script to Linux. It advanced pretty well so backup works, but not restore for today.
I wanted to write this post on the developpement forum, but it seems I can't with less than 10 posts…
You can get my work on Github : github.com/Salamandar/Backup-TA-Linux.
Salamandar aka Félix

Top stuff! I had a look through you scripts and they're looking pretty good! A lot easier to read through than the Windows BAT files.

Thanks
I'd like to say that it'd work for OSX too, but i'm not exactly sure. I'll test it when i can.
I just updated the script, it now checks for script files. (all but busybox)
I'll add some options as help.
If you mant some other features, don't hesitate to ask. If you want some other scripts (bash for android), just ask, I'll do it if i can.

I run OSX. I'm happy to look over your scripts and test them out as best I can.

I think that expecting 'adb' to be in a particular place is not the best idea.
I have 'adb' installed, but not in "/opt/android-sdk/platform-tools/". So I modified the ADB="..." line in the script to be
Code:
ADB=`which adb`
Although this requires adb to be installed somewhere in your $PATH. A possible enhancement might be to use `which adb` with a fall-back to asking the user where adb is installed.
---------- Post added at 09:35 PM ---------- Previous post was at 09:27 PM ----------
Hmmm....
I ran the script and got the following output:
Code:
viking$ ../Backup-TA.sh
[ ------------------------------------------------------------ ]
[ Backup TA vL1.0 for Sony Xperia MIT License ]
[ ------------------------------------------------------------ ]
[ Copyright (C) 2013 DevShaft ]
[ ]
[ Permission is hereby granted, free of charge, ]
[ to any person obtaining a copy of this software ]
[ and associated documentation files (the "Software"), ]
[ to deal in the Software without restriction, ]
[ including without limitation the rights to use, ]
[ copy, modify, merge, publish, distribute, sublicense, ]
[ and/or sell copies of the Software, and to permit ]
[ persons to whom the Software is furnished to do so, ]
[ subject to the following conditions: ]
[ ]
[ The above copyright notice and this permission notice ]
[ shall be included in all copies or substantial portions ]
[ of the Software. ]
[ ]
[ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ]
[ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ]
[ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ]
[ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ]
[ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ]
[ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ]
[ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ]
[ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]
[ ------------------------------------------------------------ ]
Press any key to continue…
[Lots of empty lines]
[ ------------------------------------------------------------ ]
[ Backup TA vL1.0 for Sony Xperia MIT License ]
[ ------------------------------------------------------------ ]
[ Initialization ]
[ ]
[ Make sure that you have USB Debugging enabled, you do ]
[ allow your computer ADB access by accepting its RSA key ]
[ (only needed for Android 4.2.2 or higher) and grant this ]
[ ADB process root permissions through superuser. ]
[ ------------------------------------------------------------ ]
Starting adb and waiting for phone in USB Debugging Mode…
OK
Pushing Backup TA Tools… OK !
Checking for SU binary… OK : Su found at /system/xbin/su
Requesting root permissions… OK : Got Root permissions.
[Lots of empty lines]
[ ------------------------------------------------------------ ]
[ Backup TA vL1.0 for Sony Xperia MIT License ]
[ ------------------------------------------------------------ ]
[ Choose an option : ]
[ 1) Backup ]
[ 2) Restore ]
[ 3) Restore dry-run - nothing will be written on partition ]
[ 4) Convert TA.img to backup ]
[ 5) Quit ]
[ ------------------------------------------------------------ ]
scripts/utils.sh: line 37: read: 0.1: invalid timeout specification
=======================================
BACKUP
=======================================
When you continue Backup TA will perform a backup of the TA partition.
First it will look for the TA partition by its name. When it can not
be found this way it will ask you to perform an extensive search.
The extensive search will inspect many of the partitions on your device,
in the hope to find it and continue with the backup process.
scripts/utils.sh: line 37: read: 0.1: invalid timeout specification
Are you sure? [y/N] y
=======================================
Searchin TA Partition…
Partition not found by name.
scripts/utils.sh: line 37: read: 0.1: invalid timeout specification
Do you want to perform an extensive search for the TA ? [y/N] y
=======================================
Inspecting Partitions…
--- mmcblk0p1 ---
\e[KThis is a compatible TA Partition !figuration…
--- mmcblk0p2 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p3 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p4 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p5 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p6 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p7 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p8 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p9 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p10 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p11 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p12 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p13 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p14 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p15 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p18 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p19 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p20 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p21 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p22 ---
\e[KThis is not a TA Partition.entifier…
Partition found : /dev/block/mmcblk0p1
An unknown error was caught : partition is not set. Aborting…
=======================================
Backup unsuccessful
Cleaning working directory…
Removing files from Android…
Killing ADB Daemon… OK, exiting now !
If you're using ANSI colour sequences, don't. Colour is all well and good, but (as in my case) may not be totally compatible across platforms.
Now, the backup may have failed because my poor phone has had a "rough life" (Stock Sony ROM -> CM10.2 -> FreeXperia -> Stock Sony ROM) and I may have "lost" my TA partition somewhere along the line. Let me restore the backup I made and see what happens.

This is getting very strange. I've restored the original TA backup, rebooted the phone and compared the md5sum output from the original TA backup, the /dev/block/mmcblk0p1 device and the TA backup I took an hour or so ago. They all have different MD5 values. I thought that they should all be the same - after all, they are supposed to be same data.
Code:
aec2542181f6d5c0a21c1563897c9a93 ./TA-backup-2014-05-21.img
347632d7f2761996798acd7f1acc38fc ./TA-backup-2014-09-26.img
63cabee22106f26d25a34d2664ee1695 /dev/block/mmcblk0p1
When I reboot my phone after restoring the TA image, it puts up a "NFC Firmware Update in progress" message. Which is strange - as I'm not doing anything crazy to the NFC, and I'm putting the TA image back to where I got it from.
Any ideas from anyone?

There's a logging area in the TA partition, so the contents and therefore the md5 can vary.
Sent from my C6603 using Tapatalk

I never knew that. It certainly explains why the MD5s were different. Thanks for clearing that up.

Thanks a lot for sharing this work! =)
Will give a shot with my next Xperia as i already lost my TA x)

if [[ "x" == "x$partition" ]]; then
Thank's alot for the scrips, well done.
I had to make a minor fix to get it to work on my setup. The script backup.sh checks for an empty string, but that check failes for some reason (D5803_23.0.A.2.93_Nordic_1288-5411, Linux Mint 17.1 Rebecca, adb version 1.0.31).
The trick was to change
Code:
if [[ ! -z $partition ]]; then
to
Code:
if [[ "x" == "x$partition" ]]; then
I'm not saying anyone should do the same, or that the fix is any good, but I got the script running without indicating any errors and producing some kind of file.
I'm writing this just in case anyone else would have the same problem, and this might provide a clue on how to proceed. And of course to say thank you.
Cheers!

Coming back soon
Hi !
I must admit I changed my phone (OnePlus One) so i didn't work a lot on this script lately (but I found some bugs :s )
I'll work on it next week probably to finish it properly
More infos to come
Salamandar

New structure
Hi everybody,
I rewrote a big part of my script tonight. In fact all the complexity/difficulty/errors i encoutered was due to the adb communication.
So now, I simply copy a big part of the script on the phone, then call it from the computer. That means simpler code and probably an executable script from your phone's terminal if you can't use adb.
I think i'll have finished all of that by friday
The problem here is that I don't have an XPeria anymore to test this so… if someone feels like a beta-tester, just tell me (promise i'll do a safe-beta )

Backup is OP, the rest will follow
Hi !
This took me some more time than hoped, thanks to the sh*t that is adb…
Backup is OP with the new script structure. And way more stable and readable than the old structure.
I let aside the "partition detection" stuff, I don't know if it's useful. Let me know if you get the message "Partition not found by name. Extensive search is not available yet." and we'll see to add some model-specific stuff.
Hiya everybody !
Salamandar

thanks!
Just got a Z3c so will try out soon. Always good to see linux tools (and not just windows!)
Salamandar3500 said:
Hi everybody,
I rewrote a big part of my script tonight. In fact all the complexity/difficulty/errors i encoutered was due to the adb communication.
So now, I simply copy a big part of the script on the phone, then call it from the computer. That means simpler code and probably an executable script from your phone's terminal if you can't use adb.
I think i'll have finished all of that by friday
The problem here is that I don't have an XPeria anymore to test this so… if someone feels like a beta-tester, just tell me (promise i'll do a safe-beta )
Click to expand...
Click to collapse

Related

[Q] Mission Impossible: How to let a2sd working?

Hi everybody,
I have spent several hours to try letting a2sd working and it still seems to be impossible.
I'm running the last version of CyanogenMod with the dark tremor patch installed.
I've partitioned the sd card using gparted, now I've a partition of 1024 gb ext 3 (I've tried also with different size and different file systems (2,3,4)), I've also tried with another sd card (2 gb), but nothing.
I'm always getting the same error when I try run check with a2sd:
# a2sd check
[ ] GREP: Using ROM Busybox.
[!] REBOOT: Using Darktremor Busybox.
[ ] FDISK: Using ROM Busybox.
[ ] CAT: Using ROM Busybox.
[ ] MKDIR: Using ROM Busybox.
[ ] RMDIR: Using ROM Busybox.
[ ] CHMOD: Using ROM Busybox.
[ ] MOUNT: Using ROM Busybox.
[ ] UMOUNT: Using ROM Busybox.
[ ] CP: Using ROM Busybox.
[ ] RM: Using ROM Busybox.
[ ] MV: Using ROM Busybox.
[ ] LN: Using ROM Busybox.
[ ] MORE: Using ROM Busybox.
[ ] MKNOD: Using ROM Busybox.
[ ] AWK: Using ROM Busybox.
[ ] SLEEP: Using ROM Busybox.
[ ] SYNC: Using ROM Busybox.
[ ] TEE: Using ROM Busybox.
__ _____
| \ |
| | |
|__/ | Darktremor Apps2SD 2.7.5.3 Beta 4a (2011-01-30)
[-] Checkpoint 1: Check for SD Card Fix and Implement.
[-] Checkpoint 2: Run Dalvik Heap Program (if exists).
[-] Checkpoint 3: Run Set Low Memory Killer Program (if exists).
[-] Checkpoint 4: Determine Mount Point.
[-] Checkpoint 5: Set Parameter Variables.
[ ] GetProp Command = /system/bin/toolbox getprop
[ ] SetProp Command = /system/bin/toolbox setprop
[ ] Mount Point = /sd-ext
[-] Checkpoint 6: Insert CyanogenMod patch.
[-] Checkpoint 7: Complete Dalvik Cache Move (if applicable).
[-] Checkpoint 8: Resetting Dalvik Cache Partition
[-] Checkpoint 9: Switching Davlik Cache to Cache Partition (if applicable)
[-] Checkpoint 10: Checking for existence of command parameter
[-] Checkpoint 11: Check for a2sd help command
[-] Checkpoint 12: Check for a2sd check command
[ ] Starting Apps2SD Check Program.
Darktremor 2.7.5.3 Beta 4a Apps2SD Status Report
===================================================================================
Legend: [✔]=Setting is correct
[‼]=Setting is correct, but not optimal.
[✖]=Setting is incorrect and needs to be fixed or option is not available.
===================================================================================
Block Device - [✖] Not Found
- [✖] SD card cannot mount
Obviously if I run a2sd reinstall does not work.
Does anyone have any solution?
Thank you very much
Does anyone have any solutions?
Which version are you using.
Also have you tried any other SDcard as i am using CM7 N 89 with A2SD with no issues.
First try another SDCard if this fails see if you can mount the SDCard via the phone.
If you can't give me a PM and i will try and help you out the best i can.
Just noticed you said you use gparted. If you have a custom recovery use that to partition your SDCard.
Save the data first from the SDCard that is important reboot into Recovery mode then select advance if you have Version 3.x.x.x there will be partition SD card there!!!!!!!!
You can either try s2e from the market...it will make job easy..also you could try rom manager for partitions ....
Sent from my HTC Wildfire
I'm using the last one as you: CM7 89.
I've tried with 2 different sdcard and I always get the same problem when I run "a2sd check".
The phone see the sd card correctly but the application are not installed.
Are there maybe any app to check the ext partition?
Did u install the darktremor patch as I did?
Maybe if u give me your procedure I could understand where is the problem.
Thank you.
P.S.: It's normal that gps is not working on this rom?
-Giulio
Right this is how i did it.
Booted into recovery.
Did a Wipe all (Using 3.1.0.2 Recovery)
Did a Advance Partition SD
Then Took out the SDcard and put on 89 rom and a2sd flash files on.
Then Flashed 89 rom then a2sd and rebooted the phone.
i then in terminal typed the following.
SU and then accepted root access
the a2sd install then a2sd cachesd then a2sd datasd. each after each reboot.
giulio1212 said:
P.S.: It's normal that gps is not working on this rom?
-Giulio
Click to expand...
Click to collapse
GPS Works. Reflash the radio if it doesn't. Tested on #87
I've tried to install ClockworkMod 3.1.0.2 (this version)
with unrevoked3 but it doesn't work... Unrevoked just get stuck at some point while rebooting... :/
Any ideas?
All radio's unfortunately need CWM 2.x to be flashed. You can get this by installing CWM from within the ROM Manager Application.
As for installing CWM 3.1.0.2, use an old version of Unrevoked (3.14 or 3.20), they work. You should be able to find a few links by looking around a bit.
I currently have ClockWorkMod 2.5.0.7.... I'm now trying to upgraded it to be able to create the right partition of the SD....
I did not found this versions of Unrevoked for Mac OSX .... do u have it?
Thank you
Found it.... and it works.... now I've the CWM 3.1.0.2... I will try to create the sd partition as Hacktrix explained
Bad news....
I did has hacktrix explain me but still won't works
here is what I get from the shell:
# su
# a2sd install
[ ] GREP: Using ROM Busybox.
[!] REBOOT: Using Darktremor Busybox.
[ ] FDISK: Using ROM Busybox.
[ ] CAT: Using ROM Busybox.
[ ] MKDIR: Using ROM Busybox.
[ ] RMDIR: Using ROM Busybox.
[ ] CHMOD: Using ROM Busybox.
[ ] MOUNT: Using ROM Busybox.
[ ] UMOUNT: Using ROM Busybox.
[ ] CP: Using ROM Busybox.
[ ] RM: Using ROM Busybox.
[ ] MV: Using ROM Busybox.
[ ] LN: Using ROM Busybox.
[ ] MORE: Using ROM Busybox.
[ ] MKNOD: Using ROM Busybox.
[ ] AWK: Using ROM Busybox.
[ ] SLEEP: Using ROM Busybox.
[ ] SYNC: Using ROM Busybox.
[ ] TEE: Using ROM Busybox.
__ _____
| \ |
| | |
|__/ | Darktremor Apps2SD 2.7.5.3 Beta 4a (2011-01-30)
[-] Checkpoint 1: Check for SD Card Fix and Implement.
[-] Checkpoint 2: Run Dalvik Heap Program (if exists).
[-] Checkpoint 3: Run Set Low Memory Killer Program (if exists).
[-] Checkpoint 4: Determine Mount Point.
[-] Checkpoint 5: Set Parameter Variables.
[ ] GetProp Command = /system/bin/toolbox getprop
[ ] SetProp Command = /system/bin/toolbox setprop
[ ] Mount Point = /sd-ext
[-] Checkpoint 6: Insert CyanogenMod patch.
[-] Checkpoint 7: Complete Dalvik Cache Move (if applicable).
[-] Checkpoint 8: Resetting Dalvik Cache Partition
[-] Checkpoint 9: Switching Davlik Cache to Cache Partition (if applicable)
[-] Checkpoint 10: Checking for existence of command parameter
[-] Checkpoint 11: Check for a2sd help command
[-] Checkpoint 12: Check for a2sd check command
[-] Checkpoint 13: Display version information.
[ ] Starting Darktremor Apps2SD Version 2.7.5.3 Beta 4a
[-] Checkpoint 14: Check for filesystem support.
[-] Checkpoint 15: Mount partition.
[-] Checkpoint 16: Reset Dalvik if Flag File is present.
[-] Checkpoint 17: Mount Swap.
[-] Checkpoint 18: Display Heap Size.
[ ] Heap Size set to: 24m
[-] Checkpoint 19: Check for start parameter and launch start2sd if needed.
[ ] Launching Apps2SD Start Program with install
[ ] Starting Darktremor Apps2SD in install mode
[X] SD Card not mounted.
Cannot reinstall applications to SD card.
#
I just did it like this (same stuff with two different SDCard):
1.Installed the new CWM 3.1.0.2 with unrevoked.
2.Did a WIPE All
3.Create the partition form advance->partition SD->1024mb->swap 0mb
4.Installed CM7 N89
5.Installed Darktremor Apps2SD 2.7.5.3 Beta 4a
6.Restart the phone
7.Wait
8.Run with adb "a2sd install"
9.Unsucess
Does anyone knows which is the problem... Is driving me crazy, it's really frustrating :/
I think I've done it... but I did it only with an old 2gb microSD card...
I would like to use my 32gb microSD card....
After I've created the partition I tried to mount it inside CWM:
-With 2gb card no problem, it mounts.
-With 32gb card it gives me: error mounting/
Do you know why?
Here a screenshot of my card:
{
"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"
}
Any idea on how to create a working partition with this card?
That card might be a fake! if it works on the 2GB version and i have a 16GB sdcard to which it works on that 32gb must be a fake. I can't even find a class 8 card where did you get it from ?
I ordered on ebay, in effect I paid few $$.... but, yeah I can assure you that I fill it with 32gb....
At the end I decided to use app2sd from android, that seems to work without problems on CM7 (when I've tried on CM6 sometimes app disappeared ).

[Q] Darktremor Apps2SD Supported for HTC Wildfire 2.2.1 Stock ROM?

I have a rooted HTC Wildfire with stock ROM 2.2.1,
I have the following rooting tools installed:
+ ROM Manager 4.3
+ Clockworkmod Recovery 5.0.2
+ Root Toolbox
+ Busybox 1.19
+ Terminal Emulator
I also got a 8 GB SDcard, partitioned with CWM as follows:
+ 1024 MB as Ext3
+ 64 MB SWAP
+ Rest as FAT32
I tried to install Darktremor Apps2SD 2.7.5.3 Beta 04 but it never started and whenever I start the phone.
Here's an output result after executing commands:
>> su
$ a2sd reinstall
Code:
[ ] GREP: Using ROM Busybox.
[ ] REBOOT: Using ROM Busybox.
[ ] FDISK: Using ROM Busybox.
[ ] CAT: Using ROM Busybox.
[ ] MKDIR: Using ROM Busybox.
[ ] RMDIR: Using ROM Busybox.
[ ] CHMOD: Using ROM Busybox.
[ ] MOUNT: Using ROM Busybox.
[ ] UMOUNT: Using ROM Busybox.
[ ] CP: Using ROM Busybox.
[ ] RM: Using ROM Busybox.
[ ] MV: Using ROM Busybox.
[ ] LN: Using ROM Busybox.
[ ] MORE: Using ROM Busybox.
[ ] MKNOD: Using ROM Busybox.
[ ] AWK: Using ROM Busybox.
[ ] SLEEP: Using ROM Busybox.
[ ] SYNC: Using ROM Busybox.
[ ] TEE: Using ROM Busybox.
grep: /init.rc: Permission denied
__ _____
| \ |
| | |
|__/ | Darktremor Apps2SD 2.7.5.3 Beta 4a (2011-01-30)
[-] Checkpoint 1: Check for SD Card Fix and Implement.
[-] Checkpoint 2: Run Dalvik Heap Program (if exists).
[-] Checkpoint 3: Run Set Low Memory Killer Program (if exists).
[-] Checkpoint 4: Determine Mount Point.
[-] Checkpoint 5: Set Parameter Variables.
[ ] GetProp Command = /system/bin/toolbox getprop
[ ] SetProp Command = /system/bin/toolbox setprop
[ ] Mount Point = /system/sd
[-] Checkpoint 6: Insert CyanogenMod patch.
[ ] Creating /cache/dc
mkdir: can't create directory '/cache/dc': Permission denied
chmod: /cache/dc: Permission denied
[ ] Symlinking /cache/dalvik-cache to /data/dalvik-cache
rm: can't stat '/cache/dalvik-cache': Permission denied
ln: /cache/dalvik-cache: Permission denied
[-] Checkpoint 7: Complete Dalvik Cache Move (if applicable).
[-] Checkpoint 8: Resetting Dalvik Cache Partition
[-] Checkpoint 9: Switching Davlik Cache to Cache Partition (if applicable)
[-] Checkpoint 10: Checking for existence of command parameter
[-] Checkpoint 11: Check for a2sd help command
[-] Checkpoint 12: Check for a2sd check command
[-] Checkpoint 13: Display version information.
[ ] Starting Darktremor Apps2SD Version 2.7.5.3 Beta 4a
[-] Checkpoint 14: Check for filesystem support.
[-] Checkpoint 15: Mount partition.
[-] Checkpoint 16: Reset Dalvik if Flag File is present.
[-] Checkpoint 17: Mount Swap.
[-] Checkpoint 18: Display Heap Size.
[ ] Heap Size set to:
[-] Checkpoint 19: Check for start parameter and launch start2sd if needed.
[ ] Launching Apps2SD Start Program with reinstall
[X] Problem detected: Darktremor Apps2SD may not have ran
during boot. Cannot read a2sd.mountpoint.
[ ] Starting Darktremor Apps2SD in reinstall mode
[X] SD Card not mounted.
Cannot reinstall applications to SD card.
As shown, errors are:
[X] Problem detected: Darktremor Apps2SD may not have ran
during boot. Cannot read a2sd.mountpoint.
[X] SD Card not mounted.
I wonder whether Darktremor Apps2SD officially supports stock ROM for HTC Wildfire 2.2.1 or not.
Any alternatives for this method if not supported?
Nobody ever successfully moved all apps to Ext3 partition for rooted Wildfire with stock Android 2.2.1?
A ROM must support Apps2SD to enable you to use it. You can cook your own ROM with the Stock as base, and just Apps2SD enabled using the DSIXDA Kitchen.
dude google if your current rom support ext3. the log shows problem with mounting sd. if it does not, u should partition it to ext2( kinda old, but have 2. if you want 2 stay with stock. if you plan to be a cm7 fan you can even use ext4 in latest nightly). reformatt sd. reflash rom, then install a2sd.
hey i had successed in moving app to sd using dta2sd. i even moved data to sd. check my thread " deal with a2sd ".
Sent from my HTC Wildfire using XDA App

Generating singleimage.bin

I did some research and am close to how the singleimage.bin is created. From what I am seeing it is a combination of 4 files with some gpt info at top and bottom. I have bricked my device and am looking for the right singleimage to restore it to. below is the list of file and there order and decimal for where they are in the file.
(taken from 5.0.1 gpe ota)
|_____________________________________________|
| File name | HEX | DECIMAL |
|_____________________|___________|____________|
1) sbl1_8226.mbn | 4400 | 17408 |
2) emmc_appsboot.mbn | 8C400 | 574464 |
3) rpm.bin | 203400 | 2110464 |
4) tz.bin | 280400 | 2622464 |
|_____________________________________________|
The space inbetween the files is filed with 0's. It is exactly what the name says: a singleimage. It is the memory layout of the phone. Since we are restoring it completey blank (hence blank-flash) we only flash the needed files.
So seeing this I am hoping someone with the 8226 chip (xt1032 has it dont know about others) would be willing to dd ther mmcblk0 partition (the whole phone) which is runnng 5.0.1 and this will allow us to unbrick our phone.
Information came from http://www.droidrzr.com/index.php/topic/50897-bricked-blank-screen-no-boot-options-just-black-screen-no-text-or-graphics/
finding out the partition layout I did myself using a binary viewer and comparng files.
I tried flashing the singleimage but was greeted with "invalid HDLC frame". so it is not quite fixed yet. Can anyone explain to me what this HDLC frame is?
bludotos said:
I did some research and am close to how the singleimage.bin is created. From what I am seeing it is a combination of 4 files with some gpt info at top and bottom. I have bricked my device and am looking for the right singleimage to restore it to. below is the list of file and there order and decimal for where they are in the file.
(taken from 5.0.1 gpe ota)
|_____________________________________________|
| File name | HEX | DECIMAL |
|_____________________|___________|____________|
1) sbl1_8226.mbn | 4400 | 17408 |
2) emmc_appsboot.mbn | 8C400 | 574464 |
3) rpm.bin | 203400 | 2110464 |
4) tz.bin | 280400 | 2622464 |
|_____________________________________________|
The space inbetween the files is filed with 0's. It is exactly what the name says: a singleimage. It is the memory layout of the phone. Since we are restoring it completey blank (hence blank-flash) we only flash the needed files.
So seeing this I am hoping someone with the 8226 chip (xt1032 has it dont know about others) would be willing to dd ther mmcblk0 partition (the whole phone) which is runnng 5.0.1 and this will allow us to unbrick our phone.
Information came from http://www.droidrzr.com/index.php/topic/50897-bricked-blank-screen-no-boot-options-just-black-screen-no-text-or-graphics/
finding out the partition layout I did myself using a binary viewer and comparng files.
I tried flashing the singleimage but was greeted with "invalid HDLC frame". so it is not quite fixed yet. Can anyone explain to me what this HDLC frame is?
Click to expand...
Click to collapse
I found this. Scroll to the second post
http://forum.xda-developers.com/showthread.php?t=2086142
It is there all explained . I hope you can find something usefull in it
bludotos said:
So seeing this I am hoping someone with the 8226 chip (xt1032 has it dont know about others) would be willing to dd ther mmcblk0 partition (the whole phone) which is runnng 5.0.1 and this will allow us to unbrick our phone.
Click to expand...
Click to collapse
I'm running 5.0.1 gpe on my 1032. I'll help you with it if you give proper instructions about what exactly commands I should do. should I do it in adb shell and so on and so forth.
S0bes said:
I'm running 5.0.1 gpe on my 1032. I'll help you with it if you give proper instructions about what exactly commands I should do. should I do it in adb shell and so on and so forth.
Click to expand...
Click to collapse
Thank you for offering this!
I will at least need these partitions:
sdl1: mmcblk0p2
DDR: mmcblk0p3
aboot: mmcblk0p4
rpm: mmcblk0p5
tz: mmcblk0p6
sdi: mmcblk0p7
to extract them, do:
>su
>dd if=/dev/block/mmcblk0p? of=/sdcard/images/???.img
replace "?" with the correct name. ex: dd if=/dev/block/mmcblk0p3 of=/sdcard/images/DDR.img
once done, zip them up and upload.
or you can also do a full back up: (will provide more information to me)
>su
>dd if=/dev/block/mmcblk0 of=/sdcard/full_image.img
I would really appreciate this.
Thank you again.
bludotos said:
Thank you for offering this!
I will at least need these partitions:
sdl1: mmcblk0p2
DDR: mmcblk0p3
aboot: mmcblk0p4
rpm: mmcblk0p5
tz: mmcblk0p6
sdi: mmcblk0p7
to extract them, do:
>su
>dd if=/dev/block/mmcblk0p? of=/sdcard/images/???.img
replace "?" with the correct name. ex: dd if=/dev/block/mmcblk0p3 of=/sdcard/images/DDR.img
once done, zip them up and upload.
or you can also do a full back up: (will provide more information to me)
>su
>dd if=/dev/block/mmcblk0 of=/sdcard/full_image.img
I would really appreciate this.
Thank you again.
Click to expand...
Click to collapse
I don't want to curb your enthusiasm, but generating a new singleimage.bin has already been done and tried and it does not work. Singleimage.bin contains 5 partitions: sbl, ddr, aboot, rpm and TZ. We already have a dump of those partitions taken from a Lollipop upgraded Moto G, and I already tried using those partitions to recreate singleimage.bin. It still fails. My guess is the flashing procedure fails even BEFORE trying to flash singleimage.bin, very likely due to incompatible programmer/qboot version.
Camazza said:
I don't want to curb your enthusiasm, but generating a new singleimage.bin has already been done and tried and it does not work. Singleimage.bin contains 5 partitions: sbl, ddr, aboot, rpm and TZ. We already have a dump of those partitions taken from a Lollipop upgraded Moto G, and I already tried using those partitions to recreate singleimage.bin. It still fails. My guess is the flashing procedure fails even BEFORE trying to flash singleimage.bin, very likely due to incompatible programmer/qboot version.
Click to expand...
Click to collapse
aww. been starting to thnk that. although, have you tried using another programmer file? I noticed that it starts to flash the singleimage and then stops due to a "error sending packet". So it passed the HDLC frame validation (maybe programmer_8626 doesnt check HDLC?)
I've been trying every possible combination of programmer/qboot possible with no results. We must wait for a newer qboot/programmer. I know this is sad news, but even I got tired of repetedly trying to do something impossible.
Our only hope, but a very remote one, is for someone much smarter than I am to start listening on the Qualcomm COM port and trying to interpret what's going on, especially what's failing and why. But I guess it's too hard of a job for something we *should* be able to fix in a couple weeks' time.
EDIT:
Here's what the debug of qboot reports
I - opening device: \\.\COM5
D - \\.\COM5 opened
I - OKAY [ 0.000s]
I - greeting device for command mode
D - Receiving HELLO packet
D - TARGET PROTOCOL INFO:
D - name: sahara
D - version: 2
D - compatible version: 1
D - maximum packet length: 1024
D - mode: Image transfer pending
D - Switching to "Command" mode
D - Sending HELLO_RESP packet
D - Receiving COMMAND_READY packet
I - OKAY [ 0.016s]
I - identifying device
D - Reading device serial number
D - Sending CMD_EXEC packet, cmd=1
D - Receiving CMD_EXEC_RESP packet
D - Reading device id
D - Sending CMD_EXEC packet, cmd=2
D - Receiving CMD_EXEC_RESP packet
D - Reading SBL SV
D - Sending CMD_EXEC packet, cmd=7
D - Receiving CMD_EXEC_RESP packet
I - ...serial = 0x2F4C742
I - ...chip-id = 0x800 (MSM8226)
I - ...chip-rev = 0x0
I - ...sv-sbl = 0x0
I - OKAY [ 0.016s]
I - finding files
I - ...programmer = programmer.mbn
I - ...singleimage = singleimage.bin
I - OKAY [ -0.000s]
I - validating files
I - OKAY [ -0.000s]
I - switching to download mode
D - Sending CMD_SWITCH_MODE packet
I - OKAY [ -0.000s]
I - greeting device for image downloading
D - Receiving HELLO packet
D - TARGET PROTOCOL INFO:
D - name: sahara
D - version: 2
D - compatible version: 1
D - maximum packet length: 1024
D - mode: Image transfer pending
D - Sending HELLO_RESP packet
I - OKAY [ 0.016s]
I - sending programmer
D - Loading file: programmer.mbn
D - Receiving READ_DATA packet
D - Sending 80 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 4096 bytes
D - Receiving READ_DATA packet
D - Sending 516 bytes
D - Receiving END_IMAGE_TX packet
D - Sending DONE packet
D - Receiving DONE_RESP packet
I - OKAY [ 0.031s]
I - flashing singleimage
D - Loading file: singleimage.bin
D - Pinging RDL...
D - No data from serial, retrying...
D - No data from serial, retrying...
D - No data read from serial after 2 tries
D - No data from serial, retrying...
D - No data from serial, retrying...
D - No data read from serial after 2 tries
D - \\.\COM5 closed
FAILED (blank-flash:sdl-transfer-image:sdl-hello:invalid HDLC frame)
anyway here you go
tell me if you still need a full image
question then for those who really know how this works. Does programmer.mbn read the HDLC frames? If so this means that generating the singleimage is not so important as modifying the programmer.mbn to accept the singleimage. I read up more on HDLC frames and the issue seems to be that when escaping the 0x7e bits or other bits (the partitions "frame starter/ender") they are invalid. Since it ends so quickly it must be finding an end to a frame too quickly? In which case we really do need to wait for motorola to release androd 5.
bludotos said:
Thank you for offering this!
I will at least need these partitions:
sdl1: mmcblk0p2
DDR: mmcblk0p3
aboot: mmcblk0p4
rpm: mmcblk0p5
tz: mmcblk0p6
sdi: mmcblk0p7
Guys, Its not that I am new but I may not know much. I may be wrong, but I found something in /proc (file called partitions) that shows something about these partitions. I have root browser and was trying to find about these partitions. There are other files also which give some more info. Is it helpful. Please correct me if I am wrong. Thnks.
Click to expand...
Click to collapse
We have partition information. We need programmer.mbn which will write the single image to the phone
I have the same problem. But where can we get the programmer.mbn? Is it included in some OTA files of 5.0.2 or do we have to wait until motorolas secret files leak.
I don't know but maybe the programmer is part of the motoboot.img but I have no idea how to extract it.
Well, if somebody has already modified the singleimage, can you please upload it.
Thought I did. Will upload later today then. The programmer.mbn is a proprietary file and there for needs to be leaked. I checked the motoboot.img and it does not contain it. Upgrades don't process the same s restoring from hardbrick.
Shut up you lier
Don't be over smart. Who has generated singleimage.mbn for bootloader 41.19.
lol @Ahlad be cool , being a newbie in xda doesn't mean he isn't smart , he is trying to get solution for for the issue , try to help him or just skip the thread and move on @bludotos i hope you will find a solution soon , keep trying
There is no solution unless I could get the key to decrypt the (been a while since I had time to work on it) header for each partition. I won't be continuing to work on this due to lack of time. Finishing up my cs degree.
The problem is not generating 'singleimage.bin', it's simply a disk image that's easy enough to generate.
The problem is programmer.mbn which checks the BOOTLOADER version of the phone (before flashing single image), read here for more info.
The solution would be to either wait for an updated programmer.mbn or finding a way come up with a modified programmer.mbn that passes digital signature verification.
tal.aloni said:
The problem is not generating 'singleimage.bin', it's simply a disk image that's easy enough to generate.
The problem is programmer.mbn which checks the BOOTLOADER version of the phone (before flashing single image), read here for more info.
The solution would be to either wait for an updated programmer.mbn or finding a way come up with a modified programmer.mbn that passes digital signature verification.
Click to expand...
Click to collapse
Yeah, what he said. I'm not good with explaining stuff but, that's pretty much what I meant.
Ahlad said:
Don't be over smart. Who has generated singleimage.mbn for bootloader 41.19.
Click to expand...
Click to collapse
where it is? i mean where is the singleimage.mbn???
is there any way to extract these files from a working moto g, if yes please tell me how to do that

Moto E4 (Qualcomm) new september update?

It looks like a new update is out for the Qualcomm, factory unlocked version of the Moto E4. I see the update number as "npqs26.69-27-3" and a description of "Security updates through September 1, 2017".
Anyone know how the update can be applied for those of us that are rooted? Has anyone already performed the update? Any issues to report?
You have to go fully stock to update. Probably will involve wiping the device.
I have the Verizon variant Moto E4, bought from Walmart in $40 deal in August, unlocked from eBay and then it started working for me for my AT&T SIM, yesterday I mistakenly updated the same to NDQ26.69-23-3 and now it is not working for my AT&T Sim. can anyone suggest what to do ? Has anyone run into this issue ?
Update unsuccessful on unlocked and rooted Moto E4 Qualcomm Perry
I have a moto e4 (qualcomm, perry) bought from Amazon (unlocked, no added) and have a CDMA trackfone-verizon sim. Phone is working fine, but the update will not apply. It gives me an error and indicates the update was unsuccessful. The bootloader is unlocked and the phone is rooted.
The issue seems to be the sha1 sum of by boot partition (see last_log below). I downloaded the stock rom for this device from https :// firmware.center/firmware/Motorola/Moto%20E4/Stock/
I believe the right one is PERRY_NPQ26.69-27_cid50_subsidy-DEFAULT_regulatory-XT1768_CFC_CANADA.xml.zip because Settings->About Phone->Build number is "NPQ26.69-27" and cat /proc/cpuinfo indicates "Device: perry". Does anybody else find it frustrating that I cannot get this file directly from motorola?
Inside that zip is a boot.img file. The sha1 sum of that file (computed with openssl sha1 boot.img) is 8f6e5f9814b84c48054bc9fd3df9f91610b85e09, which exactly matches the red text in the log file below. Also the length, 16777216, matches my current boot partition to the byte. I was hoping that simply writing this to the boot partition would fix the issue, but that was a big mistake. I copied the file to the phone and executed:
$ dd if=/dev/block/bootdevice/by-name/boot of=boot.img.orig #to save a backup of the original partition
$ dd if=boot.img of=/dev/block/bootdevice/by-name/boot
this bricked the device and it wouldn't boot. Didn't even make it to the Motorola splash screen. After some digging I was able to use fastboot on my PC to restore the boot.img.orig using:
PC$ fastboot flash:raw boot boot.img.orig
This restored the device to functioning order, but I was still not able to install the update. After this, tried to boot the stock boot image without flashing it using:
PC$ fastboot boot boot.img
This caused it to hang forever at the blue motorola splash screen. Power cycling cleared the issue as expected.
As you probably guessed by now, I am an experienced linux user, but new to android and really don't know what I am doing. @madbat99 suggests that I will have to flash the complete stock rom, wiping the device. I know how to backup, both with a backup app and with twrp, so wiping won't be a huge issue. Does anybody know how to flash a full rom? I am using gentoo linux and have fastboot and adb installed and can communicate with the bootloader, I have just never flashed a phone before. Should I expect to have to relock the bootloader for the update to apply? Afterwords, I am going to have to re-unlock the bootloader, re-root the device and then restore all my backups, correct?
I really want to apply this update due to the large gaping security holes it patches.
The relevant section of /cache/recovery/last_log are: (I bolded what I think is the real error)
[ 1.687300] I:whole-file signature verified against RSA key 0
[ 1.687314] I:verify_file returned 0
[ 1.687376] Installing update...
[ 1.729707] installing gptupgrade updater extensions
[ 1.739414] file_contexts.bin is taken from /file_contexts.bin
[ 1.740818] Mount command parameters gotten in updater script
[ 1.740855] mount point :/oem location: /dev/block/bootdevice/by-name/oem , file system type :ext4
[ 1.741029] secontext for the mount point /oem is ubject_remfs:s0
[ 1.744665] Source: motorola/perry/perry:7.1.1/NPQ26.69-27/31:user/release-keys
[ 1.744695] Target: motorola/perry/perry:7.1.1/NPQS26.69-27-3/3:user/release-keys
[ 1.744704] Verifying current system...
[ 2.115566] contents of partition "/dev/block/bootdevice/by-name/boot" didn't match EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938
[ 2.115605] file "EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938" doesn't have any of expected sha1 sums; checking cache
[ 2.115664] failed to stat "/cache/saved.file": No such file or directory
[ 2.115675] failed to load cache file
[ 2.115687] dump_badfile is failed: EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938 is not present
[ 2.115720] script aborted: E3005: "EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938" has unexpected contents.
[ 2.154752] E:Error in /cache/Blur_Version.26.11.31.perry.retail.en.US.zip
[ 2.154825] (Status 7)
[ 2.187583]
[ 2.209427] W:failed to read uncrypt status: No such file or directory
[ 2.209642] I:/cache/Blur_Version.26.11.31.perry.retail.en.US.zip
[ 2.209652] 0
[ 2.209660] time_total: 1
[ 2.209668] retry: 0
[ 2.209675] target_build: 3
[ 2.209682] source_build: 31
[ 2.209689] error: 3005
[ 2.209699] Installation aborted.
maurerpe said:
I have a moto e4 (qualcomm, perry) bought from Amazon (unlocked, no added) and have a CDMA trackfone-verizon sim. Phone is working fine, but the update will not apply. It gives me an error and indicates the update was unsuccessful. The bootloader is unlocked and the phone is rooted.
The issue seems to be the sha1 sum of by boot partition (see last_log below). I downloaded the stock rom for this device from https :// firmware.center/firmware/Motorola/Moto%20E4/Stock/
I believe the right one is PERRY_NPQ26.69-27_cid50_subsidy-DEFAULT_regulatory-XT1768_CFC_CANADA.xml.zip because Settings->About Phone->Build number is "NPQ26.69-27" and cat /proc/cpuinfo indicates "Device: perry". Does anybody else find it frustrating that I cannot get this file directly from motorola?
Inside that zip is a boot.img file. The sha1 sum of that file (computed with openssl sha1 boot.img) is 8f6e5f9814b84c48054bc9fd3df9f91610b85e09, which exactly matches the red text in the log file below. Also the length, 16777216, matches my current boot partition to the byte. I was hoping that simply writing this to the boot partition would fix the issue, but that was a big mistake. I copied the file to the phone and executed:
$ dd if=/dev/block/bootdevice/by-name/boot of=boot.img.orig #to save a backup of the original partition
$ dd if=boot.img of=/dev/block/bootdevice/by-name/boot
this bricked the device and it wouldn't boot. Didn't even make it to the Motorola splash screen. After some digging I was able to use fastboot on my PC to restore the boot.img.orig using:
PC$ fastboot flash:raw boot boot.img.orig
This restored the device to functioning order, but I was still not able to install the update. After this, tried to boot the stock boot image without flashing it using:
PC$ fastboot boot boot.img
This caused it to hang forever at the blue motorola splash screen. Power cycling cleared the issue as expected.
As you probably guessed by now, I am an experienced linux user, but new to android and really don't know what I am doing. @madbat99 suggests that I will have to flash the complete stock rom, wiping the device. I know how to backup, both with a backup app and with twrp, so wiping won't be a huge issue. Does anybody know how to flash a full rom? I am using gentoo linux and have fastboot and adb installed and can communicate with the bootloader, I have just never flashed a phone before. Should I expect to have to relock the bootloader for the update to apply? Afterwords, I am going to have to re-unlock the bootloader, re-root the device and then restore all my backups, correct?
I really want to apply this update due to the large gaping security holes it patches.
The relevant section of /cache/recovery/last_log are: (I bolded what I think is the real error)
[ 1.687300] I:whole-file signature verified against RSA key 0
[ 1.687314] I:verify_file returned 0
[ 1.687376] Installing update...
[ 1.729707] installing gptupgrade updater extensions
[ 1.739414] file_contexts.bin is taken from /file_contexts.bin
[ 1.740818] Mount command parameters gotten in updater script
[ 1.740855] mount point :/oem location: /dev/block/bootdevice/by-name/oem , file system type :ext4
[ 1.741029] secontext for the mount point /oem is ubject_remfs:s0
[ 1.744665] Source: motorola/perry/perry:7.1.1/NPQ26.69-27/31:user/release-keys
[ 1.744695] Target: motorola/perry/perry:7.1.1/NPQS26.69-27-3/3:user/release-keys
[ 1.744704] Verifying current system...
[ 2.115566] contents of partition "/dev/block/bootdevice/by-name/boot" didn't match EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938
[ 2.115605] file "EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938" doesn't have any of expected sha1 sums; checking cache
[ 2.115664] failed to stat "/cache/saved.file": No such file or directory
[ 2.115675] failed to load cache file
[ 2.115687] dump_badfile is failed: EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938 is not present
[ 2.115720] script aborted: E3005: "EMMC:/dev/block/bootdevice/by-name/boot:16777216:8f6e5f9814b84c48054bc9fd3df9f91610b85e09:16777216:aa4a543db08521bc2bb6860f0d8e463d199db938" has unexpected contents.
[ 2.154752] E:Error in /cache/Blur_Version.26.11.31.perry.retail.en.US.zip
[ 2.154825] (Status 7)
[ 2.187583]
[ 2.209427] W:failed to read uncrypt status: No such file or directory
[ 2.209642] I:/cache/Blur_Version.26.11.31.perry.retail.en.US.zip
[ 2.209652] 0
[ 2.209660] time_total: 1
[ 2.209668] retry: 0
[ 2.209675] target_build: 3
[ 2.209682] source_build: 31
[ 2.209689] error: 3005
[ 2.209699] Installation aborted.
Click to expand...
Click to collapse
I hate to quote a post that long but you cannot install an official update on a rooted device with custom recovery.
If you have the correct firmware for your device, you need to extract it, rename .xml files to .img and flash with fastboot.
But it really needs to be correct firmware. I don't know the correct one for your device.
Might help
---------- Post added at 09:12 PM ---------- Previous post was at 09:00 PM ----------
z82anu said:
I have the Verizon variant Moto E4, bought from Walmart in $40 deal in August, unlocked from eBay and then it started working for me for my AT&T SIM, yesterday I mistakenly updated the same to NDQ26.69-23-3 and now it is not working for my AT&T Sim. can anyone suggest what to do ? Has anyone run into this issue ?
Click to expand...
Click to collapse
i have the verizon variant and updated to this patch back in October when it came out and i'm still using my cricket sim in it with no problems. are you still having the issue?
madbat99 said:
I hate to quote a post that long but you cannot install an official update on a rooted device with custom recovery.
If you have the correct firmware for your device, you need to extract it, rename .xml files to .img and flash with fastboot.
But it really needs to be correct firmware. I don't know the correct one for your device.
Might help
---------- Post added at 09:12 PM ---------- Previous post was at 09:00 PM ----------
Click to expand...
Click to collapse
Thank you @madbat99 . Using this method I was able to flash back to stock and install the update. The update works fine with my tracfone-verizon sim. I am not having the issue reported by @z82anu
To automate the process, I wrote a perl script that parses the servicefile.xml or flashfile.xml, verifies all the steps are valid, verifies that all files exist, verifies the md5 sums, and then executes the appropriate fastboot commands. It can be downloaded from https://github.com/maurerpe/stock-flash Hopefully, this will help other linux users looking to flash back to stock. Should work on window and Mac as well, but I haven't tested it.

[+]RESTOCK - stock restore, repartition, repair and reset, including USB driver fix

RESTOCK is a new Nexus 7 2013 repair and factory reset tool for Windows. The NRT app (Nexus Root Toolkit) is similar but is old, closed-source, unsupported, abandoned, does no eMMC diagnostics and most importantly - it offers no repartitioning. Unlike NRT, Restock is specialized and optimized for Nexus 7'13 only, with streamlined operation and minimal user input.
If fastboot mode is available, then no matter what software problems like bootloops or softbricks are observed, or what custom ROM you had used before - Restock will restore your tablet to original, latest stock image, factory setup in 10 minutes (more time for one-off components download if necessary). Unforeseen issues should be reported in this thread and hopefully will be resolved within 24 hours.
If fastboot mode is not available, try the unbricking guide first.
For hardware issues, check this thread.
FEATURES
supports both flo and deb variants
small app download size (2.5MB)
automatic latest stock image (mob30x) and USB driver download from official google.com locations
robust, reliable USB device detection and driver installation - tested on Windows: XP-32, W7-32/64, W10-64(1809)
eMMC memory test and diagnostics
automatic device unlocking
option of repartition to original factory layout
- precise and reliable for any eMMC size, including 64GB and 128GB mods
- required for repartition scripts which check for original layout and flashing specific custom ROMs like e.g. Ubuntu Touch
- advised for selling in original factory condition and resolving difficult ROM flashing issues and starting from scratch
minimal user interaction and fully scripted auto-processing
the Restock script is open for inspection, corrections and improvements; post your comments and suggestions here
USAGE
download the attached zip file
unzip it
double-click on "restock.bat"
follow the prompts
SAMPLE OUTPUT
Code:
Nexus 7'13 Restock v1 @2019 k23m
SUPPORT - http://bit.ly/2C35sLZ
WARNING - installing factory image will ERASE ALL DATA from the device
Enter device name [flo OR deb]: flo
Downloading USB drivers and the latest factory image.
If not deleted, will not be downloaded again.
-- https://dl-ssl.google.com/android/repository/latest_usb_driver_windows.zip
Resolving dl-ssl.google.com... 74.125.24.190, 74.125.24.91, 74.125.24.93, ...
Connecting to dl-ssl.google.com|74.125.24.190|:443... connected.
WARNING: cannot verify dl-ssl.google.com's certificate, issued by 'CN=GTS CA 1O1,O=Google Trust Services,C=US':
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 8682859 (8.3M) [application/zip]
Saving to: 'latest_usb_driver_windows.zip'
latest_usb_driver_windows.zip 14%[======> ] 1.21M 383KB/s eta 19s
...
-- https://dl.google.com/dl/android/aosp/razor-mob30x-factory-52684dff.zip
Resolving dl.google.com... 172.217.25.46
Connecting to dl.google.com|172.217.25.46|:443... connected.
WARNING: cannot verify dl.google.com's certificate, issued by 'CN=GTS CA 1O1,O=Google Trust Services,C=US':
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 505296115 (482M) [application/zip]
Saving to: 'razor-mob30x-factory-52684dff.zip'
razor-mob30x-factory-52684dff 86%[=============================> ] 417.98M 410KB/s eta 2m 57s
...
1. boot the Nexus in fastboot mode: when OFF press POWER + VOLUME DOWN
2. when in the bootloader menu, connect it to your PC
3. wait a few seconds, then...
Press any key to continue . . .
...
...
INFO: Successfull installation of 'd:\restock\data\usb_driver\android_winusb.inf'.
INFO: Returning with code 0x1
Device not found...
1. disconnect it from PC
2. reboot to bootloader again
3. reconnect it to PC
Press any key to continue . . .
Verify...
eMMC test...
If it freezes here, the chip is faulty and needs replacement.
eMMC OK
Lock status...
GPT...
Partitions had been changed.
Restore original partitions? [y/n]: y
Wait...
sending 'bootloader' (3911 KB)...
OKAY [ 0.141s]
writing 'bootloader'...
OKAY [ 1.518s]
finished. total time: 1.658s
rebooting into bootloader...
OKAY [ -0.000s]
finished. total time: 0.008s
Wait...
sending 'gpt' (35 KB)...
OKAY [ 0.016s]
writing 'gpt'...
OKAY [ 0.109s]
finished. total time: 0.141s
rebooting into bootloader...
OKAY [ -0.000s]
finished. total time: 0.012s
If error, copy and post it, include restock.log
http://bit.ly/2C35sLZ
Note: Android flash takes 2 minutes, initial boot takes 7 minutes.
Press any key to continue . . .
sending 'bootloader' (3915 KB)...
OKAY [ 0.125s]
writing 'bootloader'...
OKAY [ 1.377s]
finished. total time: 1.502s
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.007s
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: FLO-04.08
Baseband Version.....: none
Serial Number........: xxxxxxxxx
--------------------------------------------
checking product...
OKAY [ 0.016s]
checking version-bootloader...
OKAY [ 0.000s]
sending 'boot' (7422 KB)...
OKAY [ 0.234s]
writing 'boot'...
OKAY [ 1.000s]
sending 'recovery' (8166 KB)...
OKAY [ 0.266s]
writing 'recovery'...
OKAY [ 0.328s]
erasing 'system'...
OKAY [ 1.143s]
sending 'system' (843549 KB)...
OKAY [ 26.516s]
writing 'system'...
OKAY [ 39.986s]
erasing 'userdata'...
OKAY [ 23.750s]
formatting 'userdata' partition...
Creating filesystem with parameters:
Size: 28856791040
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 7045115
Block groups: 215
Reserved block group size: 1024
Created filesystem with 11/1761280 inodes and 154578/7045115 blocks
sending 'userdata' (139085 KB)...
writing 'userdata'...
OKAY [ 12.434s]
erasing 'cache'...
OKAY [ 0.437s]
formatting 'cache' partition...
Creating filesystem with parameters:
Size: 587202560
Block size: 4096
Blocks per group: 32768
Inodes per group: 7168
Inode size: 256
Journal blocks: 2240
Label:
Blocks: 143360
Block groups: 5
Reserved block group size: 39
Created filesystem with 11/35840 inodes and 4616/143360 blocks
sending 'cache' (10984 KB)...
writing 'cache'...
OKAY [ 0.891s]
rebooting...
finished. total time: 107.057s
Press any key to exit...
RESTOCK 2
SCRIPTS
restock.bat - the main script: stock install, repair, repartition and factory reset
addons.bat - install TWRP custom recovery, mob30x-fix1, root/Magisk, ElementalX-N7-6.17 kernel
fstrim.bat - faster eMMC writes: dispatches TRIM command for all unused filesystem blocks
safe-unlock.bat - unlock without data loss
getlog.bat - diagnostics #1
relog.bat - diagnostics #2
ADDONS
These addons should be installed immediately after RESTOCK and before Android setup:
TWRP deb/flo custom recovery (it must be flashed before the other addon options)
MOB30X-FIX1 - improved Android 6.0.1 stock MOB30X installation, info: https://forum.xda-developers.com/showthread.php?t=4021757 In short, it adds WiFi 'Skip' setup option and removes old GApps to increase space on the system partition
root/Magisk - https://github.com/topjohnwu/Magisk
ElementalX-N7-6.17 custom kernel - I recommend to preset "doubletap2wake" and "battery life extender". For car use also preset "USB OTG + charge mode", info: https://forum.xda-developers.com/showthread.php?t=2389022
ERRORS
If you see errors, copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.
FSTRIM
For optimal eMMC performance run fstrim.bat from time to time.
SAFE UNLOCK
Unlock your device without data loss. MiFlash is described in the Unbricking Guide:
https://forum.xda-developers.com/showpost.php?p=75360854&postcount=199
Do not proceed unless you have read the unbricking guide and downloaded all components.
OPTIONS
Try mob30x-fix1 for improved Android 6.0.1 stock installation.
Next consider CROSS : 1-click installation of secure, up-to-date Android 7-to-11 custom ROMs, including TWRP, repartition, root, etc. as easily as RESTOCK.
NOTE
If Android is stuck on boot logo, with TWRP flash k23m-persist-fix2.zip
Did not even realize this was new! Thanks for making such a wonderfull tool! Currently using it to flash flo, and it works great!
Will install lineage after this tho
Code:
1. boot the Nexus in fastboot mode: when OFF press POWER + VOLUME DOWN
2. when in the bootloader menu, connect it to your PC
3. wait a few seconds, then...
Press any key to continue . . .
Verify...
eMMC test...
If it freezes here, the chip is faulty and needs replacement.
eMMC OK
Lock status...
GPT...
If error, copy and post it, include restock.log
[url]http://bit.ly/2C35sLZ[/url]
Note: Android flash takes 2 minutes, initial boot takes 7 minutes.
Press any key to continue . . .
sending 'bootloader' (3915 KB)...
OKAY [ 0.131s]
writing 'bootloader'...
OKAY [ 1.581s]
finished. total time: 1.719s
rebooting into bootloader...
OKAY [ 0.009s]
finished. total time: 0.014s
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: FLO-04.08
Baseband Version.....: none
Serial Number........: 07206d7c
--------------------------------------------
checking product...
OKAY [ 0.003s]
checking version-bootloader...
OKAY [ 0.004s]
sending 'boot' (7422 KB)...
OKAY [ 0.239s]
writing 'boot'...
OKAY [ 0.397s]
sending 'recovery' (8166 KB)...
OKAY [ 0.265s]
writing 'recovery'...
OKAY [ 0.448s]
erasing 'system'...
OKAY [ 0.743s]
sending 'system' (843549 KB)...
OKAY [ 26.422s]
writing 'system'...
OKAY [ 51.719s]
erasing 'userdata'...
OKAY [ 9.570s]
formatting 'userdata' partition...
Creating filesystem with parameters:
Size: 13342060544
Block size: 4096
Blocks per group: 32768
Inodes per group: 8144
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 3257339
Block groups: 100
Reserved block group size: 799
Created filesystem with 11/814400 inodes and 91881/3257339 blocks
sending 'userdata' (137198 KB)...
writing 'userdata'...
OKAY [ 12.298s]
erasing 'cache'...
OKAY [ 0.051s]
formatting 'cache' partition...
Creating filesystem with parameters:
Size: 587202560
Block size: 4096
Blocks per group: 32768
Inodes per group: 7168
Inode size: 256
Journal blocks: 2240
Label:
Blocks: 143360
Block groups: 5
Reserved block group size: 39
Created filesystem with 11/35840 inodes and 4616/143360 blocks
sending 'cache' (10984 KB)...
writing 'cache'...
OKAY [ 1.029s]
rebooting...
finished. total time: 103.239s
Press any key to exit...
Dang that was timely.
It's a big hammer for what could sometimes be a small problem but it works quickly and perfectly. The alternative is pulling hair out for hours while trying to find the easy fix.
Thanks for sharing.
wow my nexus 7 was in boot loop and i had an old NRT tool which wouldnt work at all.
computer wouldnt detect next 7 2013 thru usb cable
cannot mount usb-otg in TWRP
boot loop in custom rom
your tool fixed it so fast and easy.
THANKS SO MUCH FOR YOUR TOOL!!!
Thanks for this k23m although I hope to never have to use it. My Kingston equipped Nexus 7 is still going strong and it's my most used android device. If I run the emmc memory test and diagnostics would it tell me if the emmc is about to die and determine its overall wear and health?
Tmzdroid said:
Thanks for this k23m although I hope to never have to use it. My Kingston equipped Nexus 7 is still going strong and it's my most used android device. If I run the emmc memory test and diagnostics would it tell me if the emmc is about to die and determine its overall wear and health?
Click to expand...
Click to collapse
Hello Tmzdroid, your Kingston was from a newer production batch and probably is OK but maybe do not try any major OS/ROM changes as this most recent case demonstrates. The eMMC generation used in N7 has no "SMART" flash wear diagnostics like in SSD. This feature was introduced in eMMC v5+. Restock can identify Kingston if it has standard partitions and checks for the terminal, most common, read-only condition Kingstons suffer from. In short, the test can not indicate eMMC degradation level. The only forewarning you may get is a period of slow-downs prior to going read-only. If you feel it is happening, do fastboot format cache and if it takes longer than 2 seconds, it is almost the end and time to get your data out of the tablet, while you still can.
:highfive:
Thank you for this! It fixed my deb model <3
I'm getting "Incorrect device" trying to use Restock to recover from flo-deb_clamor_repartition. It's definitely flo, I am looking at the bootloader right now. fastboot format cache completes in 0.086 seconds. flo 32G, rev_e, bootloader FLO-04.08, no carrier, secure boot enabled, lock state unlocked.
edit: got going again with https://forum.xda-developers.com/showthread.php?t=2381582
AiRMaX-360 said:
Thank you for this! It fixed my deb model <3
Click to expand...
Click to collapse
Thank you for confirming that it works on deb. I have 3 flo's but no deb to test.
drinkypoo said:
I'm getting "Incorrect device" trying to use Restock to recover from flo-deb_clamor_repartition. It's definitely flo, I am looking at the bootloader right now. fastboot format cache completes in 0.086 seconds. flo 32G, rev_e, bootloader FLO-04.08, no carrier, secure boot enabled, lock state unlocked. edit: got going again with https://forum.xda-developers.com/showthread.php?t=2381582
Click to expand...
Click to collapse
Would you be able to post a log from the attached script? Unzip and run it in Restock's folder.
:fingers-crossed:
k23m said:
Would you be able to post a log from the attached script? Unzip and run it in Restock's folder.
:fingers-crossed:
Click to expand...
Click to collapse
Strangely, it won't run unless I run as administrator. I double-click it and nothing happens. If I run as administrator then it runs in c:\windows\system32 and doesn't list the contents of the directory you want... I even tried moving restock's folder into my user dir instead of under downloads just in case something about the path was causing problems. No idea WTF that is about. Perms look good. I went ahead and just ran the commands manually from a CMD shell in the proper directory, looks like they produced the output you were looking for... except the find command doesn't work there. Maybe it would work in command.com, dunno.
I'm not sure how much help this will be since I used other tools since trying to use restock, but here it is anyway.
drinkypoo said:
Strangely, it won't run unless I run as administrator. I double-click it and nothing happens. If I run as administrator then it runs in c:\windows\system32 and doesn't list the contents of the directory you want... I even tried moving restock's folder into my user dir instead of under downloads just in case something about the path was causing problems. No idea WTF that is about. Perms look good. I went ahead and just ran the commands manually from a CMD shell in the proper directory, looks like they produced the output you were looking for... except the find command doesn't work there. Maybe it would work in command.com, dunno. I'm not sure how much help this will be since I used other tools since trying to use restock, but here it is anyway.
Click to expand...
Click to collapse
It seems your Path env exceeds the limit:
Code:
Path=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\WinAVR-20100110\bin;C:\WinAVR-20100110\utils\bin;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\PuTTY;C:\Programs\Argyll_V1.7.0\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\GitExtensions\;C:\Program Files\Git\cmd;C:\Windows;C:\ProgramData\ComposerSetup\bin;C:\Program Files\Calibre2\;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Users\drink\AppData\Local\Android\Sdk\platform-tools;C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\bin;C:\Users\drink\AppData\Local\Android\Sdk\platform-tools;C:\Program Files (x86)\Nmap;C:\Programs\ffmpeg-20190208\bin;C:\Program Files (x86)\Atmel\Flip 3.4.7\bin;c:\programs\fastboot;C:\programs;"%~dp0data"
My path has only:
Code:
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
Please do:
Edit the path - Control Panel / System / Advanced System Settings / Advanced tab / Environment Variables button / in System Variables select Path / click Edit
copy original and save for reuse later
replace it with: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
save
reboot
run Restock
It should work now. As your N7 is already fixed, just close the window when it stops at "Note: Android flash takes 2 minutes, initial boot takes 7 minutes" and nothing will be flashed. Also, don't go ahead with "Restore original partitions? [y/n]" if it is offered.
If it still does not work, login to Windows with an admin account and then run Restock.
k23m said:
It seems your Path env exceeds the limit:
Click to expand...
Click to collapse
Sigh. Windows is garbage in so many ways.
I was just thinking I want to restore my Nexus back to 100% stock, and magically this recent thread appears. Worked perfectly. Thank you.
Strangely, only custom ROMs are working for me. I always get bootloop whenever I flash any of the razor Nexus Factory Images. I also tried the script you provided and finishes successfully, but when booting, it always end in bootloop with Google logo on it. I have access to fastboot and even can flash and boot to TWRP with no problemas. Any idea?
EDIT: Attached logs after re-running the script
bamsbamx said:
Strangely, only custom ROMs are working for me. I always get bootloop whenever I flash any of the razor Nexus Factory Images. I also tried the script you provided and finishes successfully, but when booting, it always end in bootloop with Google logo on it. I have access to fastboot and even can flash and boot to TWRP with no problemas. Any idea?
EDIT: Attached logs after re-running the script
Click to expand...
Click to collapse
It is a very interesting case. We need internal logs, please 'install' get-logs-sdcard.zip in TWRP, find 'logs.tgz' in the root of internal storage and post it here.
k23m said:
It is a very interesting case. We need internal logs, please 'install' get-logs-sdcard.zip in TWRP, find 'logs.tgz' in the root of internal storage and post it here.
Click to expand...
Click to collapse
Thanks for the quick reply, here I attach the logs... Seems like the /persist partition is empty, maybe thats the cause of the problem?
However, I can understand why that happened, maybe because I used the /system partition script for increasing its size...
EDIT: Somehow the XDA file uploader says invalid file for .tgz format, I recompressed the folder to a .zip file
bamsbamx said:
Thanks for the quick reply, here I attach the logs... Seems like the /persist partition is empty, maybe thats the cause of the problem?
However, I can understand why that happened, maybe because I used the /system partition script for increasing its size...
EDIT: Somehow the XDA file uploader says invalid file for .tgz format, I recompressed the folder to a .zip file
Click to expand...
Click to collapse
The 'persist' partition is not empty, you can see its contents in the log's 'ls_persist' file, but its SELinux contexts appear incorrect. Try this:
in TWRP backup your original 'persist' with the attached p4-backup-int.zip
go to my old post here, get those files and restore my 'persist' partition
boot stock ROM
:fingers-crossed:
k23m said:
The 'persist' partition is not empty, you can see its contents in the log's 'ls_persist' file, but its SELinux contexts appear incorrect. Try this:
in TWRP backup your original 'persist' with the attached p4-backup-int.zip
go to my old post here, get those files and restore my 'persist' partition
boot stock ROM
:fingers-crossed:
Click to expand...
Click to collapse
Still no luck. I have re-run the get-logs script and some file permissions have changed in le_persist (checked with a diff comparer), as well as new file called settings. Flashed factory image MOB30X and bootloop, then flash UnLegacy rom android 8.1.0 and boots with no problem. Cant understand what is happening... Maybe it is possible to use UART debugging to get some logs?
EDIT: Attached the new logs
bamsbamx said:
Still no luck. I have re-run the get-logs script and some file permissions have changed in le_persist (checked with a diff comparer), as well as new file called settings. Flashed factory image MOB30X and bootloop, then flash UnLegacy rom android 8.1.0 and boots with no problem. Cant understand what is happening... Maybe it is possible to use UART debugging to get some logs?
EDIT: Attached the new logs
Click to expand...
Click to collapse
This new log is much better. The timing was right and it had captured 'last_kmsg' with mob30x bootloop log, note:
Code:
[ 4.865234] init: Starting service 'logd'...
[ 4.873748] EXT4-fs error (device mmcblk0p23): ext4_mb_generate_buddy:741: group 1, 32282 clusters in bitmap, 32356 in gd
[ 4.873962] Aborting journal on device mmcblk0p23-8.
[ 4.874664] Kernel panic - not syncing: EXT4-fs (device mmcblk0p23): panic forced after error
...
[ 7.987304] Rebooting in 5 seconds..
[ 12.994476] Going down for restart now
[ 12.994628] in panic
It can't use mmcblk0p23 - the cache partition, and has to restart. New custom ROMs no longer use the cache partition and that's why they work. For comparison here is my 'last_kmsg' with mob30x...
Code:
[ 7.072235] EXT4-fs (mmcblk0p23): recovery complete
[ 7.077087] EXT4-fs (mmcblk0p23): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
[ 7.086883] fs_mgr: check_fs(): mount(/dev/block/platform/msm_sdcc.1/by-name/cache,/cache,ext4)=0: Success
[ 7.162567] fs_mgr: check_fs(): unmount(/cache) succeeded
[ 7.171722] fs_mgr: Running /system/bin/e2fsck on /dev/block/platform/msm_sdcc.1/by-name/cache
[ 7.264678] e2fsck: e2fsck 1.42.9 (28-Dec-2013)
[ 7.269744] e2fsck: /dev/block/platform/msm_sdcc.1/by-name/cache: clean, 23/35840 files, 4726/143360 blocks
[ 7.285522] EXT4-fs (mmcblk0p23): mounted filesystem with ordered data mode. Opts: barrier=1,data=ordered,nomblk_io_submit,errors=panic
[ 7.296874] fs_mgr: __mount(source=/dev/block/platform/msm_sdcc.1/by-name/cache,target=/cache,type=ext4)=0
...
[ 8.289031] init: Starting service 'logd'...
[ 8.302368] SELinux: Context u:object_r:cache_recovery_file:s0 is not valid (left unmapped).
[ 8.312286] SELinux: Context u:object_r:cache_private_backup_file:s0 is not valid (left unmapped).
[ 8.342254] init: (Loading properties from /system/build.prop took 0.01s.)
[ 8.348266] init: (Loading properties from /vendor/build.prop took 0.00s.)
[ 8.355133] init: (Loading properties from /factory/factory.prop took 0.00s.)
[ 8.369842] init: Starting service 'vold'...
[ 8.373321] logd.auditd: start
Run fastboot format cache and compare it to the 'sample output' from the first post.
There may be a partial eMMC hardware fault affecting the cache partition.
If you wish to investigate it with UART, please check my post on the subject.
:highfive:
k23m said:
This new log is much better. The timing was right and it had captured 'last_kmsg' with mob30x bootloop log, note:
Code:
[ 4.865234] init: Starting service 'logd'...
[ 4.873748] EXT4-fs error (device mmcblk0p23): ext4_mb_generate_buddy:741: group 1, 32282 clusters in bitmap, 32356 in gd
[ 4.873962] Aborting journal on device mmcblk0p23-8.
[ 4.874664] Kernel panic - not syncing: EXT4-fs (device mmcblk0p23): panic forced after error
...
[ 7.987304] Rebooting in 5 seconds..
[ 12.994476] Going down for restart now
[ 12.994628] in panic
It can't use mmcblk0p23 - the cache partition, and has to restart. New custom ROMs no longer use the cache partition and that's why they work. For comparison here is my 'last_kmsg' with mob30x...
Code:
[ 7.072235] EXT4-fs (mmcblk0p23): recovery complete
[ 7.077087] EXT4-fs (mmcblk0p23): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
[ 7.086883] fs_mgr: check_fs(): mount(/dev/block/platform/msm_sdcc.1/by-name/cache,/cache,ext4)=0: Success
[ 7.162567] fs_mgr: check_fs(): unmount(/cache) succeeded
[ 7.171722] fs_mgr: Running /system/bin/e2fsck on /dev/block/platform/msm_sdcc.1/by-name/cache
[ 7.264678] e2fsck: e2fsck 1.42.9 (28-Dec-2013)
[ 7.269744] e2fsck: /dev/block/platform/msm_sdcc.1/by-name/cache: clean, 23/35840 files, 4726/143360 blocks
[ 7.285522] EXT4-fs (mmcblk0p23): mounted filesystem with ordered data mode. Opts: barrier=1,data=ordered,nomblk_io_submit,errors=panic
[ 7.296874] fs_mgr: __mount(source=/dev/block/platform/msm_sdcc.1/by-name/cache,target=/cache,type=ext4)=0
...
[ 8.289031] init: Starting service 'logd'...
[ 8.302368] SELinux: Context u:object_r:cache_recovery_file:s0 is not valid (left unmapped).
[ 8.312286] SELinux: Context u:object_r:cache_private_backup_file:s0 is not valid (left unmapped).
[ 8.342254] init: (Loading properties from /system/build.prop took 0.01s.)
[ 8.348266] init: (Loading properties from /vendor/build.prop took 0.00s.)
[ 8.355133] init: (Loading properties from /factory/factory.prop took 0.00s.)
[ 8.369842] init: Starting service 'vold'...
[ 8.373321] logd.auditd: start
Run fastboot format cache and compare it to the 'sample output' from the first post.
There may be a partial eMMC hardware fault affecting the cache partition.
If you wish to investigate it with UART, please check my post on the subject.
:highfive:
Click to expand...
Click to collapse
Yeah, I had the idea of checking last_kmsg just after my previous post. Saw that mounting mmcblk0p30 was causing kernel panic. Ran TWRP Format Cache and err well... Bootloop was now in the boot animation (maybe I had to reflash factory image, which I didnt). Didnt see about mmcblk0p24, will format cache and post feedback. Thank you!
:highfive:

Categories

Resources