Guest User

Untitled

a guest
Sep 16th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.64 KB | None | 0 0
  1. on early-init
  2. start ueventd
  3.  
  4. on init
  5.  
  6. sysclktz 0
  7.  
  8. loglevel 3
  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/storage/sdcard
  18. export FLASH_STORAGE /mnt/storage
  19. # export EXTERNAL_STORAGE /mnt/sdcard/external_sd
  20. # export FLASH_STORAGE /mnt/sdcard
  21. export ASEC_MOUNTPOINT /mnt/asec
  22. export LOOP_MOUNTPOINT /mnt/obb
  23. export HOST_STORAGE_DIRECTORY /mnt/udisk
  24. 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
  25.  
  26. # for adobe reader mobile
  27. export RK_ADOBE_DE_MOBILE 1
  28. export RK_ADEPT_DEVICE_TYPE mobile
  29. export RK_ADOBE_DE_DOC_FOLDER "/flash/Digital Editions"
  30. export RK_ADEPT_ACTIVATION_FILE /flash/.adobe-digital-editions/activation.xml
  31. export RK_ADEPT_DEVICE_FILE /flash/.adobe-digital-editions/device.xml
  32. export RK_ADEPT_DEVICE_SALT_FILE /flash/.adobe-digital-editions/devicesalt
  33. #export RK_ADOBE_DE_DOC_FOLDER "/mnt/sdcard/Digital Editions"
  34. #export RK_ADEPT_ACTIVATION_FILE /mnt/sdcard/.adobe-digital-editions/activation.xml
  35. #export RK_ADEPT_DEVICE_FILE /mnt/sdcard/.adobe-digital-editions/device.xml
  36. #export RK_ADEPT_DEVICE_SALT_FILE /mnt/sdcard/.adobe-digital-editions/devicesalt
  37. export ADOBE_FONTS_DIR /system/fonts/adobefonts/
  38.  
  39. # Backward compatibility
  40. symlink /system/etc /etc
  41. symlink /sys/kernel/debug /d
  42.  
  43. # Right now vendor lives on the same filesystem as system,
  44. # but someday that may change.
  45. symlink /system/vendor /vendor
  46.  
  47. # create mountpoints
  48. mkdir /mnt 0775 root system
  49. # mkdir /mnt/sdcard 0000 system system
  50. mkdir /mnt/storage 0000 system system
  51. mkdir /mnt/udisk 0000 system system
  52.  
  53. # Create cgroup mount point for cpu accounting
  54. mkdir /acct
  55. mount cgroup none /acct cpuacct
  56. mkdir /acct/uid
  57.  
  58. # Backwards Compat - XXX: Going away in G*
  59. #symlink /mnt/sdcard/external_sd /sdcard
  60. #symlink /mnt/sdcard /flash
  61. symlink /mnt/storage/sdcard /sdcard
  62. symlink /mnt/storage /flash
  63. symlink /mnt/udisk /udisk
  64.  
  65. mkdir /system
  66. mkdir /data 0771 system system
  67. mkdir /cache 0770 system cache
  68. mkdir /config 0500 root root
  69.  
  70. # Directory for putting things only root should see.
  71. mkdir /mnt/secure 0700 root root
  72.  
  73. # Directory for staging bindmounts
  74. mkdir /mnt/secure/staging 0700 root root
  75.  
  76. # Directory-target for where the secure container
  77. # imagefile directory will be bind-mounted
  78. mkdir /mnt/secure/asec 0700 root root
  79.  
  80. # Secure container public mount points.
  81. mkdir /mnt/asec 0700 root system
  82. mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  83.  
  84. # Filesystem image public mount points.
  85. mkdir /mnt/obb 0700 root system
  86. mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
  87.  
  88. write /proc/sys/kernel/panic_on_oops 1
  89. write /proc/sys/kernel/hung_task_timeout_secs 0
  90. write /proc/cpu/alignment 4
  91. write /proc/sys/kernel/sched_latency_ns 10000000
  92. write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  93. write /proc/sys/kernel/sched_compat_yield 1
  94. write /proc/sys/kernel/sched_child_runs_first 0
  95.  
  96. # Create cgroup mount points for process groups
  97. mkdir /dev/cpuctl
  98. mount cgroup none /dev/cpuctl cpu
  99. chown system system /dev/cpuctl
  100. chown system system /dev/cpuctl/tasks
  101. chmod 0777 /dev/cpuctl/tasks
  102. write /dev/cpuctl/cpu.shares 1024
  103.  
  104. mkdir /dev/cpuctl/fg_boost
  105. chown system system /dev/cpuctl/fg_boost/tasks
  106. chmod 0777 /dev/cpuctl/fg_boost/tasks
  107. write /dev/cpuctl/fg_boost/cpu.shares 1024
  108.  
  109. mkdir /dev/cpuctl/bg_non_interactive
  110. chown system system /dev/cpuctl/bg_non_interactive/tasks
  111. chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  112. # 5.0 %
  113. write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  114.  
  115. on fs
  116. insmod /rk29xxnand_ko.ko
  117. # mount mtd partitions
  118. # Mount /system rw first to give the filesystem a chance to save a checkpoint
  119. mount cramfs mtd@system /system
  120. #mount mtd@system /system ro remount
  121. mount ext3 mtd@userdata /data nosuid nodev noatime nodiratime
  122. mount ext3 mtd@cache /cache nosuid nodev noatime nodiratime
  123.  
  124. on post-fs
  125. # once everything is setup, no need to modify /
  126. mount rootfs rootfs / ro remount
  127.  
  128. # We chown/chmod /data again so because mount is run as root + defaults
  129. chown system system /data
  130. chmod 0771 /data
  131.  
  132. # Create dump dir and collect dumps.
  133. # Do this before we mount cache so eventually we can use cache for
  134. # storing dumps on platforms which do not have a dedicated dump partition.
  135.  
  136. mkdir /data/dontpanic
  137. chown root log /data/dontpanic
  138. chmod 0750 /data/dontpanic
  139.  
  140. # Collect apanic data, free resources and re-arm trigger
  141. copy /proc/apanic_console /data/dontpanic/apanic_console
  142. chown root log /data/dontpanic/apanic_console
  143. chmod 0640 /data/dontpanic/apanic_console
  144.  
  145. copy /proc/apanic_threads /data/dontpanic/apanic_threads
  146. chown root log /data/dontpanic/apanic_threads
  147. chmod 0640 /data/dontpanic/apanic_threads
  148.  
  149. write /proc/apanic_console 1
  150.  
  151. # Same reason as /data above
  152. chown system cache /cache
  153. chmod 0770 /cache
  154.  
  155. # This may have been created by the recovery system with odd permissions
  156. chown system cache /cache/recovery
  157. chmod 0770 /cache/recovery
  158.  
  159. #change permissions on vmallocinfo so we can grab it from bugreports
  160. chown root log /proc/vmallocinfo
  161. chmod 0440 /proc/vmallocinfo
  162.  
  163. #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
  164. chown root system /proc/kmsg
  165. chmod 0440 /proc/kmsg
  166. chown root system /proc/sysrq-trigger
  167. chmod 0220 /proc/sysrq-trigger
  168.  
  169. # create basic filesystem structure
  170. mkdir /data/misc 01771 system misc
  171. mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  172. mkdir /data/misc/bluetooth 0770 system system
  173. mkdir /data/misc/keystore 0700 keystore keystore
  174. mkdir /data/misc/vpn 0770 system system
  175. mkdir /data/misc/systemkeys 0700 system system
  176. mkdir /data/misc/vpn/profiles 0770 system system
  177. # give system access to wpa_supplicant.conf for backup and restore
  178. mkdir /data/misc/wifi 0770 wifi wifi
  179. chmod 0770 /data/misc/wifi
  180. chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  181. mkdir /data/local 0771 shell shell
  182. mkdir /data/local/tmp 0771 shell shell
  183. mkdir /data/data 0771 system system
  184. mkdir /data/app-private 0771 system system
  185. mkdir /data/app 0771 system system
  186. mkdir /data/property 0700 root root
  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. # for factory reset function
  204. chmod 777 /dev/mtd/mtd0
  205.  
  206. on boot
  207. # basic network init
  208. ifup lo
  209. hostname localhost
  210. domainname localdomain
  211.  
  212. # set RLIMIT_NICE to allow priorities from 19 to -20
  213. setrlimit 13 40 40
  214.  
  215. # Define the oom_adj values for the classes of processes that can be
  216. # killed by the kernel. These are used in ActivityManagerService.
  217. setprop ro.FOREGROUND_APP_ADJ 0
  218. setprop ro.VISIBLE_APP_ADJ 1
  219. setprop ro.PERCEPTIBLE_APP_ADJ 2
  220. setprop ro.HEAVY_WEIGHT_APP_ADJ 3
  221. setprop ro.SECONDARY_SERVER_ADJ 4
  222. setprop ro.BACKUP_APP_ADJ 5
  223. setprop ro.HOME_APP_ADJ 6
  224. setprop ro.HIDDEN_APP_MIN_ADJ 7
  225. setprop ro.EMPTY_APP_ADJ 15
  226.  
  227. # Define the memory thresholds at which the above process classes will
  228. # be killed. These numbers are in pages (4k).
  229. setprop ro.FOREGROUND_APP_MEM 2048
  230. setprop ro.VISIBLE_APP_MEM 3072
  231. setprop ro.PERCEPTIBLE_APP_MEM 4096
  232. setprop ro.HEAVY_WEIGHT_APP_MEM 4096
  233. setprop ro.SECONDARY_SERVER_MEM 6144
  234. setprop ro.BACKUP_APP_MEM 6144
  235. setprop ro.HOME_APP_MEM 6144
  236. setprop ro.HIDDEN_APP_MEM 7168
  237. setprop ro.EMPTY_APP_MEM 8192
  238.  
  239. # Write value must be consistent with the above properties.
  240. # Note that the driver only supports 6 slots, so we have combined some of
  241. # the classes into the same memory level; the associated processes of higher
  242. # classes will still be killed first.
  243. write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15
  244.  
  245. write /proc/sys/vm/overcommit_memory 1
  246. write /proc/sys/vm/min_free_order_shift 4
  247. write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,4096,6144,7168,8192
  248.  
  249. # Set init its forked children's oom_adj.
  250. write /proc/1/oom_adj -16
  251.  
  252. # Tweak background writeout
  253. write /proc/sys/vm/dirty_expire_centisecs 200
  254. write /proc/sys/vm/dirty_background_ratio 5
  255.  
  256. # Permissions for System Server and daemons.
  257. chown radio system /sys/android_power/state
  258. chown radio system /sys/android_power/request_state
  259. chown radio system /sys/android_power/acquire_full_wake_lock
  260. chown radio system /sys/android_power/acquire_partial_wake_lock
  261. chown radio system /sys/android_power/release_wake_lock
  262. chown radio system /sys/power/state
  263. chown radio system /sys/power/wake_lock
  264. chown radio system /sys/power/wake_unlock
  265. chmod 0660 /sys/power/state
  266. chmod 0660 /sys/power/wake_lock
  267. chmod 0660 /sys/power/wake_unlock
  268. chown system system /sys/class/timed_output/vibrator/enable
  269. chown system system /sys/class/leds/keyboard-backlight/brightness
  270. chown system system /sys/class/leds/lcd-backlight/brightness
  271. chown system system /sys/class/leds/button-backlight/brightness
  272. chown system system /sys/class/leds/jogball-backlight/brightness
  273. chown system system /sys/class/leds/red/brightness
  274. chown system system /sys/class/leds/green/brightness
  275. chown system system /sys/class/leds/blue/brightness
  276. chown system system /sys/class/leds/red/device/grpfreq
  277. chown system system /sys/class/leds/red/device/grppwm
  278. chown system system /sys/class/leds/red/device/blink
  279. chown system system /sys/class/leds/red/brightness
  280. chown system system /sys/class/leds/green/brightness
  281. chown system system /sys/class/leds/blue/brightness
  282. chown system system /sys/class/leds/red/device/grpfreq
  283. chown system system /sys/class/leds/red/device/grppwm
  284. chown system system /sys/class/leds/red/device/blink
  285. chown system system /sys/class/timed_output/vibrator/enable
  286. chown system system /sys/module/sco/parameters/disable_esco
  287. chown system system /sys/kernel/ipv4/tcp_wmem_min
  288. chown system system /sys/kernel/ipv4/tcp_wmem_def
  289. chown system system /sys/kernel/ipv4/tcp_wmem_max
  290. chown system system /sys/kernel/ipv4/tcp_rmem_min
  291. chown system system /sys/kernel/ipv4/tcp_rmem_def
  292. chown system system /sys/kernel/ipv4/tcp_rmem_max
  293. chown root radio /proc/cmdline
  294. chown system system /sys/class/backlight/rk28_bl/brightness
  295.  
  296. # wisky qumeng 20110705 HDMI
  297. chmod 777 /sys/class/hdmi/hdmi-0/enable
  298. chmod 777 /sys/class/hdmi/hdmi-0/state
  299.  
  300. # for HDMI facility
  301. chown system system /dev/anx7150
  302.  
  303. # for TvOut facility
  304. chown system system /dev/rk1000_TVOUT
  305.  
  306. # for eth
  307. #BOARD_USE_ETHERNET TAG#mkdir /data/misc/dhcp_eth 0777 system system
  308.  
  309. # Define TCP buffer sizes for various networks
  310. # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  311. setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  312. setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
  313. setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
  314. setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
  315. setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
  316.  
  317. class_start default
  318.  
  319. ## Daemon processes to be run by init.
  320. ##
  321. service ueventd /sbin/ueventd
  322. critical
  323.  
  324. service console /system/bin/busybox 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.  
  360. service debuggerd /system/bin/debuggerd
  361.  
  362. service ril-daemon /system/bin/rild
  363. socket rild stream 660 root radio
  364. socket rild-debug stream 660 radio system
  365. user root
  366. group radio cache inet misc audio sdcard_rw
  367.  
  368. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  369. socket zygote stream 666
  370. onrestart write /sys/android_power/request_state wake
  371. onrestart write /sys/power/state on
  372. onrestart restart media
  373. onrestart restart netd
  374.  
  375. service media /system/bin/mediaserver
  376. socket vpu_server stream 666 media media
  377. user media
  378. group system audio camera graphics inet net_bt net_bt_admin net_raw
  379. ioprio rt 4
  380.  
  381. service bootanim /system/bin/bootanimation
  382. user graphics
  383. group graphics
  384. disabled
  385. oneshot
  386.  
  387. service dbus /system/bin/dbus-daemon --system --nofork
  388. socket dbus stream 660 bluetooth bluetooth
  389. user bluetooth
  390. group bluetooth net_bt_admin
  391.  
  392. service bluetoothd /system/bin/bluetoothd -n
  393. socket bluetooth stream 660 bluetooth bluetooth
  394. socket dbus_bluetooth stream 660 bluetooth bluetooth
  395. # init.rc does not yet support applying capabilities, so run as root and
  396. # let bluetoothd drop uid to bluetooth with the right linux capabilities
  397. group bluetooth net_bt_admin misc
  398. disabled
  399.  
  400. service hfag /system/bin/sdptool add --channel=10 HFAG
  401. user bluetooth
  402. group bluetooth net_bt_admin
  403. disabled
  404. oneshot
  405.  
  406. service hsag /system/bin/sdptool add --channel=11 HSAG
  407. user bluetooth
  408. group bluetooth net_bt_admin
  409. disabled
  410. oneshot
  411.  
  412. service opush /system/bin/sdptool add --channel=12 OPUSH
  413. user bluetooth
  414. group bluetooth net_bt_admin
  415. disabled
  416. oneshot
  417.  
  418. service pbap /system/bin/sdptool add --channel=19 PBAP
  419. user bluetooth
  420. group bluetooth net_bt_admin
  421. disabled
  422. oneshot
  423.  
  424. service installd /system/bin/installd
  425. socket installd stream 600 system system
  426.  
  427. service flash_recovery /system/bin/flash_image recovery /data/recovery.img
  428. oneshot
  429.  
  430. service racoon /system/bin/racoon
  431. socket racoon stream 600 system system
  432. # racoon will setuid to vpn after getting necessary resources.
  433. group net_admin
  434. disabled
  435. oneshot
  436.  
  437. service mtpd /system/bin/mtpd
  438. socket mtpd stream 600 system system
  439. user vpn
  440. group vpn net_admin net_raw
  441. disabled
  442. oneshot
  443.  
  444. service keystore /system/bin/keystore /data/misc/keystore
  445. user keystore
  446. group keystore
  447. socket keystore stream 666
  448.  
  449. service dumpstate /system/bin/dumpstate -s
  450. socket dumpstate stream 0660 shell log
  451. disabled
  452. oneshot
Add Comment
Please, Sign In to add comment