# Originally device/intel/common/init.common.rc import /init.watchdog.rc import /init.firmware.rc import /init.ksm.rc import /init.readahead.rc import /init.dirtybackground.rc import /init.silentlake.rc import /init.zram.rc on early-init # set permission for charger-mode chmod 0750 /charger chown system system /dev/dri/card0 chmod 0666 /dev/dri/card0 symlink /dev/dri/card0 /dev/card0 # Enable native bridge for target executables mount binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc # Mount debugfs for systrace settings mount debugfs none /sys/kernel/debug mode=0755 on init mkdir /mnt/shell 0700 shell shell # set usb serial number write /sys/class/android_usb/android0/iSerial ${ro.serialno} # support legacy paths symlink /sdcard /mnt/sdcard symlink /sdcard /storage/sdcard0 on boot #Change mmc queue nr_requests from 128 to 32 to reduce write latencies write /sys/block/mmcblk0/queue/nr_requests 32 # Change TCP Net-Core buffers sizes to improve cellular data throughput write /proc/sys/net/core/rmem_default 1048576 write /proc/sys/net/core/rmem_max 2097152 write /proc/sys/net/core/wmem_max 1048576 #Set freezing timeout value as 2000ms write /sys/power/pm_freeze_timeout 2000 on fs mkdir /factory 0775 system system mkdir /config 0775 system system mkdir /media 0775 media media mount_all /fstab mkdir /config/wifi chown system wifi /config/wifi chmod 0770 /config/wifi mkdir /config/em chown system system /config/em chmod 0770 /config/em chown system system /sys/class/usb_otg/otg0/a_bus_drop restorecon_recursive /config restorecon_recursive /factory restorecon_recursive /logs on post-fs # create virtual SD card at /mnt/sdcard, based on the /data/media directory # daemon will drop to user/group system/media_rw after initializing # underlying files in /data/media will be created with user and group media_rw (1023) # Performance tweaks for interactive governor chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse_duration chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboost_freq chmod 0220 /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse chmod 0220 /sys/devices/system/cpu/cpufreq/interactive/boostpulse write /sys/devices/system/cpu/cpufreq/interactive/irq_load_threshold 2 on post-fs-data mkdir /data/system/ 0770 system system write /proc/sys/kernel/ctrl-alt-del 0 mkdir /mnt/asec/media 0770 media media # Disable data roaming option enabled by default setprop ro.com.android.dataroaming false # Set indication (checked by vold) that we have finished this action setprop vold.post_fs_data_done 1 # Set this property to force the camera shutter sound to play on speaker setprop ro.camera.sound.forced 1 # Set this property to avoid fm rx to be muted setprop ro.fmrx.sound.forced 1 chown system system /sys/class/drm/card0/gt_max_freq_mhz # Collect panic data systematically copy /proc/emmc_ipanic_header /data/dontpanic/emmc_ipanic_header chown root log /data/dontpanic/emmc_ipanic_header chmod 0640 /data/dontpanic/emmc_ipanic_header copy /proc/emmc_ipanic_console /data/dontpanic/emmc_ipanic_console chown root log /data/dontpanic/emmc_ipanic_console chmod 0640 /data/dontpanic/emmc_ipanic_console copy /proc/emmc_ipanic_threads /data/dontpanic/emmc_ipanic_threads chown root log /data/dontpanic/emmc_ipanic_threads chmod 0640 /data/dontpanic/emmc_ipanic_threads copy /proc/emmc_ipanic_gbuffer /data/dontpanic/emmc_ipanic_gbuffer chown root log /data/dontpanic/emmc_ipanic_gbuffer chmod 0640 /data/dontpanic/emmc_ipanic_gbuffer on property:sys.boot_completed=1 start bcu_cpufreqrel on charger #set properties in COS start intel_prop setprop thermal.lite.crash 0 chown system system /dev/dri/card0 chmod 0666 /dev/dri/card0 symlink /dev/dri/card0 /dev/card0 # The permissions below should be tighter. chown system system /dev/card0 #default setting to enable charging in COS setprop sys.usb.config charging start thermald trigger firmware_mounts_complete service thermald /sbin/thermald class core disabled user root seclabel u:r:thermald:s0 service bcu_cpufreqrel /system/bin/bcu_cpufreqrel group system oneshot disabled service ct_monitor /system/bin/ct_monitor class core oneshot user root service charger_app /charger class charger user root seclabel u:r:healthd:s0 # Enable native bridge for target executables on property:ro.enable.native.bridge.exec=1 copy /system/vendor/etc/binfmt_misc/arm_exe /proc/sys/fs/binfmt_misc/register copy /system/vendor/etc/binfmt_misc/arm_dyn /proc/sys/fs/binfmt_misc/register on property:ro.enable.native.bridge.exec64=1 copy /system/vendor/etc/binfmt_misc/arm64_exe /proc/sys/fs/binfmt_misc/register copy /system/vendor/etc/binfmt_misc/arm64_dyn /proc/sys/fs/binfmt_misc/register # This property trigger has added to imitiate the previous behavior of "adb root". # The adb gadget driver used to reset the USB bus when the adbd daemon exited, # and the host side adb relied on this behavior to force it to reconnect with the # new adbd instance after init relaunches it. So now we force the USB bus to reset # here when adbd sets the service.adb.root property to 1. We also restart adbd here # rather than waiting for init to notice its death and restarting it so the timing # of USB resetting and adb restarting more closely matches the previous behavior. on property:service.adb.root=1 write /sys/class/android_usb/android0/enable 0 restart adbd write /sys/class/android_usb/android0/enable 1 on property:sys.property_forcedshutdown=1 write /sys/module/intel_mid_osip/parameters/force_shutdown_occured 1 on property:sys.shutdown.requested=0 write /sys/devices/virtual/misc/watchdog/shutdown_ongoing 1 on property:sys.shutdown.requested=1 write /sys/devices/virtual/misc/watchdog/reboot_ongoing 1 on property:sys.shutdown.requested=1recovery write /sys/devices/virtual/misc/watchdog/reboot_ongoing 1 on property:sys.shutdown.requested=1bootloader write /sys/devices/virtual/misc/watchdog/reboot_ongoing 1 # bugreport is triggered by holding down volume down, volume up and power service bugreport /system/bin/dumpstate -d -p -B \ -o /data/data/com.android.shell/files/bugreports/bugreport class main disabled oneshot keycodes 114 115 116