init: add services to build
hwservicemanager and servicemanager are needed for decryption
and fastbootd in TWRP. Include these services by default since
they are standard Android services and independent of device
tree or SoC.
Change-Id: Id0ec73d9a6ca0289c7b4f67e9dcf541b2157c04e
diff --git a/Android.mk b/Android.mk
index 1659e83..f536f1a 100755
--- a/Android.mk
+++ b/Android.mk
@@ -381,6 +381,8 @@
init.recovery.hlthchrg.rc \
init.recovery.service.rc \
init.recovery.ldconfig.rc \
+ hwservicemanager.rc \
+ servicemanager.rc \
awk \
toybox \
toolbox \
diff --git a/etc/Android.mk b/etc/Android.mk
index cb31a68..1c88912 100755
--- a/etc/Android.mk
+++ b/etc/Android.mk
@@ -58,6 +58,24 @@
LOCAL_SRC_FILES := init.recovery.ldconfig.rc
include $(BUILD_PREBUILT)
+include $(CLEAR_VARS)
+LOCAL_MODULE := hwservicemanager.rc
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
+LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/etc/init
+
+LOCAL_SRC_FILES := init/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := servicemanager.rc
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
+LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/etc/init
+
+LOCAL_SRC_FILES := init/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
ifeq ($(TWRP_INCLUDE_LOGCAT), true)
ifeq ($(TARGET_USES_LOGD), true)
diff --git a/etc/init/hwservicemanager.rc b/etc/init/hwservicemanager.rc
new file mode 100644
index 0000000..bbafb6d
--- /dev/null
+++ b/etc/init/hwservicemanager.rc
@@ -0,0 +1,9 @@
+on init
+ start hwservicemanager
+
+service hwservicemanager /system/bin/hwservicemanager
+ user root
+ group root
+ onrestart setprop hwservicemanager.ready false
+ disabled
+ seclabel u:r:recovery:s0
diff --git a/etc/init/servicemanager.rc b/etc/init/servicemanager.rc
new file mode 100644
index 0000000..40ed84d
--- /dev/null
+++ b/etc/init/servicemanager.rc
@@ -0,0 +1,8 @@
+on init
+ start servicemanager
+
+service servicemanager /system/bin/servicemanager
+ user root
+ group root readproc
+ disabled
+ seclabel u:r:recovery:s0