goroh_kun

SH-01Dのinit.rc

Feb 7th, 2012
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.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/sdcard
  18. export ASEC_MOUNTPOINT /mnt/asec
  19. export LOOP_MOUNTPOINT /mnt/obb
  20. 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
  21.  
  22. # Backward compatibility
  23. symlink /system/etc /etc
  24. symlink /sys/kernel/debug /d
  25.  
  26. # Right now vendor lives on the same filesystem as system,
  27. # but someday that may change.
  28. symlink /system/vendor /vendor
  29.  
  30. # create mountpoints
  31. mkdir /mnt 0775 root system
  32. mkdir /mnt/sdcard 0000 system system
  33. mkdir /cprm 0000 system system
  34.  
  35. mkdir /synthesis
  36. mount tmpfs tmpfs /synthesis nosuid nodev
  37. chown root root /synthesis
  38. chmod 0711 /synthesis
  39. mkdir /synthesis/sphinx 0700 root root
  40. mkdir /synthesis/hades 0777 root root
  41. mkdir /synthesis/chimaira 0777 root root
  42. mkdir /synthesis/shsd 0711 root root
  43. mkdir /synthesis/shdisp 01777 root root
  44. mkdir /synthesis/hdmi 0777 root root
  45.  
  46. mkdir /sdservice_tmp
  47. mount tmpfs tmpfs /sdservice_tmp nosuid nodev
  48. chown root root /sdservice_tmp
  49. chmod 01775 /sdservice_tmp
  50.  
  51. # obexd 2011.07.25 Start
  52. mkdir /obex_data_tmp
  53. mount tmpfs tmpfs /obex_data_tmp nosuid nodev
  54. chown root system /obex_data_tmp
  55. chmod 01775 /obex_data_tmp
  56. # obexd 2011.07.25 End
  57.  
  58. # sdbkrs 2011.07.25 Start
  59. mkdir /bkrs_data_tmp
  60. mount tmpfs tmpfs /bkrs_data_tmp nosuid nodev
  61. chown 10013 10013 /bkrs_data_tmp
  62. chmod 01775 /bkrs_data_tmp
  63. # sdbkrs 2011.07.25 End
  64.  
  65. # Create cgroup mount point for cpu accounting
  66. mkdir /acct
  67. mount cgroup none /acct cpuacct
  68. mkdir /acct/uid
  69.  
  70. # Backwards Compat - XXX: Going away in G*
  71. symlink /mnt/sdcard /sdcard
  72.  
  73. mkdir /system
  74. mkdir /data 0771 system system
  75. mkdir /cache 0770 system cache
  76. mkdir /config 0500 root root
  77.  
  78. # Directory for putting things only root should see.
  79. mkdir /mnt/secure 0700 root root
  80.  
  81. # Directory for staging bindmounts
  82. mkdir /mnt/secure/staging 0700 root root
  83.  
  84. # Directory-target for where the secure container
  85. # imagefile directory will be bind-mounted
  86. mkdir /mnt/secure/asec 0700 root root
  87.  
  88. # Secure container public mount points.
  89. mkdir /mnt/asec 0700 root system
  90. mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  91.  
  92. # Filesystem image public mount points.
  93. mkdir /mnt/obb 0700 root system
  94. mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
  95.  
  96. write /proc/sys/kernel/panic_on_oops 1
  97. write /proc/sys/kernel/hung_task_timeout_secs 0
  98. write /proc/cpu/alignment 4
  99. write /proc/sys/kernel/sched_latency_ns 10000000
  100. write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  101. write /proc/sys/kernel/sched_compat_yield 1
  102. write /proc/sys/kernel/sched_child_runs_first 0
  103.  
  104. # Create cgroup mount points for process groups
  105. mkdir /dev/cpuctl
  106. mount cgroup none /dev/cpuctl cpu
  107. chown system system /dev/cpuctl
  108. chown system system /dev/cpuctl/tasks
  109. chmod 0777 /dev/cpuctl/tasks
  110. write /dev/cpuctl/cpu.shares 1024
  111.  
  112. mkdir /dev/cpuctl/fg_boost
  113. chown system system /dev/cpuctl/fg_boost/tasks
  114. chmod 0777 /dev/cpuctl/fg_boost/tasks
  115. write /dev/cpuctl/fg_boost/cpu.shares 1024
  116.  
  117. mkdir /dev/cpuctl/bg_non_interactive
  118. chown system system /dev/cpuctl/bg_non_interactive/tasks
  119. chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  120. # 5.0 %
  121. write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  122.  
  123. on fs
  124. # mount mtd partitions
  125. # Mount /system rw first to give the filesystem a chance to save a checkpoint
  126. mount yaffs2 mtd@system /system
  127. mount yaffs2 mtd@system /system ro remount
  128. mount yaffs2 mtd@userdata /data nosuid nodev
  129. mount yaffs2 mtd@cache /cache nosuid nodev
  130.  
  131. on post-fs
  132. # once everything is setup, no need to modify /
  133. mount rootfs rootfs / ro remount
  134.  
  135. # We chown/chmod /data again so because mount is run as root + defaults
  136. chown system system /data
  137. chmod 0771 /data
  138.  
  139. # Create dump dir and collect dumps.
  140. # Do this before we mount cache so eventually we can use cache for
  141. # storing dumps on platforms which do not have a dedicated dump partition.
  142.  
  143. mkdir /data/dontpanic
  144. chown root log /data/dontpanic
  145. chmod 0750 /data/dontpanic
  146.  
  147. # Collect apanic data, free resources and re-arm trigger
  148. copy /proc/apanic_console /data/dontpanic/apanic_console
  149. chown root log /data/dontpanic/apanic_console
  150. chmod 0640 /data/dontpanic/apanic_console
  151.  
  152. copy /proc/apanic_threads /data/dontpanic/apanic_threads
  153. chown root log /data/dontpanic/apanic_threads
  154. chmod 0640 /data/dontpanic/apanic_threads
  155.  
  156. write /proc/apanic_console 1
  157.  
  158. # Same reason as /data above
  159. chown system cache /cache
  160. chmod 0770 /cache
  161.  
  162. # This may have been created by the recovery system with odd permissions
  163. chown system cache /cache/recovery
  164. chmod 0770 /cache/recovery
  165.  
  166. #change permissions on vmallocinfo so we can grab it from bugreports
  167. chown root log /proc/vmallocinfo
  168. chmod 0440 /proc/vmallocinfo
  169.  
  170. #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
  171. chown root system /proc/kmsg
  172. chmod 0440 /proc/kmsg
  173. chown root system /proc/sysrq-trigger
  174. chmod 0220 /proc/sysrq-trigger
  175.  
  176. # create basic filesystem structure
  177. mkdir /data/misc 01771 system misc
  178. mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  179. mkdir /data/misc/bluetooth 0770 system system
  180. mkdir /data/misc/keystore 0700 keystore keystore
  181. mkdir /data/misc/vpn 0770 system system
  182. mkdir /data/misc/systemkeys 0700 system system
  183. mkdir /data/misc/vpn/profiles 0770 system system
  184. # give system access to wpa_supplicant.conf for backup and restore
  185. mkdir /data/misc/wifi 0770 wifi wifi
  186. chmod 0770 /data/misc/wifi
  187. chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  188. mkdir /data/local 0771 shell shell
  189. mkdir /data/local/tmp 0771 shell shell
  190. mkdir /data/data 0771 system system
  191. mkdir /data/app-private 0771 system system
  192. mkdir /data/app 0771 system system
  193. mkdir /data/property 0700 root root
  194. mkdir /data/fota 0777 root root
  195.  
  196. # SHARP_EXTEND pedometer middle 2011.7.25 Add-Start
  197. mkdir /data/misc/pedometer 0770 system system
  198. # SHARP_EXTEND pedometer middle Add-End
  199.  
  200. # create dalvik-cache and double-check the perms
  201. mkdir /data/dalvik-cache 0771 system system
  202. chown system system /data/dalvik-cache
  203. chmod 0771 /data/dalvik-cache
  204.  
  205. # create the lost+found directories, so as to enforce our permissions
  206. mkdir /data/lost+found 0770
  207. mkdir /cache/lost+found 0770
  208.  
  209. mkdir /data/smc 0700 root root
  210. mkdir /data/smc/flashfs 0700 root root
  211.  
  212. # double check the perms, in case lost+found already exists, and set owner
  213. chown root root /data/lost+found
  214. chmod 0770 /data/lost+found
  215. chown root root /cache/lost+found
  216. chmod 0770 /cache/lost+found
  217.  
  218. mkdir /data/sb 0700 root root
  219.  
  220. on boot
  221. # basic network init
  222. ifup lo
  223. hostname localhost
  224. domainname localdomain
  225. chmod 0777 /dev/mpu
  226. chmod 0777 /dev/mpuirq
  227. chmod 0777 /dev/accelirq
  228. chmod 0777 /dev/timerirq
  229. chmod 0666 /dev/ami_sensor
  230. chmod 0666 /dev/ami_flip
  231.  
  232. #SHARP_EXTEND Concurrent GC Tuning 2011.09.20 Add-Start
  233. # set RLIMIT_NOFILE from 1024(default) to 2048
  234. setrlimit 7 2048 2048
  235. #SHARP_EXTEND Concurrent GC Tuning Add-End
  236. # set RLIMIT_NICE to allow priorities from 19 to -20
  237. setrlimit 13 40 40
  238.  
  239. # Define the oom_adj values for the classes of processes that can be
  240. # killed by the kernel. These are used in ActivityManagerService.
  241. setprop ro.FOREGROUND_APP_ADJ 0
  242. setprop ro.VISIBLE_APP_ADJ 1
  243. setprop ro.PERCEPTIBLE_APP_ADJ 2
  244. setprop ro.HEAVY_WEIGHT_APP_ADJ 3
  245. setprop ro.SECONDARY_SERVER_ADJ 4
  246. setprop ro.BACKUP_APP_ADJ 5
  247. setprop ro.HOME_APP_ADJ 6
  248. setprop ro.HIDDEN_APP_MIN_ADJ 7
  249. setprop ro.EMPTY_APP_ADJ 15
  250.  
  251. # Define the memory thresholds at which the above process classes will
  252. # be killed. These numbers are in pages (4k).
  253. setprop ro.FOREGROUND_APP_MEM 2048
  254. setprop ro.VISIBLE_APP_MEM 3072
  255. setprop ro.PERCEPTIBLE_APP_MEM 4096
  256. setprop ro.HEAVY_WEIGHT_APP_MEM 4096
  257. setprop ro.SECONDARY_SERVER_MEM 6144
  258. setprop ro.BACKUP_APP_MEM 6144
  259. setprop ro.HOME_APP_MEM 6144
  260. setprop ro.HIDDEN_APP_MEM 7168
  261. setprop ro.EMPTY_APP_MEM 8192
  262.  
  263. # Write value must be consistent with the above properties.
  264. # Note that the driver only supports 6 slots, so we have combined some of
  265. # the classes into the same memory level; the associated processes of higher
  266. # classes will still be killed first.
  267. write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15
  268.  
  269. write /proc/sys/vm/overcommit_memory 1
  270. write /proc/sys/vm/min_free_order_shift 4
  271. write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,4096,6144,7168,8192
  272.  
  273. # Set init its forked children's oom_adj.
  274. write /proc/1/oom_adj -16
  275.  
  276. # Tweak background writeout
  277. write /proc/sys/vm/dirty_expire_centisecs 200
  278. write /proc/sys/vm/dirty_background_ratio 5
  279.  
  280. # Permissions for System Server and daemons.
  281. chown radio system /sys/android_power/state
  282. chown radio system /sys/android_power/request_state
  283. chown radio system /sys/android_power/acquire_full_wake_lock
  284. chown radio system /sys/android_power/acquire_partial_wake_lock
  285. chown radio system /sys/android_power/release_wake_lock
  286. chown radio system /sys/power/state
  287. chown radio system /sys/power/wake_lock
  288. chown radio system /sys/power/wake_unlock
  289. chmod 0660 /sys/power/state
  290. chmod 0660 /sys/power/wake_lock
  291. chmod 0660 /sys/power/wake_unlock
  292. chown system system /sys/class/timed_output/vibrator/enable
  293. chown system system /sys/class/leds/keyboard-backlight/brightness
  294. chown system system /sys/class/leds/lcd-backlight/brightness
  295. chown system system /sys/class/leds/button-backlight/brightness
  296. chown system system /sys/class/leds/jogball-backlight/brightness
  297. chown system system /sys/class/leds/red/brightness
  298. chown system system /sys/class/leds/green/brightness
  299. chown system system /sys/class/leds/blue/brightness
  300. chown system system /sys/class/leds/red/device/grpfreq
  301. chown system system /sys/class/leds/red/device/grppwm
  302. chown system system /sys/class/leds/red/device/blink
  303. chown system system /sys/class/leds/red/brightness
  304. chown system system /sys/class/leds/green/brightness
  305. chown system system /sys/class/leds/blue/brightness
  306. chown system system /sys/class/leds/red/device/grpfreq
  307. chown system system /sys/class/leds/red/device/grppwm
  308. chown system system /sys/class/leds/red/device/blink
  309. chown system system /sys/class/timed_output/vibrator/enable
  310. chown system system /sys/module/sco/parameters/disable_esco
  311. chown system system /sys/kernel/ipv4/tcp_wmem_min
  312. chown system system /sys/kernel/ipv4/tcp_wmem_def
  313. chown system system /sys/kernel/ipv4/tcp_wmem_max
  314. chown system system /sys/kernel/ipv4/tcp_rmem_min
  315. chown system system /sys/kernel/ipv4/tcp_rmem_def
  316. chown system system /sys/kernel/ipv4/tcp_rmem_max
  317. chown root radio /proc/cmdline
  318.  
  319. # [WLAN][SHARP] 2011.10.13 : customize START
  320. chmod 0751 /sys/devices/platform/wifipm
  321. # [WLAN][SHARP] 2011.10.13 : customize END
  322.  
  323. # add FeliCa driver
  324. symlink /dev/ttyO2 /dev/felica
  325.  
  326. # Define TCP buffer sizes for various networks
  327. # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  328. setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  329. setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
  330. setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
  331. setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
  332. setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
  333.  
  334. # wi-fi
  335. setprop wifi.supplicant_scan_interval 2
  336.  
  337. class_start default
  338.  
  339. ## Daemon processes to be run by init.
  340. ##
  341. service shboot_daemon /system/bin/shboot_daemon
  342.  
  343. service ueventd /sbin/ueventd
  344. critical
  345.  
  346. ## add a nicer shell
  347. service console /system/xbin/ash
  348. console
  349. disabled
  350. user root
  351. group root
  352.  
  353. on property:ro.secure=0
  354. start console
  355.  
  356. service logd /system/bin/logd
  357. group system sdcard_rw
  358.  
  359. # adbd is controlled by the persist.service.adb.enable system property
  360. service adbd /sbin/adbd
  361. disabled
  362.  
  363. # adbd on at boot in emulator
  364. on property:ro.kernel.qemu=1
  365. start adbd
  366.  
  367. on property:persist.service.adb.enable=1
  368. start adbd
  369.  
  370. on property:persist.service.adb.enable=0
  371. stop adbd
  372.  
  373. service smc /system/bin/sh /system/smc/startup_smc.sh
  374. user root
  375. group root
  376. oneshot
  377.  
  378. service dgstmgrd /system/bin/dgstmgrd
  379. oneshot
  380.  
  381. service servicemanager /system/bin/servicemanager
  382. user system
  383. critical
  384. onrestart restart zygote
  385. onrestart restart media
  386.  
  387. service vold /system/bin/vold
  388. socket vold stream 0660 root mount
  389. ioprio be 2
  390.  
  391. # usbmgr 2011.08.15 add Start
  392. service usbmgrd /system/bin/usbmgrd
  393. socket usbmgrd stream 0660 root system
  394. # usbmgr 2011 08.15 add End
  395.  
  396. service netd /system/bin/netd
  397. socket netd stream 0660 root system
  398.  
  399. service debuggerd /system/bin/debuggerd
  400.  
  401. service ril-daemon /system/bin/rild
  402. socket rild stream 660 root radio
  403. socket rild-debug stream 660 radio system
  404. user root
  405. group radio cache inet misc audio sdcard_rw
  406. # mwdlfont 2011.06.20 Start
  407. service mwdlfont /system/bin/mwdlfont
  408. # mwdlfont 2011.06.20 End
  409.  
  410. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  411. socket zygote stream 666
  412. onrestart write /sys/android_power/request_state wake
  413. onrestart write /sys/power/state on
  414. onrestart restart media
  415. onrestart restart netd
  416.  
  417. service media /system/bin/mediaserver
  418. user media
  419. group system audio camera graphics inet net_bt net_bt_admin net_raw bluetooth net_admin
  420. ioprio rt 4
  421.  
  422. service bootanim /system/bin/bootanimation
  423. user graphics
  424. group graphics
  425. disabled
  426. oneshot
  427.  
  428. service dbus /system/bin/dbus-daemon --system --nofork
  429. socket dbus stream 660 bluetooth bluetooth
  430. user bluetooth
  431. group bluetooth net_bt_admin
  432.  
  433. service bluetoothd /system/bin/bluetoothd -n
  434. socket bluetooth stream 660 bluetooth bluetooth
  435. socket dbus_bluetooth stream 660 bluetooth bluetooth
  436. # init.rc does not yet support applying capabilities, so run as root and
  437. # let bluetoothd drop uid to bluetooth with the right linux capabilities
  438. group bluetooth net_bt_admin misc
  439. disabled
  440.  
  441. service hfag /system/bin/sdptool add --channel=10 HFAG
  442. user bluetooth
  443. group bluetooth net_bt_admin
  444. disabled
  445. oneshot
  446.  
  447. service hsag /system/bin/sdptool add --channel=11 HSAG
  448. user bluetooth
  449. group bluetooth net_bt_admin
  450. disabled
  451. oneshot
  452.  
  453. service opush /system/bin/sdptool add --channel=12 OPUSH
  454. user bluetooth
  455. group bluetooth net_bt_admin
  456. disabled
  457. oneshot
  458.  
  459. service pbap /system/bin/sdptool add --channel=19 PBAP
  460. user bluetooth
  461. group bluetooth net_bt_admin
  462. disabled
  463. oneshot
  464.  
  465. service installd /system/bin/installd
  466. socket installd stream 600 system system
  467.  
  468. #SHARP_EXTEND COORDINATOR 2011.11.04 Start
  469. #service flash_recovery /system/etc/install-recovery.sh
  470. # oneshot
  471. #SHARP_EXTEND COORDINATOR 2011.11.04 End
  472.  
  473. service racoon /system/bin/racoon
  474. socket racoon stream 600 system system
  475. # racoon will setuid to vpn after getting necessary resources.
  476. group net_admin
  477. disabled
  478. oneshot
  479.  
  480. service mtpd /system/bin/mtpd
  481. socket mtpd stream 600 system system
  482. user vpn
  483. group vpn net_admin net_raw
  484. disabled
  485. oneshot
  486.  
  487. service keystore /system/bin/keystore /data/misc/keystore
  488. user keystore
  489. group keystore
  490. socket keystore stream 666
  491.  
  492. service dumpstate /system/bin/dumpstate -s
  493. socket dumpstate stream 0660 shell log
  494. disabled
  495. oneshot
  496.  
  497. service fotad /system/bin/fotad
  498. user root
  499.  
  500. # SHARP_EXTEND init.rc sharing 2011.10.06 START
  501. #service dhcpcd /system/bin/dhcpcd -ABKL -d wlan0:0
  502. service dhcpcd /system/bin/dhcpcd -d wlan0 -dd
  503. disabled
  504. oneshot
  505. # SHARP_EXTEND init.rc sharing 2011.10.06 END
  506.  
  507. # SHARP_EXTEND init.rc sharing 2011.10.06 START
  508. service iprenew /system/bin/dhcpcd -n
  509. disabled
  510. oneshot
  511. # SHARP_EXTEND init.rc sharing 2011.10.06 END
  512.  
  513. service dtvserver /system/bin/dtvserver
  514. service sdservice /system/bin/sdservice
  515. #DLNA_DMP_ADD START
  516. service DlnaServer /system/bin/DlnaServer
  517. #DLNA_DMP_ADD END
  518.  
  519. # obexd 2011.07.25 Start
  520. service obexd /system/bin/obexd
  521. socket obex_manager stream 660 root system
  522. # obexd 2011.07.25 End
  523.  
  524. # irrcd 2011.07.25 Start
  525. service irrcd /system/bin/irrcd
  526. socket irrcd_sync stream 660 root system
  527. socket irrcd_async stream 660 root system
  528. # irrcd 2011.07.25 End
  529.  
  530. service fatsh_cprm /system/bin/fatsh_cprm
  531. user root
  532. disabled
  533. oneshot
  534.  
  535. # 2011/09/06 factorysettings add start
  536. service fs_service /system/bin/FactorySettingsService
  537. user root
  538. # 2011/09/06 factorysettings add end
  539.  
  540. # 2011/09/08 camera team add start
  541. service utild /system/bin/sh_utild
  542. oneshot
  543. # 2011/09/08 camera team add start
  544.  
  545. service sgxcmservice /system/bin/AddSgxCMService
Add Comment
Please, Sign In to add comment