• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import init.manta.usb.rc
2
3on init
4    start watchdogd
5
6    # See storage config details at http://source.android.com/tech/storage/
7    mkdir /mnt/shell/emulated 0700 shell shell
8    mkdir /storage/emulated 0555 root root
9
10    export EXTERNAL_STORAGE /storage/emulated/legacy
11    export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
12    export EMULATED_STORAGE_TARGET /storage/emulated
13
14    # Support legacy paths
15    symlink /storage/emulated/legacy /sdcard
16    symlink /storage/emulated/legacy /mnt/sdcard
17    symlink /storage/emulated/legacy /storage/sdcard0
18    symlink /mnt/shell/emulated/0 /storage/emulated/legacy
19
20on post-fs-data
21    mkdir /data/media 0770 media_rw media_rw
22
23    setprop vold.post_fs_data_done 1
24    mkdir /data/misc/wifi 0770 wifi wifi
25    mkdir /data/misc/wifi/sockets 0770 wifi wifi
26    mkdir /data/misc/dhcp 0770 dhcp dhcp
27    chown dhcp dhcp /data/misc/dhcp
28
29# permissions for bluetooth.
30	setprop ro.bt.bdaddr_path "/factory/bluetooth/bt_addr"
31	chown bluetooth net_bt_stack ro.bt.bdaddr_path
32	chown bluetooth net_bt_stack /dev/ttySAC0
33	chmod 0660 /dev/ttySAC0
34	chmod 0660 /sys/class/rfkill/rfkill0/state
35	chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
36	chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
37
38on boot
39    # override init.rc to keep plenty of large order chunks around
40    # to improve allocation times
41    write /proc/sys/vm/min_free_kbytes 32768
42    write /proc/sys/vm/min_free_order_shift 1
43
44    mount debugfs /sys/kernel/debug /sys/kernel/debug
45    setprop ro.radio.noril yes
46
47    # Reduce reserved lowmem from ~48MB to ~12MB
48    write /proc/sys/vm/lowmem_reserve_ratio "128 128"
49
50    # Set up kernel tracing, but disable it by default
51    chmod 0222 /sys/kernel/debug/tracing/trace_marker
52    write /sys/kernel/debug/tracing/tracing_on 0
53
54    chmod 0444 /sys/kernel/debug/smb347-regs
55
56# Set Mali power policy as Coarse demand
57    write /sys/devices/platform/mali.0/power_policy coarse_demand
58
59on fs
60    mkdir /factory 0775 radio radio
61
62    mount_all /fstab.manta
63    setprop ro.crypto.fuse_sdcard true
64
65# Permissions for backlight
66    chmod 0660 /sys/class/backlight/pwm-backlight.0/brightness
67    chown system system /sys/class/backlight/pwm-backlight.0/brightness
68
69# create data/gps for GPS daemon
70    chown root system /sys/class/gps/bcm475x/GPS_PWR_EN/value
71    chmod 0664 /sys/class/gps/bcm475x/GPS_PWR_EN/value
72    chown root system /sys/class/gps/bcm475x/GPS_nRST/value
73    chmod 0664 /sys/class/gps/bcm475x/GPS_nRST/value
74    mkdir /data/gps 771 system system
75    chown system system /data/gps
76
77# NFC: create data/nfc for nv storage
78    mkdir /data/nfc 770 nfc nfc
79    mkdir /data/nfc/param 770 nfc nfc
80
81# audio: permissions for voice processing
82    # global switch for voice processing effects
83    chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/voice_processing
84    chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/voice_processing
85    # voice processing chip sleep
86    chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/sleep
87    chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/sleep
88    # voice processing usecase preset
89    chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/preset
90    chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/preset
91    # voice processing noise suppression level
92    chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/tx_ns_level
93    chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/tx_ns_level
94    # voice processing AGC enable (TX)
95    chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/tx_agc_enable
96    chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/tx_agc_enable
97    # voice processing AEC enable
98    chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/aec_enable
99    chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/aec_enable
100
101# virtual sdcard daemon running as media_rw (1023)
102service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
103    class late_start
104
105service p2p_supplicant /system/bin/wpa_supplicant \
106    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
107    -puse_multi_chan_concurrent=1 -N -ip2p0 -Dnl80211 \
108    -c/data/misc/wifi/p2p_supplicant.conf \
109    -puse_p2p_group_interface=1use_multi_chan_concurrent=1 -e/data/misc/wifi/entropy.bin
110    #   we will start as root and wpa_supplicant will switch to user wifi
111    #   after setting up the capabilities required for WEXT
112    #   user wifi
113    #   group wifi inet keystore
114    class main
115    socket wpa_wlan0 dgram 660 wifi wifi
116    disabled
117    oneshot
118
119service wpa_supplicant /system/bin/wpa_supplicant \
120    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
121    #   we will start as root and wpa_supplicant will switch to user wifi
122    #   after setting up the capabilities required for WEXT
123    #   user wifi
124    #   group wifi inet keystore
125    class main
126    socket wpa_wlan0 dgram 660 wifi wifi
127    disabled
128    oneshot
129
130service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
131    class main
132    disabled
133    oneshot
134
135service dhcpcd_p2p /system/bin/dhcpcd -aABKL
136    class main
137    disabled
138    oneshot
139
140service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL
141    class main
142    disabled
143    oneshot
144
145service iprenew_wlan0 /system/bin/dhcpcd -n
146    class main
147    disabled
148    oneshot
149
150service iprenew_p2p /system/bin/dhcpcd -n
151    class main
152    disabled
153    oneshot
154
155service battery_charger /charger
156    class charger
157
158# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
159service watchdogd /sbin/watchdogd 10 20
160    class core
161
162service gpsd /system/vendor/bin/gpsd -c /system/vendor/etc/gps.xml
163    class main
164    socket gps seqpacket 0660 gps system
165    user gps
166    group system inet
167
168# MobiCore startup
169service mobicore /system/bin/mcDriverDaemon -r /system/vendor/secapp/020a0000000000000000000000000000.drbin
170    setenv MC_REGISTRY_PATH /system/vendor/secapp
171    user drmrpc
172    group drmrpc
173    class main
174
175# on userdebug and eng builds, enable kgdb on the serial console
176on property:ro.debuggable=1
177    write /sys/module/kgdboc/parameters/kgdboc ttyFIQ2
178    write /sys/module/fiq_debugger/parameters/kgdb_enable 1
179
180# bugreport is triggered by holding down volume down, volume up and power
181service bugreport /system/bin/bugmailer.sh -v
182    class main
183    disabled
184    oneshot
185    keycodes 114 115 116
186