Advertisement
huhka_com

Xperia acro HD (IS12S) init.rc (6.1.D.0.170)

Jul 31st, 2012
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.18 KB | None | 0 0
  1. on early-init
  2. # Set init and its forked children's oom_adj.
  3. write /proc/1/oom_adj -16
  4.  
  5. start ueventd
  6.  
  7. # create mountpoints
  8. mkdir /mnt 0775 root system
  9.  
  10. on init
  11.  
  12. sysclktz 0
  13.  
  14. loglevel 3
  15.  
  16. # setup the global environment
  17. export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
  18. export LD_LIBRARY_PATH /vendor/lib:/system/lib:/lib:/usr/lib:/system/lib/ste_omxcomponents
  19. export ANDROID_BOOTLOGO 1
  20. export ANDROID_ROOT /system
  21. export ANDROID_ASSETS /system/app
  22. export ANDROID_DATA /data
  23. export ASEC_MOUNTPOINT /mnt/asec
  24. export LOOP_MOUNTPOINT /mnt/obb
  25. 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/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar
  26.  
  27. # Backward compatibility
  28. symlink /system/etc /etc
  29. symlink /sys/kernel/debug /d
  30.  
  31. # Right now vendor lives on the same filesystem as system,
  32. # but someday that may change.
  33. symlink /system/vendor /vendor
  34.  
  35. # Create cgroup mount point for cpu accounting
  36. mkdir /acct
  37. mount cgroup none /acct cpuacct
  38. mkdir /acct/uid
  39.  
  40. mkdir /system
  41. mkdir /data 0771 system system
  42. mkdir /cache 0770 system cache
  43. mkdir /config 0500 root root
  44.  
  45. # Directory for putting things only root should see.
  46. mkdir /mnt/secure 0700 root root
  47.  
  48. # Directory for staging bindmounts
  49. mkdir /mnt/secure/staging 0700 root root
  50.  
  51. # Directory-target for where the secure container
  52. # imagefile directory will be bind-mounted
  53. mkdir /mnt/secure/asec 0700 root root
  54.  
  55. # Secure container public mount points.
  56. mkdir /mnt/asec 0700 root system
  57. mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  58.  
  59. # Filesystem image public mount points.
  60. mkdir /mnt/obb 0700 root system
  61. mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
  62.  
  63. write /proc/sys/kernel/panic_on_oops 1
  64. write /proc/sys/kernel/hung_task_timeout_secs 0
  65. write /proc/cpu/alignment 4
  66. write /proc/sys/kernel/sched_latency_ns 10000000
  67. write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  68. write /proc/sys/kernel/sched_compat_yield 1
  69. write /proc/sys/kernel/sched_child_runs_first 0
  70. write /proc/sys/kernel/randomize_va_space 2
  71.  
  72. # Create cgroup mount points for process groups
  73. mkdir /dev/cpuctl
  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
  79.  
  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
  84.  
  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
  88. # 5.0 %
  89. write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  90.  
  91. # Allow everybody to read the xt_qtaguid resource tracking misc dev.
  92. # This is needed by any process that uses socket tagging.
  93. chmod 0644 /dev/xt_qtaguid
  94.  
  95. on post-fs
  96. # once everything is setup, no need to modify /
  97. mount rootfs rootfs / ro remount
  98.  
  99. # We chown/chmod /cache again so because mount is run as root + defaults
  100. chown system cache /cache
  101. chmod 0770 /cache
  102.  
  103. # This may have been created by the recovery system with odd permissions
  104. mkdir /cache/recovery
  105. chown system cache /cache/recovery
  106. chmod 0770 /cache/recovery
  107.  
  108. #change permissions on vmallocinfo so we can grab it from bugreports
  109. chown root log /proc/vmallocinfo
  110. chmod 0440 /proc/vmallocinfo
  111.  
  112. #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
  113. chown root system /proc/kmsg
  114. chmod 0440 /proc/kmsg
  115. chown root system /proc/sysrq-trigger
  116. chmod 0220 /proc/sysrq-trigger
  117.  
  118. # create the lost+found directories, so as to enforce our permissions
  119. mkdir /cache/lost+found 0770 root root
  120.  
  121. on post-fs-data
  122. # We chown/chmod /data again so because mount is run as root + defaults
  123. chown system system /data
  124. chmod 0771 /data
  125.  
  126. # Create dump dir and collect dumps.
  127. # Do this before we mount cache so eventually we can use cache for
  128. # storing dumps on platforms which do not have a dedicated dump partition.
  129. mkdir /data/dontpanic 0750 root log
  130.  
  131. # Collect apanic data, free resources and re-arm trigger
  132. copy /proc/apanic_console /data/dontpanic/apanic_console
  133. chown root log /data/dontpanic/apanic_console
  134. chmod 0640 /data/dontpanic/apanic_console
  135.  
  136. copy /proc/apanic_threads /data/dontpanic/apanic_threads
  137. chown root log /data/dontpanic/apanic_threads
  138. chmod 0640 /data/dontpanic/apanic_threads
  139.  
  140. write /proc/apanic_console 1
  141.  
  142. # create basic filesystem structure
  143. mkdir /data/misc 01771 system misc
  144. mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  145. mkdir /data/misc/bluetooth 0770 system system
  146. mkdir /data/misc/keystore 0700 keystore keystore
  147. mkdir /data/misc/keychain 0771 system system
  148. mkdir /data/misc/vpn 0770 system vpn
  149. mkdir /data/misc/systemkeys 0700 system system
  150. # give system access to wpa_supplicant.conf for backup and restore
  151. mkdir /data/misc/wifi 0770 wifi wifi
  152. chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  153. mkdir /data/local 0751 root root
  154. mkdir /data/local/tmp 0771 shell shell
  155. mkdir /data/data 0771 system system
  156. mkdir /data/app-private 0771 system system
  157. mkdir /data/app 0771 system system
  158. mkdir /data/property 0700 root root
  159.  
  160. # create dalvik-cache, so as to enforce our permissions
  161. mkdir /data/dalvik-cache 0771 system system
  162.  
  163. # create resource-cache and double-check the perms
  164. mkdir /data/resource-cache 0771 system system
  165. chown system system /data/resource-cache
  166. chmod 0771 /data/resource-cache
  167.  
  168. # create the lost+found directories, so as to enforce our permissions
  169. mkdir /data/lost+found 0770 root root
  170.  
  171. # create directory for DRM plug-ins - give drm the read/write access to
  172. # the following directory.
  173. mkdir /data/drm 0770 drm drm
  174.  
  175. # If there is no fs-post-data action in the init.<device>.rc file, you
  176. # must uncomment this line, otherwise encrypted filesystems
  177. # won't work.
  178. # Set indication (checked by vold) that we have finished this action
  179. #setprop vold.post_fs_data_done 1
  180.  
  181. chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
  182. chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
  183. chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
  184. chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
  185.  
  186. on boot
  187. # basic network init
  188. ifup lo
  189. hostname localhost
  190. domainname localdomain
  191.  
  192. # set RLIMIT_NICE to allow priorities from 19 to -20
  193. setrlimit 13 40 40
  194.  
  195. # Memory management. Basic kernel parameters, and allow the high
  196. # level system server to be able to adjust the kernel OOM driver
  197. # paramters to match how it is managing things.
  198. write /proc/sys/vm/overcommit_memory 1
  199. write /proc/sys/vm/min_free_order_shift 4
  200. chown root system /sys/module/lowmemorykiller/parameters/adj
  201. chmod 0664 /sys/module/lowmemorykiller/parameters/adj
  202. chown root system /sys/module/lowmemorykiller/parameters/minfree
  203. chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
  204.  
  205. # Tweak background writeout
  206. write /proc/sys/vm/dirty_expire_centisecs 200
  207. write /proc/sys/vm/dirty_background_ratio 5
  208.  
  209. # Permissions for System Server and daemons.
  210. chown radio system /sys/android_power/state
  211. chown radio system /sys/android_power/request_state
  212. chown radio system /sys/android_power/acquire_full_wake_lock
  213. chown radio system /sys/android_power/acquire_partial_wake_lock
  214. chown radio system /sys/android_power/release_wake_lock
  215. chown radio system /sys/power/state
  216. chown radio system /sys/power/wake_lock
  217. chown radio system /sys/power/wake_unlock
  218. chmod 0660 /sys/power/state
  219. chmod 0660 /sys/power/wake_lock
  220. chmod 0660 /sys/power/wake_unlock
  221. chown system system /sys/class/timed_output/vibrator/enable
  222. chown system system /sys/class/leds/keyboard-backlight/brightness
  223. chown system system /sys/class/leds/lcd-backlight/brightness
  224. chown system system /sys/class/leds/button-backlight/brightness
  225. chown system system /sys/class/leds/jogball-backlight/brightness
  226. chown system system /sys/class/leds/red/brightness
  227. chown system system /sys/class/leds/green/brightness
  228. chown system system /sys/class/leds/blue/brightness
  229. chown system system /sys/class/leds/red/device/grpfreq
  230. chown system system /sys/class/leds/red/device/grppwm
  231. chown system system /sys/class/leds/red/device/blink
  232. chown system system /sys/class/leds/red/brightness
  233. chown system system /sys/class/leds/green/brightness
  234. chown system system /sys/class/leds/blue/brightness
  235. chown system system /sys/class/leds/red/device/grpfreq
  236. chown system system /sys/class/leds/red/device/grppwm
  237. chown system system /sys/class/leds/red/device/blink
  238. chown system system /sys/class/timed_output/vibrator/enable
  239. chown system system /sys/module/sco/parameters/disable_esco
  240. chown system system /sys/kernel/ipv4/tcp_wmem_min
  241. chown system system /sys/kernel/ipv4/tcp_wmem_def
  242. chown system system /sys/kernel/ipv4/tcp_wmem_max
  243. chown system system /sys/kernel/ipv4/tcp_rmem_min
  244. chown system system /sys/kernel/ipv4/tcp_rmem_def
  245. chown system system /sys/kernel/ipv4/tcp_rmem_max
  246. chown root radio /proc/cmdline
  247.  
  248. # Define TCP buffer sizes for various networks
  249. # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  250. setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  251. setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576
  252. setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576
  253. setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
  254. setprop net.tcp.buffersize.hspa 4094,87380,262144,4096,16384,262144
  255. setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
  256. setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
  257.  
  258. # Set this property so surfaceflinger is not started by system_init
  259. setprop system_init.startsurfaceflinger 0
  260.  
  261. class_start core
  262. class_start main
  263.  
  264. on nonencrypted
  265. class_start late_start
  266.  
  267. on charger
  268. class_start charger
  269.  
  270. on property:vold.decrypt=trigger_reset_main
  271. class_reset main
  272.  
  273. on property:vold.decrypt=trigger_load_persist_props
  274. load_persist_props
  275.  
  276. on property:vold.decrypt=trigger_post_fs_data
  277. trigger post-fs-data
  278.  
  279. on property:vold.decrypt=trigger_restart_min_framework
  280. class_start main
  281.  
  282. on property:vold.decrypt=trigger_restart_framework
  283. class_start main
  284. class_start late_start
  285.  
  286. on property:vold.decrypt=trigger_shutdown_framework
  287. class_reset late_start
  288. class_reset main
  289.  
  290. # Used to disable USB when switching states
  291. on property:sys.usb.config=none
  292. stop adbd
  293. write /sys/class/android_usb/android0/enable 0
  294. write /sys/class/android_usb/android0/bDeviceClass 0
  295. setprop sys.usb.state $sys.usb.config
  296.  
  297. # adb only USB configuration
  298. # This should only be used during device bringup
  299. # and as a fallback if the USB manager fails to set a standard configuration
  300. on property:sys.usb.config=adb
  301. write /sys/class/android_usb/android0/enable 0
  302. write /sys/class/android_usb/android0/idVendor 18d1
  303. write /sys/class/android_usb/android0/idProduct D002
  304. write /sys/class/android_usb/android0/functions $sys.usb.config
  305. write /sys/class/android_usb/android0/enable 1
  306. start adbd
  307. setprop sys.usb.state $sys.usb.config
  308.  
  309. # USB accessory configuration
  310. on property:sys.usb.config=accessory
  311. write /sys/class/android_usb/android0/enable 0
  312. write /sys/class/android_usb/android0/idVendor 18d1
  313. write /sys/class/android_usb/android0/idProduct 2d00
  314. write /sys/class/android_usb/android0/functions $sys.usb.config
  315. write /sys/class/android_usb/android0/enable 1
  316. setprop sys.usb.state $sys.usb.config
  317.  
  318. # USB accessory configuration, with adb
  319. on property:sys.usb.config=accessory,adb
  320. write /sys/class/android_usb/android0/enable 0
  321. write /sys/class/android_usb/android0/idVendor 18d1
  322. write /sys/class/android_usb/android0/idProduct 2d01
  323. write /sys/class/android_usb/android0/functions $sys.usb.config
  324. write /sys/class/android_usb/android0/enable 1
  325. start adbd
  326. setprop sys.usb.state $sys.usb.config
  327.  
  328. # Used to set USB configuration at boot and to switch the configuration
  329. # when changing the default configuration
  330. on property:persist.sys.usb.config=*
  331. setprop sys.usb.config $persist.sys.usb.config
  332.  
  333. ## Daemon processes to be run by init.
  334. ##
  335. service ueventd /sbin/ueventd
  336. class core
  337. critical
  338.  
  339. service console /system/bin/sh
  340. class core
  341. console
  342. disabled
  343. user shell
  344. group log
  345.  
  346. on property:ro.debuggable=1
  347. start console
  348.  
  349. # adbd is controlled via property triggers in init.<platform>.usb.rc
  350. service adbd /sbin/adbd
  351. class core
  352. disabled
  353.  
  354. # adbd on at boot in emulator
  355. on property:ro.kernel.qemu=1
  356. start adbd
  357.  
  358. # This property trigger has added to imitiate the previous behavior of "adb root".
  359. # The adb gadget driver used to reset the USB bus when the adbd daemon exited,
  360. # and the host side adb relied on this behavior to force it to reconnect with the
  361. # new adbd instance after init relaunches it. So now we force the USB bus to reset
  362. # here when adbd sets the service.adb.root property to 1. We also restart adbd here
  363. # rather than waiting for init to notice its death and restarting it so the timing
  364. # of USB resetting and adb restarting more closely matches the previous behavior.
  365. on property:service.adb.root=1
  366. write /sys/class/android_usb/android0/enable 0
  367. restart adbd
  368. write /sys/class/android_usb/android0/enable 1
  369.  
  370. service servicemanager /system/bin/servicemanager
  371. class core
  372. user system
  373. group system
  374. critical
  375. onrestart restart zygote
  376. onrestart restart media
  377. onrestart restart surfaceflinger
  378. onrestart restart drm
  379. # lismo 2012.03.02 Start
  380. onrestart restart lismo
  381. # lismo 2012.03.02 End
  382.  
  383. service vold /system/bin/vold
  384. class core
  385. socket vold stream 0660 root mount
  386. ioprio be 2
  387.  
  388. service netd /system/bin/netd
  389. class main
  390. socket netd stream 0660 root system dbus_access
  391. socket dnsproxyd stream 0660 root inet
  392.  
  393. service debuggerd /system/bin/debuggerd
  394. class main
  395.  
  396. service ril-daemon /system/bin/rild
  397. class main
  398. socket rild stream 660 root radio
  399. socket rild-debug stream 660 radio system
  400. user root
  401. group radio cache inet misc audio sdcard_rw log dbus_access
  402.  
  403. service surfaceflinger /system/bin/surfaceflinger
  404. class main
  405. user system
  406. group graphics
  407. onrestart restart zygote
  408.  
  409. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  410. class main
  411. socket zygote stream 660 root system
  412. onrestart exec /system/bin/sync
  413. onrestart write /proc/sysrq-trigger c
  414. # lismo 2012.03.02 Start
  415. onrestart restart lismo
  416. # lismo 2012.03.02 End
  417.  
  418. # lismo 2012.04.03 Start
  419. service lismo /system/bin/kdrmediaserver
  420. class main
  421. user media
  422. group system audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
  423. # lismo 2012.04.03 End
  424.  
  425. service drm /system/bin/drmserver
  426. class main
  427. user drm
  428. group system inet drmrpc
  429.  
  430. service bootanim /system/bin/bootanimation
  431. class main
  432. user graphics
  433. group graphics
  434. disabled
  435. oneshot
  436.  
  437. service dbus /system/bin/dbus-daemon --system --nofork
  438. class main
  439. socket dbus stream 660 bluetooth bluetooth
  440. socket dbus_ste stream 660 bluetooth dbus_access
  441. user bluetooth
  442. group bluetooth net_bt_admin dbus_access
  443.  
  444. service bluetoothd /system/bin/bluetoothd -n
  445. class main
  446. socket bluetooth stream 660 bluetooth bluetooth
  447. socket dbus_bluetooth stream 660 bluetooth bluetooth
  448. # init.rc does not yet support applying capabilities, so run as root and
  449. # let bluetoothd drop uid to bluetooth with the right linux capabilities
  450. group bluetooth net_bt_admin misc
  451. disabled
  452.  
  453. service installd /system/bin/installd
  454. class main
  455. socket installd stream 600 system system
  456.  
  457. service flash_recovery /system/etc/install-recovery.sh
  458. class main
  459. oneshot
  460.  
  461. service racoon /system/bin/racoon
  462. class main
  463. socket racoon stream 600 system system
  464. # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.
  465. group vpn net_admin inet
  466. disabled
  467. oneshot
  468.  
  469. service mtpd /system/bin/mtpd
  470. class main
  471. socket mtpd stream 600 system system
  472. user vpn
  473. group vpn net_admin inet net_raw
  474. disabled
  475. oneshot
  476.  
  477. service keystore /system/bin/keystore /data/misc/keystore
  478. class main
  479. user keystore
  480. group keystore
  481. socket keystore stream 666
  482.  
  483. service dumpstate /system/bin/dumpstate -s
  484. class main
  485. socket dumpstate stream 0660 shell log
  486. disabled
  487. oneshot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement