forked from RevNumbers/android_device_motorola_droid2we
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.mapphone_cdma.rc
628 lines (521 loc) · 19 KB
/
init.mapphone_cdma.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
import init.mapphone_cdma.usb.rc
on init
mount ext3 /dev/block/mmcblk1p21 /system noatime nodiratime
mount ext3 /dev/block/mmcblk1p21 /system ro remount
mount ext3 /dev/block/mmcblk1p22 /cache nosuid nodev noatime nodiratime
mount ext3 /dev/block/mmcblk1p24 /data nosuid nodev noatime nodiratime
on post-fs
mount rootfs rootfs / rw remount
# Backward compatibility
symlink /dev/ttyGS0 /dev/acm0
mkdir /cdrom 0770 system system
mount yaffs2 mtd@cdrom /cdrom ro
chown system shell /data/local
chown system shell /data/local/tmp
# Mount tmp, we dont have swap, use ramfs which can grow if required
mkdir /tmp
mount ramfs ramfs /tmp size=512k relatime
chmod 0777 /tmp
chown system shell /tmp
# Create mountpoints and mount tmpfs
mkdir /mnt 0775 root system
mkdir /osh 0755 root root
mkdir /preinstall 0755 system system
mkdir /pds 0775 system system
mkdir /data/tmp 0777 system system
mkdir /misc 0770 system misc
mkdir /sd-ext 0771 system system
# Same reason as /data above
chown system cache /cache
chmod 0771 /cache
chown system misc /misc
chmod 0770 /misc
# This may have been created by the recovery system with odd permissions
chown system cache /cache/recovery
chmod 0770 /cache/recovery
#change permissions on vmallocinfo so we can grab it from bugreports
chown root log /proc/vmallocinfo
chmod 0440 /proc/vmallocinfo
#change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
chown root system /proc/kmsg
chmod 0440 /proc/kmsg
chown root system /proc/sysrq-trigger
chmod 0220 /proc/sysrq-trigger
# Configure kernel options
# Disable automatic power control for OHCI USB IPC Temporarily
write /sys/devices/platform/ohci.0/usb1/1-3/power/level auto
# Reset system time
write /sys/class/rtc/rtc0/unsecured_rtc on
# Disable a system-wide task dump on OOM in default
write /proc/sys/vm/oom_dump_tasks 0
write /proc/sys/fs/suid_dumpable 2
# Set core pattern
write /proc/sys/kernel/core_pattern "|/system/bin/coredump %e %p %t"
# Power Management
write /sys/power/sleep_while_idle 1
write /sys/power/enable_off_mode 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 250000
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold 86
write /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate 46875
write /sys/power/sr_vdd1_autocomp 1
write /sys/power/sr_vdd2_autocomp 1
write /sys/power/enable_abb_mode 1
# Change ownership and permissions of vibrators
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/class/timed_output/vibrator/sweep
chmod 0660 /sys/class/timed_output/vibrator/enable
chmod 0660 /sys/class/timed_output/vibrator/sweep
# bluetooth power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
# Mount mtd partitions
# mount /pds as r/w
# We chown/chmod /pds again so because mount is run as root + defaults
mount yaffs2 mtd@pds /pds nosuid nodev no-checkpoint
mount ext3 /dev/block/mmcblk1p7 /pds nosuid nodev noatime nodiratime
chown system system /pds
chmod 0775 /pds
mkdir /pds/public 0775 system shell
chown system shell /pds/public
chmod 0775 /pds/public
mkdir /pds/factory 0740 mot_tcmd shell
chown mot_tcmd shell /pds/factory
chmod 0740 /pds/factory
# Tweaks
write /sys/block/mmcblk0/bdi/read_ahead_kb 512
# Mount preinstall partition
mkdir /preinstall 0771 system system
mount ext3 /dev/block/mmcblk1p23 /preinstall nosuid nodev noatime nodiratime
chmod 0771 /preinstall
chown system system /preinstall
# Create basic filesystem structure
# create moto specific dirs for mystuff
mkdir /data/download 0775 system system
mkdir /data/download/mystuff 0775 system system
# create moto specific dirs for wifi
mkdir /data/system 0771 system system
# wifi dirs
mkdir /data/misc/wifi 0770 wifi wifi
chmod 0770 /data/misc/wifi
mkdir /data/misc/wifi/hostapd.sockets 0770 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
mkdir /pds/wifi 0771 wifi wifi
chmod 0664 /pds/wifi/nvs_map.bin
mkdir /pds/whisper 0770 mot_whisper mot_whisper
chown mot_whisper mot_whisper /pds/whisper
chmod 0770 /pds/whisper
mkdir /pds/whisper/whisper_only 0700 mot_whisper mot_whisper
chown mot_whisper mot_whisper /pds/whisper/whisper_only
chmod 0700 /pds/whisper/whisper_only
chown mot_whisper /pds/whisper/whisper_only/vector0.bin
mkdir /data/misc/vpn/profiles 0770 system system
mkdir /data/tmp 0777 system system
mkdir /cache/download 0771 system cache
mkdir /cache/dalvik-cache 0771 system system
mkdir /cache/lost+found 0770 root root
# Motorola tcmd/12m stuff
mkdir /data/local/12m 0771 mot_tcmd shell
mkdir /data/local/12m/batch 0771 mot_tcmd shell
chown mot_tcmd shell /data/local
chown mot_tcmd shell /data/local/12m
chown mot_tcmd shell /data/local/12m/batch
chown mot_tcmd shell /data/local/tmp
mkdir /data/local/download 0771 system cache
# double check the perms, in case lost+found already exists, and set owner
chown root root /data/lost+found
chmod 0770 /data/lost+found
chown root root /cache/lost+found
chmod 0770 /cache/lost+found
# create logger folder
mkdir /data/logger 0770 radio log
chown radio log /data/logger
chmod 0770 /data/logger
mkdir /data/panicreports
chown root radio /data/panicreports
chmod 0775 /data/panicreports
# Backup ramconsole on abnormal reboot.
copy /proc/last_kmsg /data/dontpanic/last_kmsg
chown root log /data/dontpanic/last_kmsg
chmod 0644 /data/dontpanic/last_kmsg
# workaround: in solana somebody deletes the logfile.
# we have to back it up.
copy /data/dontpanic/apanic_console /data/logger/last_apanic_console
chmod 0700 /data/logger/apanic_console
# create the lost+found directories, so as to enforce our permissions
mkdir /pds/lost+found 0770
# double check the perms, in case lost+found already exists, and set owner
chown root root /pds/lost+found
chmod 0770 /pds/lost+found
#Create location directory
mkdir /data/location 0771 radio radio
# Create anr directory and change permission to 777 to save trace.txt
mkdir /data/anr
chmod 0777 /data/anr
# create the necessary dirs for tpapi with proper permission
mkdir /pds/security
mkdir /data/tpapi
mkdir /data/tpapi/etc
mkdir /data/tpapi/etc/tpa
mkdir /data/tpapi/etc/tpa/persistent
chmod 2770 /pds/security
chmod 2770 /data/tpapi
chmod 2770 /data/tpapi/etc
chmod 2770 /data/tpapi/etc/tpa
chmod 2770 /data/tpapi/etc/tpa/persistent
chown mot_tpapi mot_tpapi /pds/security
chown mot_tpapi mot_tpapi /pds/security/counter.bin
chown mot_tpapi mot_tpapi /pds/security/system.bin
chown mot_tpapi mot_tpapi /pds/security/storage.bin
chown mot_tpapi mot_tpapi /pds/security/keymaptable.dat
chown mot_tpapi mot_tpapi /data/tpapi
chown mot_tpapi mot_tpapi /data/tpapi/etc
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa
chown mot_tpapi mot_tpapi /data/tpapi/etc/tpa/persistent
chown mot_tpapi mot_tpapi /data/tpapi/storage.bin
chown mot_tpapi mot_tpapi /data/tpapi/user.bin
# Temporary fix permissions for gb kernel
chown root system /dev/cpcap
chown root system /dev/cpcap_batt
chown root system /dev/cpcap_mot_rtc
chown root system /dev/cpcap_uc
chown root system /dev/i2c-1
chown root system /dev/i2c-2
chown root root /dev/smodule
chown root system /dev/ttyGS0
chown root system /dev/tcmd_driver
chmod 0660 /dev/cpcap
chmod 0660 /dev/cpcap_batt
chmod 0660 /dev/cpcap_mot_rtc
chmod 0660 /dev/cpcap_uc
chmod 0660 /dev/i2c-1
chmod 0660 /dev/i2c-2
chmod 0660 /dev/smodule
chmod 0666 /dev/ttyGS0
chmod 0660 /dev/tcmd_driver
# directory for encryption management tool, enc_mgt_tool
mkdir /data/emt
chmod 0700 /data/emt
# Create wmdrm directory
mkdir /pds/wmdrm 0775 mot_drm mot_drm
# Temp workaround for HP library cleanup
symlink /dev/hp3a-omap /dev/hp3A-omap
# Permissions for video
chmod 0770 /dev/hp3a-omap
chmod 0770 /dev/hplens-omap
chmod 0770 /dev/video0
chmod 0770 /dev/video1
chmod 0770 /dev/video2
chown media camera /dev/hp3a-omap
chown media camera /dev/hplens-omap
chown media camera /dev/video0
chown media graphics /dev/video1
chown media graphics /dev/video2
# copy hostapd configuration
copy /system/etc/wifi/softap/hostapd.conf /data/misc/wifi/hostapd.conf
# directory for encryption management tool, enc_mgt_tool
mkdir /data/emt
chmod 0700 /data/emt
# Create wmdrm directory
mkdir /pds/wmdrm 0775 mot_drm mot_drm
# Temp workaround for HP library cleanup
symlink /dev/hp3a-omap /dev/hp3A-omap
mount rootfs rootfs / ro remount
# Install kernel modules
insmod /system/lib/modules/sec.ko
# Install product specific kernel modules
# exec /system/bin/load_modules.sh
# chown/chmod for FOTA
chown system system /cache/fota
chmod 0770 /cache/fota
on early-boot
# Adjust the out of memory thresholds to account for the larget
# space on sholes. These numbers are in pages (4k). Must be kept
# in sync with init.rc. This must be done before the regular init.rc
# since these properies can't change once set.
setprop ro.FOREGROUND_APP_MEM 2464
setprop ro.VISIBLE_APP_MEM 3712
setprop ro.SECONDARY_SERVER_MEM 7392
setprop ro.BACKUP_APP_MEM 7392
setprop ro.HOME_APP_MEM 7392
setprop ro.HIDDEN_APP_MEM 8608
setprop ro.CONTENT_PROVIDER_MEM 9856
setprop ro.EMPTY_APP_MEM 9856
# Define the BLAN interface
setprop ro.blan.interface usb0
class_start media_early_init
on boot
# Overwrite what init.rc selected for the memory killer params to match above.
write /sys/module/lowmemorykiller/parameters/minfree 2464,3712,7392,8608,9856,9856
# Define Motorola DBVC ATVC Property defaults (failsafe properties)
setprop ro.sys.atvc_allow_netmon_usb 0
setprop ro.sys.atvc_allow_netmon_ih 0
setprop ro.sys.atvc_allow_res_core 0
setprop ro.sys.atvc_allow_res_panic 0
setprop ro.sys.atvc_allow_all_adb 0
setprop ro.sys.atvc_allow_all_core 0
setprop ro.sys.atvc_allow_efem 0
setprop ro.sys.atvc_allow_bp_log 0
setprop ro.sys.atvc_allow_ap_mot_log 0
# Enable panic on softlockup
write /proc/sys/kernel/softlockup_panic 1
# Install kernel modules
insmod /system/lib/modules/sec.ko
# Load traffic shaping modules
insmod /system/lib/modules/ifb.ko
insmod /system/lib/modules/act_mirred.ko
insmod /system/lib/modules/sch_ingress.ko
insmod /system/lib/modules/act_police.ko
insmod /system/lib/modules/cls_u32.ko
insmod /system/lib/modules/sch_htb.ko
insmod /system/lib/modules/em_u32.ko
# Load Authentec VPN kernel module
insmod /system/lib/modules/vpnclient.ko
# Set core max size (2G)
setrlimit 4 2147483648 2147483648
# Change the ownership of led files.
chown system system /sys/class/leds/lcd-backlight/als
chown system system /sys/class/leds/lcd-backlight/pwm_mode
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/keyboard1-backlight/brightness
chown system system /sys/class/leds/keyboard2-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/red/blink
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/torch-flash/camera_strobe
chown system system /sys/class/leds/torch-flash/flash_light
chown system system /sys/class/leds/spotlight/brightness
chown system system /sys/class/backlight/adp8870_bl/brightness
chown system system /sys/class/leds/adp8870-led7/brightness
chown system system /sys/class/backlight/lm3532_bl/brightness
chmod 0660 /sys/class/leds/lcd-backlight/brightness
chmod 0660 /sys/class/leds/keyboard-backlight/brightness
chmod 0660 /sys/class/leds/keyboard1-backlight/brightness
chmod 0660 /sys/class/leds/keyboard2-backlight/brightness
chmod 0660 /sys/class/leds/button-backlight/brightness
chmod 0660 /sys/class/leds/red/blink
chmod 0660 /sys/class/leds/red/brightness
chmod 0660 /sys/class/leds/green/brightness
chmod 0660 /sys/class/leds/blue/brightness
chmod 0660 /sys/class/leds/spotlight/brightness
chmod 0660 /sys/class/leds/torch-flash/brightness
chmod 0660 /sys/class/leds/torch-flash/camera_strobe
chmod 0660 /sys/class/leds/torch-flash/flash_light
chmod 0660 /sys/class/backlight/adp8870_bl/brightness
chmod 0660 /sys/class/leds/adp8870-led7/brightness
chmod 0660 /sys/class/backlight/lm3532_bl/brightness
# The properties introduced by moto
on property:sys.chargeonly.mode=1
start battd
start console
write /data/chargeonlymode charging
exec /system/bin/charge_only_mode
# Power up to normal
on property:tcmd.suspend=0
class_start core
class_start main
class_start late_start
# Power up to suspend
on property:tcmd.suspend=1
class_start core
class_start late_start
# Normal to suspend
on property:tcmd.suspend=2
class_stop main
#start console for userdebug and eng builds
on property:ro.debuggable=1
start console
# Moto safe power down
on property:sys.reboot=1
exec /system/bin/sleep 10
exec /system/bin/reboot
on property:sys.shutdown=1
exec /system/bin/sleep 10
exec /system/bin/reboot -p
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd_tiwlan0
# Adb ICS
on property:persist.sys.usb.config=*
setprop sys.usb.config $persist.sys.usb.config
on property:sys.usb.config=mass_storage,adb
# Made by usbd, but could be usefull later..
# write /sys/devices/virtual/usb_composite/adb/enable 0
# write /dev/usb_device_mode msc_adb
# write /tmp/usbd_current_state usb_mode_msc_adb
# write /sys/devices/virtual/usb_composite/adb/enable 1
start adbd
on property:sys.usb.config=mtp,adb
start adbd
on property:sys.usb.config=ptp,adb
start adbd
on property:service.adb.root=1
write /sys/devices/virtual/usb_composite/adb/enable 0
restart adbd
write /sys/devices/virtual/usb_composite/adb/enable 1
service usbd /system/bin/usbd
class core
user root
service battd /system/bin/battd
class core
socket battdsock stream 0660 mot_accy mot_accy
user root
group mot_accy mot_pwric
oneshot
# Bluetooth services.
service hciattach /system/bin/hciattach -n -t 10 /dev/ttyS1 texasalt 3000000 flow
class late_start
user bluetooth
group bluetooth net_bt_admin
disabled
service nap /system/bin/sdptool add NAP
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_nap /system/bin/sdptool remove NAP
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service panu /system/bin/sdptool add PANU
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service del_panu /system/bin/sdptool remove PANU
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service btdhcpd /system/bin/dnsmasq -C /etc/btpan.conf
user root
disabled
oneshot
service map /system/bin/sdptool add --channel=20 --network=2 MAP
class late_start
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service napics /system/bin/sh /system/bin/napics.sh
class late_start
user root
disabled
oneshot
# TCMD
service tcmd /system/bin/tcmd
class late_start
group mot_tcmd radio mot_pwric input system log camera graphics mot_accy sdcard_rw audio inet bluetooth wifi compass net_bt_admin mot_tombstone mot_tpapi mount net_raw net_admin mot_whisper media
socket local_tcmd stream 0660 mot_tcmd mot_tcmd
socket batch_socket stream 0600 mot_tcmd mot_tcmd
oneshot
service tcmdhelp /system/bin/tcmdhelp
class late_start
socket tcmdhelp stream 0600 mot_tcmd mot_tcmd
oneshot
disabled
#execute tcmdhelp
on property:tcmd.start_tcmdhelp=1
start tcmdhelp
# Ecompass daemon
service akmd2 /system/bin/akmd2
class core
user compass
group compass misc input
# Wifi services
service wlan_loader /system/bin/wlan_loader -f /system/etc/wifi/fw_wlan1271.bin -i /system/etc/wifi/tiwlan.ini -e /pds/wifi/nvs_map.bin
class late_start
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf
class late_start
socket wpa_tiwlan0 dgram 660 wifi wifi
disabled
oneshot
service wlan_ap_loader /system/bin/logwrapper /system/bin/wlan_loader -f /system/etc/wifi/fw_tiwlan_ap.bin -i /system/etc/wifi/tiwlan_ap.ini -e /pds/wifi/nvs_map.bin
disabled
oneshot
service hostapd /system/bin/logwrapper /system/bin/hostap -d /data/misc/wifi/hostapd.conf
class main
disabled
oneshot
service dhcpcd_tiwlan0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service iprenew_tiwlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_bnep0 /system/bin/dhcpcd -n
class main
disabled
oneshot
# DSP
service baseimage /system/bin/dspexec -v -T /system/lib/dsp/baseimage.dof
class media_early_init
user media
group media graphics
oneshot
service secclkd /system/bin/secclkd
class late_start
socket secclk_socket stream 660 mot_secclkd mot_secclkd
user mot_tpapi
group mot_tpapi mot_sec_rtc mot_secclkd
oneshot
# 3D init
service pvrsrv /system/bin/pvrsrvinit
class core
user root
group root
oneshot
# Radio
service pppd /system/bin/pppd silent ipparam dun plugin /system/lib/libpppd_plugin.so
class main
user root
disabled
oneshot
service pppd-ril /system/bin/pppd-ril /dev/ttyUSB0 call pppd-ril.options plugin /system/lib/libpppd_plugin-ril.so
class late_start
user root
disabled
oneshot
service modemlog /system/bin/modemlog
class core
oneshot
service ftmipcd /system/bin/ftmipcd
class late_start
user radio
group radio inet
oneshot
service dund_dialup /system/bin/dund --listen --channel=6 --nodetach --dialup
class late_start
group net_bt net_bt_admin
disabled
oneshot
service mdm_panicd /system/bin/mdm_panicd
class late_start
oneshot
#start Authentec VPN service
service vpnclientpm /system/bin/vpnclientpm
class late_start
oneshot
user root