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
04995881
Commit
04995881
authored
Oct 08, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support androidboot.fstab_suffix cmdline flag
Fix #3187
parent
d4d837a5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
getinfo.cpp
native/jni/init/getinfo.cpp
+2
-0
init.hpp
native/jni/init/init.hpp
+1
-0
twostage.cpp
native/jni/init/twostage.cpp
+9
-6
No files found.
native/jni/init/getinfo.cpp
View file @
04995881
...
...
@@ -155,6 +155,8 @@ void load_kernel_info(cmdline *cmd) {
strcpy
(
cmd
->
hardware
,
value
);
}
else
if
(
key
==
"androidboot.hardware.platform"
)
{
strcpy
(
cmd
->
hardware_plat
,
value
);
}
else
if
(
key
==
"androidboot.fstab_suffix"
)
{
strcpy
(
cmd
->
fstab_suffix
,
value
);
}
});
...
...
native/jni/init/init.hpp
View file @
04995881
...
...
@@ -12,6 +12,7 @@ struct cmdline {
bool
force_normal_boot
;
char
slot
[
3
];
char
dt_dir
[
64
];
char
fstab_suffix
[
32
];
char
hardware
[
32
];
char
hardware_plat
[
32
];
};
...
...
native/jni/init/twostage.cpp
View file @
04995881
...
...
@@ -44,7 +44,7 @@ void FirstStageInit::prepare() {
fstab_file
[
0
]
=
'\0'
;
// Find existing fstab file
for
(
const
char
*
hw
:
{
cmd
->
hardware
,
cmd
->
hardware_plat
})
{
for
(
const
char
*
hw
:
{
cmd
->
fstab_suffix
,
cmd
->
hardware
,
cmd
->
hardware_plat
})
{
if
(
hw
[
0
]
==
'\0'
)
continue
;
sprintf
(
fstab_file
,
"fstab.%s"
,
hw
);
...
...
@@ -98,14 +98,17 @@ void FirstStageInit::prepare() {
}
}
// Dump dt fstab to fstab file in rootfs
if
(
fstab_file
[
0
]
==
'\0'
)
{
const
char
*
hw
=
cmd
->
hardware
[
0
]
?
cmd
->
hardware
:
(
cmd
->
hardware_plat
[
0
]
?
cmd
->
hardware_plat
:
nullptr
);
if
(
hw
==
nullptr
)
{
LOGE
(
"Cannot determine hardware name!
\n
"
);
const
char
*
suffix
=
cmd
->
fstab_suffix
[
0
]
?
cmd
->
fstab_suffix
:
(
cmd
->
hardware
[
0
]
?
cmd
->
hardware
:
(
cmd
->
hardware_plat
[
0
]
?
cmd
->
hardware_plat
:
nullptr
));
if
(
suffix
==
nullptr
)
{
LOGE
(
"Cannot determine fstab suffix!
\n
"
);
return
;
}
sprintf
(
fstab_file
,
"fstab.%s"
,
hw
);
sprintf
(
fstab_file
,
"fstab.%s"
,
suffix
);
}
// Patch init to force IsDtFstabCompatible() return false
...
...
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