diff --git a/native/jni/init/early_mount.cpp b/native/jni/init/early_mount.cpp index bc8dcda27..eef42c888 100644 --- a/native/jni/init/early_mount.cpp +++ b/native/jni/init/early_mount.cpp @@ -121,7 +121,7 @@ if (!is_lnk("/" #name) && read_dt_fstab(#name, partname, fstype)) { \ mnt_##name = true; \ } -void LegacyInit::early_mount() { +void RootFSInit::early_mount() { full_read("/init", self.buf, self.sz); LOGD("Reverting /init\n"); @@ -183,7 +183,7 @@ static void switch_root(const string &path) { chroot("."); } -void SARCommon::backup_files() { +void SARBase::backup_files() { if (access("/overlay.d", F_OK) == 0) cp_afc("/overlay.d", "/dev/overlay.d"); diff --git a/native/jni/init/init.cpp b/native/jni/init/init.cpp index 78fe5e407..c95b29fdb 100644 --- a/native/jni/init/init.cpp +++ b/native/jni/init/init.cpp @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) { else if (access("/apex", F_OK) == 0) init = make_unique(argv, &cmd); else - init = make_unique(argv, &cmd); + init = make_unique(argv, &cmd); } // Run the main routine diff --git a/native/jni/init/init.h b/native/jni/init/init.h index e8267e298..c02545872 100644 --- a/native/jni/init/init.h +++ b/native/jni/init/init.h @@ -67,13 +67,13 @@ public: MagiskInit(char *argv[], cmdline *cmd) : BaseInit(argv, cmd) {}; }; -class RootFSInit : public MagiskInit { +class RootFSBase : public MagiskInit { protected: int root = -1; virtual void setup_rootfs(); public: - RootFSInit(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {}; + RootFSBase(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {}; void start() override { early_mount(); setup_rootfs(); @@ -81,7 +81,7 @@ public: } }; -class SARCommon : public MagiskInit { +class SARBase : public MagiskInit { protected: raw_data config; dev_t system_dev; @@ -89,7 +89,7 @@ protected: void backup_files(); void patch_rootdir(); public: - SARCommon(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {}; + SARBase(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {}; void start() override { early_mount(); patch_rootdir(); @@ -123,46 +123,46 @@ public: } }; -class SecondStageInit : public SARCommon { +class SecondStageInit : public SARBase { protected: void early_mount() override; void cleanup() override { /* Do not do any cleanup */ } public: - SecondStageInit(char *argv[]) : SARCommon(argv, nullptr) {}; + SecondStageInit(char *argv[]) : SARBase(argv, nullptr) {}; }; /* *********** * Legacy SAR * ***********/ -class SARInit : public SARCommon { +class SARInit : public SARBase { protected: void early_mount() override; public: - SARInit(char *argv[], cmdline *cmd) : SARCommon(argv, cmd) {}; + SARInit(char *argv[], cmdline *cmd) : SARBase(argv, cmd) {}; }; /* ********** * Initramfs * **********/ -class LegacyInit : public RootFSInit { +class RootFSInit : public RootFSBase { protected: void early_mount() override; public: - LegacyInit(char *argv[], cmdline *cmd) : RootFSInit(argv, cmd) {}; + RootFSInit(char *argv[], cmdline *cmd) : RootFSBase(argv, cmd) {}; }; /* **************** * Compat-mode SAR * ****************/ -class SARCompatInit : public RootFSInit { +class SARCompatInit : public RootFSBase { protected: void early_mount() override; void setup_rootfs() override; public: - SARCompatInit(char *argv[], cmdline *cmd) : RootFSInit(argv, cmd) {}; + SARCompatInit(char *argv[], cmdline *cmd) : RootFSBase(argv, cmd) {}; }; void load_kernel_info(cmdline *cmd); diff --git a/native/jni/init/rootdir.cpp b/native/jni/init/rootdir.cpp index fde714db8..113b2af71 100644 --- a/native/jni/init/rootdir.cpp +++ b/native/jni/init/rootdir.cpp @@ -86,7 +86,7 @@ static void load_overlay_rc(int dirfd) { rewinddir(dir); } -void RootFSInit::setup_rootfs() { +void RootFSBase::setup_rootfs() { if (patch_sepolicy()) { char *addr; size_t size; @@ -149,7 +149,7 @@ void SARCompatInit::setup_rootfs() { clone_dir(system_root, root, false); close(system_root); - RootFSInit::setup_rootfs(); + RootFSBase::setup_rootfs(); } bool MagiskInit::patch_sepolicy(const char *file) { @@ -256,7 +256,7 @@ static void magic_mount(int dirfd, const string &path) { } } -void SARCommon::patch_rootdir() { +void SARBase::patch_rootdir() { sbin_overlay(self, config); // Mount system_root mirror