Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemCore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemCore
Commits
46e03798
Commit
46e03798
authored
Apr 6, 2016
by
Yabin Cui
Browse files
Options
Downloads
Patches
Plain Diff
init: write bootloader message directly.
Bug: 27176738 Change-Id: I8c95a193f3436c0893d5103760b700f3052888db
parent
a30a6263
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
init/Android.mk
+1
-0
1 addition, 0 deletions
init/Android.mk
init/builtins.cpp
+5
-8
5 additions, 8 deletions
init/builtins.cpp
with
6 additions
and
8 deletions
init/Android.mk
+
1
−
0
View file @
46e03798
...
...
@@ -83,6 +83,7 @@ LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
LOCAL_STATIC_LIBRARIES
:=
\
libinit
\
libbootloader_message_writer
\
libfs_mgr
\
libfec
\
libfec_rs
\
...
...
This diff is collapsed.
Click to expand it.
init/builtins.cpp
+
5
−
8
View file @
46e03798
...
...
@@ -44,6 +44,7 @@
#include
<android-base/file.h>
#include
<android-base/parseint.h>
#include
<android-base/stringprintf.h>
#include
<bootloader_message_writer.h>
#include
<cutils/partition_utils.h>
#include
<cutils/android_reboot.h>
#include
<logwrap/logwrap.h>
...
...
@@ -450,14 +451,10 @@ exit_success:
}
static
int
wipe_data_via_recovery
()
{
mkdir
(
"/cache/recovery"
,
0700
);
int
fd
=
open
(
"/cache/recovery/command"
,
O_RDWR
|
O_CREAT
|
O_TRUNC
|
O_CLOEXEC
,
0600
);
if
(
fd
>=
0
)
{
write
(
fd
,
"--wipe_data
\n
"
,
strlen
(
"--wipe_data
\n
"
)
+
1
);
write
(
fd
,
"--reason=wipe_data_via_recovery
\n
"
,
strlen
(
"--reason=wipe_data_via_recovery
\n
"
)
+
1
);
close
(
fd
);
}
else
{
ERROR
(
"could not open /cache/recovery/command
\n
"
);
const
std
::
vector
<
std
::
string
>
options
=
{
"--wipe_data"
,
"--reason=wipe_data_via_recovery"
};
std
::
string
err
;
if
(
!
write_bootloader_message
(
options
,
&
err
))
{
ERROR
(
"failed to set bootloader message: %s"
,
err
.
c_str
());
return
-
1
;
}
android_reboot
(
ANDROID_RB_RESTART2
,
0
,
"recovery"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment