Add magisk binary mirror

This commit is contained in:
topjohnwu 2017-08-11 17:14:55 +08:00
parent 2a7e2c70b5
commit 44adccc147
2 changed files with 4 additions and 2 deletions

View File

@ -396,14 +396,17 @@ static void mount_mirrors() {
symlink(MIRRDIR "/system/vendor", MIRRDIR "/vendor"); symlink(MIRRDIR "/system/vendor", MIRRDIR "/vendor");
LOGI("link: %s -> %s\n", MIRRDIR "/system/vendor", MIRRDIR "/vendor"); LOGI("link: %s -> %s\n", MIRRDIR "/system/vendor", MIRRDIR "/vendor");
} }
mkdir_p(MIRRDIR "/bin", 0755);
bind_mount(DATABIN, MIRRDIR "/bin");
} }
static void link_busybox() { static void link_busybox() {
mkdir_p(BBPATH, 0755); mkdir_p(BBPATH, 0755);
char *const command[] = { "busybox", "--install", "-s", BBPATH, NULL}; char *const command[] = { "busybox", "--install", "-s", BBPATH, NULL};
int pid = run_command(0, NULL, NULL, BBBIN, command); int pid = run_command(0, NULL, NULL, MIRRDIR "/bin/busybox", command);
if (pid != -1) if (pid != -1)
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);
symlink(MIRRDIR "/bin/busybox", BBPATH "/busybox");
} }
/**************** /****************

View File

@ -35,7 +35,6 @@
#define MAINIMG "/data/magisk.img" #define MAINIMG "/data/magisk.img"
#define DATABIN "/data/magisk" #define DATABIN "/data/magisk"
#define MANAGERAPK DATABIN "/magisk.apk" #define MANAGERAPK DATABIN "/magisk.apk"
#define BBBIN DATABIN "/busybox"
#define MAGISKTMP "/dev/magisk" #define MAGISKTMP "/dev/magisk"
#define MIRRDIR MAGISKTMP "/mirror" #define MIRRDIR MAGISKTMP "/mirror"
#define DUMMDIR MAGISKTMP "/dummy" #define DUMMDIR MAGISKTMP "/dummy"