FORUMS
Remove All Ads from XDA

 View Poll Results: Worked?

Yes
 
53 Vote(s)
60.92%
No
 
34 Vote(s)
39.08%

[Module/Tool] [2018.10.9] F2FS Loopback Bug Workaround -- No Kernel Patch Needed

1,451 posts
Thanks Meter: 3,234
 
Post Reply Email Thread
# F2FS Loopback Bug Workaround
## README.md
### Copyright (C) 2017-2018, VR25 @ xda-developers
#### License: GPL v3+



---
#### DISCLAIMER

This software is provided as is, in the hope that it will be useful, but without any warranty. Always read/reread this reference prior to installing/upgrading. While no cats have been harmed, I assume no responsibility under anything which might go wrong due to the use/misuse of it.

A copy of the GNU General Public License, version 3 or newer ships with every build. Please, read it prior to using, modifying and/or sharing any part of this work.

To prevent fraud, DO NOT mirror any link associated with this project; DO NOT share ready-to-flash-builds (zips) on-line!



---
#### DESCRIPTION

Some kernels from devices with F2FS-formatted data partition (i.e., Motorola) have a bug which prevents loopback devices (.img files) from being mounted read-write. This limits systemless modifications that can otherwise be achieved with Magisk.

This module works by moving magisk.img to the cache partition (EXT[2-4]-formatted) and linking it to its actual location (i.e., /data/adb/magisk.img). The other half of the process consists on automatically recreating magisk_merge.img shortly after boot and handling it the same way as magisk.img.

With this workaround, a patched kernel is dispensable.

Cache partition's size is essentially the only limiting factor -- and that's pretty much self-explanatory.

/cache/magisk_.img is automatically backed up to/data/adb on boot (only if modified) & restored on install. Thus, whenever cache is wiped, magisk_.img and its respective symlink can easily be restored by simply reinstalling the module.



---
#### PRE-REQUISITES

- Magisk v15+
- F2FS-formatted data partition
- EXT[2-4]-formatted cache partition



---
#### SETUP STEPS

Fist time
- Install from custom recovery as a regular flashable zip.


Upgrades
- Install from Magisk Manager or custom recovery.
- Reinstall after cache wipes to restore magisk.img backup.



---
#### NOTES/TIPS

Always install large modules from custom recovery only. In fact, I recommend installing every module from recovery if your device's cache partition has a very small size (i.e., only a few Megabytes).

To revert changes, uninstall the module, boot into custom recovery and delete </data/adb/magisk.img> & <magisk.img.bkp>. Lastly (while still in custom recovery), move </cache/magisk_.img> to </data/adb/magisk.img>.

Updates and reinstalls can be carried out from Magisk Manager as well.



---
#### ONLINE SUPPORT

- [Facebook Support Page](https://facebook.com/VR25-at-xda-dev...8150974794782/)
- [Git Repository](https://github.com/Magisk-Modules-Re...ug-workaround/)
- [XDA Thread](https://forum.xda-developers.com/app...ding-t3577875/)



---
#### RECENT CHANGES

**2018.10.9 (201810090)**
- Bug fixes
- Latest module template, with added sugar.
- Magisk 15-17.2 support
- Updated documentation

**2018.9.2 (201809020)**
- Improved compatibility
- Major optimizations
- Updated documentation

**2018.8.1 (201808010)**
- General optimizations
- Striped down (removed unnecessary code & files)
- Updated documentation

**2018.7.24 (201807240)**
- Fixed modPath detection issue (Magisk V16.6).
- Updated documentation
The Following 41 Users Say Thank You to VR25 For This Useful Post: [ View ] Gift VR25 Ad-Free
 
 
24th March 2017, 01:01 AM |#2  
Member
Flag dallas
Thanks Meter: 9
 
More
Works with stock roms as well 😁
24th March 2017, 01:42 AM |#3  
fortunz's Avatar
Senior Member
Flag inside
Thanks Meter: 128
 
More
My cat lost two and half lives because of this thread. Sadly, the disclaimer is in order, so I can't sue.
The Following 2 Users Say Thank You to fortunz For This Useful Post: [ View ] Gift fortunz Ad-Free
24th March 2017, 05:05 AM |#4  
Senior Member
Flag Wichita, KS
Thanks Meter: 16
 
More
Is this for Nougat or Marshmallow?
24th March 2017, 02:28 PM |#5  
Senior Member
Flag New Delhi
Thanks Meter: 460
 
More
does this work on nougat update or only on MM?
25th March 2017, 01:51 PM |#6  
Senior Member
Flag New Delhi
Thanks Meter: 460
 
More
Can someone please confirm if it will work on retin channel with dual sim... I am running stock nougat... Will it work or does it only work on MM rom...
26th March 2017, 01:33 AM |#7  
xxBrun0xx's Avatar
Senior Member
Flag CT
Thanks Meter: 642
 
More
Anybody know how to fix notifications without breaking safety net?
28th March 2017, 10:49 AM |#8  
Senior Member
Thanks Meter: 865
 
Donate to Me
More
Quote:
Originally Posted by VR25

DISCLAIMER
Not taking responsibility for any thermonuclear war or cat harm. Do it at your any risk.

NEEDED
[Unlocked Bootloader] https://youshouldknowthisbynow.com
[Latest TWRP] https://forum.xda-developers.com/mot...-play-t3495629 credits @Alberto97
[Latest FSFS patched Kernel] https://forum.xda-developers.com/mot...tched-t3546732 credits @tomparr
[Latest Magisk zip] https://forum.xda-developers.com/app...mless-t3473445 credits @topjohnwu
[Latest Magisk Manager app] https://play.google.com/store/apps/d...u.magisk&hl=en credits @topjohnwu

PROCEDURE
0. reboot bootloader
1. fastboot boot twrp.img
2. adb sideload fsfs patched kernel
3. adb sideload magisk
4. reboot system
5. install magisk manager from play store
6. reboot bootloader [yes, again]
7. fastboot boot twrp.img [yes, again]
8. adb sideload magisk [yes, again]
9. reboot system [yes, ag... you get the point]
10. open magisk manager settings, enable "magisk hide"
11. reboot, done

Works like a charm.
I however did not temporarly boot into TWRP, I flashed it as such.

Quote:
Originally Posted by mhp1995

does this work on nougat update or only on MM?

I'm on Android 7.0 Nougat.


Thanks!
Erwin
The Following 2 Users Say Thank You to ErwinP For This Useful Post: [ View ] Gift ErwinP Ad-Free
28th March 2017, 03:31 PM |#9  
VR25's Avatar
OP Senior Member
Thanks Meter: 3,234
 
Donate to Me
More
Quote:
Originally Posted by fortunz

My cat lost two and half lives because of this thread. Sadly, the disclaimer is in order, so I can't sue.

Hopefully your cat is ok now

Quote:
Originally Posted by jjdavis699

Is this for Nougat or Marshmallow?

Quote:
Originally Posted by mhp1995

does this work on nougat update or only on MM?

Quote:
Originally Posted by mhp1995

Can someone please confirm if it will work on retin channel with dual sim... I am running stock nougat... Will it work or does it only work on MM rom...

It should work on both Marshmallow and Nougat, as long as you pick the appropriate kernel for your system version (6 or 7). @mhp1995, I don't think the software channel matters. It should work across all (retus, retin , reteu, etc.).

Quote:
Originally Posted by xxBrun0xx

Anybody know how to fix notifications without breaking safety net?

No idea at this point, man. I've never had to fix mine. Perhaps only some people have it...?

@erwin, I chose not to touch the stock recovery to keep OTA installations straightforward. Easy for everyone.
The Following 3 Users Say Thank You to VR25 For This Useful Post: [ View ] Gift VR25 Ad-Free
1st April 2017, 01:08 AM |#10  
Senior Member
Flag New Delhi
Thanks Meter: 460
 
More
one question... if i wanted to install viper4android and xposed framework, should i download it from the magisk download tab or shud i flash them manually via TWRP? thanks
1st April 2017, 08:34 PM |#11  
VR25's Avatar
OP Senior Member
Thanks Meter: 3,234
 
Donate to Me
More
Quote:
Originally Posted by mhp1995

one question... if i wanted to install viper4android and xposed framework, should i download it from the magisk download tab or shud i flash them manually via TWRP? thanks

There are specific versions of these modified for systemless root. DO NOT install the standard versions. You should follow the instructions given in Magisk Manager app to download and install.
The Following User Says Thank You to VR25 For This Useful Post: [ View ] Gift VR25 Ad-Free
Post Reply Subscribe to Thread

Tags
f2fs bug, f2fs fix, f2fs patch, loopback read only

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes