Advertisement
superr

init.rc_new

Jan 18th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.72 KB | None | 0 0
  1. # Copyright (C) 2012 The Android Open Source Project
  2. #
  3. # IMPORTANT: Do not create world writable files or directories.
  4. # This is a common source of Android security bugs.
  5. #
  6.  
  7. import /init.${ro.hardware}.rc
  8. import /init.usb.rc
  9. import /init.trace.rc
  10.  
  11. on early-init
  12. # Set init and its forked children's oom_adj.
  13. write /proc/1/oom_adj -16
  14.  
  15. start ueventd
  16.  
  17. # create mountpoints
  18. mkdir /mnt 0775 root system
  19.  
  20. on init
  21.  
  22. sysclktz 0
  23.  
  24. loglevel 3
  25.  
  26. # setup the global environment
  27. export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
  28. export LD_LIBRARY_PATH /vendor/lib:/system/lib
  29. export ANDROID_BOOTLOGO 1
  30. export ANDROID_ROOT /system
  31. export ANDROID_ASSETS /system/app
  32. export ANDROID_DATA /data
  33. export EXTERNAL_STORAGE /mnt/sdcard
  34. export ASEC_MOUNTPOINT /mnt/asec
  35. export LOOP_MOUNTPOINT /mnt/obb
  36. export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
  37.  
  38. # Backward compatibility
  39. symlink /system/etc /etc
  40. symlink /sys/kernel/debug /d
  41.  
  42. # Right now vendor lives on the same filesystem as system,
  43. # but someday that may change.
  44. symlink /system/vendor /vendor
  45.  
  46. # create mountpoints
  47. mkdir /mnt 0775 root system
  48. mkdir /mnt/sdcard 0000 system system
  49.  
  50. # Create cgroup mount point for cpu accounting
  51. mkdir /acct
  52. mount cgroup none /acct cpuacct
  53. mkdir /acct/uid
  54.  
  55. # Backwards Compat - XXX: Going away in G*
  56. symlink /mnt/sdcard /sdcard
  57.  
  58. mkdir /system
  59. mkdir /data 0771 system system
  60. mkdir /cache 0771 system cache
  61. mkdir /config 0500 root root
  62.  
  63. # Directory for putting things only root should see.
  64. mkdir /mnt/secure 0700 root root
  65.  
  66. # Directory for staging bindmounts
  67. mkdir /mnt/secure/staging 0700 root root
  68.  
  69. # Directory-target for where the secure container
  70. # imagefile directory will be bind-mounted
  71. mkdir /mnt/secure/asec 0700 root root
  72.  
  73. # Secure container public mount points.
  74. mkdir /mnt/asec 0700 root system
  75. mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  76.  
  77. # Filesystem image public mount points.
  78. mkdir /mnt/obb 0700 root system
  79. mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
  80.  
  81. write /proc/sys/kernel/panic_on_oops 1
  82. write /proc/sys/kernel/hung_task_timeout_secs 0
  83. write /proc/cpu/alignment 4
  84. write /proc/sys/kernel/sched_latency_ns 10000000
  85. write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  86. write /proc/sys/kernel/sched_compat_yield 1
  87. write /proc/sys/kernel/sched_child_runs_first 0
  88. write /proc/sys/kernel/randomize_va_space 2
  89. write /proc/sys/kernel/kptr_restrict 2
  90. write /proc/sys/kernel/dmesg_restrict 1
  91. write /proc/sys/vm/mmap_min_addr 32768
  92. write /proc/sys/kernel/sched_rt_runtime_us 950000
  93. write /proc/sys/kernel/sched_rt_period_us 1000000
  94.  
  95. # Create cgroup mount points for process groups
  96. mkdir /dev/cpuctl
  97. mount cgroup none /dev/cpuctl cpu
  98. chown system system /dev/cpuctl
  99. chown system system /dev/cpuctl/tasks
  100. chmod 0777 /dev/cpuctl/tasks
  101. write /dev/cpuctl/cpu.shares 1024
  102. write /dev/cpuctl/cpu.rt_runtime_us 950000
  103. write /dev/cpuctl/cpu.rt_period_us 1000000
  104.  
  105. mkdir /dev/cpuctl/apps
  106. chown system system /dev/cpuctl/apps/tasks
  107. chmod 0777 /dev/cpuctl/apps/tasks
  108. write /dev/cpuctl/apps/cpu.shares 1024
  109. write /dev/cpuctl/apps/cpu.rt_runtime_us 800000
  110. write /dev/cpuctl/apps/cpu.rt_period_us 1000000
  111.  
  112. mkdir /dev/cpuctl/apps/bg_non_interactive
  113. chown system system /dev/cpuctl/apps/bg_non_interactive/tasks
  114. chmod 0777 /dev/cpuctl/apps/bg_non_interactive/tasks
  115. # 5.0 %
  116. write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52
  117. write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000
  118. write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000
  119.  
  120. # Allow everybody to read the xt_qtaguid resource tracking misc dev.
  121. # This is needed by any process that uses socket tagging.
  122. chmod 0644 /dev/xt_qtaguid
  123.  
  124. on fs
  125. # mount mtd partitions
  126. # Mount /system rw first to give the filesystem a chance to save a checkpoint
  127. mount yaffs2 mtd@system /system
  128. mount yaffs2 mtd@system /system ro remount
  129. mount yaffs2 mtd@userdata /data nosuid nodev
  130. mount yaffs2 mtd@persist /persist nosuid nodev
  131. mount yaffs2 mtd@cache /cache nosuid nodev
  132. mount yaffs2 mtd@persist /persist nosuid nodev
  133.  
  134. on emmc-fs
  135. # mount mmc partitions
  136. # wait /dev/block/mmcblk0p12
  137. # mount ext4 /dev/block/mmcblk0p12 /system ro barrier=1
  138. # wait /dev/block/mmcblk0p13
  139. # exec /system/bin/e2fsck -p /dev/block/mmcblk0p13
  140. # mount ext4 /dev/block/mmcblk0p13 /data nosuid nodev barrier=1 noauto_da_alloc
  141. # mount ext4 /dev/block/mmcblk0p14 /persist nosuid nodev barrier=1
  142. # mount ext4 /dev/block/mmcblk0p15 /cache nosuid nodev barrier=1
  143. wait /dev/block/mmcblk0p15
  144. mount ext4 /dev/block/mmcblk0p15 /system ro barrier=1
  145. chmod 0777 /system/bin/ext4check.sh
  146. #------carrier parition----------
  147. wait /dev/block/mmcblk0p16
  148. exec /system/bin/sh -c "/system/bin/ext4check.sh CARRIER /dev/block/mmcblk0p16"
  149. mount ext4 /dev/block/mmcblk0p16 /carrier nosuid nodev barrier=1
  150. #------userdata----------
  151. wait /dev/block/mmcblk0p19
  152. exec /system/bin/sh -c "/system/bin/ext4check.sh USERDATA /dev/block/mmcblk0p19"
  153. mount ext4 /dev/block/mmcblk0p19 /data nosuid nodev barrier=1
  154. #------persist----------
  155. wait /dev/block/mmcblk0p7
  156. exec /system/bin/sh -c "/system/bin/ext4check.sh PERSIST /dev/block/mmcblk0p7"
  157. mount ext4 /dev/block/mmcblk0p7 /persist nosuid nodev barrier=1
  158. #------cache----------
  159. wait /dev/block/mmcblk0p18
  160. exec /system/bin/sh -c "/system/bin/ext4check.sh CACHE /dev/block/mmcblk0p18"
  161. mount ext4 /dev/block/mmcblk0p18 /cache nosuid nodev barrier=1
  162. #------fixup last partition----------
  163. #wait /dev/block/mmcblk0p19
  164. #exec /system/bin/sh -c "/system/bin/fixebr.sh mmcblk0"
  165. #exec /system/bin/sh -c "/system/bin/vfat_valid.sh /dev/block/mmcblk0p19 INTERNAL_SD"
  166.  
  167. on post-fs
  168. # once everything is setup, no need to modify /
  169. mount rootfs rootfs / ro remount
  170.  
  171. # We chown/chmod /cache again so because mount is run as root + defaults
  172. chown system cache /cache
  173. chmod 0771 /cache
  174.  
  175. # This may have been created by the recovery system with odd permissions
  176. chown system cache /cache/recovery
  177. chmod 0770 /cache/recovery
  178.  
  179. #change permissions on vmallocinfo so we can grab it from bugreports
  180. chown root log /proc/vmallocinfo
  181. chmod 0440 /proc/vmallocinfo
  182.  
  183. #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
  184. chown root system /proc/kmsg
  185. chmod 0440 /proc/kmsg
  186. chown root system /proc/sysrq-trigger
  187. chmod 0220 /proc/sysrq-trigger
  188.  
  189. # create the lost+found directories, so as to enforce our permissions
  190. mkdir /cache/lost+found 0770 root root
  191.  
  192. on post-fs-data
  193. # We chown/chmod /data again so because mount is run as root + defaults
  194. chown system system /data
  195. chmod 0771 /data
  196.  
  197. # Create dump dir and collect dumps.
  198. # Do this before we mount cache so eventually we can use cache for
  199. # storing dumps on platforms which do not have a dedicated dump partition.
  200. mkdir /data/dontpanic 0750 root log
  201.  
  202. # Collect apanic data, free resources and re-arm trigger
  203. copy /proc/apanic_console /data/dontpanic/apanic_console
  204. chown root log /data/dontpanic/apanic_console
  205. chmod 0640 /data/dontpanic/apanic_console
  206.  
  207. copy /proc/apanic_threads /data/dontpanic/apanic_threads
  208. chown root log /data/dontpanic/apanic_threads
  209. chmod 0640 /data/dontpanic/apanic_threads
  210.  
  211. write /proc/apanic_console 1
  212.  
  213. # create basic filesystem structure
  214. mkdir /data/misc 01771 system misc
  215. mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  216. mkdir /data/misc/bluetooth 0770 system system
  217. mkdir /data/misc/keystore 0700 keystore keystore
  218. mkdir /data/misc/keychain 0771 system system
  219. mkdir /data/misc/vpn 0770 system vpn
  220. mkdir /data/misc/systemkeys 0700 system system
  221. # give system access to wpa_supplicant.conf for backup and restore
  222. mkdir /data/misc/wifi 0770 wifi wifi
  223. chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  224. mkdir /data/local 0751 root root
  225.  
  226. #ZTE_JHT_20120423+++
  227. mkdir /data/misc/wifi/hostapd 0770 wifi wifi
  228. #ZTE_JHT_20120423---
  229. #Hector 20120611 add for autoIP property+++
  230. setprop persist.service.wlan.autoIP
  231.  
  232. # For security reasons, /data/local/tmp should always be empty.
  233. # Do not place files or directories in /data/local/tmp
  234. mkdir /data/local 0771 shell shell
  235. mkdir /data/local/tmp 0771 shell shell
  236. mkdir /data/data 0771 system system
  237. mkdir /data/app-private 0771 system system
  238. mkdir /data/app-asec 0700 root root
  239. mkdir /data/app 0771 system system
  240. mkdir /data/property 0700 root root
  241. mkdir /data/ssh 0750 root shell
  242. mkdir /data/ssh/empty 0700 root root
  243. mkdir /data/radio 0770 radio radio
  244. chmod 2770 /data/radio
  245. #ZTE_WSH_QMI_20120428,begin
  246. mkdir /dev/socket/qmux_radio 0770 radio radio
  247. mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
  248. mkdir /dev/socket/qmux_audio 0770 audio audio
  249. #ZTE_WSH_QMI_20120428,end
  250.  
  251. # create dalvik-cache and double-check the perms, so as to enforce our permissions
  252. mkdir /data/dalvik-cache 0771 system system
  253. chown system system /data/dalvik-cache
  254. chmod 0771 /data/dalvik-cache
  255.  
  256. # create resource-cache and double-check the perms
  257. mkdir /data/resource-cache 0771 system system
  258. chown system system /data/resource-cache
  259. chmod 0771 /data/resource-cache
  260.  
  261. # create the lost+found directories, so as to enforce our permissions
  262. mkdir /data/lost+found 0770 root root
  263.  
  264. # create directory for DRM plug-ins - give drm the read/write access to
  265. # the following directory.
  266. mkdir /data/drm 0770 drm drm
  267.  
  268. # If there is no fs-post-data action in the init.<device>.rc file, you
  269. # must uncomment this line, otherwise encrypted filesystems
  270. # won't work.
  271. # Set indication (checked by vold) that we have finished this action
  272. #setprop vold.post_fs_data_done 1
  273.  
  274. chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
  275. chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
  276. chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
  277. chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
  278.  
  279. # Include extra init file
  280. import /init.cm.rc
  281.  
  282. on boot
  283. # basic network init
  284. ifup lo
  285. hostname localhost
  286. domainname localdomain
  287.  
  288. # set RLIMIT_NICE to allow priorities from 19 to -20
  289. setrlimit 13 40 40
  290.  
  291. # Memory management. Basic kernel parameters, and allow the high
  292. # level system server to be able to adjust the kernel OOM driver
  293. # parameters to match how it is managing things.
  294. write /proc/sys/vm/overcommit_memory 1
  295. write /proc/sys/vm/min_free_order_shift 4
  296. chown root system /sys/module/lowmemorykiller/parameters/adj
  297. chmod 0664 /sys/module/lowmemorykiller/parameters/adj
  298. chown root system /sys/module/lowmemorykiller/parameters/minfree
  299. chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
  300.  
  301. # Tweak background writeout
  302. write /proc/sys/vm/dirty_expire_centisecs 200
  303. write /proc/sys/vm/dirty_background_ratio 5
  304.  
  305. # Permissions for System Server and daemons.
  306. chown radio system /sys/android_power/state
  307. chown radio system /sys/android_power/request_state
  308. chown radio system /sys/android_power/acquire_full_wake_lock
  309. chown radio system /sys/android_power/acquire_partial_wake_lock
  310. chown radio system /sys/android_power/release_wake_lock
  311. chown radio system /sys/power/state
  312. chown system system /sys/power/wakeup_count
  313. chown radio system /sys/power/wake_lock
  314. chown radio system /sys/power/wake_unlock
  315. chmod 0660 /sys/power/state
  316. chmod 0660 /sys/power/wake_lock
  317. chmod 0660 /sys/power/wake_unlock
  318.  
  319. chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
  320. chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
  321. chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
  322. chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
  323. chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
  324. chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
  325. chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
  326. chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
  327. chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
  328. chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
  329. chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
  330. chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
  331. chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
  332. chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
  333. chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
  334.  
  335. # Assume SMP uses shared cpufreq policy for all CPUs
  336. chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  337. chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  338. chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  339. chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  340. chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  341. chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  342.  
  343. chown system camera /sys/class/leds/flashlight/brightness
  344. chown system system /sys/class/timed_output/vibrator/enable
  345. chown system system /sys/class/leds/keyboard-backlight/brightness
  346. chown system system /sys/class/leds/lcd-backlight/brightness
  347. chown system system /sys/class/leds/button-backlight/brightness
  348. chown system system /sys/class/leds/jogball-backlight/brightness
  349. chown system system /sys/class/leds/red/brightness
  350. chown system system /sys/class/leds/green/brightness
  351. chown system system /sys/class/leds/blue/brightness
  352. chown system system /sys/class/leds/red/device/grpfreq
  353. chown system system /sys/class/leds/red/device/grppwm
  354. chown system system /sys/class/leds/red/device/blink
  355. chown system system /sys/class/leds/red/brightness
  356. chown system system /sys/class/leds/green/brightness
  357. chown system system /sys/class/leds/blue/brightness
  358. chown system system /sys/class/leds/red/device/grpfreq
  359. chown system system /sys/class/leds/red/device/grppwm
  360. chown system system /sys/class/leds/red/device/blink
  361. chown system system /sys/class/timed_output/vibrator/enable
  362. chown root system /sys/module/msm_battery/parameters/usb_charger_enable
  363. chown system system /sys/module/sco/parameters/disable_esco
  364. chown system system /sys/kernel/ipv4/tcp_wmem_min
  365. chown system system /sys/kernel/ipv4/tcp_wmem_def
  366. chown system system /sys/kernel/ipv4/tcp_wmem_max
  367. chown system system /sys/kernel/ipv4/tcp_rmem_min
  368. chown system system /sys/kernel/ipv4/tcp_rmem_def
  369. chown system system /sys/kernel/ipv4/tcp_rmem_max
  370. chown root radio /proc/cmdline
  371.  
  372. # Define TCP buffer sizes for various networks
  373. # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  374. setprop net.tcp.buffersize.default 4096,87380,704512,4096,16384,110208
  375. setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576
  376. setprop net.tcp.buffersize.lte 4096,87380,1220608,4096,16384,563200
  377. setprop net.tcp.buffersize.umts 4096,87380,563200,4096,16384,110208
  378. setprop net.tcp.buffersize.hspa 4096,87380,704512,4096,16384,110208
  379. setprop net.tcp.buffersize.hsupa 4096,87380,704512,4096,16384,262144
  380. setprop net.tcp.buffersize.hsdpa 4096,87380,704512,4096,16384,262144
  381. setprop net.tcp.buffersize.hspap 4096,87380,1220608,4096,16384,393216
  382. setprop net.tcp.buffersize.edge 4096,26280,35040,4096,16384,35040
  383. setprop net.tcp.buffersize.gprs 4096,8760,11680,4096,8760,11680
  384. setprop net.tcp.buffersize.evdo 4096,87380,563200,4096,16384,262144
  385. setprop net.tcp.buffersize.evdo_b 4096,87380,704512,4096,16384,262144
  386.  
  387. # Assign TCP buffer thresholds to be ceiling value of technology maximums
  388. # Increased technology maximums should be reflected here.
  389. write /proc/sys/net/core/rmem_max 3461120
  390. write /proc/sys/net/core/wmem_max 3461120
  391.  
  392. # Set this property so surfaceflinger is not started by system_init
  393. setprop system_init.startsurfaceflinger 0
  394.  
  395. # Run sysinit
  396. exec /system/bin/sysinit
  397.  
  398. class_start core
  399. class_start main
  400.  
  401. on nonencrypted
  402. class_start late_start
  403.  
  404. on charger
  405. class_start charger
  406.  
  407. on property:vold.decrypt=trigger_reset_main
  408. class_reset main
  409.  
  410. on property:vold.decrypt=trigger_load_persist_props
  411. load_persist_props
  412.  
  413. on property:vold.decrypt=trigger_post_fs_data
  414. trigger post-fs-data
  415.  
  416. on property:vold.decrypt=trigger_restart_min_framework
  417. class_start main
  418.  
  419. on property:vold.decrypt=trigger_restart_framework
  420. class_start main
  421. class_start late_start
  422.  
  423. on property:vold.decrypt=trigger_shutdown_framework
  424. class_reset late_start
  425. class_reset main
  426.  
  427. # Used to disable USB when switching states
  428. on property:sys.usb.config=none
  429. stop adbd
  430. write /sys/class/android_usb/android0/enable 0
  431. write /sys/class/android_usb/android0/bDeviceClass 0
  432. setprop sys.usb.state $sys.usb.config
  433.  
  434. # adb only USB configuration
  435. # This should only be used during device bringup
  436. # and as a fallback if the USB manager fails to set a standard configuration
  437. on property:sys.usb.config=adb
  438. write /sys/class/android_usb/android0/enable 0
  439. write /sys/class/android_usb/android0/idVendor 19D2
  440. write /sys/class/android_usb/android0/idProduct 1352
  441. write /sys/class/android_usb/android0/functions adb
  442. write /sys/class/android_usb/android0/enable 1
  443. start adbd
  444. setprop sys.usb.state $sys.usb.config
  445.  
  446. # USB accessory configuration
  447. on property:sys.usb.config=accessory
  448. write /sys/class/android_usb/android0/enable 0
  449. write /sys/class/android_usb/android0/idVendor 18d1
  450. write /sys/class/android_usb/android0/idProduct 2d00
  451. write /sys/class/android_usb/android0/functions $sys.usb.config
  452. write /sys/class/android_usb/android0/enable 1
  453. setprop sys.usb.state $sys.usb.config
  454.  
  455. # USB accessory configuration, with adb
  456. on property:sys.usb.config=accessory,adb
  457. write /sys/class/android_usb/android0/enable 0
  458. write /sys/class/android_usb/android0/idVendor 18d1
  459. write /sys/class/android_usb/android0/idProduct 2d01
  460. write /sys/class/android_usb/android0/functions $sys.usb.config
  461. write /sys/class/android_usb/android0/enable 1
  462. start adbd
  463. setprop sys.usb.state $sys.usb.config
  464.  
  465. # Used to set USB configuration at boot and to switch the configuration
  466. # when changing the default configuration
  467. on property:persist.sys.usb.config=*
  468. setprop sys.usb.config $persist.sys.usb.config
  469.  
  470. ## Daemon processes to be run by init.
  471. ##
  472. service ueventd /sbin/ueventd
  473. class core
  474. critical
  475.  
  476. service console /system/bin/sh
  477. class core
  478. console
  479. disabled
  480. user shell
  481. group log
  482.  
  483. on property:ro.debuggable=1
  484. start console
  485.  
  486. # adbd is controlled via property triggers in init.<platform>.usb.rc
  487. service adbd /sbin/adbd
  488. class core
  489. disabled
  490.  
  491. # adbd on at boot in emulator
  492. on property:ro.kernel.qemu=1
  493. start adbd
  494.  
  495. # This property trigger has added to imitiate the previous behavior of "adb root".
  496. # The adb gadget driver used to reset the USB bus when the adbd daemon exited,
  497. # and the host side adb relied on this behavior to force it to reconnect with the
  498. # new adbd instance after init relaunches it. So now we force the USB bus to reset
  499. # here when adbd sets the service.adb.root property to 1. We also restart adbd here
  500. # rather than waiting for init to notice its death and restarting it so the timing
  501. # of USB resetting and adb restarting more closely matches the previous behavior.
  502. on property:service.adb.root=1
  503. write /sys/class/android_usb/android0/enable 0
  504. restart adbd
  505. write /sys/class/android_usb/android0/enable 1
  506.  
  507. service servicemanager /system/bin/servicemanager
  508. class core
  509. user system
  510. group system
  511. critical
  512. onrestart restart zygote
  513. onrestart restart media
  514. onrestart restart surfaceflinger
  515. onrestart restart drm
  516.  
  517. service vold /system/bin/vold
  518. class core
  519. socket vold stream 0660 root mount
  520. ioprio be 2
  521.  
  522. service netd /system/bin/netd
  523. class main
  524. socket netd stream 0660 root system
  525. socket dnsproxyd stream 0660 root inet
  526. socket mdns stream 0660 root system
  527.  
  528. service debuggerd /system/bin/debuggerd
  529. class main
  530.  
  531. service ril-daemon /system/bin/rild
  532. class main
  533. socket rild stream 660 root radio
  534. socket rild-debug stream 660 radio system
  535. user root
  536. group radio cache inet misc audio sdcard_r sdcard_rw qcom_oncrpc diag qcom_diag log
  537.  
  538. service surfaceflinger /system/bin/surfaceflinger
  539. class main
  540. user system
  541. group graphics
  542. onrestart restart zygote
  543.  
  544. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  545. class main
  546. socket zygote stream 666 root system
  547. onrestart write /sys/android_power/request_state wake
  548. onrestart write /sys/power/state on
  549. onrestart restart media
  550. onrestart restart netd
  551.  
  552. service drm /system/bin/drmserver
  553. class main
  554. user drm
  555. group drm system inet drmrpc sdcard_r qcom_oncrpc
  556.  
  557. #** ZTE_MODIFY yangyang10099103, 2011-08-01, for start DRM service #
  558. service DrmHost /system/bin/DrmHost
  559. class late_start
  560. disabled
  561. #** ZTE_MODIFY end
  562.  
  563. on property:ro.feature.ztedrm.support=1
  564. mkdir /data/oma 1777
  565. chmod 1777 /data/oma
  566. mkdir /data/oma/conf 1777
  567. chmod 1777 /data/oma/conf
  568. start DrmHost
  569.  
  570. service media /system/bin/mediaserver
  571. class main
  572. user media
  573. group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
  574. ioprio rt 4
  575.  
  576. service bootanim /system/bin/bootanimation
  577. class main
  578. user graphics
  579. group graphics
  580. disabled
  581. oneshot
  582.  
  583. service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
  584. class late_start
  585. user root
  586. group shell
  587. oneshot
  588.  
  589. service dbus /system/bin/dbus-daemon --system --nofork
  590. class main
  591. socket dbus stream 660 bluetooth bluetooth
  592. user bluetooth
  593. group bluetooth net_bt_admin
  594.  
  595. service bluetoothd /system/bin/bluetoothd -n
  596. class main
  597. socket bluetooth stream 660 bluetooth bluetooth
  598. socket dbus_bluetooth stream 660 bluetooth bluetooth
  599. # init.rc does not yet support applying capabilities, so run as root and
  600. # let bluetoothd drop uid to bluetooth with the right linux capabilities
  601. group bluetooth net_bt_admin misc
  602. disabled
  603.  
  604. service installd /system/bin/installd
  605. class main
  606. socket installd stream 600 system system
  607.  
  608. service racoon /system/bin/racoon
  609. class main
  610. socket racoon stream 600 system system
  611. # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.
  612. group vpn net_admin inet
  613. disabled
  614. oneshot
  615.  
  616. service mtpd /system/bin/mtpd
  617. class main
  618. socket mtpd stream 600 system system
  619. user vpn
  620. group vpn net_admin inet net_raw
  621. disabled
  622. oneshot
  623.  
  624. service keystore /system/bin/keystore /data/misc/keystore
  625. class main
  626. user keystore
  627. group keystore drmrpc
  628. socket keystore stream 666
  629.  
  630. service dumpstate /system/bin/dumpstate -s
  631. class main
  632. socket dumpstate stream 0660 shell log
  633. disabled
  634. oneshot
  635.  
  636. service sshd /system/bin/start-ssh
  637. class main
  638. disabled
  639.  
  640. service mdnsd /system/bin/mdnsd
  641. class main
  642. user mdnsr
  643. group inet net_raw
  644. socket mdnsd stream 0660 mdnsr inet
  645. disabled
  646. oneshot
  647.  
  648. #ZTE_shuangdan_20120306 start
  649. service getlog /system/bin/getlogtofile
  650. user root
  651. disabled
  652. oneshot
  653.  
  654. #tcd add start
  655. service activatelog /system/bin/sh /system/bin/checklog.sh
  656. user root
  657. disabled
  658. oneshot
  659. #ZTE_JHT_20120418+++
  660. service wlan_prop /system/bin/sh /system/etc/init.wlanprop.sh
  661. class late_start
  662. oneshot
  663. #ZTE_JHT_20120418---
  664.  
  665. on property:persist.service.adb.enable=1
  666. start activatelog
  667.  
  668. on property:persist.service.adb.enable=0
  669. start activatelog
  670.  
  671. #tcd add end
  672. on property:persist.sys.ztelog.enable=1
  673. start getlog
  674.  
  675. on property:persist.sys.ztelog.enable=0
  676. stop getlog
  677.  
  678. #ZTE_shuangdan_20120306
  679. #ruanmeisi
  680. service hibernate /system/bin/hibernate
  681. class late_start
  682. disabled
  683. oneshot
  684.  
  685. service dhcpcd_wlan0 /system/bin/dhcpcd -BKLG
  686. class late_start
  687. disabled
  688. oneshot
  689.  
  690. service dhcpcd_p2p /system/bin/dhcpcd -BKLG
  691. class late_start
  692. disabled
  693. oneshot
  694.  
  695. service iprenew_wlan0 /system/bin/dhcpcd -n
  696. class late_start
  697. disabled
  698. oneshot
  699.  
  700. service iprenew_p2p /system/bin/dhcpcd -n p2p
  701. class late_start
  702. disabled
  703. oneshot
  704.  
  705. service iprelease_wlan0 /system/bin/dhcpcd -k
  706. class late_start
  707. disabled
  708. oneshot
  709.  
  710. #ZTE_JHT_20120423+++
  711. service hostapd /system/bin/hostapd -dddd /data/misc/wifi/hostapd.conf
  712. class late_start
  713. # socket hostapd_wlan0 dgram 660 root wifi
  714. user root
  715. group wifi
  716. oneshot
  717. disabled
  718. #ZTE_JHT_20120423---
  719.  
  720. #ZTE_LILEYANG_PARTNERAPP
  721. service copypartnerapp /system/bin/copypartnerapp
  722. class late_start
  723. oneshot
  724. #end ZTE_LILEYANG_PARTNERAPP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement