| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 1 | import init.pecan.usb.rc |
| 2 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 3 | on early-init |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 4 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 5 | mkdir /system |
| 6 | mkdir /data 0771 system system |
| 7 | mkdir /cache 0771 system cache |
| 8 | mkdir /mnt/sdcard 0000 system system |
| 9 | mkdir /sd-ext 0771 system system |
| 10 | |
| 11 | |
| 12 | on init |
| 13 | |
| 14 | # setup the global environment |
| 15 | export EXTERNAL_STORAGE /mnt/sdcard |
| 16 | export SD_EXT_DIRECTORY /sd-ext |
| 17 | export DOWNLOAD_CACHE /cache/download |
| 18 | |
| 19 | # Backwards Compat - XXX: Going away in G* |
| 20 | symlink /mnt/sdcard /sdcard |
| 21 | |
| 22 | # Add permissions for camera access |
| 23 | chmod 0666 /dev/msm_camera/config0 |
| 24 | chmod 0666 /dev/msm_camera/control0 |
| 25 | chmod 0666 /dev/msm_camera/frame0 |
| 26 | chmod 0666 /dev/msm_camera/pic0 |
| 27 | |
| 28 | # Define the memory thresholds at which the above process classes will |
| 29 | # be killed. These numbers are in pages (4k). |
| 30 | setprop ro.FOREGROUND_APP_MEM 1536 |
| 31 | setprop ro.VISIBLE_APP_MEM 2048 |
| 32 | setprop ro.SECONDARY_SERVER_MEM 4096 |
| 33 | setprop ro.BACKUP_APP_MEM 4096 |
| 34 | setprop ro.HOME_APP_MEM 4096 |
| 35 | setprop ro.HIDDEN_APP_MEM 5120 |
| 36 | setprop ro.CONTENT_PROVIDER_MEM 5632 |
| 37 | setprop ro.EMPTY_APP_MEM 6144 |
| 38 | |
| 39 | # Import Froyo LMK settings due to its less aggressive nature |
| 40 | write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144 |
| 41 | # Enable low memory killer to check file pages |
| 42 | write /sys/module/lowmemorykiller/parameters/minfile 0,0,0,5120,5632,6144 |
| 43 | write /sys/module/lowmemorykiller/parameters/check_filepages 1 |
| 44 | |
| 45 | # fix for enropy service and some other that failed |
| 46 | chmod 0755 /data/system/appwidgets.xml |
| 47 | chmod 0755 /data/system/entropy.dat |
| 48 | chmod 0755 /data/system/wallpaper_info.xml |
| 49 | |
| 50 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 51 | on fs |
| 52 | |
| 53 | # framebuffer permission for copybit |
| 54 | chmod 0666 /dev/graphics/fb0 |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 55 | |
| 56 | on post-fs |
| 57 | |
| 58 | # nv |
| 59 | mkdir /data/nv |
| 60 | chown system system /data/nv |
| 61 | chmod 0711 /data/nv |
| 62 | |
| 63 | mkdir /data/local/download 0771 system cache |
| 64 | mkdir /cache/download 0771 system cache |
| 65 | |
| 66 | # wifi |
| 67 | chmod 0777 /data/misc/wifi/config_mac |
| 68 | mkdir /data/audioprop 0777 system system |
| 69 | mkdir /data/misc/wifi/sockets 0770 wifi wifi |
| 70 | setprop wifi.supplicant_scan_interval 20 |
| 71 | setprop wifi.interface wlan0 |
| 72 | mkdir /data/misc/dhcp 0777 system system |
| 73 | |
| 74 | |
| 75 | on post-fs-data |
| 76 | |
| 77 | # wifi |
| 78 | mkdir /data/misc/wifi 0770 wifi wifi |
| 79 | mkdir /data/misc/wifi/sockets 0770 wifi wifi |
| 80 | mkdir /data/misc/dhcp 0770 dhcp dhcp |
| 81 | chown dhcp dhcp /data/misc/dhcp |
| 82 | |
| 83 | |
| 84 | # last line for post-fs-data |
| 85 | setprop vold.post_fs_data_done 1 |
| 86 | |
| 87 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 88 | on early-boot |
| 89 | # set RLIMIT_MEMLOCK to 64MB |
| 90 | setrlimit 8 67108864 67108864 |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 91 | |
| 92 | on boot |
| 93 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 94 | # Temporary hack to prevent framebuffer flicker |
| 95 | chmod 0777 /sys/class/graphics/fb0/state |
| 96 | write /sys/class/graphics/fb0/state 1 |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 97 | |
| 98 | # radio |
| 99 | mkdir /data/radio 0770 radio radio |
| 100 | chmod 2770 /data/radio |
| 101 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 102 | ## SENSOR |
| 103 | mkdir /data/amit 0777 ami304d ami304d |
| 104 | chmod 0666 /data/amit/AMI306_Config.ini |
| 105 | chmod 0666 /data/amit/AMI306_Config2.ini |
| 106 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 107 | # liblights |
| 108 | chown system system /sys/class/leds/green/brightness |
| 109 | chown system system /sys/class/leds/green/blink |
| 110 | chown system system /sys/class/leds/amber/brightness |
| 111 | chown system system /sys/class/leds/amber/blink |
| 112 | chown system system /sys/class/leds/button-backlight/brightness |
| 113 | chown system system /sys/class/leds/flashlight/brightness |
| 114 | chown system system /sys/class/leds/lcd-backlight/brightness |
| 115 | chown system system /sys/class/leds/keyboard-backlight/brightness |
| 116 | |
| 117 | # wifi |
| 118 | mkdir /data/misc 01771 system misc |
| 119 | mkdir /data/misc/wifi 0770 system wifi |
| 120 | mkdir /data/misc/wifi/sockets |
| 121 | chmod 770 /data/misc/wifi/sockets |
| 122 | mkdir /data/misc/dhcp 0770 dhcp dhcp |
| 123 | chown dhcp dhcp /data/misc/dhcp |
| 124 | mkdir /data/system 0775 system system |
| 125 | |
| 126 | # bluetooth |
| 127 | chmod 0660 /dev/ttyHS0 |
| 128 | chown bluetooth bluetooth /dev/ttyHS0 |
| 129 | chown bluetooth bluetooth /proc/bluetooth/sleep/proto |
| 130 | chmod 0660 /sys/class/rfkill/rfkill0/state |
| 131 | chmod 0660 /sys/class/rfkill/rfkill0/type |
| 132 | |
| 133 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state |
| 134 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type |
| 135 | write /sys/class/rfkill/rfkill0/state 0 |
| 136 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 137 | # allow interfaces to get IPv6 address when tethering is enabled |
| 138 | write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2 |
| 139 | write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2 |
| 140 | write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2 |
| 141 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 142 | # Fast dormancy |
| 143 | setprop ro.ril.fast.dormancy.rule 1 |
| 144 | setprop ro.ril.fd.scron.timeout 4 |
| 145 | setprop ro.ril.fd.scroff.timeout 3 |
| 146 | |
| RonGokhale | 7a2c6f8 | 2012-12-03 00:48:41 +0530 | [diff] [blame] | 147 | |
| 148 | # I/O scheduler |
| 149 | chown system system /sys/block/mmcblk0/queue/scheduler |
| 150 | chmod 0664 /sys/block/mmcblk0/queue/scheduler |
| 151 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 152 | # Wakelock debug |
| 153 | write /sys/module/wakelock/parameters/debug_mask 7 |
| 154 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 155 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 156 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 157 | ############################################################################# |
| 158 | ### S E R V I C E S ## |
| 159 | ############################################################################# |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 160 | |
| 161 | service qmuxd /system/bin/qmuxd |
| 162 | class core |
| 163 | user radio |
| 164 | group radio audio inet bluetooth |
| 165 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 166 | service ami304d /system/bin/ami304d |
| 167 | class main |
| 168 | user compass |
| 169 | group system |
| 170 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 171 | service hciattach /system/bin/sh /system/bin/init.qcom.bt.sh |
| 172 | class main |
| 173 | user bluetooth |
| 174 | group bluetooth net_bt_admin |
| 175 | disabled |
| 176 | |
| 177 | service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant -Dwext -iwlan0 -W -c/data/misc/wifi/wpa_supplicant.conf |
| 178 | class main |
| 179 | socket wpa_wlan0 dgram 660 wifi wifi |
| 180 | group system wifi inet |
| 181 | disabled |
| 182 | oneshot |
| 183 | |
| 184 | service dhcpcd_wlan0 /system/bin/dhcpcd -BKA |
| 185 | class core |
| 186 | disabled |
| 187 | oneshot |
| 188 | |
| 189 | service iprenew_wlan0 /system/bin/dhcpcd -n |
| 190 | class main |
| 191 | disabled |
| 192 | oneshot |
| 193 | |
| 194 | service dhcpcd_bnep0 /system/bin/dhcpcd -B |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 195 | class main |
| 196 | disabled |
| 197 | oneshot |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 198 | |
| 199 | service iprenew_bnep0 /system/bin/dhcpcd -n |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 200 | class main |
| 201 | disabled |
| 202 | oneshot |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 203 | |
| 204 | service dhcpservice /system/bin/netcfg wlan0 dhcp |
| 205 | class main |
| 206 | oneshot |
| 207 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 208 | on property:dev.bootcomplete=1 |
| 209 | stop dhcp-service |
| 210 | start dhcp-service |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 211 | |
| 212 | service setapversion /system/bin/lgapversion |
| 213 | class main |
| 214 | user radio |
| 215 | group radio |
| 216 | disabled |
| 217 | oneshot |
| 218 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 219 | on property:gsm.version.baseband=V07u-000-000-MAR-23-2009 |
| 220 | start setapversion |
| 221 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 222 | service hfag /system/bin/sdptool add --channel=10 HFAG |
| 223 | class main |
| 224 | user bluetooth |
| 225 | group bluetooth net_bt_admin |
| 226 | disabled |
| 227 | oneshot |
| 228 | |
| 229 | service hsag /system/bin/sdptool add --channel=11 HSAG |
| 230 | class main |
| 231 | user bluetooth |
| 232 | group bluetooth net_bt_admin |
| 233 | disabled |
| 234 | oneshot |
| 235 | |
| 236 | service opush /system/bin/sdptool add --channel=12 OPUSH |
| 237 | class main |
| 238 | user bluetooth |
| 239 | group bluetooth net_bt_admin |
| 240 | disabled |
| 241 | oneshot |
| 242 | |
| 243 | service pbap /system/bin/sdptool add --channel=19 PBAP |
| 244 | class main |
| 245 | user bluetooth |
| 246 | group bluetooth net_bt_admin |
| 247 | disabled |
| 248 | oneshot |
| 249 | |
| 250 | service map /system/bin/sdptool add --channel=16 MAS |
| 251 | class main |
| 252 | user bluetooth |
| 253 | group bluetooth net_bt_admin |
| 254 | disabled |
| 255 | oneshot |
| 256 | |
| 257 | service qcom-sh /system/bin/sh /init.qcom.sh |
| 258 | class core |
| 259 | user root |
| 260 | oneshot |
| 261 | |
| 262 | service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh |
| 263 | class main |
| 264 | user root |
| 265 | disabled |
| 266 | oneshot |
| 267 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 268 | ## Stop dhcpcd when wifi was stopped |
| 269 | on property:init.svc.wpa_supplicant=stopped |
| 270 | stop dhcpcd_wlan0 |
| 271 | |
| 272 | ## start qcom-post-boot |
| 273 | on property:init.svc.bootanim=stopped |
| 274 | start qcom-post-boot |
| 275 | |
| 276 | ## Read BT address |
| 277 | on property:service.brcm.bt.mac=* |
| 278 | exec /system/bin/hwaddrs |
| 279 | |
| Keyur | 2a73fe7 | 2012-10-13 09:05:54 +0530 | [diff] [blame] | 280 | on property:gsm.current.phone-type=1 |
| 281 | start setapversion |
| 282 | |
| RonGokhale | edad651 | 2012-12-08 09:44:22 +0530 | [diff] [blame] | 283 | on property:gsm.version.baseband=V07u-000-000-MAR-23-2009 |
| 284 | start setapversion |
| 285 | |
| RonGokhale | 9a66571 | 2012-10-25 01:51:07 +0530 | [diff] [blame] | 286 | # Triggered by the KEY_VOLUME_DOWN+KEY_MENU keycodes |
| 287 | service bugreport /system/bin/logwrapper /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport |
| 288 | keycodes 114 139 |
| 289 | class main |
| 290 | disabled |
| 291 | oneshot |