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 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 11 | # Disabled virtual memory randomization |
| 12 | # (if randomization is enabled the AEM-JIT will have a lower cache hit rate) |
| 13 | write /proc/sys/kernel/randomize_va_space 0 |
| 14 | |
Dmitry Shmidt | 8b50938 | 2017-07-25 15:10:48 -0700 | [diff] [blame] | 15 | # Initialize cpusets to boot-time values |
| 16 | write /dev/cpuset/foreground/cpus 0-7 |
Dmitry Shmidt | 8b50938 | 2017-07-25 15:10:48 -0700 | [diff] [blame] | 17 | write /dev/cpuset/background/cpus 0-7 |
| 18 | write /dev/cpuset/system-background/cpus 0-7 |
| 19 | write /dev/cpuset/top-app/cpus 0-7 |
| 20 | |
Dmitry Shmidt | 3dacd44 | 2017-08-25 13:54:51 -0700 | [diff] [blame] | 21 | start watchdogd |
| 22 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 23 | on fs |
Amit Pundir | af628c2 | 2016-11-02 16:37:00 +0800 | [diff] [blame] | 24 | mount_all /fstab.${ro.hardware} |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 25 | setprop ro.crypto.fuse_sdcard false |
| 26 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 27 | on post-fs |
Yongqin Liu | 05ba086 | 2016-03-23 21:22:57 +0800 | [diff] [blame] | 28 | # For legacy support |
| 29 | # See storage config details at http://source.android.com/tech/storage/ |
| 30 | # since /storage is mounted on post-fs in init.rc |
Yongqin Liu | 05ba086 | 2016-03-23 21:22:57 +0800 | [diff] [blame] | 31 | symlink /sdcard /storage/sdcard0 |
| 32 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 33 | # BT LED sysfs entry |
Dmitry Shmidt | 883877c | 2016-09-01 13:49:00 -0700 | [diff] [blame] | 34 | write /sys/class/leds/bt_active/trigger "hci1rx" |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 35 | |
| 36 | chmod 0666 /dev/ump |
| 37 | chmod 0666 /dev/ion |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 38 | chmod 0666 /dev/graphics/fb0 |
| 39 | |
| 40 | # fake some battery state |
| 41 | setprop status.battery.state Slow |
| 42 | setprop status.battery.level 5 |
| 43 | setprop status.battery.level_raw 50 |
| 44 | setprop status.battery.level_scale 9 |
| 45 | |
| 46 | # Set Display density |
| 47 | setprop ro.sf.lcd_density 160 |
| 48 | |
| 49 | # Set supported opengles version |
| 50 | setprop ro.opengles.version 196608 |
| 51 | |
Sahaj Sarup | 18db08a | 2017-09-09 03:44:32 +0530 | [diff] [blame] | 52 | # If an app forces screen rotation, revert it once the apps closes |
| 53 | setprop persist.demo.rotationlock 1 |
John Stultz | 6a4721f | 2016-08-17 17:48:15 -0700 | [diff] [blame] | 54 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 55 | # enable Google-specific location features, |
| 56 | # like NetworkLocationProvider and LocationCollector |
| 57 | setprop ro.com.google.locationfeatures 1 |
| 58 | |
| 59 | # enable test harness |
| 60 | setprop ro.test_harness true |
| 61 | |
Yongqin Liu | 8fd6c4f | 2016-12-19 17:38:31 +0800 | [diff] [blame] | 62 | on post-fs-data |
| 63 | mkdir /data/media 0770 media_rw media_rw |
| 64 | mkdir /data/misc/gatord 0700 root root |
| 65 | # Set SELinux security contexts for files used by lava. |
| 66 | restorecon_recursive /data/local/tmp/lava |
| 67 | |
| 68 | on property:sys.boot_completed=1 |
| 69 | # update cpuset now that processors are up |
| 70 | # Foreground should contain most cores (7 is reserved for top-app) |
| 71 | write /dev/cpuset/foreground/cpus 0-6 |
| 72 | |
| 73 | # top-app gets all cpus (including reserved #7) |
| 74 | write /dev/cpuset/top-app/cpus 0-7 |
| 75 | |
| 76 | #background contains a small subset (generally one little core) |
| 77 | write /dev/cpuset/background/cpus 0 |
| 78 | |
| 79 | # add system-background cpuset, a new cpuset for system services |
| 80 | # that should not run on larger cores |
| 81 | # system-background is for system tasks that should only run on |
| 82 | # little cores, not on bigs to be used only by init |
| 83 | write /dev/cpuset/system-background/cpus 0-3 |
| 84 | |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 85 | on property:usb_speed.switch=high |
| 86 | write /sys/kernel/debug/f72c0000.usb/config "0" |
| 87 | |
| 88 | on property:usb_speed.switch=full |
| 89 | write /sys/kernel/debug/f72c0000.usb/config "1" |
| 90 | |
| 91 | #userspace daemon needed for bluetooth |
Myles Watson | 34e8b23 | 2017-02-15 14:26:09 -0800 | [diff] [blame] | 92 | service uim /vendor/bin/uim |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 93 | class main |
Yongqin Liu | 6c1cf5e | 2016-06-16 23:33:50 +0800 | [diff] [blame] | 94 | user bluetooth |
Ajay Panicker | a771b13 | 2016-09-20 11:28:28 -0700 | [diff] [blame] | 95 | group bluetooth net_bt_admin system |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 96 | oneshot |
| 97 | |
Roshan Pius | 17ea3f3 | 2017-02-23 10:17:59 -0800 | [diff] [blame] | 98 | service wpa_supplicant /system/vendor/bin/hw/wpa_supplicant \ |
Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 99 | -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ |
| 100 | -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 |
| 101 | socket wpa_wlan0 dgram 660 wifi wifi |
| 102 | class main |
| 103 | disabled |
| 104 | oneshot |
Dmitry Shmidt | 3dacd44 | 2017-08-25 13:54:51 -0700 | [diff] [blame] | 105 | |
| 106 | # Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin |
| 107 | service watchdogd /sbin/watchdogd 10 20 |
| 108 | class core |
| 109 | oneshot |
| 110 | seclabel u:r:watchdogd:s0 |