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
2db60e0a
Commit
2db60e0a
authored
Nov 06, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Pixel 2 XL support
parent
e7108483
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
magiskinit.c
jni/init/magiskinit.c
+10
-0
No files found.
jni/init/magiskinit.c
View file @
2db60e0a
...
...
@@ -35,6 +35,9 @@
#include "utils.h"
#include "magiskpolicy.h"
// #define VLOG(fmt, ...) printf(fmt, __VA_ARGS__) /* Enable to debug */
#define VLOG(fmt, ...)
struct
cmdline
{
int
skip_initramfs
;
char
slot
[
3
];
...
...
@@ -66,6 +69,9 @@ static void parse_cmdline(struct cmdline *cmd) {
while
(
tok
!=
NULL
)
{
if
(
strncmp
(
tok
,
"androidboot.slot_suffix"
,
23
)
==
0
)
{
sscanf
(
tok
,
"androidboot.slot_suffix=%s"
,
cmd
->
slot
);
}
else
if
(
strncmp
(
tok
,
"androidboot.slot"
,
16
)
==
0
)
{
cmd
->
slot
[
0
]
=
'_'
;
sscanf
(
tok
,
"androidboot.slot=%s"
,
cmd
->
slot
+
1
);
}
else
if
(
strcmp
(
tok
,
"skip_initramfs"
)
==
0
)
{
cmd
->
skip_initramfs
=
1
;
}
...
...
@@ -74,6 +80,7 @@ static void parse_cmdline(struct cmdline *cmd) {
}
static
void
parse_device
(
struct
device
*
dev
,
char
*
uevent
)
{
dev
->
partname
[
0
]
=
'\0'
;
char
*
tok
;
tok
=
strtok
(
uevent
,
"
\n
"
);
while
(
tok
!=
NULL
)
{
...
...
@@ -88,6 +95,7 @@ static void parse_device(struct device *dev, char *uevent) {
}
tok
=
strtok
(
NULL
,
"
\n
"
);
}
VLOG
(
"%s [%s] (%u, %u)
\n
"
,
dev
->
devname
,
dev
->
partname
,
(
unsigned
)
dev
->
major
,
(
unsigned
)
dev
->
minor
);
}
static
int
setup_block
(
struct
device
*
dev
,
const
char
*
partname
)
{
...
...
@@ -293,6 +301,8 @@ int main(int argc, char *argv[]) {
struct
cmdline
cmd
;
parse_cmdline
(
&
cmd
);
VLOG
(
"cmdline: skip_initramfs=[%d] slot_suffix=[%s]
\n
"
,
cmd
.
skip_initramfs
,
cmd
.
slot
);
int
root
=
open
(
"/"
,
O_RDONLY
|
O_CLOEXEC
);
if
(
cmd
.
skip_initramfs
)
{
...
...
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