From 7baebf1345ff9e861ea8ccf9712128a3b7cd9fcc Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 14 Jan 2014 12:30:40 -0800 Subject: [PATCH] add the pre-recovery service Add a service called "pre-recovery" which is normally stopped but can be started by the system server when we want to go into recovery. It will do any preparation needed (currently needed to handle update packages that reside on an encrypted /data partition) and then set sys.powerctl when it's ready to actually reboot. Bug: 12188746 Change-Id: I894a4cb200395a0f6d7fe643ed4c2ac0a45d2052 --- include/private/android_filesystem_config.h | 1 + init/property_service.c | 1 + rootdir/init.rc | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index 53619ac168..e3568ae048 100644 --- a/include/private/android_filesystem_config.h +++ b/include/private/android_filesystem_config.h @@ -247,6 +247,7 @@ static const struct fs_path_config android_files[] = { /* the following files have enhanced capabilities and ARE included in user builds. */ { 00750, AID_ROOT, AID_SHELL, (1 << CAP_SETUID) | (1 << CAP_SETGID), "system/bin/run-as" }, + { 00750, AID_ROOT, AID_ROOT, 0, "system/bin/uncrypt" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" }, { 00755, AID_ROOT, AID_ROOT, 0, "system/lib/valgrind/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" }, diff --git a/init/property_service.c b/init/property_service.c index 1b9327ce37..6cdb9574e7 100644 --- a/init/property_service.c +++ b/init/property_service.c @@ -110,6 +110,7 @@ struct { } control_perms[] = { { "dumpstate",AID_SHELL, AID_LOG }, { "ril-daemon",AID_RADIO, AID_RADIO }, + { "pre-recovery", AID_SYSTEM, AID_SYSTEM }, {NULL, 0, 0 } }; diff --git a/rootdir/init.rc b/rootdir/init.rc index 7ee1be9019..324ac373b9 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -577,3 +577,8 @@ service mdnsd /system/bin/mdnsd socket mdnsd stream 0660 mdnsr inet disabled oneshot + +service pre-recovery /system/bin/uncrypt + class main + disabled + oneshot -- GitLab