Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_vold
Commits
ffa2e099
Commit
ffa2e099
authored
9 years ago
by
Yabin Cui
Browse files
Options
Download
Email Patches
Plain Diff
vold: write bootloader message directly.
Bug: 27176738 Change-Id: I09bfe777e383325809d7ecc2dcb9129fe234053f
parent
8aff854b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
Android.mk
Android.mk
+1
-0
cryptfs.c
cryptfs.c
+3
-8
No files found.
Android.mk
View file @
ffa2e099
...
...
@@ -60,6 +60,7 @@ common_shared_libraries := \
libkeymaster_messages
\
common_static_libraries
:=
\
libbootloader_message_writer
\
libfs_mgr
\
libfec
\
libfec_rs
\
...
...
This diff is collapsed.
Click to expand it.
cryptfs.c
View file @
ffa2e099
...
...
@@ -62,6 +62,7 @@
#include "CheckBattery.h"
#include "Process.h"
#include <bootloader_message_writer.h>
#include <hardware/keymaster0.h>
#include <hardware/keymaster1.h>
...
...
@@ -3262,14 +3263,8 @@ int cryptfs_enable_internal(char *howarg, int crypt_type, char *passwd,
if
(
!
strcmp
(
value
,
"1"
))
{
/* wipe data if encryption failed */
SLOGE
(
"encryption failed - rebooting into recovery to wipe data
\n
"
);
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=cryptfs_enable_internal
\n
"
,
strlen
(
"--reason=cryptfs_enable_internal
\n
"
)
+
1
);
close
(
fd
);
}
else
{
SLOGE
(
"could not open /cache/recovery/command
\n
"
);
if
(
!
write_bootloader_message
(
"--wipe_data
\n
--reason=cryptfs_enable_internal
\n
"
))
{
SLOGE
(
"could not write bootloader message
\n
"
);
}
cryptfs_reboot
(
recovery
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
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