Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.02 KB | None | 0 0
  1.  
  2. on init
  3.  
  4. sysclktz 0
  5.  
  6. loglevel 3
  7.  
  8. # setup the global environment
  9. export PATH /sbin:/system/sbin:/system/bin:/system/xbin:/bin
  10. export LD_LIBRARY_PATH /system/lib
  11. export ANDROID_BOOTLOGO 1
  12. export ANDROID_ROOT /system
  13. export ANDROID_ASSETS /system/app
  14. export ANDROID_DATA /data
  15. export EXTERNAL_STORAGE /mnt/sdcard
  16. export ASEC_MOUNTPOINT /mnt/asec
  17. export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/com.htc.framework.jar:/system/framework/com.htc.android.pimlib.jar:/system/framework/com.htc.android.easopen.jar:/system/framework/com.scalado.util.ScaladoUtil.jar:/system/framework/com.orange.authentication.simcard.jar
  18. export TERMINFO /system/etc/terminfo
  19.  
  20. # Backward compatibility
  21. symlink /system/etc /etc
  22. symlink /sys/kernel/debug /d
  23.  
  24. # create mountpoints
  25. mkdir /mnt 0775 root system
  26. mkdir /mnt/sdcard 0000 system system
  27.  
  28. # Create cgroup mount point for cpu accounting
  29. mkdir /acct
  30. mount cgroup none /acct cpuacct
  31. mkdir /acct/uid
  32.  
  33. # Backwards Compat - XXX: Going away in G*
  34. symlink /mnt/sdcard /sdcard
  35.  
  36. mkdir /system
  37. mkdir /data 0771 system system
  38. mkdir /cache 0771 system cache
  39. mkdir /config 0500 root root
  40.  
  41. # Directory for putting things only root should see.
  42. mkdir /mnt/secure 0700 root root
  43.  
  44. # Directory for staging bindmounts
  45. mkdir /mnt/secure/staging 0700 root root
  46.  
  47. # Directory-target for where the secure container
  48. # imagefile directory will be bind-mounted
  49. mkdir /mnt/secure/asec 0700 root root
  50.  
  51. # Secure container public mount points.
  52. mkdir /mnt/asec 0700 root system
  53. mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  54.  
  55. mount rootfs rootfs / rw remount
  56.  
  57. write /proc/sys/kernel/panic_on_oops 1
  58. write /proc/sys/kernel/hung_task_timeout_secs 0
  59. write /proc/cpu/alignment 4
  60. write /proc/sys/kernel/sched_latency_ns 5000000
  61. write /proc/sys/kernel/sched_wakeup_granularity_ns 100000
  62. write /proc/sys/kernel/sched_min_granularity_ns 100000
  63. write /proc/sys/kernel/sched_compat_yield 1
  64. write /proc/sys/kernel/sched_child_runs_first 0
  65.  
  66. # Create cgroup mount points for process groups
  67. mkdir /dev/cpuctl
  68. mount cgroup none /dev/cpuctl cpu
  69. chown system system /dev/cpuctl
  70. chown system system /dev/cpuctl/tasks
  71. chmod 0777 /dev/cpuctl/tasks
  72. write /dev/cpuctl/cpu.shares 1024
  73.  
  74. mkdir /dev/cpuctl/fg_boost
  75. chown system system /dev/cpuctl/fg_boost/tasks
  76. chmod 0777 /dev/cpuctl/fg_boost/tasks
  77. write /dev/cpuctl/fg_boost/cpu.shares 1024
  78.  
  79. mkdir /dev/cpuctl/bg_non_interactive
  80. chown system system /dev/cpuctl/bg_non_interactive/tasks
  81. chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  82. # 5.0 %
  83. write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  84.  
  85. # mount mtd partitions
  86. # Mount /system rw first to give the filesystem a chance to save a checkpoint
  87. mount yaffs2 mtd@system /system
  88. mount yaffs2 mtd@system /system ro remount
  89.  
  90. # We chown/chmod /data again so because mount is run as root + defaults
  91. mount yaffs2 mtd@userdata /data nosuid nodev
  92. chown system system /data
  93. chmod 0771 /data
  94.  
  95. # Create dump dir and collect dumps.
  96. # Do this before we mount cache so eventually we can use cache for
  97. # storing dumps on platforms which do not have a dedicated dump partition.
  98.  
  99. mkdir /data/dontpanic
  100. chown root log /data/dontpanic
  101. chmod 0750 /data/dontpanic
  102.  
  103. # Collect apanic data, free resources and re-arm trigger
  104. copy /proc/apanic_console /data/dontpanic/apanic_console
  105. chown root log /data/dontpanic/apanic_console
  106. chmod 0640 /data/dontpanic/apanic_console
  107.  
  108. copy /proc/apanic_threads /data/dontpanic/apanic_threads
  109. chown root log /data/dontpanic/apanic_threads
  110. chmod 0640 /data/dontpanic/apanic_threads
  111.  
  112. write /proc/apanic_console 1
  113.  
  114. # Same reason as /data above
  115. mount yaffs2 mtd@cache /cache nosuid nodev
  116. chown system cache /cache
  117. chmod 0771 /cache
  118.  
  119. # This may have been created by the recovery system with odd permissions
  120. chown system cache /cache/recovery
  121. chmod 0770 /cache/recovery
  122.  
  123. #change permissions on vmallocinfo so we can grab it from bugreports
  124. chown root log /proc/vmallocinfo
  125. chmod 0440 /proc/vmallocinfo
  126.  
  127. #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
  128. chown root system /proc/kmsg
  129. chmod 0440 /proc/kmsg
  130. chown root system /proc/sysrq-trigger
  131. chmod 0220 /proc/sysrq-trigger
  132.  
  133. # create basic filesystem structure
  134. mkdir /data/misc 01771 system misc
  135. mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  136. mkdir /data/misc/bluetooth 0770 system system
  137. mkdir /data/misc/keystore 0700 keystore keystore
  138. mkdir /data/misc/vpn 0770 system system
  139. mkdir /data/misc/systemkeys 0700 system system
  140. mkdir /data/misc/vpn/profiles 0770 system system
  141. # give system access to wpa_supplicant.conf for backup and restore
  142. mkdir /data/misc/wifi 0770 wifi wifi
  143. chmod 0770 /data/misc/wifi
  144. chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  145. mkdir /data/local 0771 shell shell
  146. mkdir /data/local/tmp 0771 shell shell
  147. mkdir /data/data 0771 system system
  148. mkdir /data/app-private 0771 system system
  149. mkdir /data/app 0771 system system
  150. mkdir /data/property 0700 root root
  151. # DRMv1 rights storage
  152. symlink /data/local /data/drm
  153. mkdir /data/local/rights 0777 shell shell
  154. chown shell shell /data/drm
  155. write /data/drm/rights/mid.txt 0
  156. chmod 0777 /data/drm/rights/mid.txt
  157.  
  158. # create dalvik-cache and double-check the perms
  159. mkdir /data/dalvik-cache 0771 system system
  160. chown system system /data/dalvik-cache
  161. chmod 0771 /data/dalvik-cache
  162.  
  163. # create dalvik-cache and double-check the perms
  164. mkdir /cache/dalvik-cache 0771 system system
  165. chown system system /cache/dalvik-cache
  166. chmod 0771 /cache/dalvik-cache
  167.  
  168. # create the lost+found directories, so as to enforce our permissions
  169. mkdir /data/lost+found 0770
  170. mkdir /cache/lost+found 0770
  171.  
  172. # double check the perms, in case lost+found already exists, and set owner
  173. chown root root /data/lost+found
  174. chmod 0770 /data/lost+found
  175. chown root root /cache/lost+found
  176. chmod 0770 /cache/lost+found
  177.  
  178. on boot
  179. # basic network init
  180. ifup lo
  181. hostname localhost
  182. domainname localdomain
  183.  
  184. # set RLIMIT_NICE to allow priorities from 19 to -20
  185. setrlimit 13 40 40
  186.  
  187. # Define the oom_adj values for the classes of processes that can be
  188. # killed by the kernel. These are used in ActivityManagerService.
  189. setprop ro.FOREGROUND_APP_ADJ 0
  190. setprop ro.VISIBLE_APP_ADJ 1
  191. setprop ro.SECONDARY_SERVER_ADJ 2
  192. setprop ro.BACKUP_APP_ADJ 2
  193. setprop ro.HOME_APP_ADJ 4
  194. setprop ro.HIDDEN_APP_MIN_ADJ 7
  195. setprop ro.CONTENT_PROVIDER_ADJ 14
  196. setprop ro.EMPTY_APP_ADJ 15
  197.  
  198. # Define the memory thresholds at which the above process classes will
  199. # be killed. These numbers are in pages (4k).
  200. setprop ro.FOREGROUND_APP_MEM 1536
  201. setprop ro.VISIBLE_APP_MEM 2048
  202. setprop ro.SECONDARY_SERVER_MEM 4096
  203. setprop ro.BACKUP_APP_MEM 4096
  204. setprop ro.HOME_APP_MEM 4096
  205. setprop ro.HIDDEN_APP_MEM 5120
  206. setprop ro.CONTENT_PROVIDER_MEM 5632
  207. setprop ro.EMPTY_APP_MEM 6144
  208.  
  209.  
  210.  
  211. # New Stuff
  212. mkdir /data/misc/wifi 0770 wifi wifi
  213. mkdir /data/misc/wifi/sockets 0770 wifi wifi
  214. mkdir /data/misc/dhcp 0770 dhcp dhcp
  215. chown dhcp dhcp /data/misc/dhcp
  216.  
  217.  
  218. # Enable Anr history , it would output the debuginfo to data partition
  219. # 1: on 0: off
  220. # setprop debugtool.anrhistory 1
  221.  
  222. # Set error receiver
  223. setprop ro.error.receiver.htc.apps com.android.updater
  224.  
  225. #ruu
  226. write /data/misc/screen_lock_status 0
  227. chown system system /data/misc/screen_lock_status
  228. chmod 644 /data/misc/screen_lock_status
  229.  
  230. # Write value must be consistent with the above properties.
  231. # Note that the driver only supports 6 slots, so we have HOME_APP at the
  232. # same memory level as services.
  233. write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
  234.  
  235. write /proc/sys/vm/overcommit_memory 1
  236. write /proc/sys/vm/min_free_order_shift 4
  237. write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
  238.  
  239. # Set init its forked children's oom_adj.
  240. write /proc/1/oom_adj -16
  241.  
  242. # Tweak background writeout
  243. write /proc/sys/vm/dirty_expire_centisecs 200
  244. write /proc/sys/vm/dirty_background_ratio 5
  245.  
  246. # Permissions for System Server and daemons.
  247. chown radio system /sys/android_power/state
  248. chown radio system /sys/android_power/request_state
  249. chown radio system /sys/android_power/acquire_full_wake_lock
  250. chown radio system /sys/android_power/acquire_partial_wake_lock
  251. chown radio system /sys/android_power/release_wake_lock
  252. chown radio system /sys/power/state
  253. chown radio system /sys/power/wake_lock
  254. chown radio system /sys/power/wake_unlock
  255. chown radio system /sys/camera_led_status/led_ril_status
  256. chown system system /sys/camera_led_status/led_wimax_status
  257. chown system system /sys/camera_led_status/led_hotspot_status
  258. chown media system /sys/android_camera/cam_mode
  259. chmod 0660 /sys/power/state
  260. chmod 0660 /sys/power/wake_lock
  261. chmod 0660 /sys/power/wake_unlock
  262. chown system system /sys/class/timed_output/vibrator/enable
  263. chown system system /sys/class/leds/keyboard-backlight/brightness
  264. chown system system /sys/class/leds/lcd-backlight/brightness
  265. chown system system /sys/class/leds/button-backlight/brightness
  266. chown system system /sys/class/leds/jogball-backlight/brightness
  267. chown system system /sys/class/leds/caps/brightness
  268. chown system system /sys/class/leds/func/brightness
  269. chown system system /sys/class/leds/red/brightness
  270. chown system system /sys/class/leds/green/brightness
  271. chown system system /sys/class/leds/blue/brightness
  272. chown system system /sys/class/leds/amber/brightness
  273. chown system system /sys/class/leds/red/device/grpfreq
  274. chown system system /sys/class/leds/red/device/grppwm
  275. chown system system /sys/class/leds/red/device/blink
  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/green/blink
  280. chown system system /sys/class/leds/green/off_timer
  281. chown system system /sys/class/leds/amber/blink
  282. chown system system /sys/class/leds/amber/off_timer
  283. chown system system /sys/class/timed_output/vibrator/enable
  284. chown system system /sys/module/sco/parameters/disable_esco
  285. chown system system /sys/kernel/ipv4/tcp_wmem_min
  286. chown system system /sys/kernel/ipv4/tcp_wmem_def
  287. chown system system /sys/kernel/ipv4/tcp_wmem_max
  288. chown system system /sys/kernel/ipv4/tcp_rmem_min
  289. chown system system /sys/kernel/ipv4/tcp_rmem_def
  290. chown system system /sys/kernel/ipv4/tcp_rmem_max
  291. chown root radio /proc/cmdline
  292.  
  293.  
  294. # bluetooth power up/down interface
  295. chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
  296. chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
  297. chmod 0660 /sys/class/rfkill/rfkill0/state
  298.  
  299. chown radio radio /sys/module/pm/parameters/idle_sleep_mode
  300.  
  301. # for wireless modem
  302. chown system system /sys/module/serial/parameters/modem_enabled
  303. chown system system /dev/ttyHSUSB0
  304. chown system system /dev/smd9
  305. chown media media /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  306.  
  307. # chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
  308. # chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
  309. # chmod 0660 /sys/class/rfkill/rfkill0/state
  310. # chown bluetooth bluetooth /dev/ttyMSM0
  311. chmod 0666 /dev/ttyHS1
  312. chown root radio /proc/cmdline
  313. chmod 666 /proc/cmdline
  314.  
  315. chmod 666 /dev/input/event0
  316. chmod 666 /dev/input/event1
  317. chmod 666 /dev/input/event2
  318. chmod 666 /dev/input/event3
  319. chmod 666 /dev/input/event4
  320. chmod 666 /dev/input/event5
  321. chmod 666 /dev/input/event6
  322. chmod 666 /sys/class/i2c-adapter/i2c-0/0-0018/enable
  323. chmod 666 /sys/class/i2c-adapter/i2c-0/0-0019/enable
  324. chmod 666 /sys/class/i2c-adapter/i2c-0/0-0018/rate
  325. chmod 666 /sys/class/i2c-adapter/i2c-0/0-0019/rate
  326. chmod 666 /sys/class/i2c-adapter/i2c-0/0-0018/scale
  327. chmod 666 /sys/class/i2c-adapter/i2c-0/0-0019/scale
  328.  
  329. chmod 666 /dev/uinput
  330. chmod 666 /etc/bluez/audio.conf
  331. chmod 666 /etc/bluez/hcid.conf
  332. chmod 666 /etc/bluez/input.conf
  333.  
  334. chmod 666 /dev/msm_snd
  335. chmod 666 /dev/msm_pcm_in
  336. chmod 666 /dev/msm_audpre
  337. chmod 666 /dev/msm_mp3
  338. chmod 666 /dev/msm_pcm_out
  339. chmod 666 /dev/msm_pcm_ctl
  340. chmod 666 /dev/msm_hw3dm
  341. chmod 666 /dev/msm_hw3dc
  342.  
  343.  
  344. # Define TCP buffer sizes for various networks
  345. # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  346. setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  347. setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
  348. setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
  349. setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
  350. setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
  351. # setprop net.tcp.buffersize.wimax 107380,221184,524288,4096,16384,110208
  352.  
  353.  
  354. # Wireless properties
  355. setprop wifi.interface eth0
  356. setprop net.dns1 87.194.255.154
  357. setprop net.dns2 87.194.255.155
  358.  
  359. start sysinit
  360.  
  361. on property:cm.filesystem.ready=1
  362. class_start default
  363.  
  364. ## Daemon processes to be run by init.
  365. ##
  366. service console /system/bin/sh
  367. console
  368.  
  369. # adbd is controlled by the persist.service.adb.enable system property
  370. service adbd /sbin/adbd
  371. disabled
  372.  
  373. # adbd on at boot in emulator
  374. on property:ro.kernel.qemu=1
  375. start adbd
  376.  
  377. on property:persist.service.adb.enable=1
  378. start adbd
  379.  
  380. on property:persist.service.adb.enable=0
  381. stop adbd
  382.  
  383. service servicemanager /system/bin/servicemanager
  384. user system
  385. critical
  386. onrestart restart zygote
  387. onrestart restart media
  388.  
  389. service vold /system/bin/vold
  390. socket vold stream 0660 root mount
  391. ioprio be 2
  392.  
  393. service netd /system/bin/netd
  394. socket netd stream 0660 root system
  395.  
  396. service debuggerd /system/bin/debuggerd
  397.  
  398. service ril-daemon /system/bin/rild -l /system/lib/libhtc_ril_wrapper.so -- -d /dev/smd0
  399. socket rild stream 660 root radio
  400. socket rild-debug stream 660 radio system
  401. socket rild-htc stream 660 radio system
  402. user root
  403. group radio cache inet misc audio
  404.  
  405. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  406. socket zygote stream 666
  407. onrestart write /sys/android_power/request_state wake
  408. onrestart write /sys/power/state on
  409. onrestart restart media
  410.  
  411. service media /system/bin/mediaserver
  412. user media
  413. group system audio camera graphics inet net_bt net_bt_admin net_raw
  414. ioprio rt 4
  415.  
  416. service bootsound /system/bin/playmp3
  417. user media
  418. group audio
  419. oneshot
  420.  
  421. service bootanim /system/bin/bootanimation
  422. user graphics
  423. group system audio graphics
  424. disabled
  425. oneshot
  426.  
  427. service dbus /system/bin/dbus-daemon --system --nofork
  428. socket dbus stream 666 bluetooth bluetooth
  429. user bluetooth
  430. group bluetooth net_bt_admin
  431.  
  432. service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm \
  433. --baudrate 3000000 --patchram /etc/firmware/bcm4329.hcd /dev/ttyHS0
  434. user bluetooth
  435. group bluetooth net_bt_admin
  436. disabled
  437.  
  438. service bluetoothd /system/bin/bluetoothd -n
  439. socket bluetooth stream 660 bluetooth bluetooth
  440. socket dbus_bluetooth stream 660 bluetooth bluetooth
  441. group bluetooth net_bt_admin misc
  442. disabled
  443.  
  444. service hfag /system/bin/sdptool add --channel=10 HFAG
  445. user bluetooth
  446. group bluetooth net_bt_admin
  447. disabled
  448. oneshot
  449.  
  450. service hsag /system/bin/sdptool add --channel=11 HSAG
  451. user bluetooth
  452. group bluetooth net_bt_admin
  453. disabled
  454. oneshot
  455.  
  456. service opush /system/bin/sdptool add --channel=12 OPUSH
  457. user bluetooth
  458. group bluetooth net_bt_admin
  459. disabled
  460. oneshot
  461.  
  462. service pbap /system/bin/sdptool add --channel=19 PBAP
  463. user bluetooth
  464. group bluetooth net_bt_admin
  465. disabled
  466. oneshot
  467.  
  468. service installd /system/bin/installd
  469. socket installd stream 600 system system
  470.  
  471.  
  472. service racoon /system/bin/racoon
  473. socket racoon stream 600 system system
  474. # racoon will setuid to vpn after getting necessary resources.
  475. group net_admin
  476. disabled
  477. oneshot
  478.  
  479. service mtpd /system/bin/mtpd
  480. socket mtpd stream 600 system system
  481. user vpn
  482. group vpn net_admin net_raw
  483. disabled
  484. oneshot
  485.  
  486. service keystore /system/bin/keystore /data/misc/keystore
  487. user keystore
  488. group keystore
  489. socket keystore stream 666
  490.  
  491.  
  492. service akmd /system/bin/akmd
  493. user compass
  494. group compass misc input
  495.  
  496. service wpa_supplicant /system/bin/wpa_supplicant \
  497. -Dwext -ieth0 -c/data/misc/wifi/wpa_supplicant.conf
  498. #user wifi
  499. #group wifi inet
  500. socket wpa_eth0 dgram 660 wifi wifi
  501. disabled
  502. oneshot
  503.  
  504. service dhcpcd /system/bin/dhcpcd -ABKL eth0
  505. disabled
  506. oneshot
  507.  
  508. service btld /system/bin/logwrapper /system/bin/btld -lpm 1 -hb 3000000
  509. user root
  510. group bluetooth net_bt_admin
  511. disabled
  512. oneshot
  513.  
  514. # for USB internet sharing
  515. service udhcpd /system/bin/udhcpd
  516. disabled
  517. oneshot
  518.  
  519. service netsharing_on /system/bin/netsharing net on
  520. disabled
  521. oneshot
  522.  
  523. service netsharing_off /system/bin/netsharing net off
  524. disabled
  525. oneshot
  526.  
  527. service netsharing_pass /system/bin/netsharing net_pass on
  528. disabled
  529. oneshot
  530.  
  531. service modem /system/xbin/wireless_modem
  532. user system
  533. group system
  534. disabled
  535.  
  536. service zchgd /system/bin/zchgd
  537. user root
  538. group root graphics
  539. oneshot
  540.  
  541. service dumpstate /system/bin/dumpstate -s
  542. socket dumpstate stream 0660 shell log
  543. disabled
  544. oneshot
  545.  
  546. on property:dev.bootcomplete=1
  547. start bootcomplete
  548.  
  549. service bootcomplete /system/bin/bootcomplete
  550. user root
  551. group root
  552. disabled
  553. oneshot
  554.  
  555. service shutdown /system/bin/shutdown
  556. user root
  557. group root
  558. disabled
  559. oneshot
  560.  
  561. service ipd /system/bin/ipd
  562. socket ipd stream 666 root inet
  563.  
  564. # Execute files in /etc/init.d before booting
  565. service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
  566. disabled
  567. oneshot
  568.  
  569. service init_cam /init_cam.sh
  570. oneshot
  571.  
  572. on property:service.modem.enable=1
  573. start modem
  574.  
  575. on property:service.modem.enable=0
  576. stop modem
  577.  
  578. service srv_ser2net /system/bin/ser2net -n
  579. disabled
  580.  
  581. on property:service.ser2net.enable=1
  582. start srv_ser2net
  583.  
  584. on property:service.ser2net.enable=0
  585. stop srv_ser2net
  586.  
  587. #service rmnet-mtu /bin/sh /rmnet0-mtu.sh
Add Comment
Please, Sign In to add comment