Label current SAR impl as compat

The current system-as-root magiskinit implementation (converting
root directory in system partition to legacy rootfs setup) is now
considered as backwards compatible only.

The new implementation that is hide and Android Q friendly is coming soon.
This commit is contained in:
topjohnwu 2019-06-22 03:18:45 -07:00
parent cfec0db947
commit 1058aeb04f
3 changed files with 7 additions and 7 deletions

View File

@ -118,7 +118,7 @@ void LegacyInit::early_mount() {
mount_root(odm);
}
void SARInit::early_mount() {
void SARCompatInit::early_mount() {
char partname[32];
char fstype[32];
char block_dev[64];

View File

@ -132,7 +132,7 @@ void LegacyInit::preset() {
rename("/.backup/init", "/init");
}
void SARInit::preset() {
void SARCompatInit::preset() {
full_read("/init", &self.buf, &self.sz);
LOGD("Cleaning rootfs\n");
@ -168,9 +168,9 @@ public:
}
};
class TestInit : public SARInit {
class TestInit : public SARCompatInit {
public:
TestInit(char *argv[], cmdline *cmd) : SARInit(argv, cmd) {};
TestInit(char *argv[], cmdline *cmd) : SARCompatInit(argv, cmd) {};
void start() override {
preset();
early_mount();
@ -219,7 +219,7 @@ int main(int argc, char *argv[]) {
if (run_test) {
init = make_unique<TestInit>(argv, &cmd);
} else if (cmd.system_as_root) {
init = make_unique<SARInit>(argv, &cmd);
init = make_unique<SARCompatInit>(argv, &cmd);
} else {
decompress_ramdisk();
if (access("/sbin/recovery", F_OK) == 0)

View File

@ -52,12 +52,12 @@ public:
LegacyInit(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {};
};
class SARInit : public MagiskInit {
class SARCompatInit : public MagiskInit {
protected:
void preset() override;
void early_mount() override;
public:
SARInit(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {};
SARCompatInit(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {};
};
static inline bool is_lnk(const char *name) {