2 symlink /initlogo.rle.bak /initlogo.rle
11 # setup the global environment
12 export PATH /sbin:/system/sbin:/system/bin:/system/xbin
13 export LD_LIBRARY_PATH /system/lib
14 export ANDROID_BOOTLOGO 1
15 export ANDROID_ROOT /system
16 export ANDROID_ASSETS /system/app
17 export ANDROID_DATA /data
18 export EXTERNAL_STORAGE /mnt/sdcard2
19 export ASEC_MOUNTPOINT /mnt/asec
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
22 # Location of BT firmware files
23 export BT_FW_PATH /vendor/firmware
25 # for windows adb users..
28 # Backward compatibility
29 symlink /system/etc /etc
30 symlink /sys/kernel/debug /d
33 mkdir /mnt 0775 root system
34 mkdir /mnt/sdcard 0000 system system
35 mkdir /mnt/sdcard2 0000 system system
37 # Create cgroup mount point for cpu accounting
39 mount cgroup none /acct cpuacct
42 # Backwards Compat - XXX: Going away in G*
43 symlink /mnt/sdcard2 /sdcard
46 mkdir /data 0771 system system
47 mkdir /cache 0770 system cache
48 mkdir /config 0500 root root
50 # Directory for putting things only root should see.
51 mkdir /mnt/secure 0700 root root
53 # Directory for staging bindmounts
54 mkdir /mnt/secure/staging 0700 root root
56 # Directory-target for where the secure container
57 # imagefile directory will be bind-mounted
58 mkdir /mnt/secure/asec 0700 root root
60 # Secure container public mount points.
61 mkdir /mnt/asec 0700 root system
62 mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
64 # write /proc/sys/kernel/panic_on_oops 1
65 write /proc/sys/kernel/hung_task_timeout_secs 0
66 write /proc/cpu/alignment 4
67 write /proc/sys/kernel/sched_latency_ns 10000000
68 write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
69 write /proc/sys/kernel/sched_compat_yield 1
70 write /proc/sys/kernel/sched_child_runs_first 0
72 # Create cgroup mount points for process groups
74 mount cgroup none /dev/cpuctl cpu
75 chown system system /dev/cpuctl
76 chown system system /dev/cpuctl/tasks
77 chmod 0777 /dev/cpuctl/tasks
78 write /dev/cpuctl/cpu.shares 1024
80 mkdir /dev/cpuctl/fg_boost
81 chown system system /dev/cpuctl/fg_boost/tasks
82 chmod 0777 /dev/cpuctl/fg_boost/tasks
83 write /dev/cpuctl/fg_boost/cpu.shares 1024
85 mkdir /dev/cpuctl/bg_non_interactive
86 chown system system /dev/cpuctl/bg_non_interactive/tasks
87 chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
89 write /dev/cpuctl/bg_non_interactive/cpu.shares 52
91 # Power Management Patches
92 chmod 0777 /sys/power/state
93 chmod 0777 /sys/power/wake_lock
94 chmod 0777 /sys/power/wake_unlock
95 chmod 0777 /sys/power/wait_for_fb_sleep
96 chmod 0777 /sys/power/wait_for_fb_wake
98 chown system system /data
101 # Create dump dir and collect dumps.
102 # Do this before we mount cache so eventually we can use cache for
103 # storing dumps on platforms which do not have a dedicated dump partition.
105 mkdir /data/dontpanic
106 chown root log /data/dontpanic
107 chmod 0750 /data/dontpanic
109 # Collect apanic data, free resources and re-arm trigger
110 copy /proc/apanic_console /data/dontpanic/apanic_console
111 chown root log /data/dontpanic/apanic_console
112 chmod 0640 /data/dontpanic/apanic_console
114 copy /proc/apanic_threads /data/dontpanic/apanic_threads
115 chown root log /data/dontpanic/apanic_threads
116 chmod 0640 /data/dontpanic/apanic_threads
118 write /proc/apanic_console 1
120 # Same reason as /data above
121 chown system cache /cache
124 # This may have been created by the recovery system with odd permissions
125 chown system cache /cache/recovery
126 chmod 0770 /cache/recovery
128 #change permissions on vmallocinfo so we can grab it from bugreports
129 chown root log /proc/vmallocinfo
130 chmod 0440 /proc/vmallocinfo
132 #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
133 chown root system /proc/kmsg
134 chmod 0440 /proc/kmsg
135 chown root system /proc/sysrq-trigger
136 chmod 0220 /proc/sysrq-trigger
138 # change permissions for Overlay
139 chmod 0777 /dev/video1
140 chmod 0777 /dev/video2
141 chmod 0777 /dev/omap-resizer
143 # change permissions for Overlay on 2.6.37 kernel
144 chmod 777 /dev/video7
148 # create basic filesystem structure
149 mkdir /data/misc 01771 system misc
150 mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
151 mkdir /data/misc/bluetooth 0770 system system
152 mkdir /data/misc/keystore 0700 keystore keystore
153 mkdir /data/misc/vpn 0770 system system
154 mkdir /data/misc/systemkeys 0700 system system
155 mkdir /data/misc/vpn/profiles 0770 system system
157 # give system access to wpa_supplicant.conf for backup and restore
158 mkdir /system/etc/wifi 0770 system wifi
159 chmod 0770 /system/etc/wifi
160 chmod 0660 /system/etc/wifi/wpa_supplicant.conf
161 chown system wifi /system/etc/wifi/wpa_supplicant.conf
162 mkdir /data/misc/wifi 0770 system wifi
163 mkdir /data/misc/wifi/sockets 0777 system wifi
164 chmod 0770 /data/misc/wifi
165 chmod 0660 /data/misc/wifi/wpa_supplicant.conf
166 chown wifi wifi /data/misc/wifi
167 chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
169 mkdir /data/local 0771 shell shell
170 mkdir /data/local/tmp 0771 shell shell
171 mkdir /data/data 0771 system system
172 mkdir /data/app-private 0771 system system
173 mkdir /data/app 0771 system system
174 mkdir /data/property 0700 root root
175 mkdir /data/misc/dhcp 0777 dhcp dhcp
176 mkdir /data/misc/udhcpd 0777 system wifi
177 chown dhcp dhcp /data/misc/dhcp
179 # create dalvik-cache and double-check the perms
180 mkdir /data/dalvik-cache 0771 system system
181 chown system system /data/dalvik-cache
182 chmod 0771 /data/dalvik-cache
184 # create the lost+found directories, so as to enforce our permissions
185 mkdir /data/lost+found 0770
186 mkdir /cache/lost+found 0770
188 # double check the perms, in case lost+found already exists, and set owner
189 chown root root /data/lost+found
190 chmod 0770 /data/lost+found
191 chown root root /cache/lost+found
192 chmod 0770 /cache/lost+found
194 # console changed to ttyO* from ttyS* since 2.6.37 kernel.
195 chmod 0660 /dev/ttyO1
196 chown bluetooth bluetooth /dev/ttyO1
197 # chmod 0660 sys/class/rfkill/rfkill0/state
198 # chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
199 # write /sys/class/rfkill/rfkill0/state 0
206 # domainname localdomain
208 # set RLIMIT_NICE to allow priorities from 19 to -20
211 # No battery hardware present
212 setprop hw.nobattery true
213 setprop hw.nophone true
215 # Power Management Patches
218 # Enabling CPU Freq and CPU Idle
220 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor performance
223 mount debugfs debugfs /debug
224 # write /debug/pm_debug/sleep_while_idle 0
225 # write /debug/pm_debug/enable_off_mode 0
227 # Define the oom_adj values for the classes of processes that can be
228 # killed by the kernel. These are used in ActivityManagerService.
229 setprop ro.FOREGROUND_APP_ADJ 0
230 setprop ro.VISIBLE_APP_ADJ 1
231 setprop ro.PERCEPTIBLE_APP_ADJ 2
232 setprop ro.HEAVY_WEIGHT_APP_ADJ 3
233 setprop ro.SECONDARY_SERVER_ADJ 4
234 setprop ro.BACKUP_APP_ADJ 5
235 setprop ro.HOME_APP_ADJ 6
236 setprop ro.HIDDEN_APP_MIN_ADJ 7
237 setprop ro.EMPTY_APP_ADJ 15
239 # Define the memory thresholds at which the above process classes will
240 # be killed. These numbers are in pages (4k).
241 setprop ro.FOREGROUND_APP_MEM 2048
242 setprop ro.VISIBLE_APP_MEM 3072
243 setprop ro.PERCEPTIBLE_APP_MEM 4096
244 setprop ro.HEAVY_WEIGHT_APP_MEM 4096
245 setprop ro.SECONDARY_SERVER_MEM 6144
246 setprop ro.BACKUP_APP_MEM 6144
247 setprop ro.HOME_APP_MEM 6144
248 setprop ro.HIDDEN_APP_MEM 5120
249 setprop ro.EMPTY_APP_MEM 6144
251 # Write value must be consistent with the above properties.
252 # Note that the driver only supports 6 slots, so we have HOME_APP at the
253 # same memory level as services.
254 write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15
256 write /proc/sys/vm/overcommit_memory 1
257 write /proc/sys/vm/min_free_order_shift 4
258 write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,4096,6144,7168,8192
260 # Set init its forked children's oom_score_adj.
261 write /proc/1/oom_score_adj -16
263 # Tweak background writeout
264 write /proc/sys/vm/dirty_expire_centisecs 200
265 write /proc/sys/vm/dirty_background_ratio 5
267 # Permissions for System Server and daemons.
268 chown radio system /sys/android_power/state
269 chown radio system /sys/android_power/request_state
270 chown radio system /sys/android_power/acquire_full_wake_lock
271 chown radio system /sys/android_power/acquire_partial_wake_lock
272 chown radio system /sys/android_power/release_wake_lock
273 chown radio system /sys/power/state
274 chown radio system /sys/power/wake_lock
275 chown radio system /sys/power/wake_unlock
276 #Power Management patches
277 chown radio system /sys/power/wait_for_fb_sleep
278 chown radio system /sys/power/wait_for_fb_wake
280 chmod 0660 /sys/power/state
281 chmod 0660 /sys/power/wake_lock
282 chmod 0660 /sys/power/wake_unlock
283 #Brightness Control patches for 2.6.37 kernel
284 # chmod 0777 /sys/devices/omapdss/display0/backlight/sharp-ls/brightness
285 # chown system system /sys/devices/omapdss/display0/backlight/sharp-ls/brightness
286 # chown system system /sys/class/timed_output/vibrator/enable
287 # chown system system /sys/class/leds/keyboard-backlight/brightness
288 # chown system system /sys/class/timed_output/vibrator/enable
289 chown system system /sys/module/sco/parameters/disable_esco
290 chown system system /sys/kernel/ipv4/tcp_wmem_min
291 chown system system /sys/kernel/ipv4/tcp_wmem_def
292 chown system system /sys/kernel/ipv4/tcp_wmem_max
293 chown system system /sys/kernel/ipv4/tcp_rmem_min
294 chown system system /sys/kernel/ipv4/tcp_rmem_def
295 chown system system /sys/kernel/ipv4/tcp_rmem_max
296 chown root radio /proc/cmdline
297 chown system system /system/etc/wifi
298 # wl12xx_sdio, wlan module for 2.6.37 wlan release
299 # chown system system /system/etc/wifi/wl12xx_sdio.ko
301 # chmod 0755 /wl1271bt_enable
303 # Define TCP buffer sizes for various networks
304 # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
305 setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
306 setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
307 setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
308 setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
309 setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
311 setprop wifi.interface wlan0
315 ## Daemon processes to be run by init.
317 #service logcat /system/bin/logcat -f /dev/kmsg
320 service ueventd /sbin/ueventd
323 #service console /system/bin/sh
326 service pvr /system/bin/rc.pvr start
328 # adbd is controlled by the persist.service.adb.enable system property
329 service adbd /sbin/adbd
332 # adbd on at boot in emulator
333 on property:ro.kernel.qemu=1
336 on property:persist.service.adb.enable=1
339 on property:persist.service.adb.enable=0
342 service servicemanager /system/bin/servicemanager
345 onrestart restart zygote
346 onrestart restart media
348 service vold /system/bin/vold
349 socket vold stream 0660 root mount
352 service netd /system/bin/netd
353 socket netd stream 0660 root system
355 service debuggerd /system/bin/debuggerd
357 service ril-daemon /system/bin/rild
358 socket rild stream 660 root radio
359 socket rild-debug stream 660 radio system
361 group radio cache inet misc audio
363 service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
364 socket zygote stream 666
365 onrestart write /sys/android_power/request_state wake
366 onrestart write /sys/power/state on
367 onrestart restart media
369 service media /system/bin/mediaserver
371 group system audio camera graphics inet net_bt net_bt_admin net_raw sdcard_rw
374 service bootanim /system/bin/bootanimation
380 service dbus /system/bin/dbus-daemon --system --nofork
381 socket dbus stream 660 bluetooth bluetooth
383 group bluetooth net_bt_admin
385 service bluetoothd /system/bin/bluetoothd -n
386 socket bluetooth stream 660 bluetooth bluetooth
387 socket dbus_bluetooth stream 660 bluetooth bluetooth
388 # init.rc does not yet support applying capabilities, so run as root and
389 # let bluetoothd drop uid to bluetooth with the right linux capabilities
390 group bluetooth net_bt_admin misc
393 service hfag /system/bin/sdptool add --channel=10 HFAG
395 group bluetooth net_bt_admin
399 service hsag /system/bin/sdptool add --channel=11 HSAG
401 group bluetooth net_bt_admin
405 service opush /system/bin/sdptool add --channel=12 OPUSH
407 group bluetooth net_bt_admin
411 service pbap /system/bin/sdptool add --channel=19 PBAP
413 group bluetooth net_bt_admin
417 service installd /system/bin/installd
418 socket installd stream 600 system system
420 #service flash_recovery /system/etc/install-recovery.sh
423 service racoon /system/bin/racoon
424 socket racoon stream 600 system system
425 # racoon will setuid to vpn after getting necessary resources.
430 service mtpd /system/bin/mtpd
431 socket mtpd stream 600 system system
433 group vpn net_admin net_raw
437 service keystore /system/bin/keystore /data/misc/keystore
440 socket keystore stream 666
442 service dumpstate /system/bin/dumpstate -s
443 socket dumpstate stream 0660 shell log
448 service wifi /system/bin/rc.wifi start
451 # rfkill is not supported, use this instead
452 #service btpwr /wl1271bt_enable /dev/ttyO1
456 #service hciattach /system/bin/hciattach -n /dev/ttyO1 texas 3000000
458 # changing user to root from bluetooth is a potential security issue
459 # group bluetooth net_bt_admin misc
463 # wpa_supplicant and dhcp daemon
464 service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd -qq
465 socket wpa_wlan0 dgram 660 system wifi
466 group system wifi inet
470 service dhcpcd /system/bin/dhcpcd -ABKL wlan0