summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/Android.mk20
-rw-r--r--etc/init.rc4
-rw-r--r--etc/init.recovery.servicenew.rc5
-rw-r--r--etc/init.recovery.serviceold.rc4
4 files changed, 30 insertions, 3 deletions
diff --git a/etc/Android.mk b/etc/Android.mk
index 5e612b63e..461457787 100644
--- a/etc/Android.mk
+++ b/etc/Android.mk
@@ -31,6 +31,26 @@ include $(BUILD_PREBUILT)
endif
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 22; echo $$?),0)
+ include $(CLEAR_VARS)
+ LOCAL_MODULE := init.recovery.service.rc
+ LOCAL_MODULE_TAGS := eng
+ LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
+ LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
+
+ LOCAL_SRC_FILES := init.recovery.servicenew.rc
+ include $(BUILD_PREBUILT)
+else
+ include $(CLEAR_VARS)
+ LOCAL_MODULE := init.recovery.service.rc
+ LOCAL_MODULE_TAGS := eng
+ LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
+ LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
+
+ LOCAL_SRC_FILES := init.recovery.serviceold.rc
+ include $(BUILD_PREBUILT)
+endif
+
ifeq ($(TWRP_INCLUDE_LOGCAT), true)
ifeq ($(TARGET_USES_LOGD), true)
diff --git a/etc/init.rc b/etc/init.rc
index 907436c71..a62b68d84 100644
--- a/etc/init.rc
+++ b/etc/init.rc
@@ -1,5 +1,6 @@
import /init.recovery.logd.rc
import /init.recovery.usb.rc
+import /init.recovery.service.rc
import /init.recovery.${ro.hardware}.rc
on early-init
@@ -109,9 +110,6 @@ service healthd /sbin/healthd -r
critical
seclabel u:r:healthd:s0
-service recovery /sbin/recovery
- seclabel u:r:recovery:s0
-
service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
disabled
socket adbd stream 660 system system
diff --git a/etc/init.recovery.servicenew.rc b/etc/init.recovery.servicenew.rc
new file mode 100644
index 000000000..bb2853c1a
--- /dev/null
+++ b/etc/init.recovery.servicenew.rc
@@ -0,0 +1,5 @@
+on boot
+
+# For starting recovery on 5.0 and newer
+service recovery /sbin/recovery
+ seclabel u:r:recovery:s0
diff --git a/etc/init.recovery.serviceold.rc b/etc/init.recovery.serviceold.rc
new file mode 100644
index 000000000..892b226ff
--- /dev/null
+++ b/etc/init.recovery.serviceold.rc
@@ -0,0 +1,4 @@
+on boot
+
+# For starting recovery on 4.4 and older
+service recovery /sbin/recovery