init.PrivatBank.rc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. on fs
  2. sysclktz 0
  3. loglevel 3
  4. # setup the global environment
  5. export PATH /bin:/sbin:/usr/sbin:/usr/bin:/base/bin:/base/sbin:/opt/bin
  6. export GCONV_PATH /lib/gconv
  7. export DISPLAY :0.0
  8. symlink /startup/bin /bin
  9. symlink /startup/sbin /sbin
  10. mkdir /tmp
  11. mount tmpfs tmpfs /tmp
  12. mkdir /tmp/run
  13. mkdir /tmp/lock
  14. chmod 1777 /tmp/lock
  15. mkdir /var
  16. symlink /tmp /var/tmp
  17. symlink /tmp/run /var/run
  18. symlink /tmp/lock /var/lock
  19. mkdir /base
  20. loadimg mtd@base /base
  21. mkdir /data
  22. copy /proc/mtd /startup/mtd
  23. chmod 0444 /startup/mtd
  24. check_and_mount_data
  25. on early-boot
  26. # create POSIX shared memory folder
  27. mkdir /dev/shm
  28. chmod 0777 /dev/shm
  29. mount tmpfs tmpfs /dev/shm
  30. # restrict file permission under /usr/bin
  31. chmod 750 /usr/bin/modemd
  32. chmod 750 /usr/bin/pedd
  33. chmod 750 /usr/bin/ipservice
  34. chown root MAINAPP /usr/bin/crashd
  35. chmod 750 /usr/bin/crashd
  36. chown root root /usr/bin/devinfo
  37. chmod 755 /usr/bin/devinfo
  38. chown root MAINAPP /usr/bin/installer
  39. chmod 750 /usr/bin/installer
  40. chmod 750 /usr/bin/keyman
  41. # logcat, let it 755
  42. chown root MAINAPP /usr/bin/runapp
  43. chmod 750 /usr/bin/runapp
  44. chmod 750 /usr/bin/servicemanager
  45. chown root MAINAPP /usr/bin/tm
  46. chmod 750 /usr/bin/tm
  47. chown root MAINAPP /usr/bin/systemservice
  48. chmod 750 /usr/bin/systemservice
  49. chown root MAINAPP /usr/bin/ts_calibrate
  50. chmod 750 /usr/bin/ts_calibrate
  51. chown root MAINAPP /usr/bin/xcbd
  52. chmod 750 /usr/bin/xcbd
  53. # ./captoi sys_ptrace
  54. setcap 0x00080000 /bin/gdbserver
  55. # ./captoi dac_override setgid setuid setfcap chown
  56. setcap 0x800000c3 /usr/bin/installer
  57. # ./captoi setgid setuid
  58. setcap 0x000000c0 /usr/bin/runapp
  59. # ./captoi setgid setuid
  60. setcap 0x000000c0 /bin/xlogin
  61. # ./captoi net_admin net_raw sys_boot sys_time sys_admin
  62. setcap 0x02603000 /usr/bin/tm
  63. # ./captoi sys_admin sys_ptrace
  64. setcap 0x00280000 /usr/bin/crashd
  65. # ./captoi net_admin net_raw sys_boot sys_time sys_admin
  66. setcap 0x02603000 /usr/bin/systemservice
  67. # ./captoi sys_boot sys_time
  68. setcap 0x02400000 /usr/bin/xcbd
  69. mkdir /data/tombstones
  70. chmod 770 /data/tombstones
  71. chown MAINAPP MAINAPP /data/tombstones
  72. mkdir /data/security
  73. chmod 600 /data/security
  74. chown root root /data/security
  75. symlink /base/lib /lib
  76. symlink /data/etc /etc
  77. symlink /data/opt /opt
  78. symlink /lib/gconv /usr/lib/gconv
  79. write /proc/sys/kernel/randomize_va_space 2
  80. write /proc/sys/net/ipv4/tcp_keepalive_time 30
  81. write /proc/sys/net/ipv4/tcp_keepalive_intvl 15
  82. write /proc/sys/net/ipv4/tcp_keepalive_probes 5
  83. setprop ro.pukmode 2
  84. on boot
  85. # basic network init
  86. ifup lo
  87. hostname localhost
  88. domainname localdomain
  89. # mount usbfs
  90. mkdir /dev/bus/usb
  91. mount usbfs none /dev/bus/usb devmode=0666
  92. # u-disk mount
  93. mkdir /mnt
  94. mount tmpfs tmpfs /mnt noatime noexec nosuid size=16k
  95. chown MAINAPP MAINAPP /mnt
  96. # set RLIMIT_NICE to allow priorities from 19 to -20
  97. # RLIMIT_NICE 13
  98. setrlimit 13 40 40
  99. # RLIMIT_STACK 3
  100. setrlimit 3 2097152 2097152
  101. class_start core
  102. if property:ro.fac.prolin_debug_level=0 rm /startup/modules/*
  103. if property:ro.fac.prolin_debug_level=0 rmdir /startup/modules/
  104. if property:ro.fac.prolin_debug_level=0 rm /startup/*.rc
  105. if property:ro.fac.prolin_debug_level=0 rm /startup/*.sh
  106. if property:ro.fac.prolin_debug_level=0 rm /startup/*.prop
  107. if property:ro.fac.prolin_debug_level=0 rm /startup/firmware/lcd_*.rle
  108. if property:ro.fac.prolin_debug_level=0 rm startup/firmware/lcd.watermark
  109. if property:ro.fac.prolin_debug_level=0 rm startup/firmware/lcd_readme.txt
  110. if property:ro.fac.prolin_debug_level=1 rm /startup/modules/*
  111. if property:ro.fac.prolin_debug_level=1 rmdir /startup/modules/
  112. if property:ro.fac.prolin_debug_level=1 rm /startup/*.rc
  113. if property:ro.fac.prolin_debug_level=1 rm /startup/*.sh
  114. if property:ro.fac.prolin_debug_level=1 rm /startup/*.prop
  115. wait /tmp/.BINDER_SERVICE_MANAGER_DONE
  116. rm /tmp/.BINDER_SERVICE_MANAGER_DONE
  117. class_start default
  118. # daemon processes to be run by init.
  119. service ueventd /startup/ueventd
  120. critical
  121. service console-root /bin/sh
  122. console
  123. disabled
  124. user root
  125. group root
  126. service console-MAINAPP /bin/sh
  127. console
  128. disabled
  129. user MAINAPP
  130. group MAINAPP
  131. on property:persist.sys.console.enable=1
  132. if property:ro.console=1 start console-MAINAPP
  133. if property:ro.console=2 start console-root
  134. on property:persist.sys.console.enable=0
  135. if property:ro.console=1 stop console-MAINAPP
  136. if property:ro.console=2 stop console-root