Jean-Baptiste Queru | 671476b | 2012-05-29 10:40:37 -0700 | [diff] [blame^] | 1 | import init.grouper.usb.rc |
| 2 | |
| 3 | on early-init |
| 4 | mount debugfs debugfs /sys/kernel/debug |
| 5 | |
| 6 | # for backwards compatibility |
| 7 | export EXTERNAL_STORAGE /storage/sdcard0 |
| 8 | mkdir /storage 0050 system sdcard_r |
| 9 | mkdir /storage/sdcard0 0000 system system |
| 10 | symlink /storage/sdcard0 /sdcard |
| 11 | symlink /storage/sdcard0 /mnt/sdcard |
| 12 | |
| 13 | # create directory for mounting usb drives |
| 14 | mkdir /mnt/usbdrive 0666 system system |
| 15 | symlink /mnt/usbdrive /usbdrive |
| 16 | |
| 17 | on fs |
| 18 | setprop ro.crypto.umount_sd false |
| 19 | mount_all /fstab.grouper |
| 20 | |
| 21 | on post-fs-data |
| 22 | mkdir /data/misc/wifi 0770 wifi wifi |
| 23 | mkdir /data/misc/wifi/sockets 0770 wifi wifi |
| 24 | mkdir /data/misc/dhcp 0770 dhcp dhcp |
| 25 | chown dhcp dhcp /data/misc/dhcp |
| 26 | |
| 27 | # we will remap this as /storage/sdcard0 with the sdcard fuse tool |
| 28 | mkdir /data/media 0770 media_rw media_rw |
| 29 | chown media_rw media_rw /data/media |
| 30 | |
| 31 | # change back to bluetooth from system |
| 32 | chown bluetooth bluetooth /data/misc/bluetooth |
| 33 | |
| 34 | # Set indication (checked by vold) that we have finished this action |
| 35 | setprop vold.post_fs_data_done 1 |
| 36 | |
| 37 | on boot |
| 38 | |
| 39 | # bluetooth |
| 40 | # UART device |
| 41 | chmod 0660 /dev/ttyHS2 |
| 42 | chown bluetooth bluetooth /dev/ttyHS2 |
| 43 | |
| 44 | # power up/down interface |
| 45 | chmod 0660 /sys/class/rfkill/rfkill0/state |
| 46 | chmod 0660 /sys/class/rfkill/rfkill0/type |
| 47 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state |
| 48 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type |
| 49 | |
| 50 | # bluetooth MAC address programming |
| 51 | chown bluetooth bluetooth ro.bt.bdaddr_path |
| 52 | chown bluetooth bluetooth /system/etc/bluetooth |
| 53 | chown bluetooth bluetooth /data/misc/bluetooth |
| 54 | setprop ro.bt.bdaddr_path "/data/misc/bluetooth/bdaddr" |
| 55 | |
| 56 | # NFC |
| 57 | setprop ro.nfc.port "I2C" |
| 58 | chmod 0660 /dev/pn544 |
| 59 | chown nfc nfc /dev/pn544 |
| 60 | |
| 61 | # backlight |
| 62 | chown system system /sys/class/backlight/pwm-backlight/brightness |
| 63 | |
| 64 | # didim |
| 65 | chown system system /sys/class/graphics/fb0/device/smartdimmer/enable |
| 66 | chown system system /sys/class/graphics/fb0/device/smartdimmer/aggressiveness |
| 67 | |
| 68 | # power |
| 69 | chown system system /sys/kernel/tegra_cap/core_cap_level |
| 70 | chown system system /sys/kernel/tegra_cap/core_cap_state |
| 71 | chown system system /sys/module/cpu_tegra/parameters/cpu_user_cap |
| 72 | |
| 73 | # Sensor |
| 74 | insmod /system/lib/modules/mpu6050b1.ko |
| 75 | insmod /system/lib/modules/inv_mpu_ak89xx.ko |
| 76 | |
| 77 | # Power management settings |
| 78 | write /sys/module/cpu_tegra3/parameters/no_lp 0 |
| 79 | #write /sys/module/tegra3_emc/parameters/emc_enable 0 |
| 80 | #write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1000000 |
| 81 | write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive |
| 82 | write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive |
| 83 | write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive |
| 84 | write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive |
| 85 | write /sys/devices/system/cpu/cpufreq/interactive/boost_factor 2 |
| 86 | write /sys/devices/system/cpu/cpufreq/interactive/input_boost 1 |
| 87 | write /sys/devices/system/cpu/cpufreq/interactive/sustain_load 80 |
| 88 | write /sys/module/cpu_tegra3/parameters/auto_hotplug 1 |
| 89 | #write /sys/module/cpuidle_t3/parameters/lp2_0_in_idle 0 |
| 90 | write /sys/module/cpuidle/parameters/lp2_in_idle 0 |
| 91 | |
| 92 | # Default Read Ahead value for sdcards |
| 93 | write /sys/block/mmcblk0/queue/read_ahead_kb 2048 |
| 94 | write /sys/block/mmcblk1/queue/read_ahead_kb 2048 |
| 95 | |
| 96 | # GPS init |
| 97 | write /sys/class/gpio/export 162 |
| 98 | write /sys/class/gpio/gpio162/value 0 |
| 99 | write /sys/class/gpio/gpio162/direction out |
| 100 | chown gps gps /sys/class/gpio/gpio162/value |
| 101 | chmod 0664 /sys/class/gpio/gpio162/value |
| 102 | mkdir /data/gps |
| 103 | chown gps gps /data/gps |
| 104 | chmod 770 /data/gps |
| 105 | chown gps gps /dev/ttyHS1 |
| 106 | chmod 0660 /dev/ttyHS1 |
| 107 | |
| 108 | |
| 109 | # Load WiFi driver |
| 110 | |
| 111 | # BB mapping symbolic name to the logging ttyACM port |
| 112 | symlink /dev/ttyACM2 /dev/log_modem |
| 113 | |
| 114 | # Touch |
| 115 | chown system system /dev/elan-iap |
| 116 | chown system system /proc/ektf_dbg |
| 117 | start touch_fw_update |
| 118 | |
| 119 | # Write BT BD_ADDR |
| 120 | service btmacreader /system/bin/btmacreader |
| 121 | class main |
| 122 | oneshot |
| 123 | |
| 124 | service wpa_supplicant /system/bin/wpa_supplicant \ |
| 125 | -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin |
| 126 | # we will start as root and wpa_supplicant will switch to user wifi |
| 127 | # after setting up the capabilities required for WEXT |
| 128 | # user wifi |
| 129 | # group wifi inet keystore |
| 130 | class main |
| 131 | socket wpa_wlan0 dgram 660 wifi wifi |
| 132 | disabled |
| 133 | oneshot |
| 134 | |
| 135 | service p2p_supplicant /system/bin/wpa_supplicant \ |
| 136 | -iwlan0 -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -N \ |
| 137 | -ip2p0 -Dnl80211 -c /data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1 |
| 138 | # we will start as root and wpa_supplicant will switch to user wifi |
| 139 | # after setting up the capabilities required for WEXT |
| 140 | # user wifi |
| 141 | # group wifi inet keystore |
| 142 | class main |
| 143 | socket wpa_wlan0 dgram 660 wifi wifi |
| 144 | disabled |
| 145 | oneshot |
| 146 | |
| 147 | service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL |
| 148 | class main |
| 149 | disabled |
| 150 | oneshot |
| 151 | |
| 152 | service dhcpcd_p2p /system/bin/dhcpcd -aABKL |
| 153 | class main |
| 154 | disabled |
| 155 | oneshot |
| 156 | |
| 157 | service dhcpcd_eth0 /system/bin/dhcpcd -ABKL -f/system/etc/dhcpcd/dhcpcd.conf |
| 158 | class main |
| 159 | disabled |
| 160 | oneshot |
| 161 | |
| 162 | service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL |
| 163 | class main |
| 164 | disabled |
| 165 | oneshot |
| 166 | |
| 167 | service iprenew_wlan0 /system/bin/dhcpcd -n |
| 168 | class main |
| 169 | disabled |
| 170 | oneshot |
| 171 | |
| 172 | service iprenew_p2p /system/bin/dhcpcd -n |
| 173 | class main |
| 174 | disabled |
| 175 | oneshot |
| 176 | |
| 177 | service iprenew_eth0 /system/bin/dhcpcd -n |
| 178 | class main |
| 179 | disabled |
| 180 | oneshot |
| 181 | |
| 182 | #Sensor: load calibration files. |
| 183 | service sensors-config /system/bin/sensors-config |
| 184 | class main |
| 185 | user root |
| 186 | oneshot |
| 187 | #Sensor load calibration files end |
| 188 | |
| 189 | # create virtual SD card at /storage/sdcard0, based on the /data/media directory |
| 190 | # deamon will drop to user/group system/media_rw after initializing |
| 191 | # underlying files in /data/media wil be created with user and group media_rw (1023) |
| 192 | service sdcard /system/bin/sdcard /data/media 1023 1023 |
| 193 | class late_start |
| 194 | |
| 195 | # bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys |
| 196 | service bugreport /system/bin/bugmailer.sh -b /system/media/audio/ui/Dock.ogg -e /system/media/audio/ui/Undock.ogg |
| 197 | class main |
| 198 | disabled |
| 199 | oneshot |
| 200 | keycodes 115 114 |
| 201 | |
| 202 | #BCM |
| 203 | service hciattach /system/bin/brcm_patchram_plus --enable_hci --scopcm=0,2,0,0,0,0,0,0,0,0 \ |
| 204 | --baudrate 3000000 --use_baudrate_for_download --patchram /etc/firmware/bcm4330.hcd --no2bytes --enable_lpm --tosleep=50000 /dev/ttyHS2 |
| 205 | class main |
| 206 | user bluetooth |
| 207 | group bluetooth net_bt_admin |
| 208 | disabled |
| 209 | |
| 210 | # Start GPS daemon |
| 211 | on boot |
| 212 | service gps-daemon /system/bin/glgps -c /system/etc/gps/gpsconfig.xml |
| 213 | socket gps seqpacket 0666 gps gps |
| 214 | user gps |
| 215 | group gps |
| 216 | class late_start |
| 217 | |
| 218 | # Recovery daemon: configure MSC partition |
| 219 | service recoveryd /system/bin/recoveryd /dev/block/platform/sdhci-tegra.3/by-name/MSC |
| 220 | disabled |
| 221 | class main |
| 222 | user root |
| 223 | group root |
| 224 | oneshot |
| 225 | |
| 226 | on property:sys.shutdown.requested=1recovery |
| 227 | start recoveryd |
| 228 | |
| 229 | # start tf_daemon service |
| 230 | service tf_daemon /system/bin/tf_daemon -storageDir /data/tf -d |
| 231 | class main |
| 232 | user root |
| 233 | group shell |
| 234 | |
| 235 | # may restart due to /data/tf not existing yet |
| 236 | on property:init.svc.tf_daemon=restarting |
| 237 | mkdir /data/tf |
| 238 | |
| 239 | #Raydium touch setting |
| 240 | service rm_ts_service /system/bin/rm_ts_server |
| 241 | class main |
| 242 | |
| 243 | # create filesystems if necessary |
| 244 | service setup_fs /system/bin/setup_fs \ |
| 245 | /dev/block/platform/sdhci-tegra.3/by-name/UDA \ |
| 246 | /dev/block/platform/sdhci-tegra.3/by-name/CAC |
| 247 | class core |
| 248 | user root |
| 249 | group root |
| 250 | oneshot |
| 251 | |
| 252 | service touch_fw_update /system/bin/sh -c "echo /system/etc/firmware/touch_fw.ekt > /sys/bus/i2c/drivers/elan-ktf3k/1-0010/update_fw" |
| 253 | class main |
| 254 | disabled |
| 255 | user root |
| 256 | group root |
| 257 | oneshot |
| 258 | |