apex: mount up apex files into /sbin for library access

This patch uses the loop device to mount files under
/sbin/ from /system/apex in order for the device to
use libraries or other files store inside these files.

Each apex file is mounted over a loop device into a
directory correpsonding to the apex filename under
/sbin/.

Once apex mounting is completed, TWRP will set a
property twrp.apex.loaded to true so that init
can use them as a LD_LIBARY_PATH source.
Change-Id: I69f14a969123ac9cf1afc85b6cf76836cb092fb2

Change-Id: Ica6a7d8e479bcaec8bec4483b5e8d2b45ee105fb
This commit is contained in:
bigbiff
2020-04-12 19:16:19 -04:00
parent ee7b7ffba4
commit 32cbabe413
7 changed files with 191 additions and 4 deletions
+5
View File
@@ -3277,7 +3277,12 @@ bool TWPartitionManager::Prepare_Super_Volume(TWPartition* twrpPart) {
return false;
}
while (access(fstabEntry.blk_device.c_str(), F_OK) != 0) {
usleep(100);
}
twrpPart->Set_Block_Device(fstabEntry.blk_device);
twrpPart->Mount(true);
twrpPart->Update_Size(true);
twrpPart->Change_Mount_Read_Only(true);
twrpPart->Set_Can_Be_Backed_Up(false);