Skip to content

Commit

Permalink
bundle init.rc contents with its service
Browse files Browse the repository at this point in the history
Bug: 23186545
Change-Id: I52616b8ab1165fdef716f9b8f958665f2308c12e
  • Loading branch information
Tom Cherry authored and spezi77 committed Mar 13, 2016
1 parent f703c80 commit eb51038
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adb/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ endif

LOCAL_MODULE := adbd

LOCAL_INIT_RC := adbd.rc

LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Expand Down
14 changes: 14 additions & 0 deletions adb/adbd.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on post-fs-data
mkdir /data/misc/adb 02750 system shell
mkdir /data/adb 0700 root root

# adbd is controlled via property triggers in init.<platform>.usb.rc
service adbd /sbin/adbd --root_seclabel=u:r:su:s0
class core
socket adbd stream 660 system system
disabled
seclabel u:r:adbd:s0

# adbd on at boot in emulator
on property:ro.kernel.qemu=1
start adbd
3 changes: 3 additions & 0 deletions debuggerd/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp

LOCAL_CPPFLAGS := $(common_cppflags)

LOCAL_INIT_RC_32 := debuggerd.rc
LOCAL_INIT_RC_64 := debuggerd64.rc

ifeq ($(TARGET_IS_64_BIT),true)
LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT
endif
Expand Down
2 changes: 2 additions & 0 deletions debuggerd/debuggerd.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service debuggerd /system/bin/debuggerd
class main
2 changes: 2 additions & 0 deletions debuggerd/debuggerd64.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service debuggerd64 /system/bin/debuggerd64
class main
2 changes: 2 additions & 0 deletions lmkd/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ LOCAL_CFLAGS := -Werror

LOCAL_MODULE := lmkd

LOCAL_INIT_RC := lmkd.rc

include $(BUILD_EXECUTABLE)
4 changes: 4 additions & 0 deletions lmkd/lmkd.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
service lmkd /system/bin/lmkd
class core
critical
socket lmkd seqpacket 0660 system system
2 changes: 2 additions & 0 deletions logcat/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ LOCAL_MODULE := logcat

LOCAL_CFLAGS := -Werror

LOCAL_INIT_RC := logcatd.rc

include $(BUILD_EXECUTABLE)

include $(call first-makefiles-under,$(LOCAL_PATH))
13 changes: 13 additions & 0 deletions logcat/logcatd.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on property:persist.logd.logpersistd=logcatd
# all exec/services are called with umask(077), so no gain beyond 0700
mkdir /data/misc/logd 0700 logd log
# logd for write to /data/misc/logd, log group for read from pstore (-L)
exec - logd log -- /system/bin/logcat -L -b all -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r 64 -n 256
start logcatd

service logcatd /system/bin/logcat -b all -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r 64 -n 256
class late_start
disabled
# logd for write to /data/misc/logd, log group for read from log daemon
user logd
group log
2 changes: 2 additions & 0 deletions logd/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ include $(CLEAR_VARS)

LOCAL_MODULE:= logd

LOCAL_INIT_RC := logd.rc

LOCAL_SRC_FILES := \
main.cpp \
LogCommand.cpp \
Expand Down
9 changes: 9 additions & 0 deletions logd/logd.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
service logd /system/bin/logd
class core
socket logd stream 0666 logd logd
socket logdr seqpacket 0666 logd logd
socket logdw dgram 0222 logd logd

service logd-reinit /system/bin/logd --reinit
oneshot
disabled

0 comments on commit eb51038

Please sign in to comment.