Guest User

Untitled

a guest
May 23rd, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.02 KB | None | 0 0
  1.  
  2. on init
  3.  
  4. sysclktz 0
  5.  
  6. loglevel 3
  7.  
  8. # setup the global environment
  9. export TERMINFO /system/etc/terminfo
  10. export PATH /sbin:/system/sbin:/system/bin:/system/xbin
  11. export LD_LIBRARY_PATH /system/lib
  12. export ANDROID_BOOTLOGO 1
  13. export ANDROID_ROOT /system
  14. export ANDROID_ASSETS /system/app
  15. export ANDROID_DATA /data
  16. export EXTERNAL_STORAGE /mnt/sdcard
  17. export ASEC_MOUNTPOINT /mnt/asec
  18. export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/com.htc.framework.jar:/system/framework/com.htc.android.pimlib.jar:/system/framework/com.htc.android.easopen.jar:/system/framework/com.scalado.util.ScaladoUtil.jar
  19.  
  20. # Backward compatibility
  21. symlink /system/etc /etc
  22. symlink /sys/kernel/debug /d
  23.  
  24. # create mountpoints
  25. mkdir /mnt 0775 root system
  26. mkdir /mnt/sdcard 0000 system system
  27.  
  28. # Create cgroup mount point for cpu accounting
  29. mkdir /acct
  30. mount cgroup none /acct cpuacct
  31. mkdir /acct/uid
  32.  
  33. # Backwards Compat - XXX: Going away in G*
  34. symlink /mnt/sdcard /sdcard
  35.  
  36. mkdir /system
  37. mkdir /data 0771 system system
  38. mkdir /cache 0770 system cache
  39. mkdir /config 0500 root root
  40.  
  41. # Directory for putting things only root should see.
  42. mkdir /mnt/secure 0700 root root
  43.  
  44. # Directory for staging bindmounts
  45. mkdir /mnt/secure/staging 0700 root root
  46.  
  47. # Directory-target for where the secure container
  48. # imagefile directory will be bind-mounted
  49. mkdir /mnt/secure/asec 0700 root root
  50.  
  51. # Secure container public mount points.
  52. mkdir /mnt/asec 0700 root system
  53. mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  54.  
  55. mount rootfs rootfs / ro remount
  56.  
  57. write /proc/sys/kernel/panic_on_oops 1
  58. write /proc/sys/kernel/hung_task_timeout_secs 0
  59. write /proc/cpu/alignment 4
  60. write /proc/sys/kernel/sched_latency_ns 5000000
  61. write /proc/sys/kernel/sched_wakeup_granularity_ns 100000
  62. write /proc/sys/kernel/sched_min_granularity_ns 100000
  63. write /proc/sys/kernel/sched_compat_yield 1
  64. write /proc/sys/kernel/sched_child_runs_first 0
  65.  
  66. # Create cgroup mount points for process groups
  67. mkdir /dev/cpuctl
  68. mount cgroup none /dev/cpuctl cpu
  69. chown system system /dev/cpuctl
  70. chown system system /dev/cpuctl/tasks
  71. chmod 0777 /dev/cpuctl/tasks
  72. write /dev/cpuctl/cpu.shares 1024
  73.  
  74. mkdir /dev/cpuctl/fg_boost
  75. chown system system /dev/cpuctl/fg_boost/tasks
  76. chmod 0777 /dev/cpuctl/fg_boost/tasks
  77. write /dev/cpuctl/fg_boost/cpu.shares 1024
  78.  
  79. mkdir /dev/cpuctl/bg_non_interactive
  80. chown system system /dev/cpuctl/bg_non_interactive/tasks
  81. chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  82. # 5.0 %
  83. write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  84.  
  85. # mount mtd partitions
  86. # Mount /system rw first to give the filesystem a chance to save a checkpoint
  87. mount yaffs2 mtd@system /system
  88. mount yaffs2 mtd@system /system ro remount
  89.  
  90. # We chown/chmod /data again so because mount is run as root + defaults
  91. mount yaffs2 mtd@userdata /data nosuid nodev
  92. chown system system /data
  93. chmod 0771 /data
  94.  
  95. # Create dump dir and collect dumps.
  96. # Do this before we mount cache so eventually we can use cache for
  97. # storing dumps on platforms which do not have a dedicated dump partition.
  98.  
  99. mkdir /data/dontpanic
  100. chown root log /data/dontpanic
  101. chmod 0750 /data/dontpanic
  102.  
  103. # Collect apanic data, free resources and re-arm trigger
  104. copy /proc/apanic_console /data/dontpanic/apanic_console
  105. chown root log /data/dontpanic/apanic_console
  106. chmod 0640 /data/dontpanic/apanic_console
  107.  
  108. copy /proc/apanic_threads /data/dontpanic/apanic_threads
  109. chown root log /data/dontpanic/apanic_threads
  110. chmod 0640 /data/dontpanic/apanic_threads
  111.  
  112. write /proc/apanic_console 1
  113.  
  114. # Same reason as /data above
  115. mount yaffs2 mtd@cache /cache nosuid nodev
  116. chown system cache /cache
  117. chmod 0770 /cache
  118.  
  119. # This may have been created by the recovery system with odd permissions
  120. chown system cache /cache/recovery
  121. chmod 0770 /cache/recovery
  122.  
  123. #change permissions on vmallocinfo so we can grab it from bugreports
  124. chown root log /proc/vmallocinfo
  125. chmod 0440 /proc/vmallocinfo
  126.  
  127. #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
  128. chown root system /proc/kmsg
  129. chmod 0440 /proc/kmsg
  130. chown root system /proc/sysrq-trigger
  131. chmod 0220 /proc/sysrq-trigger
  132.  
  133. # create basic filesystem structure
  134. mkdir /data/misc 01771 system misc
  135. mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  136. mkdir /data/misc/bluetooth 0770 system system
  137. mkdir /data/misc/keystore 0700 keystore keystore
  138. mkdir /data/misc/vpn 0770 system system
  139. mkdir /data/misc/systemkeys 0700 system system
  140. mkdir /data/misc/vpn/profiles 0770 system system
  141. # give system access to wpa_supplicant.conf for backup and restore
  142. mkdir /data/misc/wifi 0770 wifi wifi
  143. chmod 0770 /data/misc/wifi
  144. chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  145. mkdir /data/local 0771 shell shell
  146. mkdir /data/local/tmp 0771 shell shell
  147. mkdir /data/data 0771 system system
  148. mkdir /data/app-private 0771 system system
  149. mkdir /data/app 0771 system system
  150. mkdir /data/property 0700 root root
  151. # DRMv1 rights storage
  152. symlink /data/local /data/drm
  153. mkdir /data/local/rights 0777 shell shell
  154. chown shell shell /data/drm
  155.  
  156. # create dalvik-cache and double-check the perms
  157. mkdir /data/dalvik-cache 0771 system system
  158. chown system system /data/dalvik-cache
  159. chmod 0771 /data/dalvik-cache
  160.  
  161. # create the lost+found directories, so as to enforce our permissions
  162. mkdir /data/lost+found 0770
  163. mkdir /cache/lost+found 0770
  164.  
  165. # double check the perms, in case lost+found already exists, and set owner
  166. chown root root /data/lost+found
  167. chmod 0770 /data/lost+found
  168. chown root root /cache/lost+found
  169. chmod 0770 /cache/lost+found
  170.  
  171. on boot
  172. # basic network init
  173. ifup lo
  174. hostname localhost
  175. domainname localdomain
  176.  
  177. # set RLIMIT_NICE to allow priorities from 19 to -20
  178. setrlimit 13 40 40
  179.  
  180. # Define the oom_adj values for the classes of processes that can be
  181. # killed by the kernel. These are used in ActivityManagerService.
  182. setprop ro.FOREGROUND_APP_ADJ 0
  183. setprop ro.VISIBLE_APP_ADJ 1
  184. setprop ro.SECONDARY_SERVER_ADJ 2
  185. setprop ro.BACKUP_APP_ADJ 2
  186. setprop ro.HOME_APP_ADJ 4
  187. setprop ro.HIDDEN_APP_MIN_ADJ 7
  188. setprop ro.CONTENT_PROVIDER_ADJ 14
  189. setprop ro.EMPTY_APP_ADJ 15
  190.  
  191. # Define the memory thresholds at which the above process classes will
  192. # be killed. These numbers are in pages (4k).
  193. setprop ro.FOREGROUND_APP_MEM 1536
  194. setprop ro.VISIBLE_APP_MEM 2048
  195. setprop ro.SECONDARY_SERVER_MEM 4096
  196. setprop ro.BACKUP_APP_MEM 4096
  197. setprop ro.HOME_APP_MEM 4096
  198. setprop ro.HIDDEN_APP_MEM 5120
  199. setprop ro.CONTENT_PROVIDER_MEM 15360
  200. setprop ro.EMPTY_APP_MEM 25600
  201.  
  202. # Enable Anr history , it would output the debuginfo to data partition
  203. # 1: on 0: off
  204. # setprop debugtool.anrhistory 1
  205.  
  206. # Set error receiver
  207. setprop ro.error.receiver.htc.apps com.android.updater
  208.  
  209. #ruu
  210. write /data/misc/screen_lock_status 0
  211. chown system system /data/misc/screen_lock_status
  212. chmod 644 /data/misc/screen_lock_status
  213.  
  214. # Write value must be consistent with the above properties.
  215. # Note that the driver only supports 6 slots, so we have HOME_APP at the
  216. # same memory level as services.
  217. write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
  218.  
  219. write /proc/sys/vm/overcommit_memory 1
  220. write /proc/sys/vm/min_free_order_shift 4
  221. write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,4096,5120,15360,25600
  222.  
  223. # Set init its forked children's oom_adj.
  224. write /proc/1/oom_adj -16
  225.  
  226. # Tweak background writeout
  227. write /proc/sys/vm/dirty_expire_centisecs 200
  228. write /proc/sys/vm/dirty_background_ratio 5
  229.  
  230. # Permissions for System Server and daemons.
  231. chown radio system /sys/android_power/state
  232. chown radio system /sys/android_power/request_state
  233. chown radio system /sys/android_power/acquire_full_wake_lock
  234. chown radio system /sys/android_power/acquire_partial_wake_lock
  235. chown radio system /sys/android_power/release_wake_lock
  236. chown radio system /sys/power/state
  237. chown radio system /sys/power/wake_lock
  238. chown radio system /sys/power/wake_unlock
  239. chown radio system /sys/camera_led_status/led_ril_status
  240. chown system system /sys/camera_led_status/led_wimax_status
  241. chown system system /sys/camera_led_status/led_hotspot_status
  242. chown media system /sys/android_camera/cam_mode
  243. chmod 0660 /sys/power/state
  244. chmod 0660 /sys/power/wake_lock
  245. chmod 0660 /sys/power/wake_unlock
  246. chown system system /sys/class/timed_output/vibrator/enable
  247. chown system system /sys/class/leds/keyboard-backlight/brightness
  248. chown system system /sys/class/leds/lcd-backlight/brightness
  249. chown system system /sys/class/leds/button-backlight/brightness
  250. chown system system /sys/class/leds/jogball-backlight/brightness
  251. chown system system /sys/class/leds/caps/brightness
  252. chown system system /sys/class/leds/func/brightness
  253. chown system system /sys/class/leds/red/brightness
  254. chown system system /sys/class/leds/green/brightness
  255. chown system system /sys/class/leds/blue/brightness
  256. chown system system /sys/class/leds/amber/brightness
  257. chown system system /sys/class/leds/red/device/grpfreq
  258. chown system system /sys/class/leds/red/device/grppwm
  259. chown system system /sys/class/leds/red/device/blink
  260. chown system system /sys/class/leds/red/device/grpfreq
  261. chown system system /sys/class/leds/red/device/grppwm
  262. chown system system /sys/class/leds/red/device/blink
  263. chown system system /sys/class/leds/green/blink
  264. chown system system /sys/class/leds/green/off_timer
  265. chown system system /sys/class/leds/amber/blink
  266. chown system system /sys/class/leds/amber/off_timer
  267. chown system system /sys/class/timed_output/vibrator/enable
  268. chown system system /sys/module/sco/parameters/disable_esco
  269. chown system system /sys/kernel/ipv4/tcp_wmem_min
  270. chown system system /sys/kernel/ipv4/tcp_wmem_def
  271. chown system system /sys/kernel/ipv4/tcp_wmem_max
  272. chown system system /sys/kernel/ipv4/tcp_rmem_min
  273. chown system system /sys/kernel/ipv4/tcp_rmem_def
  274. chown system system /sys/kernel/ipv4/tcp_rmem_max
  275. chown root radio /proc/cmdline
  276.  
  277. # Define TCP buffer sizes for various networks
  278. # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  279. setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  280. setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
  281. setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
  282. setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
  283. setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
  284. setprop net.tcp.buffersize.wimax 107380,221184,524288,4096,16384,110208
  285.  
  286. start sysinit
  287. on property:cm.filesystem.ready=1
  288.  
  289. class_start default
  290.  
  291. ## Daemon processes to be run by init.
  292. ##
  293. service console /system/bin/sh
  294. console
  295.  
  296. # adbd is controlled by the persist.service.adb.enable system property
  297. service adbd /sbin/adbd
  298. disabled
  299.  
  300. # adbd on at boot in emulator
  301. on property:ro.kernel.qemu=1
  302. start adbd
  303.  
  304. on property:persist.service.adb.enable=1
  305. start adbd
  306.  
  307. on property:persist.service.adb.enable=0
  308. stop adbd
  309.  
  310. service servicemanager /system/bin/servicemanager
  311. user system
  312. critical
  313. onrestart restart zygote
  314. onrestart restart media
  315.  
  316. service vold /system/bin/vold
  317. socket vold stream 0660 root mount
  318. ioprio be 2
  319.  
  320. service netd /system/bin/netd
  321. socket netd stream 0660 root system
  322.  
  323. service debuggerd /system/bin/debuggerd
  324.  
  325. service ril-daemon /system/bin/rild
  326. socket rild stream 660 root radio
  327. socket rild-debug stream 660 radio system
  328. socket rild-htc stream 660 radio system
  329. user root
  330. group radio cache inet misc audio
  331.  
  332. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  333. socket zygote stream 666
  334. onrestart write /sys/android_power/request_state wake
  335. onrestart write /sys/power/state on
  336. onrestart restart media
  337.  
  338. service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
  339. disabled
  340. oneshot
  341.  
  342. service media /system/bin/mediaserver
  343. user media
  344. group system audio camera graphics inet net_bt net_bt_admin net_raw
  345. ioprio rt 4
  346.  
  347. service bootsound /system/bin/playmp3
  348. user media
  349. group audio
  350. oneshot
  351.  
  352. service bootanim /system/bin/bootanimation
  353. user graphics
  354. group system audio graphics
  355. disabled
  356. oneshot
  357.  
  358. service dbus /system/bin/dbus-daemon --system --nofork
  359. socket dbus stream 666 bluetooth bluetooth
  360. user bluetooth
  361. group bluetooth net_bt_admin
  362.  
  363. service bluetoothd /system/bin/bluetoothd -n
  364. socket bluetooth stream 660 bluetooth bluetooth
  365. socket dbus_bluetooth stream 660 bluetooth bluetooth
  366. # init.rc does not yet support applying capabilities, so run as root and
  367. # let bluetoothd drop uid to bluetooth with the right linux capabilities
  368. group bluetooth net_bt_admin misc
  369. disabled
  370.  
  371. service hfag /system/bin/sdptool add --channel=10 HFAG
  372. user bluetooth
  373. group bluetooth net_bt_admin
  374. disabled
  375. oneshot
  376.  
  377. service hsag /system/bin/sdptool add --channel=11 HSAG
  378. user bluetooth
  379. group bluetooth net_bt_admin
  380. disabled
  381. oneshot
  382.  
  383. service opush /system/bin/sdptool add --channel=12 OPUSH
  384. user bluetooth
  385. group bluetooth net_bt_admin
  386. disabled
  387. oneshot
  388.  
  389. service pbap /system/bin/sdptool add --channel=19 PBAP
  390. user bluetooth
  391. group bluetooth net_bt_admin
  392. disabled
  393. oneshot
  394.  
  395. service installd /system/bin/installd
  396. socket installd stream 600 system system
  397.  
  398. service flash_recovery /system/etc/install-recovery.sh
  399. oneshot
  400.  
  401. service racoon /system/bin/racoon
  402. socket racoon stream 600 system system
  403. # racoon will setuid to vpn after getting necessary resources.
  404. group net_admin
  405. disabled
  406. oneshot
  407.  
  408. service mtpd /system/bin/mtpd
  409. socket mtpd stream 600 system system
  410. user vpn
  411. group vpn net_admin net_raw
  412. disabled
  413. oneshot
  414.  
  415. service keystore /system/bin/keystore /data/misc/keystore
  416. user keystore
  417. group keystore
  418. socket keystore stream 666
  419.  
  420. service dumpstate /system/bin/dumpstate -s
  421. socket dumpstate stream 0660 shell log
  422. disabled
  423. oneshot
  424.  
  425. on property:dev.bootcomplete=1
  426. start bootcomplete
  427.  
  428. service bootcomplete /system/bin/bootcomplete
  429. user root
  430. group root
  431. disabled
  432. oneshot
  433.  
  434. service shutdown /system/bin/shutdown
  435. user root
  436. group root
  437. disabled
  438. oneshot
  439.  
  440. service ipd /system/bin/ipd
  441. socket ipd stream 666 root inet
Add Comment
Please, Sign In to add comment