Refactor Lineage init rc file

*) Put Lineage rc files in /system/etc/init instead of /init.lineage.rc

*) Split into function specific files (vibrator-specific stuff moved to
   our custom vibrator HAL service)

Change-Id: I1d00950253fbf7fdd7a4b7bd52adbed971923575
This commit is contained in:
Sam Mortimer 2017-09-21 10:10:49 -07:00
parent 6c3c2c0bca
commit c10885231f
10 changed files with 142 additions and 147 deletions

View file

@ -65,9 +65,9 @@ PRODUCT_COPY_FILES += \
vendor/lineage/prebuilt/common/etc/init.d/90userinit:system/etc/init.d/90userinit
endif
# Lineage-specific init file
PRODUCT_COPY_FILES += \
vendor/lineage/prebuilt/common/etc/init.local.rc:root/init.lineage.rc
# Copy all Lineage-specific init rc files
$(foreach f,$(wildcard vendor/lineage/prebuilt/common/etc/init/*.rc),\
$(eval PRODUCT_COPY_FILES += $(f):system/etc/init/$(notdir $f)))
# Copy over added mimetype supported in libcore.net.MimeUtils
PRODUCT_COPY_FILES += \

View file

@ -0,0 +1,11 @@
# adb over network
on property:adb.network.port=*
setprop service.adb.tcp.port ${adb.network.port}
on property:service.adb.tcp.port=5555
stop adbd
start adbd
on property:service.adb.tcp.port=-1
stop adbd
start adbd

View file

@ -1,38 +1,3 @@
# LineageOS extras
on init
export ANDROID_CACHE /cache
export TERMINFO /system/etc/terminfo
# Set up the BFQIO hierarchy
mkdir /dev/bfqio 0755 root system
mount cgroup none /dev/bfqio bfqio
chown root system /dev/bfqio/tasks
chmod 0664 /dev/bfqio/tasks
chmod 0220 /dev/bfqio/cgroup.event_control
# Soft realtime class for display service
mkdir /dev/bfqio/rt-display 0755 root system
write /dev/bfqio/rt-display/bfqio.ioprio_class 1
chown system system /dev/bfqio/rt-display/tasks
chmod 0664 /dev/bfqio/rt-display/tasks
chmod 0220 /dev/bfqio/rt-display/cgroup.event_control
on post-fs-data
mkdir /data/ssh 0750 root shell
mkdir /data/ssh/empty 0600 root shell
mkdir /cache/recovery 0770 system cache
# Create an additional OTA package directory that unlike /data/ota_package
# will not be touched by GmsCore.
mkdir /data/lineageos_updates 0770 system cache
# Run sysinit
start sysinit
# Change permissions on fsck log so it can be added to the dropbox
chown root log /dev/fscklogs/log
chmod 0640 /dev/fscklogs/log
on boot
# interactive governor
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
@ -102,114 +67,5 @@ on boot
chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
chown system system /sys/block/mmcblk0/queue/scheduler
chmod 0664 /sys/block/mmcblk0/queue/scheduler
restorecon /sys/block/mmcblk0/queue/scheduler
chown system system /sys/block/sda/queue/scheduler
chmod 0664 /sys/block/sda/queue/scheduler
restorecon /sys/block/sda/queue/scheduler
chown system system /sys/block/sde/queue/scheduler
chmod 0664 /sys/block/sde/queue/scheduler
restorecon /sys/block/sde/queue/scheduler
chown system system /sys/block/dm-0/queue/scheduler
chmod 0664 /sys/block/dm-0/queue/scheduler
restorecon /sys/block/dm-0/queue/scheduler
chown system system /dev/cpuctl/cpu.notify_on_migrate
chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
# LiveDisplay sysfs
chown system system /sys/devices/virtual/graphics/fb0/aco
chmod 0660 /sys/devices/virtual/graphics/fb0/aco
chown system system /sys/devices/virtual/graphics/fb0/cabc
chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
chown system system /sys/devices/virtual/graphics/fb0/hbm
chmod 0660 /sys/devices/virtual/graphics/fb0/hbm
chown system system /sys/devices/virtual/graphics/fb0/rgb
chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
chown system system /sys/devices/virtual/graphics/fb0/sre
chmod 0660 /sys/devices/virtual/graphics/fb0/sre
chown system system /sys/devices/virtual/graphics/fb0/color_enhance
chmod 0660 /sys/devices/virtual/graphics/fb0/color_enhance
# Vibrator intensity control
chown system system /sys/class/timed_output/vibrator/vtg_level
chmod 0644 /sys/class/timed_output/vibrator/vtg_level
# Define TCP delayed ack settings for WiFi & LTE
chown system system /sys/kernel/ipv4/tcp_delack_seg
chown system system /sys/kernel/ipv4/tcp_use_userconfig
setprop net.tcp.delack.default 1
setprop net.tcp.delack.wifi 20
setprop net.tcp.delack.lte 8
setprop net.tcp.usercfg.default 0
setprop net.tcp.usercfg.wifi 1
setprop net.tcp.usercfg.lte 1
# Persistent properties (only created if persist exists)
mkdir /persist/properties 0770 system system
# sysinit (/system/etc/init.d)
service sysinit /system/bin/sysinit
user root
oneshot
disabled
# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/dumpstate -d -p -B -z \
-o /data/user_de/0/com.android.shell/files/bugreports/bugreport
oneshot
disabled
keycodes 114 115 116
# adb over network
on property:adb.network.port=*
setprop service.adb.tcp.port ${adb.network.port}
on property:service.adb.tcp.port=5555
stop adbd
start adbd
on property:service.adb.tcp.port=-1
stop adbd
start adbd
# Disable ril services if noril prop is set
on property:ro.radio.noril=1
stop ril-daemon
stop qmuxd
stop netmgrd
on property:persist.radio.noril=1
setprop ro.radio.noril 1
# Configure IO scheduler
on property:sys.io.scheduler=*
write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
write /sys/block/mmcblk1/queue/scheduler ${sys.io.scheduler}
write /sys/block/sda/queue/scheduler ${sys.io.scheduler}
write /sys/block/sde/queue/scheduler ${sys.io.scheduler}
write /sys/block/dm-0/queue/scheduler ${sys.io.scheduler}
on property:persist.sys.io.scheduler=*
setprop sys.io.scheduler ${persist.sys.io.scheduler}
# Set slice_idle to 0 for CFQ
on property:sys.io.scheduler=cfq
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
write /sys/block/mmcblk1/queue/iosched/slice_idle 0
write /sys/block/sda/queue/iosched/slice_idle 0
write /sys/block/sde/queue/iosched/slice_idle 0
write /sys/block/dm-0/queue/iosched/slice_idle 0
# Set slice_idle to 0 for BFQ
on property:sys.io.scheduler=bfq
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
write /sys/block/mmcblk1/queue/iosched/slice_idle 0
write /sys/block/sda/queue/iosched/slice_idle 0
write /sys/block/sde/queue/iosched/slice_idle 0
write /sys/block/dm-0/queue/iosched/slice_idle 0

View file

@ -0,0 +1,58 @@
on init
# Set up the BFQIO hierarchy
mkdir /dev/bfqio 0755 root system
mount cgroup none /dev/bfqio bfqio
chown root system /dev/bfqio/tasks
chmod 0664 /dev/bfqio/tasks
chmod 0220 /dev/bfqio/cgroup.event_control
# Soft realtime class for display service
mkdir /dev/bfqio/rt-display 0755 root system
write /dev/bfqio/rt-display/bfqio.ioprio_class 1
chown system system /dev/bfqio/rt-display/tasks
chmod 0664 /dev/bfqio/rt-display/tasks
chmod 0220 /dev/bfqio/rt-display/cgroup.event_control
on boot
chown system system /sys/block/mmcblk0/queue/scheduler
chmod 0664 /sys/block/mmcblk0/queue/scheduler
restorecon /sys/block/mmcblk0/queue/scheduler
chown system system /sys/block/sda/queue/scheduler
chmod 0664 /sys/block/sda/queue/scheduler
restorecon /sys/block/sda/queue/scheduler
chown system system /sys/block/sde/queue/scheduler
chmod 0664 /sys/block/sde/queue/scheduler
restorecon /sys/block/sde/queue/scheduler
chown system system /sys/block/dm-0/queue/scheduler
chmod 0664 /sys/block/dm-0/queue/scheduler
restorecon /sys/block/dm-0/queue/scheduler
# Configure IO scheduler
on property:sys.io.scheduler=*
write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
write /sys/block/mmcblk1/queue/scheduler ${sys.io.scheduler}
write /sys/block/sda/queue/scheduler ${sys.io.scheduler}
write /sys/block/sde/queue/scheduler ${sys.io.scheduler}
write /sys/block/dm-0/queue/scheduler ${sys.io.scheduler}
on property:persist.sys.io.scheduler=*
setprop sys.io.scheduler ${persist.sys.io.scheduler}
# Set slice_idle to 0 for CFQ
on property:sys.io.scheduler=cfq
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
write /sys/block/mmcblk1/queue/iosched/slice_idle 0
write /sys/block/sda/queue/iosched/slice_idle 0
write /sys/block/sde/queue/iosched/slice_idle 0
write /sys/block/dm-0/queue/iosched/slice_idle 0
# Set slice_idle to 0 for BFQ
on property:sys.io.scheduler=bfq
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
write /sys/block/mmcblk1/queue/iosched/slice_idle 0
write /sys/block/sda/queue/iosched/slice_idle 0
write /sys/block/sde/queue/iosched/slice_idle 0
write /sys/block/dm-0/queue/iosched/slice_idle 0

View file

@ -0,0 +1,14 @@
on boot
# LiveDisplay sysfs
chown system system /sys/devices/virtual/graphics/fb0/aco
chmod 0660 /sys/devices/virtual/graphics/fb0/aco
chown system system /sys/devices/virtual/graphics/fb0/cabc
chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
chown system system /sys/devices/virtual/graphics/fb0/hbm
chmod 0660 /sys/devices/virtual/graphics/fb0/hbm
chown system system /sys/devices/virtual/graphics/fb0/rgb
chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
chown system system /sys/devices/virtual/graphics/fb0/sre
chmod 0660 /sys/devices/virtual/graphics/fb0/sre
chown system system /sys/devices/virtual/graphics/fb0/color_enhance
chmod 0660 /sys/devices/virtual/graphics/fb0/color_enhance

View file

@ -0,0 +1,8 @@
# Disable ril services if noril prop is set
on property:ro.radio.noril=1
stop ril-daemon
stop qmuxd
stop netmgrd
on property:persist.radio.noril=1
setprop ro.radio.noril 1

View file

@ -0,0 +1,3 @@
on post-fs-data
mkdir /data/ssh 0750 root shell
mkdir /data/ssh/empty 0600 root shell

View file

@ -0,0 +1,31 @@
# LineageOS core functionality
on init
export ANDROID_CACHE /cache
export TERMINFO /system/etc/terminfo
on post-fs-data
mkdir /cache/recovery 0770 system cache
# Run sysinit
start sysinit
# Change permissions on fsck log so it can be added to the dropbox
chown root log /dev/fscklogs/log
chmod 0640 /dev/fscklogs/log
on boot
# Persistent properties (only created if persist exists)
mkdir /persist/properties 0770 system system
# sysinit (/system/etc/init.d)
service sysinit /system/bin/sysinit
user root
oneshot
disabled
# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/dumpstate -d -p -B -z \
-o /data/user_de/0/com.android.shell/files/bugreports/bugreport
oneshot
disabled
keycodes 114 115 116

View file

@ -0,0 +1,10 @@
on boot
# Define TCP delayed ack settings for WiFi & LTE
chown system system /sys/kernel/ipv4/tcp_delack_seg
chown system system /sys/kernel/ipv4/tcp_use_userconfig
setprop net.tcp.delack.default 1
setprop net.tcp.delack.wifi 20
setprop net.tcp.delack.lte 8
setprop net.tcp.usercfg.default 0
setprop net.tcp.usercfg.wifi 1
setprop net.tcp.usercfg.lte 1

View file

@ -0,0 +1,4 @@
on post-fs-data
# Create an additional OTA package directory that unlike /data/ota_package
# will not be touched by GmsCore.
mkdir /data/lineageos_updates 0770 system cache