OSDN Git Service

change LOCAL_MODULE_TAGS user to eng
[gb-231r1-is01/GB_2.3_IS01.git] / init.rc
1 on early-init
2     start ueventd
3
4 on init
5
6 sysclktz 0
7
8 loglevel 6
9
10 # setup the global environment
11     export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
12     export LD_LIBRARY_PATH /vendor/lib:/system/lib
13     export ANDROID_BOOTLOGO 1
14     export ANDROID_ROOT /system
15     export ANDROID_ASSETS /system/app
16     export ANDROID_DATA /data
17     export EXTERNAL_STORAGE /mnt/sdcard
18     export ASEC_MOUNTPOINT /mnt/asec
19     export LOOP_MOUNTPOINT /mnt/obb
20     export BOOTCLASSPATH /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
21     export DEBUG 6
22
23 # Backward compatibility
24 ##    symlink /system/etc /etc
25     symlink /sys/kernel/debug /d
26
27 # create mountpoints
28     mkdir /mnt 0775 root system
29     mkdir /mnt/sdcard 0000 system system
30
31 # Create cgroup mount point for cpu accounting
32     mkdir /acct
33     mount cgroup none /acct cpuacct
34     mkdir /acct/uid
35
36 # Backwards Compat - XXX: Going away in G*
37     symlink /mnt/sdcard /sdcard
38
39 ##    mkdir /system
40 ##    mkdir /data 0771 system system
41     mkdir /cache 0770 system cache
42     mkdir /config 0500 root root
43
44     # Directory for putting things only root should see.
45     mkdir /mnt/secure 0700 root root
46
47     # Directory for staging bindmounts
48     mkdir /mnt/secure/staging 0700 root root
49
50     # Directory-target for where the secure container
51     # imagefile directory will be bind-mounted
52     mkdir /mnt/secure/asec  0700 root root
53
54     # Secure container public mount points.
55     mkdir /mnt/asec  0700 root system
56     mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
57
58     # Filesystem image public mount points.
59     mkdir /mnt/obb 0700 root system
60     mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
61
62     write /proc/sys/kernel/panic_on_oops 1
63     write /proc/sys/kernel/hung_task_timeout_secs 0
64     write /proc/cpu/alignment 4
65     write /proc/sys/kernel/sched_latency_ns 10000000
66     write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
67     write /proc/sys/kernel/sched_compat_yield 1
68     write /proc/sys/kernel/sched_child_runs_first 0
69
70 # Create cgroup mount points for process groups
71     mkdir /dev/cpuctl
72     mount cgroup none /dev/cpuctl cpu
73     chown system system /dev/cpuctl
74     chown system system /dev/cpuctl/tasks
75     chmod 0777 /dev/cpuctl/tasks
76     write /dev/cpuctl/cpu.shares 1024
77
78     mkdir /dev/cpuctl/fg_boost
79     chown system system /dev/cpuctl/fg_boost/tasks
80     chmod 0777 /dev/cpuctl/fg_boost/tasks
81     write /dev/cpuctl/fg_boost/cpu.shares 1024
82
83     mkdir /dev/cpuctl/bg_non_interactive
84     chown system system /dev/cpuctl/bg_non_interactive/tasks
85     chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
86     # 5.0 %
87     write /dev/cpuctl/bg_non_interactive/cpu.shares 52
88
89 on fs
90 # mount mtd partitions
91     # Mount /system rw first to give the filesystem a chance to save a checkpoint
92 ##    mount yaffs2 mtd@system /system
93 ##    mount yaffs2 mtd@system /system ro remount
94 ##    mount yaffs2 mtd@userdata /data0 nosuid nodev
95     mount yaffs2 mtd@cache /cache nosuid nodev
96
97 on post-fs
98     # once everything is setup, no need to modify /
99 ##    mount rootfs rootfs / ro remount
100
101     mount ext3 /dev/block/mmcblk0p1 /data0 nodev
102     symlink /data0/data_ginger/data /data
103     chown system system /data
104     chown system system /data0/data_ginger/data
105     chmod 0771  system system /data0/data_ginger/data
106     symlink /data0/system_ginger/system /system    
107     symlink /system/etc /etc
108
109 # Right now vendor lives on the same filesystem as system,
110 # but someday that may change.
111     symlink /system/vendor /vendor
112
113     # We chown/chmod /data again so because mount is run as root + defaults
114     chown system system /data
115     chmod 0771 /data
116
117     # Create dump dir and collect dumps.
118     # Do this before we mount cache so eventually we can use cache for
119     # storing dumps on platforms which do not have a dedicated dump partition.
120    
121     mkdir /data/dontpanic
122     chown root log /data/dontpanic
123     chmod 0750 /data/dontpanic
124
125     # Collect apanic data, free resources and re-arm trigger
126     copy /proc/apanic_console /data/dontpanic/apanic_console
127     chown root log /data/dontpanic/apanic_console
128     chmod 0640 /data/dontpanic/apanic_console
129
130     copy /proc/apanic_threads /data/dontpanic/apanic_threads
131     chown root log /data/dontpanic/apanic_threads
132     chmod 0640 /data/dontpanic/apanic_threads
133
134     write /proc/apanic_console 1
135
136     # Same reason as /data above
137     chown system cache /cache
138     chmod 0770 /cache
139
140     # This may have been created by the recovery system with odd permissions
141     chown system cache /cache/recovery
142     chmod 0770 /cache/recovery
143
144     #change permissions on vmallocinfo so we can grab it from bugreports
145     chown root log /proc/vmallocinfo
146     chmod 0440 /proc/vmallocinfo
147
148     #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
149     chown root system /proc/kmsg
150     chmod 0440 /proc/kmsg
151     chown root system /proc/sysrq-trigger
152     chmod 0220 /proc/sysrq-trigger
153
154 # create basic filesystem structure
155     mkdir /data/misc 01771 system misc
156     mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
157     mkdir /data/misc/bluetooth 0770 system system
158     mkdir /data/misc/keystore 0700 keystore keystore
159     mkdir /data/misc/vpn 0770 system system
160     mkdir /data/misc/systemkeys 0700 system system
161     mkdir /data/misc/vpn/profiles 0770 system system
162     # give system access to wpa_supplicant.conf for backup and restore
163     mkdir /data/misc/wifi 0770 wifi wifi
164     mkdir /data/misc/wifi/sockets 0770 wifi wifi
165     mkdir /data/misc/dhcp 0770 dhcp dhcp
166     chown dhcp dhcp /data/misc/dhcp
167     chown wifi wifi /data/misc/wifi
168     chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
169     chown wifi wifi /data/misc/wifi/sockets
170     chmod 0666 /system/etc/wifi/wpa_supplicant.conf
171     chmod 0770 /data/misc/wifi
172     chmod 0660 /data/misc/wifi/wpa_supplicant.conf
173
174     chmod 0660 /data/misc/dhcp/dhcpcd-wlan0.pid
175     chown dhcp shell /system/etc/dhcpcd/dhcpcd-run-hooks
176
177     mkdir /data/local 0771 shell shell
178     mkdir /data/local/tmp 0771 shell shell
179     mkdir /data/data 0771 system system
180     mkdir /data/app-private 0771 system system
181     mkdir /data/app 0771 system system
182     mkdir /data/property 0700 root root
183     chown system system /data/app
184     chown system system /data/app-private
185     chmod 777 /data/app
186     chmod 777 /data/app-private
187
188     # create dalvik-cache and double-check the perms
189     mkdir /data/dalvik-cache 0771 system system
190     chown system system /data/dalvik-cache
191     chmod 0771 /data/dalvik-cache
192
193     # create the lost+found directories, so as to enforce our permissions
194     mkdir /data/lost+found 0770
195     mkdir /cache/lost+found 0770
196
197     # double check the perms, in case lost+found already exists, and set owner
198     chown root root /data/lost+found
199     chmod 0770 /data/lost+found
200     chown root root /cache/lost+found
201     chmod 0770 /cache/lost+found
202
203     # create data/drm directory
204     mkdir /data/drm 0774 drm drm
205     chown drm drm /data/drm
206     chmod 0774 /data/drm
207
208 on boot
209 # basic network init
210 #    ifup lo
211 #    hostname localhost
212 #    domainname localdomain
213
214 # set RLIMIT_NICE to allow priorities from 19 to -20
215     setrlimit 13 40 40
216
217 # Define the oom_adj values for the classes of processes that can be
218 # killed by the kernel.  These are used in ActivityManagerService.
219     setprop ro.FOREGROUND_APP_ADJ 0
220     setprop ro.VISIBLE_APP_ADJ 1
221     setprop ro.PERCEPTIBLE_APP_ADJ 2
222     setprop ro.HEAVY_WEIGHT_APP_ADJ 3
223     setprop ro.SECONDARY_SERVER_ADJ 4
224     setprop ro.BACKUP_APP_ADJ 5
225     setprop ro.HOME_APP_ADJ 6
226     setprop ro.HIDDEN_APP_MIN_ADJ 7
227     setprop ro.EMPTY_APP_ADJ 15
228
229 # Define the memory thresholds at which the above process classes will
230 # be killed.  These numbers are in pages (4k).
231     setprop ro.FOREGROUND_APP_MEM 2048
232     setprop ro.VISIBLE_APP_MEM 3072
233     setprop ro.PERCEPTIBLE_APP_MEM 4096
234     setprop ro.HEAVY_WEIGHT_APP_MEM 4096
235     setprop ro.SECONDARY_SERVER_MEM 6144
236     setprop ro.BACKUP_APP_MEM 6144
237     setprop ro.HOME_APP_MEM 6144
238     setprop ro.HIDDEN_APP_MEM 7168
239     setprop ro.EMPTY_APP_MEM 8192
240
241 # Write value must be consistent with the above properties.
242 # Note that the driver only supports 6 slots, so we have combined some of
243 # the classes into the same memory level; the associated processes of higher
244 # classes will still be killed first.
245     write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15
246
247     write /proc/sys/vm/overcommit_memory 1
248     write /proc/sys/vm/min_free_order_shift 4
249     write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,4096,6144,7168,8192
250
251     # Set init its forked children's oom_adj.
252     write /proc/1/oom_adj -16
253
254     # Tweak background writeout
255     write /proc/sys/vm/dirty_expire_centisecs 200
256     write /proc/sys/vm/dirty_background_ratio  5
257
258     # Permissions for System Server and daemons.
259     chown radio system /sys/android_power/state
260     chown radio system /sys/android_power/request_state
261     chown radio system /sys/android_power/acquire_full_wake_lock
262     chown radio system /sys/android_power/acquire_partial_wake_lock
263     chown radio system /sys/android_power/release_wake_lock
264     chown radio system /sys/power/state
265     chown radio system /sys/power/wake_lock
266     chown radio system /sys/power/wake_unlock
267     chmod 0660 /sys/power/state
268     chmod 0660 /sys/power/wake_lock
269     chmod 0660 /sys/power/wake_unlock
270     chown system system /sys/class/timed_output/vibrator/enable
271     chown system system /sys/class/leds/keyboard-backlight/brightness
272     chown system system /sys/class/leds/lcd-backlight/brightness
273     chown system system /sys/class/leds/button-backlight/brightness
274     chown system system /sys/class/leds/jogball-backlight/brightness
275     chown system system /sys/class/leds/red/brightness
276     chown system system /sys/class/leds/green/brightness
277     chown system system /sys/class/leds/blue/brightness
278     chown system system /sys/class/leds/red/device/grpfreq
279     chown system system /sys/class/leds/red/device/grppwm
280     chown system system /sys/class/leds/red/device/blink
281     chown system system /sys/class/leds/red/brightness
282     chown system system /sys/class/leds/green/brightness
283     chown system system /sys/class/leds/blue/brightness
284     chown system system /sys/class/leds/red/device/grpfreq
285     chown system system /sys/class/leds/red/device/grppwm
286     chown system system /sys/class/leds/red/device/blink
287     chown system system /sys/class/timed_output/vibrator/enable
288     chown system system /sys/module/sco/parameters/disable_esco
289     chown system system /sys/kernel/ipv4/tcp_wmem_min
290     chown system system /sys/kernel/ipv4/tcp_wmem_def
291     chown system system /sys/kernel/ipv4/tcp_wmem_max
292     chown system system /sys/kernel/ipv4/tcp_rmem_min
293     chown system system /sys/kernel/ipv4/tcp_rmem_def
294     chown system system /sys/kernel/ipv4/tcp_rmem_max
295     chown root radio /proc/cmdline
296
297     chown system system /sys/bus/platform/drivers/msm_sdcc/msm_sdcc.1/polling
298
299
300 # Define TCP buffer sizes for various networks
301 #   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
302     setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
303     setprop net.tcp.buffersize.wifi    4095,87380,110208,4096,16384,110208
304     setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
305     setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
306     setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
307
308     class_start default
309
310 ## Daemon processes to be run by init.
311 ##
312 insmod /system/lib/modules/unifi_sdio.ko
313     setprop wifi.interface wlan0
314     setprop wlan.driver.status ok
315     ifup lo
316     ifup wlan0
317     hostname localhost
318     domainname localdomain
319     user system
320
321 service ueventd /sbin/ueventd
322     critical
323
324 service console /system/bin/sh
325     console
326     disabled
327     user shell
328     group log
329
330 on property:ro.secure=0
331     start console
332
333 # adbd is controlled by the persist.service.adb.enable system property
334 service adbd /sbin/adbd
335     disabled
336
337 # adbd on at boot in emulator
338 on property:ro.kernel.qemu=1
339     start adbd
340
341 on property:persist.service.adb.enable=1
342     start adbd
343
344 on property:persist.service.adb.enable=0
345     stop adbd
346
347 service servicemanager /system/bin/servicemanager
348     user system
349     critical
350     onrestart restart zygote
351     onrestart restart media
352
353 service vold /system/bin/vold
354     socket vold stream 0660 root mount
355     ioprio be 2
356
357 service netd /system/bin/netd
358     socket netd stream 0660 root system
359     socket dnsproxyd stream 0660 root inet
360
361 service debuggerd /system/bin/debuggerd
362
363 service ril-daemon /system/bin/rild
364     socket rild stream 660 root radio
365     socket rild-debug stream 660 radio system
366     user root
367     group radio cache inet misc audio sdcard_rw
368
369 service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
370     socket zygote stream 666
371     onrestart write /sys/android_power/request_state wake
372     onrestart write /sys/power/state on
373     onrestart restart media
374     onrestart restart netd
375
376 service drm /system/bin/drmserver
377     user drm
378     group system root inet
379
380 service drmio /system/bin/drmioserver
381     user drmio
382
383 service media /system/bin/mediaserver
384     user media
385     group system audio camera graphics inet net_bt net_bt_admin net_raw
386     ioprio rt 4
387
388 service bootanim /system/bin/bootanimation
389     user graphics
390     group graphics
391     disabled
392     oneshot
393
394 service dbus /system/bin/dbus-daemon --system --nofork
395     socket dbus stream 660 bluetooth bluetooth
396     user bluetooth
397     group bluetooth net_bt_admin
398
399 service bluetoothd /system/bin/bluetoothd -n
400     socket bluetooth stream 660 bluetooth bluetooth
401     socket dbus_bluetooth stream 660 bluetooth bluetooth
402     # init.rc does not yet support applying capabilities, so run as root and
403     # let bluetoothd drop uid to bluetooth with the right linux capabilities
404     group bluetooth net_bt_admin misc
405     disabled
406
407 service hfag /system/bin/sdptool add --channel=10 HFAG
408     user bluetooth
409     group bluetooth net_bt_admin
410     disabled
411     oneshot
412
413 service hsag /system/bin/sdptool add --channel=11 HSAG
414     user bluetooth
415     group bluetooth net_bt_admin
416     disabled
417     oneshot
418
419 service opush /system/bin/sdptool add --channel=12 OPUSH
420     user bluetooth
421     group bluetooth net_bt_admin
422     disabled
423     oneshot
424
425 service pbap /system/bin/sdptool add --channel=19 PBAP
426     user bluetooth
427     group bluetooth net_bt_admin
428     disabled
429     oneshot
430
431 service installd /system/bin/installd
432     socket installd stream 600 system system
433
434 ##service flash_recovery /system/etc/install-recovery.sh
435 ##    oneshot
436
437 busybox --install 
438 service racoon /system/bin/racoon
439     socket racoon stream 600 system system
440     # racoon will setuid to vpn after getting necessary resources.
441     group net_admin
442     disabled
443     oneshot
444
445 service mtpd /system/bin/mtpd
446     socket mtpd stream 600 system system
447     user vpn
448     group vpn net_admin net_raw
449     disabled
450     oneshot
451
452 service keystore /system/bin/keystore /data/misc/keystore
453     user keystore
454     group keystore
455     socket keystore stream 666
456
457 service dumpstate /system/bin/dumpstate -s
458     socket dumpstate stream 0660 shell log
459     disabled
460     oneshot
461
462 service shlcdc_process /system/bin/shlcdc_process
463 service shdisp_process /system/bin/shdisp_process
464
465 service ifcfg_ralink /system/bin/ifconfig wlan0 up
466
467 service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd
468         disabled
469 #     user wifi
470 #    user system
471 #    group system wifi inet
472     socket wpa_wlan0 dgram 660 wifi wifi
473     oneshot
474
475 service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -d wlan0
476     disabled
477     oneshot
478
479 on property:init.svc.wpa_supplicant=stopped
480         stop dhcpcd
481
482 service synergy_service /system/bin/logwrapper /system/bin/synergy_service -C /dev/ttyHS0 -U 4000000
483     oneshot
484
485 service shsd_process /system/bin/shsd_process
486
487 ##service dtvserver /system/bin/dtvserver
488 service sdservice /system/bin/sdservice
489
490 service obexd /system/bin/obexd
491     socket obex_manager stream 660 root mount
492
493 service akmd2 /system/bin/akmd2
494
495 service shusb_process /system/bin/shusb_process
496 service medousa /system/bin/medousa
497     group sdcard_rw
498