Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.98 KB | None | 0 0
  1. import init.htc7x30.usb.rc
  2.  
  3. on early-init
  4. # Removed during droid-hal-device build : mount debugfs /sys/kernel/debug /sys/kernel/debug
  5. mkdir /storage 0555 root root
  6. mkdir /storage/primary 0555 root root
  7. mkdir /storage/primary/legacy 0555 root root
  8. export EXTERNAL_STORAGE /storage/primary/legacy
  9.  
  10. # Support legacy paths
  11. symlink /storage/primary/legacy /sdcard
  12. symlink /storage/primary/legacy /mnt/sdcard
  13. symlink /storage/primary/legacy /storage/sdcard0
  14. symlink /mnt/shell/primary/0 /storage/primary/legacy
  15.  
  16. setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000
  17.  
  18. on early-fs
  19. mkdir /devlog 0700 root root
  20.  
  21. on fs
  22. #mount all the things
  23. mount_all fstab.spade
  24.  
  25. on post-fs
  26. chmod 0771 /cache
  27. chown system cache /cache
  28. chmod 0700 /devlog
  29. chown root root /devlog
  30.  
  31. on post-fs-data
  32. # Prep for services
  33. chmod 0771 /data
  34. chown system system /data
  35. mkdir /data/radio 0770 radio radio
  36. mkdir /data/misc 1771 system misc
  37. mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  38. mkdir /data/misc/keystore 0700 keystore keystore
  39. mkdir /data/misc/vpn 0770 system vpn
  40. chown system vpn /data/misc/vpn
  41. mkdir /data/misc/vpn/profiles 0770 system vpn
  42. chown system vpn /data/misc/vpn/profiles
  43. mkdir /data/misc/wifi 0770 wifi wifi
  44. mkdir /data/misc/wifi/sockets 0770 wifi wifi
  45. mkdir /data/misc/dhcp 0770 dhcp dhcp
  46. chown dhcp dhcp /data/misc/dhcp
  47.  
  48. # Allow system to have access to /dev/tun directory
  49. mkdir /dev/tun 0770 system vpn
  50. chown system vpn /dev/tun
  51. chmod 0770 /dev/tun
  52.  
  53. # Set indication (checked by vold) that we have finished this action
  54. setprop vold.post_fs_data_done 1
  55.  
  56. on boot
  57. # CyanogenMod SysFS entries
  58. chown radio system /sys/module/gpio_event/parameters/phone_call_status
  59. chmod 0664 /sys/module/gpio_event/parameters/phone_call_status
  60. chown radio system /sys/camera_led_status/led_ril_status
  61. chmod 0644 /sys/camera_led_status/led_ril_status
  62.  
  63. # Power Management
  64. chmod 0664 /sys/module/pm/parameters/idle_sleep_mode
  65.  
  66. # Disable idle power collapse to speed up the boot process
  67. # Enable it when boot is complete
  68. write /sys/module/pm2/parameters/idle_sleep_mode 3
  69.  
  70. # Disable IPv6 over mobile radio
  71. #write /proc/sys/net/ipv6/conf/rmnet0/disable_ipv6 1
  72. #write /proc/sys/net/ipv6/conf/rmnet1/disable_ipv6 1
  73. #write /proc/sys/net/ipv6/conf/rmnet2/disable_ipv6 1
  74.  
  75. # HTC SysFS for "Flip to Speaker"
  76. chown radio radio /sys/class/htc_accelerometer/accelerometer/PhoneOnOffFlag
  77. chown radio radio /sys/class/htc_ecompass/ecompass/PhoneOnOffFlag
  78.  
  79. # Optical sensors
  80. chown system system /sys/class/optical_sensors/lightsensor/ls_adc
  81. chown system system /sys/class/optical_sensors/lightsensor/ls_auto
  82. chown system system /sys/class/optical_sensors/lightsensor/ls_kadc
  83. chown system radio /sys/class/optical_sensors/proximity/ps_adc
  84. chown system system /sys/class/optical_sensors/proximity/ps_kadc
  85. chmod 0666 /sys/class/optical_sensors/proximity/ps_kadc
  86. chown system system /sys/class/optical_sensors/proximity/ps_led
  87. chown system system /sys/class/optical_sensors/proximity/ps_test_mode
  88.  
  89. # SysFS charging functions
  90. chown radio radio /sys/class/power_supply/battery/charger_control
  91. chmod 0660 /sys/class/power_supply/battery/charger_control
  92.  
  93. # bluetooth power up/down interface
  94. chown bluetooth bluetooth /dev/ttyHS0
  95. chmod 0660 /sys/class/rfkill/rfkill0/type
  96. chmod 0660 /sys/class/rfkill/rfkill0/state
  97. chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
  98. chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
  99.  
  100. # Bluetooth MAC address programming
  101. chown bluetooth net_bt_stack /sys/module/htc_bdaddress/parameters/bdaddress
  102. setprop ro.bt.bdaddr_path /sys/module/htc_bdaddress/parameters/bdaddress
  103.  
  104. # bluetooth LPM
  105. chmod 0220 /proc/bluetooth/sleep/lpm
  106. chmod 0220 /proc/bluetooth/sleep/btwrite
  107. chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
  108. chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
  109.  
  110. # liblights permissions
  111. chown system system /sys/class/leds/amber/brightness
  112. chown system system /sys/class/leds/amber/blink
  113. chown system system /sys/class/leds/green/brightness
  114. chown system system /sys/class/leds/green/blink
  115. chown system system /sys/class/leds/button-backlight/brightness
  116. chown system camera /sys/class/leds/flashlight/brightness
  117. chmod 0660 /sys/class/leds/flashlight/brightness
  118. chown system system /sys/class/leds/lcd-backlight/brightness
  119.  
  120. # Increase readahead buffers on MMC devices
  121. write /sys/block/mmcblk0/queue/read_ahead_kb 2048
  122. write /sys/block/mmcblk1/queue/read_ahead_kb 1024
  123.  
  124. # Flash storage isn't a good entropy source, and only causes locking
  125. # overhead in the kernel. Turn it off.
  126. write /sys/block/mmcblk0/queue/add_random 0
  127. write /sys/block/mmcblk1/queue/add_random 0
  128.  
  129. # Radio_feedback permissions
  130. chown radio radio /dev/radio_feedback
  131. chmod 0660 /dev/radio_feedback
  132.  
  133. # Advanced settings
  134. chown root system /sys/android_touch/sweep2wake
  135. chmod 0664 /sys/android_touch/sweep2wake
  136. chown root system /sys/android_touch/s2w_allow_stroke
  137. chmod 0664 /sys/android_touch/s2w_allow_stroke
  138. chown root system /sys/android_touch/s2w_min_distance
  139. chmod 0664 /sys/android_touch/s2w_min_distance
  140. chown root system /sys/android_touch/s2w_register_threshold
  141. chmod 0664 /sys/android_touch/s2w_register_threshold
  142. chown root system /sys/android_touch/doubletap2wake
  143. chmod 0664 /sys/android_touch/doubletap2wake
  144. chown root system /sys/android_touch/dt2w_max_duration
  145. chmod 0664 /sys/android_touch/dt2w_max_duration
  146. chown root system /sys/android_touch/dt2w_min_duration
  147. chmod 0664 /sys/android_touch/dt2w_min_duration
  148. chown root system /sys/kernel/fast_charge/force_fast_charge
  149. chmod 0664 /sys/kernel/fast_charge/force_fast_charge
  150.  
  151. # Use a reasonable min free value for low memory killer
  152. write /proc/sys/vm/min_free_kbytes 8192
  153.  
  154. # Network tweaks
  155. write /proc/sys/net/ipv4/tcp_fin_timeout 30
  156. write /proc/sys/net/ipv4/tcp_keepalive_intvl 30
  157. write /proc/sys/net/ipv4/tcp_timestamps 1
  158. write /proc/sys/net/ipv4/tcp_keepalive_time 1200
  159. write /proc/sys/net/core/rmem_max 524288
  160. write /proc/sys/net/core/wmem_max 524288
  161. write /proc/sys/net/ipv4/tcp_tw_reuse 1
  162. write /proc/sys/net/ipv4/tcp_window_scaling 1
  163. write /proc/sys/net/ipv4/tcp_mem "8192 87380 524288"
  164.  
  165. # The next two settings will be overwritten every time
  166. # the network type switches (wifi <-> umts etc.)
  167. # so we start with wifi values to ensure best
  168. # performance after boot.
  169. write /proc/sys/net/ipv4/tcp_rmem "8192 87380 524288"
  170. write /proc/sys/net/ipv4/tcp_wmem "8192 87380 393216"
  171.  
  172. setprop net.tcp.buffersize.wifi 8192,87380,524288,8192,87380,524288
  173. setprop net.tcp.buffersize.hsdpa 8192,87380,524288,8192,65536,393216
  174. setprop net.tcp.buffersize.umts 6144,87380,393216,6144,32768,283008
  175. setprop net.tcp.buffersize.edge 4096,32768,220416,4096,32768,110208
  176. setprop net.tcp.buffersize.gprs 4096,16384,32768,4096,11680,16384
  177.  
  178. on property:sys.boot_completed=1
  179. write /sys/module/pm2/parameters/idle_sleep_mode 1
  180.  
  181. on property:init.svc.wpa_supplicant=stopped
  182. stop dhcpcd
  183.  
  184. service wpa_supplicant /system/bin/wpa_supplicant \
  185. -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
  186. class main
  187. socket wpa_wlan0 dgram 660 wifi wifi
  188. disabled
  189. oneshot
  190.  
  191. service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
  192. class main
  193. disabled
  194. oneshot
  195.  
  196. #bluetooth
  197. service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
  198. class main
  199. disabled
  200. oneshot
  201.  
  202. service iprenew_wlan0 /system/bin/dhcpcd -n
  203. class late_start
  204. disabled
  205. oneshot
  206.  
  207. service iprenew_bnep0 /system/bin/dhcpcd -n
  208. class main
  209. disabled
  210. oneshot
  211.  
  212. # Compass and accelerometer daemon
  213. service akmd /system/bin/akmd
  214. class late_start
  215. user compass
  216. group compass misc input
  217.  
  218. # Bugreport is triggered by the KEY_VOLUMEUP and BTN_MOUSE keycodes
  219. service bugreport /system/bin/bugmailer.sh -v
  220. class late_start
  221. disabled
  222. oneshot
  223. keycodes 114 115 116
  224.  
  225. service rmt_storage /system/bin/rmt_storage /dev/block/mmcblk0p13 /dev/block/mmcblk0p14
  226. class core
  227. user root
  228.  
  229. service htc_ebdlogd /system/bin/htc_ebdlogd -s -k -P 7
  230. class main
  231. user root
  232. disabled
  233. oneshot
  234.  
  235. service htc_ebdlogd_rel /system/bin/htc_ebdlogd -s -k
  236. class main
  237. user root
  238. disabled
  239. oneshot
  240.  
  241. on property:ro.build.tags=test-keys
  242. start htc_ebdlogd
  243.  
  244. on property:ro.build.tags=release-keys
  245. start htc_ebdlogd_rel
  246.  
  247. on property:service.adb.root=1
  248. write /sys/class/android_usb/android0/enable 0
  249. restart adbd
  250. write /sys/class/android_usb/android0/enable 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement