Amit Pundir | af628c2 | 2016-11-02 16:37:00 +0800 | [diff] [blame] | 1 | import init.${ro.hardware}.usb.rc |
Leo Yan | a063cbd | 2017-05-23 13:03:05 +0800 | [diff] [blame] | 2 | import init.${ro.hardware}.power.rc |
Dmitry Shmidt | d711433 | 2015-12-10 10:35:59 -0800 | [diff] [blame] | 3 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 4 | on init |
| 5 | # mount debugfs |
Dmitry Shmidt | 5756810 | 2017-08-29 15:41:17 -0700 | [diff] [blame] | 6 | mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755 |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 7 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 8 | # disable transparent huge pages |
| 9 | write /sys/kernel/mm/transparent_hugepage/enabled "never" |
| 10 | |
Dmitry Shmidt | 8b50938 | 2017-07-25 15:10:48 -0700 | [diff] [blame] | 11 | # Initialize cpusets to boot-time values |
| 12 | write /dev/cpuset/foreground/cpus 0-7 |
Dmitry Shmidt | 8b50938 | 2017-07-25 15:10:48 -0700 | [diff] [blame] | 13 | write /dev/cpuset/background/cpus 0-7 |
| 14 | write /dev/cpuset/system-background/cpus 0-7 |
| 15 | write /dev/cpuset/top-app/cpus 0-7 |
| 16 | |
Dmitry Shmidt | ad4b0cc | 2018-02-09 14:58:50 -0800 | [diff] [blame] | 17 | # Create UDS structure for base VR services |
| 18 | mkdir /dev/socket/pdx 0775 system system |
| 19 | mkdir /dev/socket/pdx/system 0775 system system |
| 20 | mkdir /dev/socket/pdx/system/buffer_hub 0775 system system |
| 21 | mkdir /dev/socket/pdx/system/performance 0775 system system |
| 22 | mkdir /dev/socket/pdx/system/vr 0775 system system |
| 23 | mkdir /dev/socket/pdx/system/vr/display 0775 system system |
| 24 | mkdir /dev/socket/pdx/system/vr/pose 0775 system system |
| 25 | mkdir /dev/socket/pdx/system/vr/sensors 0775 system system |
| 26 | |
Dmitry Shmidt | 3dacd44 | 2017-08-25 13:54:51 -0700 | [diff] [blame] | 27 | start watchdogd |
| 28 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 29 | on fs |
John Stultz | 531fb4c | 2018-06-20 16:42:53 -0700 | [diff] [blame] | 30 | mount_all /vendor/etc/fstab.${ro.hardware} |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 31 | setprop ro.crypto.fuse_sdcard false |
| 32 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 33 | on post-fs |
Yongqin Liu | 05ba086 | 2016-03-23 21:22:57 +0800 | [diff] [blame] | 34 | # For legacy support |
| 35 | # See storage config details at http://source.android.com/tech/storage/ |
| 36 | # since /storage is mounted on post-fs in init.rc |
Yongqin Liu | 05ba086 | 2016-03-23 21:22:57 +0800 | [diff] [blame] | 37 | symlink /sdcard /storage/sdcard0 |
| 38 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 39 | # BT LED sysfs entry |
Dmitry Shmidt | 883877c | 2016-09-01 13:49:00 -0700 | [diff] [blame] | 40 | write /sys/class/leds/bt_active/trigger "hci1rx" |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 41 | |
| 42 | chmod 0666 /dev/ump |
| 43 | chmod 0666 /dev/ion |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 44 | chmod 0666 /dev/graphics/fb0 |
| 45 | |
| 46 | # fake some battery state |
| 47 | setprop status.battery.state Slow |
| 48 | setprop status.battery.level 5 |
| 49 | setprop status.battery.level_raw 50 |
| 50 | setprop status.battery.level_scale 9 |
| 51 | |
| 52 | # Set Display density |
| 53 | setprop ro.sf.lcd_density 160 |
| 54 | |
| 55 | # Set supported opengles version |
| 56 | setprop ro.opengles.version 196608 |
John Stultz | 6dc5ce5 | 2017-11-01 18:58:15 -0700 | [diff] [blame^] | 57 | setprop ro.hardware.hwcomposer drm |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 58 | |
Sahaj Sarup | 18db08a | 2017-09-09 03:44:32 +0530 | [diff] [blame] | 59 | # If an app forces screen rotation, revert it once the apps closes |
| 60 | setprop persist.demo.rotationlock 1 |
John Stultz | 6a4721f | 2016-08-17 17:48:15 -0700 | [diff] [blame] | 61 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 62 | # enable Google-specific location features, |
| 63 | # like NetworkLocationProvider and LocationCollector |
| 64 | setprop ro.com.google.locationfeatures 1 |
| 65 | |
| 66 | # enable test harness |
| 67 | setprop ro.test_harness true |
| 68 | |
Yongqin Liu | 8fd6c4f | 2016-12-19 17:38:31 +0800 | [diff] [blame] | 69 | on post-fs-data |
| 70 | mkdir /data/media 0770 media_rw media_rw |
| 71 | mkdir /data/misc/gatord 0700 root root |
| 72 | # Set SELinux security contexts for files used by lava. |
| 73 | restorecon_recursive /data/local/tmp/lava |
| 74 | |
Dmitry Shmidt | fe54c48 | 2018-01-30 12:49:31 -0800 | [diff] [blame] | 75 | on zygote-start |
| 76 | mkdir /data/vendor/wifi 0770 wifi wifi |
| 77 | mkdir /data/vendor/wifi/wpa 0770 wifi wifi |
| 78 | mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi |
| 79 | |
Yongqin Liu | 8fd6c4f | 2016-12-19 17:38:31 +0800 | [diff] [blame] | 80 | on property:sys.boot_completed=1 |
| 81 | # update cpuset now that processors are up |
| 82 | # Foreground should contain most cores (7 is reserved for top-app) |
| 83 | write /dev/cpuset/foreground/cpus 0-6 |
| 84 | |
| 85 | # top-app gets all cpus (including reserved #7) |
| 86 | write /dev/cpuset/top-app/cpus 0-7 |
| 87 | |
| 88 | #background contains a small subset (generally one little core) |
| 89 | write /dev/cpuset/background/cpus 0 |
| 90 | |
| 91 | # add system-background cpuset, a new cpuset for system services |
| 92 | # that should not run on larger cores |
| 93 | # system-background is for system tasks that should only run on |
| 94 | # little cores, not on bigs to be used only by init |
| 95 | write /dev/cpuset/system-background/cpus 0-3 |
| 96 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 97 | on property:usb_speed.switch=high |
| 98 | write /sys/kernel/debug/f72c0000.usb/config "0" |
| 99 | |
| 100 | on property:usb_speed.switch=full |
| 101 | write /sys/kernel/debug/f72c0000.usb/config "1" |
| 102 | |
| 103 | #userspace daemon needed for bluetooth |
Myles Watson | 34e8b23 | 2017-02-15 14:26:09 -0800 | [diff] [blame] | 104 | service uim /vendor/bin/uim |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 105 | class main |
Yongqin Liu | 6c1cf5e | 2016-06-16 23:33:50 +0800 | [diff] [blame] | 106 | user bluetooth |
Ajay Panicker | a771b13 | 2016-09-20 11:28:28 -0700 | [diff] [blame] | 107 | group bluetooth net_bt_admin system |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 108 | oneshot |
| 109 | |
Roshan Pius | 17ea3f3 | 2017-02-23 10:17:59 -0800 | [diff] [blame] | 110 | service wpa_supplicant /system/vendor/bin/hw/wpa_supplicant \ |
Jeff Vander Stoep | bf2a846 | 2017-11-30 12:37:46 -0800 | [diff] [blame] | 111 | -g@android:wpa_wlan0 |
Roshan Pius | c5ef7d2 | 2018-02-05 16:45:49 -0800 | [diff] [blame] | 112 | interface android.hardware.wifi.supplicant@1.0::ISupplicant default |
| 113 | interface android.hardware.wifi.supplicant@1.1::ISupplicant default |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 114 | socket wpa_wlan0 dgram 660 wifi wifi |
| 115 | class main |
| 116 | disabled |
| 117 | oneshot |
Dmitry Shmidt | 3dacd44 | 2017-08-25 13:54:51 -0700 | [diff] [blame] | 118 | |
| 119 | # Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin |
Tom Cherry | 60cc570 | 2018-08-02 12:35:36 -0700 | [diff] [blame] | 120 | service watchdogd /system/bin/watchdogd 10 20 |
Dmitry Shmidt | 3dacd44 | 2017-08-25 13:54:51 -0700 | [diff] [blame] | 121 | class core |
| 122 | oneshot |
| 123 | seclabel u:r:watchdogd:s0 |
Dmitry Shmidt | 6e5ccc6 | 2018-06-11 15:01:46 -0700 | [diff] [blame] | 124 | |
| 125 | service bugreport /system/bin/dumpstate -d -p -B -z \ |
| 126 | -o /data/user_de/0/com.android.shell/files/bugreports/bugreport |
| 127 | class main |
| 128 | disabled |
| 129 | oneshot |