Vishal Bhoj | e72c920 | 2015-10-23 18:10:21 +0100 | [diff] [blame] | 1 | on init |
| 2 | # mount debugfs |
| 3 | mount debugfs /sys/kernel/debug /sys/kernel/debug |
| 4 | |
| 5 | setprop wifi.interface wlan0 |
| 6 | |
| 7 | # Set this property so AdvancedWifiSettings would show the checkbox |
| 8 | # for Enable/Disable Active Roaming |
| 9 | setprop ro.wifi.active_roaming.enable true |
| 10 | |
| 11 | # disable transparent huge pages |
| 12 | write /sys/kernel/mm/transparent_hugepage/enabled "never" |
| 13 | |
| 14 | # See storage config details at http://source.android.com/tech/storage/ |
| 15 | symlink /sdcard /mnt/sdcard |
| 16 | symlink /sdcard /storage/sdcard0 |
| 17 | |
| 18 | |
| 19 | # Disabled virtual memory randomization |
| 20 | # (if randomization is enabled the AEM-JIT will have a lower cache hit rate) |
| 21 | write /proc/sys/kernel/randomize_va_space 0 |
| 22 | |
| 23 | #bluetooth |
| 24 | #UART device |
| 25 | chmod 0660 /dev/ttyAMA1 |
| 26 | chown bluetooth net_bt_stack /dev/ttyAMA1 |
| 27 | |
| 28 | on fs |
| 29 | mount_all /fstab.hikey |
| 30 | setprop ro.crypto.fuse_sdcard false |
| 31 | |
| 32 | mount configfs none /sys/kernel/config |
| 33 | mkdir /sys/kernel/config/usb_gadget/g1 |
| 34 | mkdir /sys/kernel/config/usb_gadget/g1/functions/ffs.adb |
| 35 | |
| 36 | mkdir /dev/usb-ffs 0770 shell shell |
| 37 | mkdir /dev/usb-ffs/adb 0770 shell shell |
| 38 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 39 | |
| 40 | write /sys/kernel/config/usb_gadget/g1/idVendor 0x12d1 |
| 41 | write /sys/kernel/config/usb_gadget/g1/idProduct 0x103a |
| 42 | mkdir /sys/kernel/config/usb_gadget/g1/strings/0x409 |
| 43 | write /sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber "0123456789" |
| 44 | write /sys/kernel/config/usb_gadget/g1/strings/0x409/manufacturer "HISILICON" |
| 45 | write /sys/kernel/config/usb_gadget/g1/strings/0x409/product "ADB Gadget" |
| 46 | |
| 47 | mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1 |
| 48 | mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409 |
| 49 | write /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409/configuration "Conf 1" |
| 50 | symlink /sys/kernel/config/usb_gadget/g1/functions/ffs.adb /sys/kernel/config/usb_gadget/g1/configs/c.1/ffs.adb |
| 51 | start adbd |
| 52 | |
| 53 | |
| 54 | on post-fs-data |
| 55 | mkdir /data/media 0770 media_rw media_rw |
| 56 | mkdir /data/misc/gatord 0700 root root |
| 57 | mkdir /data/misc/wireless 0771 system system |
| 58 | mkdir /data/misc/wifi 0771 wifi wifi |
| 59 | mkdir /data/misc/wifi/sockets 0771 wifi wifi |
| 60 | mkdir /data/misc/wifi/wapi_certs 0777 wifi wifi |
| 61 | mkdir /data/misc/dhcp 0770 dhcp dhcp |
| 62 | # Set SELinux security contexts for files used by lava. |
| 63 | restorecon_recursive /data/local/tmp/lava |
| 64 | |
| 65 | on post-fs |
| 66 | # insert WiFi Modules |
| 67 | insmod /system/modules/rfkill.ko |
| 68 | insmod /system/modules/wifi/compat.ko |
| 69 | insmod /system/modules/wifi/cfg80211.ko |
| 70 | insmod /system/modules/wifi/mac80211.ko |
| 71 | insmod /system/modules/wifi/wlcore.ko |
| 72 | insmod /system/modules/wifi/wl18xx.ko |
| 73 | insmod /system/modules/wifi/wlcore_sdio.ko |
| 74 | |
| 75 | # BT LED sysfs entry |
| 76 | write /sys/devices/leds/leds/bt_active/trigger "hci1rx" |
| 77 | |
| 78 | chmod 0666 /dev/ump |
| 79 | chmod 0666 /dev/ion |
| 80 | chmod 0666 /dev/mali |
| 81 | chown system.graphics /dev/mali |
| 82 | chmod 0666 /dev/graphics/fb0 |
| 83 | |
| 84 | # fake some battery state |
| 85 | setprop status.battery.state Slow |
| 86 | setprop status.battery.level 5 |
| 87 | setprop status.battery.level_raw 50 |
| 88 | setprop status.battery.level_scale 9 |
| 89 | |
| 90 | # Set Display density |
| 91 | setprop ro.sf.lcd_density 160 |
| 92 | |
| 93 | # Set supported opengles version |
| 94 | setprop ro.opengles.version 196608 |
| 95 | |
| 96 | # change permissions for process groups |
| 97 | # https://bugs.launchpad.net/bugs/1037611 |
| 98 | chmod 0660 /dev/cpuctl |
| 99 | |
| 100 | # enable Google-specific location features, |
| 101 | # like NetworkLocationProvider and LocationCollector |
| 102 | setprop ro.com.google.locationfeatures 1 |
| 103 | |
| 104 | # enable test harness |
| 105 | setprop ro.test_harness true |
| 106 | |
| 107 | # Setup paths used for socket communication with the dhcp daemon (dhcpd) |
| 108 | mkdir /data/misc/dhcp 0770 dhcp dhcp |
| 109 | chown dhcp dhcp /data/misc/dhcp |
| 110 | |
| 111 | on property:sys.usb.config=adb |
| 112 | write /sys/kernel/config/usb_gadget/g1/UDC "f72c0000.usb" |
| 113 | write /sys/class/udc/f72c0000.usb/soft_connect "disconnect" |
| 114 | write /sys/class/udc/f72c0000.usb/soft_connect "connect" |
| 115 | setprop sys.usb.state ${sys.usb.config} |
| 116 | |
| 117 | # FIXME: we need to bind the driver while adbd is restarted. We need delay else bind fails. Need to investigate |
| 118 | on property:init.svc.adbd=running |
| 119 | wait /dev/socket/hack 1 |
| 120 | write /sys/kernel/config/usb_gadget/g1/UDC "f72c0000.usb" |
| 121 | write /sys/class/udc/f72c0000.usb/soft_connect "disconnect" |
| 122 | write /sys/class/udc/f72c0000.usb/soft_connect "connect" |
| 123 | setprop sys.usb.state ${sys.usb.config} |
| 124 | |
| 125 | |
| 126 | on property:usb_speed.switch=high |
| 127 | write /sys/kernel/debug/f72c0000.usb/config "0" |
| 128 | |
| 129 | on property:usb_speed.switch=full |
| 130 | write /sys/kernel/debug/f72c0000.usb/config "1" |
| 131 | |
| 132 | #userspace daemon needed for bluetooth |
| 133 | service uim /system/bin/uim |
| 134 | class main |
| 135 | user root |
| 136 | oneshot |
| 137 | |
| 138 | service wpa_supplicant /system/bin/wpa_supplicant \ |
| 139 | -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ |
| 140 | -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 |
| 141 | socket wpa_wlan0 dgram 660 wifi wifi |
| 142 | class main |
| 143 | disabled |
| 144 | oneshot |
| 145 | |
| 146 | service dhcpcd_wlan0 /system/bin/dhcpcd -dABKL |
| 147 | group dhcp |
| 148 | disabled |
| 149 | oneshot |
| 150 | |
| 151 | service dhcpcd_eth0 /system/bin/dhcpcd -dABKL |
| 152 | group dhcp |
| 153 | disabled |
| 154 | oneshot |
| 155 | |
| 156 | service dhcpcd_bt-pan /system/bin/dhcpcd -dABKL |
| 157 | group dhcp |
| 158 | disabled |
| 159 | oneshot |