yashsingh1/xdaforums huggingface dataset:
[G4 Android Development] steadfasterX:
Very Nice :good: :D thx for sharing! :highfive: maybe write down the command instead of a screenshot :rolleyes: but anyways I'm glad it works for you

Lol.. Yes I thought something like this must have happened :p you're the first one otherwise ;) but [MENTION=6302635]sdembiske[/MENTION] is doing a great job as well! I'm just happy to have such heavy testers like you both and ppl like [MENTION=5178091]alitavas[/MENTION] sharing their knowledge ;)

.
[G4 Android Development] sdembiske:
Hmm ... the H812 will simply not accept the exFAT format on my 32GB SanDisk class 10 card. Indicates blank SD or unsupported file system, no matter how many times I reformat in exFAT using 2 different methods (MiniTool Partition Wizard and Windows). Back to FAT32 for now (reads it right away) ... Let's me out I'm afraid for any further testing at this point.
[G4 Android Development] steadfasterX:
Oh hm I saw several posts of ppl that they loosing exfat support after rooting the device. But that makes no sense to me tbh because rooting on locked devices will not change the kernel?! Strange.. So ext4 may work then?
[G4 Android Development] sdembiske:
ext4 was read no problem, just not exFAT.

Re: Version 4 - Tried a backup (without system image checked) and it went ok - just tried to restore and it failed with Failed to mount '/system' (Device or resource busy). Here's whats interesting - I mounted system both before doing the backup and again before doing the restore. Now soft bricked - didn't get the restore log while in TWRP - so will refurbish and pull the logs later. :(
[G4 Android Development] steadfasterX:
So just to be clear: you soft bricked it by restoring the system image or by restoring a usual system backup?

.
[G4 Android Development] sdembiske:
Usual system backup. Backup without system image checked and restore of that backup. Corrected my previous post - backup went OK, restore failed.
[G4 Android Development] steadfasterX:
ok thats bad. without a recovery.log hard to say what has happened..

once restored to a working device you should do a system image backup again and put it to an ext4 formatted partition.

that way you could recover more easily from a soft brick then.

or instead you could also just use the exfat one u have and use MTP to pull it directly after the backup (while still in TWRP) from your device.

The image backup should be the more resistent method to backup&restore thats y I added it. The only caveat is that the external sdcard has to be formatted with either ext4 or exfat then but its the best method due to the FIsH hack we use here.

Btw

When you receive a restore error I would recommend to try it again without system checked. Maybe that helps I'm not sure though..

.
[G4 Android Development] sdembiske:
I have already formatted the SD card back to FAT32 and in order to backup a system image to ext4, I would have to expand my ext4 partition to provide enough room for the backup but ... how would I direct the system image backup to just the ext4 partition, let alone pull it so I could put it on my Windows laptop to be able to put it back on the SD card? Not sure that would work.

I'm going to leave it for a bit as I've re-installed a prior TWRP-in-FiSH version. I've always had to check the system partition before restoring in every other version - if I didn't, it soft bricked. I believe Rees86 with his H812 commented on that with V3 Beta5 as well as it threw up errors when he didn't. Have you changed anything in this regard with V4?

Questions: Maybe a dumb one, but would enabling "compression" in TWRP-in-FiSH, allow backing up the system image over 4GB to the FAT32 partition? Also, why is it , that using the Send_Command.exe \\.\COM from LG Root in Recovery mode, I can take a copy of the rooted system image in internal memory that is over 4GB?
[G4 Android Development] ReeS86:
I'm running a backup now - here's a question for you though, did you have to un-check mount system as read-only before it would allow you to mount the system. I had a similar issue on a previous version of TWRP-in-FIsH that seems to have returned where /system could not be mounted with the read-only option enabled. It mounts just fine with it un-checked though.
[G4 Android Development] sdembiske:
I didn't have it as mounted read only .. have never done that. I had no problem with the backup, or mounting system, just the restore.
[G4 Android Development] ReeS86:
So I tried to restore a normal backup and it seems the system partition was formatted OK but wasn't able to mount afterwards. I copied the logs using the menu system in TWRP and I'll post them once I get my phone back up and running. This was after creating a system image failed however due to filesize (will have to check the format of my SD card, thought it was EXFAT.)

EDIT: on the bright side since it was just the system partition I was able to use LGUP on the 'UPGRADE' setting to restore without losing any data. The recover.log is attached - I also have the kernel dmesg.log if it's helpful.

EDIT-2: Ok so just see see if the backup worked I re-installed TWRP-in-FIsH version 3 and it seems that the backup from version 4 can be restored, so no issues with the backup procedure in Ver. 4. I noticed though that the terminal description is different when resoring (see below).

TWRP-in-FIsH version 4: indicates formatting system as ext4, then has issues remounting.

TWRP-in-FIsH version 3: indicates "Removing all files under '/system'

EDIT-3: After some more digging I noticed there is an option in TWRP which is "Use rm -rf instead of formatting". I think this may be the difference between version 3 and version 4 for me. I'll try to restore again tomorrow with this option enabled if I have time.
[G4 Android Development] sdembiske:
Great point about the ext4 partition mounting and the LGUP on the upgrade setting. After my restored fail with V4, nothing but problems remounting the ext4 partition on boot. BUT, even more interesting, the ext4 partition mounting on boot has continued to be an issue after I reformatted from exFAT to FAT32, even after reformatting the ext4 partition, when an earlier version of TWRP-in-FiSH has been used to create a backup, only. Very strange ...

Great point about being able to restore with V4 from a previous version - I thought the ext4 mount problem on boot was a failing SD card or an app corruption.
[G4 Android Development] sdembiske:
OK- reinstalled V4.1 and ran a backup and restore (without disk image checked) - No problems with either but ... still getting an issue on rebooting from TWRP with ext4 not being mounted - Link2SD Plus keeps asking to recreate the mount script and after re-creating and a Quick Boot seems to get it operational again. I'm reformatting the ext4 partition again and will see if it makes any difference.

I backed up the system image (only) to my Internal memory with no issues. However, before I attempt a restore, does everything have to be checked for the backup and restore, excluding the regular system partition or, will the system image alone restore it all anyway? Just want to be clear on this - Thanks.
[G4 Android Development] steadfasterX:
I hope you meant you re-installed v4.1 right? ;)

I'm sorry but I dunno link2sd as I do not use it so I have no idea what that mount script is and where it is placed normally.. If link2sd creates a file in /system it would be nice to see how it looks

before

a restore and

afterwards

..

If you select the system image on restore you do not need to select the usual system restore. Only one of both are required and both restore only the system (so your Android ROM) only without anything else. Restoring the system image is generally more bullet proof bc it will just dd copy the whole partition while a usual restore use copy commands on that brutally mounted system partition which could fail (haven't seen it yet but maaaaybe it is your problem with link2sd - so if you restore the system image and lin2sd is just working then it is related).

If you want to restore your data partition or boot or recovery etc you have to select those as well.

Thanks to [MENTION=1258758]ReeS86[/MENTION] we now have the installer modified to run without any PC. That means you can install TWRP-in-FIsH from within Android!

https://github.com/Carbon-Fusion/android_FIsH/pull/3

It would be nice if you could give him a thx click (here) for his contribution :) !

I will integrate the already merged code in the upcoming

v4.2

release as well.

.
[G4 Android Development] sdembiske:
Yes, meant 4.1 Ok - Thanks - that's what I thought but I wanted to double check first.
[G4 Android Development] steadfasterX:
PRE-Release of TWRP-in-FIsH v4 (4.2)

This version is based on/includes:

FIsH v3.1 changelog: previously used version <---> this version

TWRP-in-FIsH device tree changelog: previously used version <---> this version

TWRP changelog: v3.1.1-0

Summary:

Fixed the restore issue in PRE-Release of TWRP-in-FIsH v4

Identical FisHFOOD / TWRP file as in PRE-Release of TWRP-in-FIsH v4.1

Installer is now able to detect and run from within Android* (read the NOTES!)

Everything

is better now ;)

(.... TWRP updated, many FIsH improvements, added an option to backup /system as image,... read the above changelogs!)

Please find the new pre-release version attached to this post. You have to rename the file extension to ".tar.gz" sorry for this but XDA is crazy about uploading a tar.gz file.. :confused: :eek:

NOTES:

Thanks to [MENTION=1258758]ReeS86[/MENTION] we now have the installer modified to run without any PC. That means you can install TWRP-in-FIsH from within Android!

It would be nice if you could give him a thx click (here) for his contribution :) !

Bring TWRP-in-FIsH to your Android device

Example-1

with any PC (windows, linux, ...): adb push TWRP-in-FIsH.tgz /sdcard (replace TWRP-in-FIsH.tgz this with the real file name)

Example-2

if you have busybox installed (within an Android Terminal):

cd /sdcard

wget http://full-URL-to-file (replace full-URL-to-file with the real direct download link)

Example-3

with just a browser: well just download it.. ;) but remember where it was saved!

extract it

Example from within Android Terminal:

cd /sdcard (or the folder where you have downloaded TWRP-in-FIsH)

tar xzf TWRP-in-FIsH.tgz (replace TWRP-in-FIsH.tgz this with the real file name)

run the installer (but do it correctly)

Example from within Android Terminal:

su

sh ./install.sh (using

sh

is absolutely important otherwise it will fail)

done

.
[G4 Android Development] sdembiske:
OK - successful restore accomplished with V4.1 of a complete backup with system image checked (not usual system restore), from Internal memory due to file size restriction with FAT32 formatting. All good! After booting up the Link2SD issue with ext4 appeared again but after a minute or two following a fresh re-boot seemed to disappear after simply canceling the recreate mount script/Quick Reboot option when it threw up the warning about the ext4 partition not being mounted. May just be a delay in getting SuperSU root access? Not sure, but it keeps surfacing after going into TWRP-in-FiSH and rebooting system.

Link2SD info Link: https://gist.github.com/sdembis/ef6fb26ded52346cb4210a102c0568b1

Don't know if anything there will help.
[G4 Android Development] steadfasterX:
nice! thx for testing again!! :)

Could you also make a backup & restore with a usual system backup? It should work as well but just to be sure that I can release that build...

hm strange with the link2sd. something in the app seems to be fooled.. maybe you can ask the developer of that app why that happens and what can be done to avoid it. or maybe its a known "issue"..

.
[G4 Android Development] sdembiske:
Already done successfully, it was the first thing I did - see post #316.

Since the issue only appeared after installing V4 and then reformatting the SD card to exFAT before returning it to Fat32 and has persisted, I'm not sure that it is an issue with Link2SD as there has been no updates to the app and I have never had it occur before. It continues to throw up the error about the 2nd partition not being mounted after boot with the apps that are linked to the SD card, not visible to the system then. A quick reboot seems to solve it temporarily but then it recurs on a full reboot or power down and back up.

Addendum

:

The issue only appears after booting into TWRP-in-FiSH. Recreating the mount scripts, followed by a couple of Quick Reboots appears to take care of the issue, until the next time I reload TWRP-in-FiSH V4.1. It had never appeared before in prior versions, so I suspect there has been another minor change somewhere in TWRP-in-FiSH V4 and 4.1. Have you run a 'difference' program to see if any other changes might have been done or occurred that might cause this issue? Thanks.
[G4 Android Development] steadfasterX:
Sure there is always a diff. For this we have github:

Click on the FIsH changelog in https://xdaforums.com/g4/development/locked-twrpinfish-locked-g4-devices-t3573048/post72731413

Plus it includes a new TWRP version ofc..!

I still don't have an idea what happens there.. That's why I mentioned to ask the app dev. Not because I think he made something wrong but to understand what and why it happens..

.
[G4 Android Development] sdembiske:
OK - no problem. Never clicked on the changelog links - Very Cool with the differences ability.

I have since reformatted my ext4 partition, deleted the app and all leftover stuff from it in Xplore file manager and re-installed it - no luck as problem re-appeared. Next went into "Settings" > "Apps" and Reset App preferences. Then booted into TWRP-in-FiSH , cleaned the cache and re-booted - problem didn't recur whereas it had before just by booting into it and rebooting after - so it may boil down to simply having to reset the app preferences after the soft brick and re-install of stock and rooted kdz's with data restore from Titanium backup, (fingers crossed, eh?), i.e., it suggests it is not related to your work at all ... so far at least, so good.

Sorry if you pulled any hair out over this - if the problem recurs I will contact the Link2SD developer.:good:
[G4 Android Development] stillsober:
look into FolderMount instead of link2sd, see if problem persist
[G4 Android Development] steadfasterX:
Release of TWRP-in-FIsH v4 (4.2)

(

identical

to the latest pre-release)

Download:

Go to the Downloads tab

Full Changelogs:

FIsH changelog: previously used version <---> this version

TWRP-in-FIsH device tree changelog: previously used version <---> this version

TWRP changelog: v3.1.1-0

Summary

changelog (read the above FULL changelogs for details!):

Installer is now able to detect and run from within Android* (read the NOTES in the OP - topic "Installation (Android / no PC)"!)

Added the option to backup /system as an IMAGE* (read the following HINT!)

Using this new option is a bulletproof method to backup and restore in TWRP-in-FIsH because you have to keep in mind that FIsH is a giant and brutal hack and even when a usual backup & restore is proven to work fine I would recommend to use both backup methods - if you can.

HINT: This method requires an ext4 or exfat partition on your external SD card otherwise image backups will fail due to the file size.
[MENTION=6302635]sdembiske[/MENTION] reports success using the internal storage as target for the backup but if you do this keep in mind that you have to move that backup to your PC manually to ensure you have it by hand for the worst case.

Everything

is better now ;)

(.... TWRP updated, many FIsH improvements, added an option to backup /system as image,... read ALL the above changelogs!)

.
[G4 Android Development] fates13:
Just a heads up that for the install from within android instructions, you're missing a step where you need to change the directory using the command "cd /sdcard/android_FIsH" before running the "sh ./install.sh" command.
[G4 Android Development] steadfasterX:
asbolutely! fixed in OP. thx for pointing :)

.
[G4 Android Development] sdembiske:
Question regarding the backup and restore of the "firmware" version in TWRP-in-FiSH.

Is it specific to the carrier and would it, for example, include the option to have and use the VoLTE option if that carrier's version is known to have it included and be fully functional? The problem ReeS86 and I have run into is that we both have Rogers/Fido original firmware based phones but are not able to get a confirmed Rogers/Fido stock H81210n kdz (my phone came with MM installed - and VoLTE was installed and operational) but when we install the confirmed rooted Rogers/Fido H81210n version, an exFAT formatted SD card is not recognized for whatever reason (I believe it could be when hackarchive's Root_Injection method was used to root that system image, the SD card of the member who did it originally had their SD card formatted in FAT32 or did not have one installed at all - strange, I know but it does seem to be the case). The VoLTE option is present and functioning in that rooted version.

So ... if I do restore the "firmware" only backup from that rooted version that could (?) include VoLTE, would it potentially restore without any problems to the rooted version H81210n that does work with exFAT but does not have VoLTE? If so, what would be the likelihood of success/failure, chances of a hard brick etc., in your opinion? :confused:

Thanks,

S.
[G4 Android Development] steadfasterX:
First of all: Do you have injected root by yourself or (afaiu) do you have used a prepared kdz?

I think u are using an already prepared KDZ so the first thing you should do is injecting the system image on your own.

You know the guide already ;)

If you have no Linux try FWUL ( https://tinyurl.com/FWULatXDA ) ...

strange enough that an exfat sd is not being detected after rooting. The support of the filesystem is handled by the kernel and that will not be touched when rooting in LL. It would break the boot chain..

so it must be either an older / wrong kernel in the kdz you're using or it is a general issue with supersu.

Thats why I would suggest to make the injection by yourself. it may be related and it is the best way to find out where the problem is.

reg. firmware partition: I dont think that your issues/solutions will come from here. The firmware partition contains proprietary stuff needed to communicate with e.g. your modem/radio so it have to fit your model (or one could say: country)

TL;DR

use the system image of the kdz where VoLTE works fine and inject root by yourself.

.
[G4 Android Development] sdembiske:
Thanks. Unfortunately, that is the issue as my phone came with MM installed, not LP. I had to use an already rooted version and and I have not been able to get the confirmed stock LP H81210n Rogers/Fido version I need, anywhere to do the root-injection myself. I was hoping I might be able to reverse-engineer hackarchive's root injection method but I don't have the necessary skills to do it and I'm not sure if using Chainfire's built-in uninstall of root in his app would work with hackarchive's method. I have tested out another carrier's stock same version (without VoLTE) and discovered that if an sd card is not installed when the root-injection method is used, it won't recognize an exFAT formatted card when one is installed after, for whatever reason, so I'm not sure it is entirely a kernel issue but that does make more sense.

On another note, the Link2SD issue of not seeing the 2nd partition mounted at boot, does seem to be related to SuperSU perhaps being slower to grant root to the Link2SD app so the SD card 2nd partition can be read immediately.

Finally, I have not been able with previous versions of TWRP-in-FiSH to restore without first having to mount the "system" partition - with version 4.2, I now can. Big win! No more soft bricks from forgetfulness. Congrats!

Thank you again for all your work here and in exploring the dual boot options. It is, as always, very much appreciated.
[G4 Android Development] steadfasterX:
well u can do backup of your system partition and try the attached unroot script....

I hacked it together in 3 min so no guarantees for nothing

! I haven't looked into what supersu unroot does tbh.

It is based on the autoroot script of hackarchive's root injection - just by reverting the stuff made.

Bc i haven't double checked or even tested it there are high chances that this may soft brick things but changes are made in the system image only!

Besides that and I say it just for sure and for others may reading this: removing root means

disabling TWRP-in-FIsH

!

That means you have to re-root again (will means reflashing prerooted-STOCK + install TWRP-in-FIsH) before u can restore anything..

Usage:

download the script and extract it

boot into TWRP

copy script to your device (e.g. adb push revert_root_injection.sh /external_sd/ )

mount

system

and external sd

exec the script (eg. adb shell "/bin/sh /external_sd/revert_root_injection.sh")

-> if the exec doesnt work this way you may have to move it first to /tmp

reboot.. and keep thumbs pressed that it boots ..

If the sdcard will be detected afterwards it is supersu related..

.
[G4 Android Development] Folloxme:
Can I install dirty unicorn or cm with this hack?
[G4 Android Development] sdembiske:
Thank you so much! Really appreciate it. Will give it a shot and report back.

PS: I seem to live for soft bricks, lately ... LOL.

Best,

S.
[G4 Android Development] steadfasterX:
lol :) good luck!

Really READ THE OP. At least

Limitations

.
[G4 Android Development] sdembiske:
As much as I'd love to report success, the script resulted in a 'soft brick' (I'm thinking of changing my middle name to it ... lol). TWRP froze up after the script executed and I had to pull the battery - when I tried to reboot I got the initial logo with the blue led but then it went next to a spinning boot-up logo and no further. I'm wondering if it might be better trying it when it's already booted in android?

FYI: This is what I finally had to use to execute the script after trying your suggested commands:

adb shell

cd /external_sd/

sh revert_root_injection.sh

I understood the risk and I very much appreciate your effort to help :)
[G4 Android Development] steadfasterX:
Hm yes we are cutting the branch we are sitting on..i feared that this might happen but I can adapt it so it will work hopefully better. if you like. It would still freeze but at the very end only instead of the beginning..

Did you see any messages on the screen after executing the script?

There is one thing in the root injection which is bad. The injection script normally backups everything before replacing it but there is one file which just get deleted so I'm not sure if the way I revert is correct.

I need this from a complete stock so non rooted device:

ls -la /system/bin/app_process

I believe it is just a symlink to app_process64 but I'm not sure.

If it is NOT a symlink you need that file because it is not backuped!! So pull it from the device when it is not a symlink and I will adapt the revert.

Soo if you want to change your FIRST name to soft brick just gimme the above and a hint and I will prepare your next soft brick ;)

I would also add a log option to the external sd as well to see what happens.

Happy bricking ;)

.
[G4 Android Development] sdembiske:
The script executed from what I could tell and I did see the messages you embedded. It appears the freeze happened at the end of the script - TWRP was non-responsive to any tab touches which is why I had to pull the battery as I couldn't exit to reboot. I'm wondering if I should have typed "exit" and entered it after the script ran as it did run in in adb shell? Given that TWRP-in-FiSH was going to be disabled, would it have made any difference?

The only way I could provide the ls -la /system/bin/app_process is from a different carrier version of the same kdz version, i.e., H81210n. I would have to refurbish again but if that would do the trick, how would you suggest I pull it?

The log option would be helpful.

All that said, this is way above and beyond what was expected when I asked the initial question and it is taking up your time, so I have to leave it up to you if you want to do any more on it.

Thanks again for all.