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
f4926cb8
Commit
f4926cb8
authored
Jan 03, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactoring
parent
1e77e086
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
twostage.cpp
native/jni/init/twostage.cpp
+4
-10
No files found.
native/jni/init/twostage.cpp
View file @
f4926cb8
...
@@ -27,11 +27,7 @@ void fstab_entry::to_file(FILE *fp) {
...
@@ -27,11 +27,7 @@ void fstab_entry::to_file(FILE *fp) {
line[val##1] = '\0'; \
line[val##1] = '\0'; \
entry.val = &line[val##0];
entry.val = &line[val##0];
static
bool
read_fstab_file
(
const
char
*
fstab_file
,
vector
<
fstab_entry
>
&
fstab
)
{
static
void
read_fstab_file
(
const
char
*
fstab_file
,
vector
<
fstab_entry
>
&
fstab
)
{
if
(
!
fstab_file
||
fstab_file
[
0
]
==
'\0'
)
{
LOGE
(
"fstab file is empty"
);
return
false
;
}
file_readline
(
fstab_file
,
[
&
](
string_view
l
)
->
bool
{
file_readline
(
fstab_file
,
[
&
](
string_view
l
)
->
bool
{
if
(
l
[
0
]
==
'#'
||
l
.
length
()
==
1
)
if
(
l
[
0
]
==
'#'
||
l
.
length
()
==
1
)
return
true
;
return
true
;
...
@@ -55,7 +51,6 @@ static bool read_fstab_file(const char *fstab_file, vector<fstab_entry> &fstab)
...
@@ -55,7 +51,6 @@ static bool read_fstab_file(const char *fstab_file, vector<fstab_entry> &fstab)
fstab
.
emplace_back
(
std
::
move
(
entry
));
fstab
.
emplace_back
(
std
::
move
(
entry
));
return
true
;
return
true
;
});
});
return
true
;
}
}
#define FSR "/first_stage_ramdisk"
#define FSR "/first_stage_ramdisk"
...
@@ -204,15 +199,14 @@ void FirstStageInit::prepare() {
...
@@ -204,15 +199,14 @@ void FirstStageInit::prepare() {
// When dt fstab fails, fall back to default fstab
// When dt fstab fails, fall back to default fstab
LOGI
(
"dt fstab contains error, fall back to default fstab
\n
"
);
LOGI
(
"dt fstab contains error, fall back to default fstab
\n
"
);
fstab
.
clear
();
fstab
.
clear
();
if
(
!
read_fstab_file
(
fstab_file
,
fstab
))
read_fstab_file
(
fstab_file
,
fstab
);
return
;
}
else
{
}
else
{
// Patch init to force IsDtFstabCompatible() return false
// Patch init to force IsDtFstabCompatible() return false
auto
init
=
mmap_data
(
"/init"
,
true
);
auto
init
=
mmap_data
(
"/init"
,
true
);
init
.
patch
({
make_pair
(
"android,fstab"
,
"xxx"
)});
init
.
patch
({
make_pair
(
"android,fstab"
,
"xxx"
)});
}
}
}
else
if
(
!
read_fstab_file
(
fstab_file
,
fstab
))
{
}
else
{
re
turn
;
re
ad_fstab_file
(
fstab_file
,
fstab
)
;
}
}
// Append oppo's custom fstab
// Append oppo's custom fstab
...
...
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