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
543ce937
Commit
543ce937
authored
Apr 01, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't need to find system_dev
parent
5537b083
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
15 deletions
+4
-15
build.gradle
build.gradle
+1
-1
init.hpp
native/jni/init/init.hpp
+0
-1
mount.cpp
native/jni/init/mount.cpp
+0
-12
rootdir.cpp
native/jni/init/rootdir.cpp
+3
-1
No files found.
build.gradle
View file @
543ce937
...
@@ -17,7 +17,7 @@ buildscript {
...
@@ -17,7 +17,7 @@ buildscript {
maven
{
url
'https://kotlin.bintray.com/kotlinx'
}
maven
{
url
'https://kotlin.bintray.com/kotlinx'
}
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools.build:gradle:3.6.
1
'
classpath
'com.android.tools.build:gradle:3.6.
2
'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:${vKotlin}"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:${vKotlin}"
classpath
"androidx.navigation:navigation-safe-args-gradle-plugin:$vNav"
classpath
"androidx.navigation:navigation-safe-args-gradle-plugin:$vNav"
...
...
native/jni/init/init.hpp
View file @
543ce937
...
@@ -66,7 +66,6 @@ public:
...
@@ -66,7 +66,6 @@ public:
class
SARBase
:
public
MagiskInit
{
class
SARBase
:
public
MagiskInit
{
protected
:
protected
:
raw_data
config
;
raw_data
config
;
dev_t
system_dev
;
void
backup_files
(
const
char
*
self_path
);
void
backup_files
(
const
char
*
self_path
);
void
patch_rootdir
();
void
patch_rootdir
();
...
...
native/jni/init/mount.cpp
View file @
543ce937
...
@@ -218,7 +218,6 @@ void SARInit::early_mount() {
...
@@ -218,7 +218,6 @@ void SARInit::early_mount() {
exit
(
1
);
exit
(
1
);
}
}
}
}
system_dev
=
dev
;
xmkdir
(
"/system_root"
,
0755
);
xmkdir
(
"/system_root"
,
0755
);
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
);
...
@@ -237,17 +236,6 @@ void SecondStageInit::early_mount() {
...
@@ -237,17 +236,6 @@ void SecondStageInit::early_mount() {
rm_rf
(
"/.backup"
);
rm_rf
(
"/.backup"
);
rm_rf
(
"/overlay.d"
);
rm_rf
(
"/overlay.d"
);
// Find system_dev
parse_mnt
(
"/proc/mounts"
,
[
&
](
mntent
*
me
)
->
bool
{
if
(
me
->
mnt_dir
==
"/system_root"
sv
)
{
struct
stat
st
;
stat
(
me
->
mnt_fsname
,
&
st
);
system_dev
=
st
.
st_rdev
;
return
false
;
}
return
true
;
});
switch_root
(
"/system_root"
);
switch_root
(
"/system_root"
);
}
}
...
...
native/jni/init/rootdir.cpp
View file @
543ce937
...
@@ -270,8 +270,10 @@ void SARBase::patch_rootdir() {
...
@@ -270,8 +270,10 @@ void SARBase::patch_rootdir() {
sbin_overlay
(
self
,
config
);
sbin_overlay
(
self
,
config
);
// Mount system_root mirror
// Mount system_root mirror
struct
stat
st
;
xstat
(
"/"
,
&
st
);
xmkdir
(
ROOTMIR
,
0755
);
xmkdir
(
ROOTMIR
,
0755
);
mknod
(
ROOTBLK
,
S_IFBLK
|
0600
,
s
ystem
_dev
);
mknod
(
ROOTBLK
,
S_IFBLK
|
0600
,
s
t
.
st
_dev
);
if
(
xmount
(
ROOTBLK
,
ROOTMIR
,
"ext4"
,
MS_RDONLY
,
nullptr
))
if
(
xmount
(
ROOTBLK
,
ROOTMIR
,
"ext4"
,
MS_RDONLY
,
nullptr
))
xmount
(
ROOTBLK
,
ROOTMIR
,
"erofs"
,
MS_RDONLY
,
nullptr
);
xmount
(
ROOTBLK
,
ROOTMIR
,
"erofs"
,
MS_RDONLY
,
nullptr
);
...
...
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