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
a52a3e38
Commit
a52a3e38
authored
Sep 22, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change some class names
parent
ee0cef06
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
early_mount.cpp
native/jni/init/early_mount.cpp
+2
-2
init.cpp
native/jni/init/init.cpp
+1
-1
init.h
native/jni/init/init.h
+12
-12
rootdir.cpp
native/jni/init/rootdir.cpp
+3
-3
No files found.
native/jni/init/early_mount.cpp
View file @
a52a3e38
...
...
@@ -121,7 +121,7 @@ if (!is_lnk("/" #name) && read_dt_fstab(#name, partname, fstype)) { \
mnt_##name = true; \
}
void
Legacy
Init
::
early_mount
()
{
void
RootFS
Init
::
early_mount
()
{
full_read
(
"/init"
,
self
.
buf
,
self
.
sz
);
LOGD
(
"Reverting /init
\n
"
);
...
...
@@ -183,7 +183,7 @@ static void switch_root(const string &path) {
chroot
(
"."
);
}
void
SAR
Common
::
backup_files
()
{
void
SAR
Base
::
backup_files
()
{
if
(
access
(
"/overlay.d"
,
F_OK
)
==
0
)
cp_afc
(
"/overlay.d"
,
"/dev/overlay.d"
);
...
...
native/jni/init/init.cpp
View file @
a52a3e38
...
...
@@ -220,7 +220,7 @@ int main(int argc, char *argv[]) {
else
if
(
access
(
"/apex"
,
F_OK
)
==
0
)
init
=
make_unique
<
AFirstStageInit
>
(
argv
,
&
cmd
);
else
init
=
make_unique
<
Legacy
Init
>
(
argv
,
&
cmd
);
init
=
make_unique
<
RootFS
Init
>
(
argv
,
&
cmd
);
}
// Run the main routine
...
...
native/jni/init/init.h
View file @
a52a3e38
...
...
@@ -67,13 +67,13 @@ public:
MagiskInit
(
char
*
argv
[],
cmdline
*
cmd
)
:
BaseInit
(
argv
,
cmd
)
{};
};
class
RootFS
Init
:
public
MagiskInit
{
class
RootFS
Base
:
public
MagiskInit
{
protected
:
int
root
=
-
1
;
virtual
void
setup_rootfs
();
public
:
RootFS
Init
(
char
*
argv
[],
cmdline
*
cmd
)
:
MagiskInit
(
argv
,
cmd
)
{};
RootFS
Base
(
char
*
argv
[],
cmdline
*
cmd
)
:
MagiskInit
(
argv
,
cmd
)
{};
void
start
()
override
{
early_mount
();
setup_rootfs
();
...
...
@@ -81,7 +81,7 @@ public:
}
};
class
SAR
Common
:
public
MagiskInit
{
class
SAR
Base
:
public
MagiskInit
{
protected
:
raw_data
config
;
dev_t
system_dev
;
...
...
@@ -89,7 +89,7 @@ protected:
void
backup_files
();
void
patch_rootdir
();
public
:
SAR
Common
(
char
*
argv
[],
cmdline
*
cmd
)
:
MagiskInit
(
argv
,
cmd
)
{};
SAR
Base
(
char
*
argv
[],
cmdline
*
cmd
)
:
MagiskInit
(
argv
,
cmd
)
{};
void
start
()
override
{
early_mount
();
patch_rootdir
();
...
...
@@ -123,46 +123,46 @@ public:
}
};
class
SecondStageInit
:
public
SAR
Common
{
class
SecondStageInit
:
public
SAR
Base
{
protected
:
void
early_mount
()
override
;
void
cleanup
()
override
{
/* Do not do any cleanup */
}
public
:
SecondStageInit
(
char
*
argv
[])
:
SAR
Common
(
argv
,
nullptr
)
{};
SecondStageInit
(
char
*
argv
[])
:
SAR
Base
(
argv
,
nullptr
)
{};
};
/* ***********
* Legacy SAR
* ***********/
class
SARInit
:
public
SAR
Common
{
class
SARInit
:
public
SAR
Base
{
protected
:
void
early_mount
()
override
;
public
:
SARInit
(
char
*
argv
[],
cmdline
*
cmd
)
:
SAR
Common
(
argv
,
cmd
)
{};
SARInit
(
char
*
argv
[],
cmdline
*
cmd
)
:
SAR
Base
(
argv
,
cmd
)
{};
};
/* **********
* Initramfs
* **********/
class
LegacyInit
:
public
RootFSInit
{
class
RootFSInit
:
public
RootFSBase
{
protected
:
void
early_mount
()
override
;
public
:
LegacyInit
(
char
*
argv
[],
cmdline
*
cmd
)
:
RootFSInit
(
argv
,
cmd
)
{};
RootFSInit
(
char
*
argv
[],
cmdline
*
cmd
)
:
RootFSBase
(
argv
,
cmd
)
{};
};
/* ****************
* Compat-mode SAR
* ****************/
class
SARCompatInit
:
public
RootFS
Init
{
class
SARCompatInit
:
public
RootFS
Base
{
protected
:
void
early_mount
()
override
;
void
setup_rootfs
()
override
;
public
:
SARCompatInit
(
char
*
argv
[],
cmdline
*
cmd
)
:
RootFS
Init
(
argv
,
cmd
)
{};
SARCompatInit
(
char
*
argv
[],
cmdline
*
cmd
)
:
RootFS
Base
(
argv
,
cmd
)
{};
};
void
load_kernel_info
(
cmdline
*
cmd
);
...
...
native/jni/init/rootdir.cpp
View file @
a52a3e38
...
...
@@ -86,7 +86,7 @@ static void load_overlay_rc(int dirfd) {
rewinddir
(
dir
);
}
void
RootFS
Init
::
setup_rootfs
()
{
void
RootFS
Base
::
setup_rootfs
()
{
if
(
patch_sepolicy
())
{
char
*
addr
;
size_t
size
;
...
...
@@ -149,7 +149,7 @@ void SARCompatInit::setup_rootfs() {
clone_dir
(
system_root
,
root
,
false
);
close
(
system_root
);
RootFS
Init
::
setup_rootfs
();
RootFS
Base
::
setup_rootfs
();
}
bool
MagiskInit
::
patch_sepolicy
(
const
char
*
file
)
{
...
...
@@ -256,7 +256,7 @@ static void magic_mount(int dirfd, const string &path) {
}
}
void
SAR
Common
::
patch_rootdir
()
{
void
SAR
Base
::
patch_rootdir
()
{
sbin_overlay
(
self
,
config
);
// Mount system_root mirror
...
...
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