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
252afe89
Commit
252afe89
authored
Aug 03, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use mirror in post-fs-data scripts
parent
9dd467a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
bootstages.c
native/jni/core/bootstages.c
+18
-2
No files found.
native/jni/core/bootstages.c
View file @
252afe89
...
...
@@ -128,6 +128,18 @@ static void set_path(struct vector *v) {
vec_push_back
(
v
,
NULL
);
}
static
void
set_mirror_path
(
struct
vector
*
v
)
{
for
(
int
i
=
0
;
environ
[
i
];
++
i
)
{
if
(
strncmp
(
environ
[
i
],
"PATH="
,
5
)
==
0
)
{
vec_push_back
(
v
,
strdup
(
"PATH="
BBPATH
":/sbin:"
MIRRDIR
"/system/bin:"
MIRRDIR
"/system/xbin:"
MIRRDIR
"/vendor/bin"
));
}
else
{
vec_push_back
(
v
,
strdup
(
environ
[
i
]));
}
}
vec_push_back
(
v
,
NULL
);
}
/***********
* Scripts *
***********/
...
...
@@ -146,7 +158,9 @@ static void exec_common_script(const char* stage) {
if
(
access
(
buf2
,
X_OK
)
==
-
1
)
continue
;
LOGI
(
"%s.d: exec [%s]
\n
"
,
stage
,
entry
->
d_name
);
int
pid
=
exec_command
(
0
,
NULL
,
set_path
,
"sh"
,
buf2
,
NULL
);
int
pid
=
exec_command
(
0
,
NULL
,
strcmp
(
stage
,
"post-fs-data"
)
?
set_path
:
set_mirror_path
,
"sh"
,
buf2
,
NULL
);
if
(
pid
!=
-
1
)
waitpid
(
pid
,
NULL
,
0
);
}
...
...
@@ -163,7 +177,9 @@ static void exec_module_script(const char* stage) {
if
(
access
(
buf2
,
F_OK
)
==
-
1
||
access
(
buf
,
F_OK
)
==
0
)
continue
;
LOGI
(
"%s: exec [%s.sh]
\n
"
,
module
,
stage
);
int
pid
=
exec_command
(
0
,
NULL
,
set_path
,
"sh"
,
buf2
,
NULL
);
int
pid
=
exec_command
(
0
,
NULL
,
strcmp
(
stage
,
"post-fs-data"
)
?
set_path
:
set_mirror_path
,
"sh"
,
buf2
,
NULL
);
if
(
pid
!=
-
1
)
waitpid
(
pid
,
NULL
,
0
);
}
...
...
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