Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
4a212dba
Commit
4a212dba
authored
Jun 25, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Early mount partitions in SAR
parent
aac9e85e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
early_mount.cpp
native/jni/init/early_mount.cpp
+10
-1
init.cpp
native/jni/init/init.cpp
+1
-0
No files found.
native/jni/init/early_mount.cpp
View file @
4a212dba
...
@@ -175,6 +175,8 @@ static void switch_root(const string &path) {
...
@@ -175,6 +175,8 @@ static void switch_root(const string &path) {
void
SARInit
::
early_mount
()
{
void
SARInit
::
early_mount
()
{
char
partname
[
32
];
char
partname
[
32
];
char
fstype
[
32
];
char
block_dev
[
64
];
full_read
(
"/init"
,
&
self
.
buf
,
&
self
.
sz
);
full_read
(
"/init"
,
&
self
.
buf
,
&
self
.
sz
);
full_read
(
"/.backup/.magisk"
,
&
config
.
buf
,
&
config
.
sz
);
full_read
(
"/.backup/.magisk"
,
&
config
.
buf
,
&
config
.
sz
);
...
@@ -191,6 +193,13 @@ void SARInit::early_mount() {
...
@@ -191,6 +193,13 @@ void SARInit::early_mount() {
if
(
xmount
(
"/dev/root"
,
"/system_root"
,
"ext4"
,
MS_RDONLY
,
nullptr
))
if
(
xmount
(
"/dev/root"
,
"/system_root"
,
"ext4"
,
MS_RDONLY
,
nullptr
))
xmount
(
"/dev/root"
,
"/system_root"
,
"erofs"
,
MS_RDONLY
,
nullptr
);
xmount
(
"/dev/root"
,
"/system_root"
,
"erofs"
,
MS_RDONLY
,
nullptr
);
switch_root
(
"/system_root"
);
switch_root
(
"/system_root"
);
// Make dev writable
xmount
(
"tmpfs"
,
"/dev"
,
"tmpfs"
,
0
,
"mode=755"
);
mount_root
(
vendor
);
mount_root
(
product
);
mount_root
(
odm
);
}
}
#define umount_root(name) \
#define umount_root(name) \
...
@@ -198,8 +207,8 @@ if (mnt_##name) \
...
@@ -198,8 +207,8 @@ if (mnt_##name) \
umount("/" #name);
umount("/" #name);
void
MagiskInit
::
cleanup
()
{
void
MagiskInit
::
cleanup
()
{
BaseInit
::
cleanup
();
umount
(
SELINUX_MNT
);
umount
(
SELINUX_MNT
);
BaseInit
::
cleanup
();
umount_root
(
system
);
umount_root
(
system
);
umount_root
(
vendor
);
umount_root
(
vendor
);
umount_root
(
product
);
umount_root
(
product
);
...
...
native/jni/init/init.cpp
View file @
4a212dba
...
@@ -115,6 +115,7 @@ static int dump_manager(const char *path, mode_t mode) {
...
@@ -115,6 +115,7 @@ static int dump_manager(const char *path, mode_t mode) {
void
BaseInit
::
cleanup
()
{
void
BaseInit
::
cleanup
()
{
umount
(
"/sys"
);
umount
(
"/sys"
);
umount
(
"/proc"
);
umount
(
"/proc"
);
umount
(
"/dev"
);
}
}
void
BaseInit
::
re_exec_init
()
{
void
BaseInit
::
re_exec_init
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment