How can I properly mount my SD card as "internal" (i.e. so that all apps are on it) using a custom filesystem (in my case Ext4, but I'd like to use full-disk encryption using a key that I can decrypt when putting the SD card in my laptop too, and eventually switch to a custom FUSE filesystem, so it's not an ext4-specific question)?
According to https://source.android.com/security/encryption/full-disk, I would need to run class_stop late_start; class_stop main
to halt all applications, mount on top of /data (I guess, any other location that should be hidden?), and restart with class_start late_start; class_start main
. However, these commands do not exist, and don't seem to be sub-commands of init
.
How would I do this stop-all-apps, mount-on-/data/, start-all-apps dance from an adb
shell?
I have root access via adb
, but no root access for apps. The bootloader is locked (needs to be for my banking app it seems), so I can't edit /etc/vold.fstab or any other file in /system or /vendor. I'm using /e/ os Android 10 (a fork of LineageOS).
adb shell
. Theinit
commands you mentioned aren't to be executed from commandline but need to be put in some.rc
file: android.googlesource.com/platform/system/core/+/master/init/…. They are already defined in.rc
files by ROM developers and are executed automatically in proper sequence when you format your SD card as Adoptable (internal) Storage.init.rc
(dm-crypt
+mount
ormount
+fscrypt
or mount a FUSE filesystem). I can't edit this file: it's on boot.img, and something in the system refuses to lock the bootloader if it's modified (e.g. I flashing a magisk'ed boot.img and locking gives a "corrupted" message, and my bank's app won't run with unlocked boot)