From d26135b34d4ee9d983931d64c8cb18dd2562b938 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 24 Sep 2014 11:46:36 -0700 Subject: [PATCH] Include reason when wiping data. This will help us track down who requested a data wipe. Bug: 17412160 Change-Id: I40f73d2d0f08123d2afc044a3dde485151b400d9 --- init/builtins.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/builtins.c b/init/builtins.c index 8dbaab76a..c1925514b 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -478,7 +478,8 @@ static int wipe_data_via_recovery() mkdir("/cache/recovery", 0700); int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC, 0600); if (fd >= 0) { - write(fd, "--wipe_data", strlen("--wipe_data") + 1); + 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");