Magical Overlayfs v3.2.2 Fix Unofficial
Use OverlayFS to make |OVERLAYFS MUST BE SUPPORTED |
read-only system partitions become |MUST BE SUPPORTED BY |
read-write partitions. OverlayFS MUST |BE SUPPORTED BY KERNEL! |
be supported by kernel! |SUPPORTED BY KERNEL! RECOMMENDED |
Recommended for EROFS ROMs. The |BY KERNEL! RECOMMENDED FOR |
release from the upstream |KERNEL! RECOMMENDED FOR EROFS |
repo of v3.2.2 is |RECOMMENDED FOR EROFS ROMS |
broken somehow with Magisk |FOR EROFS ROMS THE |
v27.0. I simply rebuilt |EROFS ROMS THE RELEASE |
it per comments in |ROMS THE RELEASE FROM |
open issues on that |THE RELEASE FROM THE |
repo and now it |RELEASE FROM THE UPSTREAM |
works. Notes: works on systems |FROM THE UPSTREAM REPO |
BELOW a13 is not |THE UPSTREAM REPO OF |
guaranteed! Version: v3.2.2-Fixed Author: agreenbhm, HuskyDG |UPSTREAM REPO OF V3.2.2 |
(repo – base) Magisk-overlayfs-release_v3.2.2-fixed |OF V3.2.2 IS BROKEN |
On Android |V3.2.2 IS BROKEN SOMEHOW |
10+, system partitions might |IS BROKEN SOMEHOW WITH |
no longer be able |BROKEN SOMEHOW WITH MAGISK |
to remount as read-write. |SOMEHOW WITH MAGISK V27.0. |
For devices use dynamic |WITH MAGISK V27.0. I |
partition, it is nearly |MAGISK V27.0. I SIMPLY |
impossible to modify system |V27.0. I SIMPLY REBUILT |
partiton as there is |I SIMPLY REBUILT IT |
no space left. This |SIMPLY REBUILT IT PER |
module solves these problem |REBUILT IT PER COMMENTS |
by using OverlayFS. So |IT PER COMMENTS IN |
what is OverlayFS? On |PER COMMENTS IN OPEN |
Wikipedia: OverlayFS is |COMMENTS IN OPEN ISSUES |
a union mount filesystem |IN OPEN ISSUES ON |
implementation for Linux. It |OPEN ISSUES ON THAT |
combines multiple different underlying |ISSUES ON THAT REPO |
mount points into one, |ON THAT REPO AND |
resulting in single directory |THAT REPO AND NOW |
structure that contains underlying |REPO AND NOW IT |
files and sub-directories from |AND NOW IT WORKS |
all sources. Common applications |NOW IT WORKS NOTES: |
overlay a read/write partition |IT WORKS NOTES: WORKS |
over a read-only partition, |WORKS NOTES: WORKS ON |
such as with LiveCDs |NOTES: WORKS ON SYSTEMS |
and IoT devices with |WORKS ON SYSTEMS BELOW |
limited flash memory write |ON SYSTEMS BELOW A13 |
cycles. Benefits of using overlayfs |SYSTEMS BELOW A13 IS |
for system partitions: If you |IT IS NEARLY IMPOSSIBLE |
are interested in OverlayFS, |IS NEARLY IMPOSSIBLE TO |
you can read documentation |NEARLY IMPOSSIBLE TO MODIFY |
at https://docs.kernel.org/filesystems/overlayfs.html There |IMPOSSIBLE TO MODIFY SYSTEM |
is two way:Description:
Changelog:
Get Link |REPO OF V3.2.2 IS |
Magisk Overlayfs
/system, /vendor, /product, /system_ext, |IS NOT GUARANTEED VERSION: |
/odm, /odm_dlkm, /vendor_dlkm, …) |NOT GUARANTEED VERSION: V3.2.2-FIXED |
become read-write./data storage is |GUARANTEED VERSION: V3.2.2-FIXED SYSTEM |
used for upperdir of |VERSION: V3.2.2-FIXED SYSTEM PARTITIONS |
OverlayFS mount. However, on |V3.2.2-FIXED SYSTEM PARTITIONS MIGHT |
some kernel, f2fs is |SYSTEM PARTITIONS MIGHT NO |
not supported by OverlayFS |PARTITIONS MIGHT NO LONGER |
and cannot be used |MIGHT NO LONGER BE |
directly. The workaround is |NO LONGER BE ABLE |
to create an ext4 |LONGER BE ABLE TO |
loop image then mount |BE ABLE TO REMOUNT |
it.Build
GitHub Actions
Linux/WSL
git clone |PARTITON AS THERE IS |
http://github.com/HuskyDG/Magisk_OverlayFS && cd Magisk_OverlayFS
|AS THERE IS NO |
start="2">
wget https://dl.google.com/android/repository/android-ndk-r23b-linux.zip unzip |IS NO SPACE LEFT. |
android-ndk-r23b-linux.zip
- Run
bash build.sh
KernelSU |NO SPACE LEFT. THIS | problem
- The KernelSU module is |SPACE LEFT. THIS MODULE | similar to Magisk in |LEFT. THIS MODULE SOLVES | that it allows users |THIS MODULE SOLVES THESE | to modify the system |MODULE SOLVES THESE PROBLEM | partition while maintaining system |SOLVES THESE PROBLEM BY | integrity. It does this |THESE PROBLEM BY USING | through the implementation of |PROBLEM BY USING OVERLAYFS. | overlayfs. However, it’s important |BY USING OVERLAYFS. SO | to note that KernelSU |USING OVERLAYFS. SO WHAT | makes changes to the |OVERLAYFS. SO WHAT IS | system partition by using |SO WHAT IS OVERLAYFS | read-only overlayfs, which also |WHAT IS OVERLAYFS THE | mounts on top of |IS OVERLAYFS THE KERNELSU | magic_overlayfs and prevent system |OVERLAYFS THE KERNELSU MODULE | from being remounted as |THE KERNELSU MODULE IS | read-write. If you want |KERNELSU MODULE IS SIMILAR | to remount your system |MODULE IS SIMILAR TO | partitions as read-write, you |IS SIMILAR TO MAGISK | simply need to first |SIMILAR TO MAGISK IN | unmount the KernelSU overlayfs |TO MAGISK IN THAT | using this command:
nsenter -t |MAGISK IN THAT IT | 1 -m sh overlayfs_system |IN THAT IT ALLOWS | --unmount-ksu
or set DO_UNMOUNT_KSU=true in |THAT IT ALLOWS USERS |
/data/adb/modules(_update)/magisk_overlayfs/mode.sh
- After that you will |IT ALLOWS USERS TO | be able to remount |ALLOWS USERS TO MODIFY | system as read-write
Change OverlayFS |USERS TO MODIFY THE | mode
- OverlayFS is mounted as |TO MODIFY THE SYSTEM | read-only by default
- Configure overlayfs |MODIFY THE SYSTEM PARTITION |
mode in
/data/adb/modules(_update)/magisk_overlayfs/mode.shto |THE SYSTEM PARTITION WHILE | change mode of OverlayFS
Read-write |SYSTEM PARTITION WHILE MAINTAINING | mode of overlayfs will |PARTITION WHILE MAINTAINING SYSTEM | cause baseband on some |WHILE MAINTAINING SYSTEM INTEGRITY. | devices stop working
# 0 |MAINTAINING SYSTEM INTEGRITY. IT |
- read-only but can |SYSTEM INTEGRITY. IT DOES |
still remount as read-write |INTEGRITY. IT DOES THIS |
# 1 - read-write |IT DOES THIS THROUGH |
default # 2 - |DOES THIS THROUGH THE |
read-only locked (cannot remount |THIS THROUGH THE IMPLEMENTATION |
as read-write)
export OVERLAY_MODE=2
- OverlayFS |THROUGH THE IMPLEMENTATION OF |
upper loop device will |THE IMPLEMENTATION OF OVERLAYFS. |
be setup at
/dev/block/overlayfs_loop - On |IMPLEMENTATION OF OVERLAYFS. HOWEVER, |
Magisk, OverlayFS upper loop |OF OVERLAYFS. HOWEVER, IT’S |
are mounted at
$(magisk |OVERLAYFS. HOWEVER, IT’S IMPORTANT | --path)/overlayfs_mnt. You can make |HOWEVER, IT’S IMPORTANT TO | modifications through this path |IT’S IMPORTANT TO NOTE | to make changes to |IMPORTANT TO NOTE THAT | overlayfs mounted in system.
Modify |TO NOTE THAT KERNELSU | system files with OverlayFS
- If |NOTE THAT KERNELSU MAKES |
you are lazy to |THAT KERNELSU MAKES CHANGES |
remount, please modify
mode.sh|KERNELSU MAKES CHANGES TO | and set it to |MAKES CHANGES TO THE |OVERLAY_MODE=1so overlayfs will |CHANGES TO THE SYSTEM | be always read-write every |TO THE SYSTEM PARTITION | boot. - You can quickly remount |THE SYSTEM PARTITION BY | all overlayfs to read-write |SYSTEM PARTITION BY USING | by this command in |PARTITION BY USING READ-ONLY | terminal:
su -mm -c magic_remount_rw
- After |BY USING READ-ONLY OVERLAYFS, | that you can restore |USING READ-ONLY OVERLAYFS, WHICH | all system partitons back |READ-ONLY OVERLAYFS, WHICH ALSO | to read-only mode by |OVERLAYFS, WHICH ALSO MOUNTS | this commamd in terminal:
su |WHICH ALSO MOUNTS ON |
-mm -c magic_remount_roOverlayfs-based Magisk |ALSO MOUNTS ON TOP | module
- If you want to |MOUNTS ON TOP OF |
use overlayfs mount for |ON TOP OF MAGIC_OVERLAYFS |
your module, add these |TOP OF MAGIC_OVERLAYFS AND |
line to the end |OF MAGIC_OVERLAYFS AND PREVENT |
of
customize.sh:
OVERLAY_IMAGE_EXTRA=0 |MAGIC_OVERLAYFS AND PREVENT SYSTEM | # number |AND PREVENT SYSTEM FROM | of kb need to |PREVENT SYSTEM FROM BEING | be added to overlay.img |SYSTEM FROM BEING REMOUNTED | OVERLAY_IMAGE_SHRINK=true # shrink overlay.img |FROM BEING REMOUNTED AS | or not? # Only |BEING REMOUNTED AS READ-WRITE. | use OverlayFS if Magisk_OverlayFS |REMOUNTED AS READ-WRITE. IF | is installed if [ |AS READ-WRITE. IF YOU | -f "/data/adb/modules/magisk_overlayfs/util_functions.sh" ] && |READ-WRITE. IF YOU WANT | |IF YOU WANT TO | /data/adb/modules/magisk_overlayfs/overlayfs_system --test; then |YOU WANT TO REMOUNT | ui_print "- Add support |WANT TO REMOUNT YOUR | for overlayfs" . |TO REMOUNT YOUR SYSTEM | /data/adb/modules/magisk_overlayfs/util_functions.sh support_overlayfs && |REMOUNT YOUR SYSTEM PARTITIONS | rm -rf "$MODPATH"/system fi
Bugreport
- Magisk/KernelSU |YOUR SYSTEM PARTITIONS AS | version
- Magisk/KernelSU logs
/cache/overlayfs.log- logcat, dmesg, …
Reset |SYSTEM PARTITIONS AS READ-WRITE, | overlayfs
- Remove
/data/adb/overlayand reinstall |PARTITIONS AS READ-WRITE, YOU | module
Without Magisk
- Simple configuration to |AS READ-WRITE, YOU SIMPLY | test:
# - Create a |READ-WRITE, YOU SIMPLY NEED | writeable directory in ext4 |YOU SIMPLY NEED TO | (f2fs) /data # which |SIMPLY NEED TO FIRST | will be used for |NEED TO FIRST UNMOUNT | upperdir # - On |TO FIRST UNMOUNT THE | some Kernel, f2fs is |FIRST UNMOUNT THE KERNELSU | not supported by OverlayFS |UNMOUNT THE KERNELSU OVERLAYFS | # and cannot be |THE KERNELSU OVERLAYFS USING | used directly WRITEABLE=/data/overlayfs mkdir |KERNELSU OVERLAYFS USING THIS | -p "$WRITEABLE" # - |OVERLAYFS USING THIS COMMAND | Export list of modules |USING THIS COMMAND OVERLAYFS | if you want to |THIS COMMAND OVERLAYFS MUST | load mounts by overlayfs |COMMAND OVERLAYFS MUST BE | # - If you |OVERLAYFS MUST BE SUPPORTED | have /vendor /product /system_ext |MUST BE SUPPORTED BY | as seperate partitons # |BE SUPPORTED BY KERNEL! | - Please move it |SUPPORTED BY KERNEL! RECOMMENDED | out of "system" folder, |BY KERNEL! RECOMMENDED FOR | overwise **BOOM** export OVERLAYLIST=/data/adb/modules/module_a:/data/adb/modules/module_b |KERNEL! RECOMMENDED FOR EROFS | # - If there |RECOMMENDED FOR EROFS ROMS | is Magisk, export this |FOR EROFS ROMS THE | in post-fs-data.sh (before magic |EROFS ROMS THE RELEASE | mount): export MAGISKTMP="$(magisk --path)" |ROMS THE RELEASE FROM | # - Load overlayfs |THE RELEASE FROM THE | ./overlayfs_system "$WRITEABLE"|RELEASE FROM THE UPSTREAM |
