mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-04 16:27:39 +00:00
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:
parent
cfec0db947
commit
1058aeb04f
@ -118,7 +118,7 @@ void LegacyInit::early_mount() {
|
|||||||
mount_root(odm);
|
mount_root(odm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SARInit::early_mount() {
|
void SARCompatInit::early_mount() {
|
||||||
char partname[32];
|
char partname[32];
|
||||||
char fstype[32];
|
char fstype[32];
|
||||||
char block_dev[64];
|
char block_dev[64];
|
||||||
|
@ -132,7 +132,7 @@ void LegacyInit::preset() {
|
|||||||
rename("/.backup/init", "/init");
|
rename("/.backup/init", "/init");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SARInit::preset() {
|
void SARCompatInit::preset() {
|
||||||
full_read("/init", &self.buf, &self.sz);
|
full_read("/init", &self.buf, &self.sz);
|
||||||
|
|
||||||
LOGD("Cleaning rootfs\n");
|
LOGD("Cleaning rootfs\n");
|
||||||
@ -168,9 +168,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestInit : public SARInit {
|
class TestInit : public SARCompatInit {
|
||||||
public:
|
public:
|
||||||
TestInit(char *argv[], cmdline *cmd) : SARInit(argv, cmd) {};
|
TestInit(char *argv[], cmdline *cmd) : SARCompatInit(argv, cmd) {};
|
||||||
void start() override {
|
void start() override {
|
||||||
preset();
|
preset();
|
||||||
early_mount();
|
early_mount();
|
||||||
@ -219,7 +219,7 @@ int main(int argc, char *argv[]) {
|
|||||||
if (run_test) {
|
if (run_test) {
|
||||||
init = make_unique<TestInit>(argv, &cmd);
|
init = make_unique<TestInit>(argv, &cmd);
|
||||||
} else if (cmd.system_as_root) {
|
} else if (cmd.system_as_root) {
|
||||||
init = make_unique<SARInit>(argv, &cmd);
|
init = make_unique<SARCompatInit>(argv, &cmd);
|
||||||
} else {
|
} else {
|
||||||
decompress_ramdisk();
|
decompress_ramdisk();
|
||||||
if (access("/sbin/recovery", F_OK) == 0)
|
if (access("/sbin/recovery", F_OK) == 0)
|
||||||
|
@ -52,12 +52,12 @@ public:
|
|||||||
LegacyInit(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {};
|
LegacyInit(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class SARInit : public MagiskInit {
|
class SARCompatInit : public MagiskInit {
|
||||||
protected:
|
protected:
|
||||||
void preset() override;
|
void preset() override;
|
||||||
void early_mount() override;
|
void early_mount() override;
|
||||||
public:
|
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) {
|
static inline bool is_lnk(const char *name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user