OSDN Git Service

d9079d86e2c5706bc9d6882f94b5e92677de6667
[android-x86/build.git] / target / board / generic_x86 / init.rc
1
2 on init
3
4 sysclktz 0
5
6 loglevel 3
7
8 # setup the global environment
9     export PATH /sbin:/system/sbin:/system/bin:/system/xbin
10     export LD_LIBRARY_PATH /system/lib
11     export ANDROID_BOOTLOGO 1
12     export ANDROID_ROOT /system
13     export ANDROID_ASSETS /system/app
14     export ANDROID_DATA /data
15     export EXTERNAL_STORAGE /sdcard
16     export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
17
18 # Backward compatibility
19     symlink system/etc /etc
20     symlink system/lib /lib
21
22 # create mountpoints and mount tmpfs on sqlite_stmt_journals and debugfs on d
23     mkdir /d
24     chown system system /sdcard
25     chmod 0777 /sdcard
26     mkdir /data 0771 system system
27     mkdir /cache 0770 system cache
28     mkdir /sqlite_stmt_journals 01777 root root
29     mount tmpfs tmpfs /sqlite_stmt_journals size=4m
30     mount debugfs debugfs /d
31
32     mount rootfs rootfs / ro remount
33
34     write /proc/sys/kernel/panic_on_oops 1
35     write /proc/sys/kernel/hung_task_timeout_secs 0
36     write /proc/cpu/alignment 4
37     write /proc/sys/kernel/sched_latency_ns 10000000
38     write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
39
40 # mount mtd partitions
41 # TODO: this should be mounted by fs vol id (i.e. /dev/block-by-volid/system),
42 #       once init gets that functionality.
43 #   mount ext3 /dev/block/sda6 /system
44 #   mount ext3 /dev/block/sda6 /system ro remount
45
46     # We chown/chmod /data again so because mount is run as root + defaults
47 #   mount ext3 /dev/block/sda8 /data
48     chown system system /data
49     chmod 0771 /data
50
51     # Same reason as /data above
52 #   mount ext3 /dev/block/sda5 /cache
53     chown system cache /cache
54     chmod 0770 /cache
55
56     # This may have been created by the recovery system with odd permissions
57     chown system system /cache/recovery
58     chmod 0770 /cache/recovery
59
60 # create basic filesystem structure
61     mkdir /data/misc 01771 system misc
62     mkdir /data/misc/hcid 0770 bluetooth bluetooth
63     mkdir /data/local 0771 shell shell
64     mkdir /data/local/tmp 0771 shell shell
65     mkdir /data/data 0771 system system
66     mkdir /data/app-private 0771 system system
67     mkdir /data/app 0771 system system
68     mkdir /data/property 0700 root root
69
70     mkdir /data/misc/wifi 0770 wifi wifi
71     mkdir /data/misc/wifi/sockets 0770 wifi wifi
72     mkdir /data/system/wpa_supplicant 0770 wifi wifi
73     mkdir /data/misc/dhcp 0770 dhcp dhcp
74     chown dhcp dhcp /data/misc/dhcp
75
76     # create dalvik-cache and double-check the perms
77     mkdir /data/dalvik-cache 0771 system system
78     chown system system /data/dalvik-cache
79     chmod 0771 /data/dalvik-cache
80
81     # create the lost+found directories, so as to enforce our permissions
82     mkdir /data/lost+found 0770
83     mkdir /cache/lost+found 0770
84
85     # double check the perms, in case lost+found already exists, and set owner
86     chown root root /data/lost+found
87     chmod 0770 /data/lost+found
88     chown root root /cache/lost+found
89     chmod 0770 /cache/lost+found
90
91
92 ### Load some modules
93
94 on boot
95 # basic network init
96     ifup lo
97     hostname localhost
98     domainname localdomain
99
100 # set RLIMIT_NICE to allow priorities from 19 to -20
101     setrlimit 13 40 40
102
103 # Define the oom_adj values for the classes of processes that can be
104 # killed by the kernel.  These are used in ActivityManagerService.
105     setprop ro.FOREGROUND_APP_ADJ 0
106     setprop ro.VISIBLE_APP_ADJ 1
107     setprop ro.SECONDARY_SERVER_ADJ 2
108     setprop ro.BACKUP_APP_ADJ 2
109     setprop ro.HOME_APP_ADJ 4
110     setprop ro.HIDDEN_APP_MIN_ADJ 7
111     setprop ro.CONTENT_PROVIDER_ADJ 14
112     setprop ro.EMPTY_APP_ADJ 15
113
114 # Define the memory thresholds at which the above process classes will
115 # be killed.  These numbers are in pages (4k).
116     setprop ro.FOREGROUND_APP_MEM 1536
117     setprop ro.VISIBLE_APP_MEM 2048
118     setprop ro.SECONDARY_SERVER_MEM 4096
119     setprop ro.BACKUP_APP_MEM 4096
120     setprop ro.HOME_APP_MEM 4096
121     setprop ro.HIDDEN_APP_MEM 8192
122     setprop ro.CONTENT_PROVIDER_MEM 8704
123     setprop ro.EMPTY_APP_MEM 16384
124
125 # Write value must be consistent with the above properties.
126     write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
127
128     write /proc/sys/vm/overcommit_memory 1
129     write /proc/sys/vm/min_free_order_shift 4
130     write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,8192,8704,16384
131
132     # Set init its forked children's oom_adj.
133     write /proc/1/oom_adj -16
134
135     # Permissions for System Server and daemons.
136     chown radio system /sys/android_power/state
137     chown radio system /sys/android_power/request_state
138     chown radio system /sys/android_power/acquire_full_wake_lock
139     chown radio system /sys/android_power/acquire_partial_wake_lock
140     chown radio system /sys/android_power/release_wake_lock
141     chown radio system /sys/power/state
142     chown radio system /sys/power/wake_lock
143     chown radio system /sys/power/wake_unlock
144     chmod 0660 /sys/power/state
145     chmod 0660 /sys/power/wake_lock
146     chmod 0660 /sys/power/wake_unlock
147     chown system system /sys/class/timed_output/vibrator/enable
148     chown system system /sys/class/leds/keyboard-backlight/brightness
149     chown system system /sys/class/leds/lcd-backlight/brightness
150     chown system system /sys/class/leds/button-backlight/brightness
151     chown system system /sys/class/leds/red/brightness
152     chown system system /sys/class/leds/green/brightness
153     chown system system /sys/class/leds/blue/brightness
154     chown system system /sys/class/leds/red/device/grpfreq
155     chown system system /sys/class/leds/red/device/grppwm
156     chown system system /sys/class/leds/red/device/blink
157     chown system system /sys/class/leds/red/brightness
158     chown system system /sys/class/leds/green/brightness
159     chown system system /sys/class/leds/blue/brightness
160     chown system system /sys/class/leds/red/device/grpfreq
161     chown system system /sys/class/leds/red/device/grppwm
162     chown system system /sys/class/leds/red/device/blink
163     chown system system /sys/class/timed_output/vibrator/enable
164     chown system system /sys/module/sco/parameters/disable_esco
165     chown system system /sys/kernel/ipv4/tcp_wmem_min
166     chown system system /sys/kernel/ipv4/tcp_wmem_def
167     chown system system /sys/kernel/ipv4/tcp_wmem_max
168     chown system system /sys/kernel/ipv4/tcp_rmem_min
169     chown system system /sys/kernel/ipv4/tcp_rmem_def
170     chown system system /sys/kernel/ipv4/tcp_rmem_max
171     chown root radio /proc/cmdline
172
173 # Define TCP buffer sizes for various networks
174 #   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
175     setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
176     setprop net.tcp.buffersize.wifi    4095,87380,110208,4096,16384,110208
177     setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
178     setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
179     setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
180
181     setprop ro.radio.use-ppp no
182     setprop ro.radio.noril yes
183     setprop status.battery.state Slow
184     setprop status.battery.level 5
185     setprop status.battery.level_raw  50
186     setprop status.battery.level_scale 9
187     setprop alsa.mixer.playback.master Master
188     setprop alsa.mixer.capture.master Capture
189     setprop alsa.mixer.playback.earpiece Master
190     setprop alsa.mixer.capture.earpiece Capture
191     setprop alsa.mixer.playback.headset Master
192     setprop alsa.mixer.playback.speaker Master
193
194     setprop EXTERNAL_STORAGE_STATE unmounted
195
196     # merge from system.prop
197     setprop ro.config.sync yes
198     setprop app.setupwizard.disable 1
199     setprop keyguard.no_require_sim 1
200     setprop ro.alarm.volume.adjustable true
201     setprop ro.simulated.phone true
202
203     class_start default
204
205 ## Daemon processes to be run by init.
206 ##
207 service console /system/bin/sh
208     console
209
210 # adbd is controlled by the persist.service.adb.enable system property
211 service adbd /sbin/adbd
212
213 on property:persist.service.adb.enable=1
214     start adbd
215
216 on property:persist.service.adb.enable=0
217     stop adbd
218
219 service servicemanager /system/bin/servicemanager
220     user system
221     critical
222     onrestart restart zygote
223     onrestart restart media
224
225 service vold /system/bin/vold
226     socket vold stream 0660 root mount
227
228 service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
229     socket zygote stream 666
230     onrestart write /sys/android_power/request_state wake
231     onrestart write /sys/power/state on
232
233 service media /system/bin/mediaserver
234     user media
235     group sdcard_rw system audio camera graphics inet net_bt
236
237 service bootanim /system/bin/bootanimation
238     user graphics
239     group graphics
240     disabled
241     oneshot
242
243 service installd /system/bin/installd
244     socket installd stream 600 system system
245
246 service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c /data/misc/wifi/wpa_supplicant.conf
247     group system wifi
248     disabled
249     oneshot
250
251 service dbus /system/bin/dbus-daemon --system --nofork
252     socket dbus stream 660 bluetooth bluetooth
253     user bluetooth
254     group bluetooth net_bt_admin
255
256 service hcid /system/bin/hcid -d -s -n -f /etc/bluez/hcid.conf
257     socket bluetooth stream 660 bluetooth bluetooth
258     socket dbus_bluetooth stream 660 bluetooth bluetooth
259     group bluetooth net_bt_admin misc
260     disabled
261
262 service hfag /system/bin/sdptool add --channel=10 HFAG
263     user bluetooth
264     group bluetooth net_bt_admin misc
265     disabled
266     oneshot
267
268 service hsag /system/bin/sdptool add --channel=11 HSAG
269     user bluetooth
270     group bluetooth net_bt_admin misc
271     disabled
272     oneshot
273
274 #Please do not change anything below this line. If you want to add new service, add it above this line
275 #REMOVE FROM HERE
276 service dhcpcd /system/bin/dhcpcd wlan0
277     group system dhcp
278     disabled
279     oneshot
280