Adjust class structures

This commit is contained in:
topjohnwu
2019-06-24 01:50:47 -07:00
parent 6cde695194
commit bb67a837d3
4 changed files with 35 additions and 42 deletions

View File

@@ -40,14 +40,6 @@ constexpr const char wrapper[] =
;
void RootFSInit::setup_rootfs() {
if (cmd->system_as_root) {
// Clone rootfs
LOGD("Clone root dir from system to rootfs\n");
int system_root = xopen("/system_root", O_RDONLY | O_CLOEXEC);
clone_dir(system_root, root, false);
close(system_root);
}
if (patch_sepolicy()) {
constexpr char SYSTEM_INIT[] = "/system/bin/init";
// If init is symlink, copy it to rootfs so we can patch
@@ -131,6 +123,16 @@ void RootFSInit::setup_rootfs() {
close(fd);
}
void SARCompatInit::setup_rootfs() {
// Clone rootfs
LOGD("Clone root dir from system to rootfs\n");
int system_root = xopen("/system_root", O_RDONLY | O_CLOEXEC);
clone_dir(system_root, root, false);
close(system_root);
RootFSInit::setup_rootfs();
}
bool MagiskInit::patch_sepolicy() {
bool patch_init = false;