Magisk/native/jni
topjohnwu dbf8c41209 Force init to load fstab from file in 2SI
Patching DTBs is proven to be difficult and problematic as there are
tons of different formats out there. Adding support for all the formats
in magiskboot has been quite an headache in the past year, and it still
definitely does not cover all possible cases of them out there.

There is another issue: fake dt fstabs. Some super old devices do not
have device trees in their boot images, so some custom ROM developers
had came up with a "genius" solution: hardcode fstab entries directly
in the kernel source code and create fake device tree nodes even if
Android 10+ init can graciously take fstab files instead (-_-) 。。。

And there is YET another issue: DTBs are not always in boot images!
Google is crazy enough to litter DTBs all over the place, it is like
they cannot make up their minds (duh). This means the dt fstabs can be
either concatnated after the kernel (1), in the DTB partition (2), in
the DTBO partition (3), in the recovery_dtbo section in boot images (4),
or in the dtb section in boot images (5). FIVE f**king places, how can
anyone keep up with that!

With Android 10+ that uses 2 stage inits, it is crutual for Magisk to
be able to modify fstab mount points in order to let the original init
mount partitions for us, but NOT switch root and continue booting. For
devices using dt for early mount fstab, we used to patch the DTB at
install time with magiskboot. However these changes are permanent and
cannot be restored back at reinstallation.

With this commit, Magisk will read dt fstabs and write them to ramdisk
at boot time. And in that case, the init binary will also be patched
to force it to NEVER use fstabs in device-tree. By doing so, we can
unify ramdisk based 2SI fstab patching as basically we are just patching
fstab files. This also means we can manipulate fstab whatever Magisk
needs in the future without the need to going through the headache that
is patching DTBs at installation.
2020-05-04 02:21:51 -07:00
..
core Fix --remove-modules command 2020-04-30 01:27:48 -07:00
external Update BusyBox 2020-05-02 03:42:42 -07:00
include Fix --remove-modules command 2020-04-30 01:27:48 -07:00
init Force init to load fstab from file in 2SI 2020-05-04 02:21:51 -07:00
magiskboot Make version reporting consistent 2020-03-23 01:17:13 -07:00
magiskhide Fix --remove-modules command 2020-04-30 01:27:48 -07:00
magiskpolicy Add untrusted_app_29 for Android 11 2020-04-20 21:50:52 -07:00
resetprop Make version reporting consistent 2020-03-23 01:17:13 -07:00
su Make version reporting consistent 2020-03-23 01:17:13 -07:00
systemproperties Update Makefiles 2020-04-06 22:45:08 -07:00
utils More complete support for fstab in dt 2020-05-03 22:49:54 -07:00
.gitignore Add entrypoint to build test 2019-04-01 02:46:09 -04:00
Android.mk Introduce new module mount implementation 2020-04-18 02:00:48 -07:00
Application.mk Fix build on Windows 2020-01-26 12:27:07 +08:00