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
18 # Backward compatibility
19 symlink /system/etc /etc
21 # create mountpoints and mount tmpfs on sqlite_stmt_journals and debugfs on d
23 chown system system /sdcard
25 mkdir /data 0771 system system
26 mkdir /cache 0770 system cache
27 mkdir /sqlite_stmt_journals 01777 root root
28 mount tmpfs tmpfs /sqlite_stmt_journals size=4m
29 mount debugfs debugfs /d
31 mount rootfs rootfs / ro remount
33 write /proc/sys/kernel/panic_on_oops 1
34 write /proc/sys/kernel/hung_task_timeout_secs 0
35 write /proc/cpu/alignment 4
36 write /proc/sys/kernel/sched_latency_ns 10000000
37 write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
39 # mount mtd partitions
40 # TODO: this should be mounted by fs vol id (i.e. /dev/block-by-volid/system),
41 # once init gets that functionality.
42 # mount ext3 /dev/block/sda6 /system
43 # mount ext3 /dev/block/sda6 /system ro remount
45 # We chown/chmod /data again so because mount is run as root + defaults
46 # mount ext3 /dev/block/sda8 /data
47 chown system system /data
50 # Same reason as /data above
51 # mount ext3 /dev/block/sda5 /cache
52 chown system cache /cache
55 # This may have been created by the recovery system with odd permissions
56 chown system system /cache/recovery
57 chmod 0770 /cache/recovery
59 # create basic filesystem structure
60 mkdir /data/misc 01771 system misc
61 mkdir /data/misc/hcid 0770 bluetooth bluetooth
62 mkdir /data/local 0771 shell shell
63 mkdir /data/local/tmp 0771 shell shell
64 mkdir /data/data 0771 system system
65 mkdir /data/app-private 0771 system system
66 mkdir /data/app 0771 system system
67 mkdir /data/property 0700 root root
69 mkdir /data/misc/wifi 0770 wifi wifi
70 mkdir /data/misc/wifi/sockets 0770 wifi wifi
71 mkdir /data/system/wpa_supplicant 0770 wifi wifi
72 mkdir /data/misc/dhcp 0770 dhcp dhcp
73 chown dhcp dhcp /data/misc/dhcp
75 # create dalvik-cache and double-check the perms
76 mkdir /data/dalvik-cache 0771 system system
77 chown system system /data/dalvik-cache
78 chmod 0771 /data/dalvik-cache
80 # create the lost+found directories, so as to enforce our permissions
81 mkdir /data/lost+found 0770
82 mkdir /cache/lost+found 0770
84 # double check the perms, in case lost+found already exists, and set owner
85 chown root root /data/lost+found
86 chmod 0770 /data/lost+found
87 chown root root /cache/lost+found
88 chmod 0770 /cache/lost+found
98 domainname localdomain
100 # set RLIMIT_NICE to allow priorities from 19 to -20
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.HOME_APP_ADJ 4
109 setprop ro.HIDDEN_APP_MIN_ADJ 7
110 setprop ro.CONTENT_PROVIDER_ADJ 14
111 setprop ro.EMPTY_APP_ADJ 15
113 # Define the memory thresholds at which the above process classes will
114 # be killed. These numbers are in pages (4k).
115 setprop ro.FOREGROUND_APP_MEM 1536
116 setprop ro.VISIBLE_APP_MEM 2048
117 setprop ro.SECONDARY_SERVER_MEM 4096
118 setprop ro.HOME_APP_MEM 4096
119 setprop ro.HIDDEN_APP_MEM 8192
120 setprop ro.CONTENT_PROVIDER_MEM 8704
121 setprop ro.EMPTY_APP_MEM 16384
123 # Write value must be consistent with the above properties.
124 write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
126 write /proc/sys/vm/overcommit_memory 1
127 write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,8192,8704,16384
129 # Set init its forked children's oom_adj.
130 write /proc/1/oom_adj -16
132 # Permissions for System Server and daemons.
133 chown radio system /sys/android_power/state
134 chown radio system /sys/android_power/request_state
135 chown radio system /sys/android_power/acquire_full_wake_lock
136 chown radio system /sys/android_power/acquire_partial_wake_lock
137 chown radio system /sys/android_power/release_wake_lock
138 chown radio system /sys/power/state
139 chown radio system /sys/power/wake_lock
140 chown radio system /sys/power/wake_unlock
141 chmod 0660 /sys/power/state
142 chmod 0660 /sys/power/wake_lock
143 chmod 0660 /sys/power/wake_unlock
144 chown system system /sys/class/timed_output/vibrator/enable
145 chown system system /sys/class/leds/keyboard-backlight/brightness
146 chown system system /sys/class/leds/lcd-backlight/brightness
147 chown system system /sys/class/leds/button-backlight/brightness
148 chown system system /sys/class/leds/red/brightness
149 chown system system /sys/class/leds/green/brightness
150 chown system system /sys/class/leds/blue/brightness
151 chown system system /sys/class/leds/red/device/grpfreq
152 chown system system /sys/class/leds/red/device/grppwm
153 chown system system /sys/class/leds/red/device/blink
154 chown system system /sys/class/leds/red/brightness
155 chown system system /sys/class/leds/green/brightness
156 chown system system /sys/class/leds/blue/brightness
157 chown system system /sys/class/leds/red/device/grpfreq
158 chown system system /sys/class/leds/red/device/grppwm
159 chown system system /sys/class/leds/red/device/blink
160 chown system system /sys/class/timed_output/vibrator/enable
161 chown system system /sys/module/sco/parameters/disable_esco
162 chown system system /sys/kernel/ipv4/tcp_wmem_min
163 chown system system /sys/kernel/ipv4/tcp_wmem_def
164 chown system system /sys/kernel/ipv4/tcp_wmem_max
165 chown system system /sys/kernel/ipv4/tcp_rmem_min
166 chown system system /sys/kernel/ipv4/tcp_rmem_def
167 chown system system /sys/kernel/ipv4/tcp_rmem_max
168 chown root radio /proc/cmdline
170 # Define TCP buffer sizes for various networks
171 # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
172 setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
173 setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
174 setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
175 setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
176 setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
178 setprop EXTERNAL_STORAGE_STATE mounted
179 setprop wlan.modpath MODPATH
183 ## Daemon processes to be run by init.
185 service console /system/bin/sh
188 # adbd is controlled by the persist.service.adb.enable system property
189 service adbd /sbin/adbd
191 on property:persist.service.adb.enable=1
194 on property:persist.service.adb.enable=0
197 service servicemanager /system/bin/servicemanager
200 onrestart restart zygote
201 onrestart restart media
203 service mountd /system/bin/mountd
204 socket mountd stream 0660 root mount
206 service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
207 socket zygote stream 666
208 onrestart write /sys/android_power/request_state wake
209 onrestart write /sys/power/state on
211 service media /system/bin/mediaserver
213 group system audio camera graphics inet net_bt net_bt_admin
215 service installd /system/bin/installd
216 socket installd stream 600 system system
218 service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c /system/etc/wifi/wpa_supplicant.conf
223 service dhcpcd /system/bin/dhcpcd wlan0