Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 17th, 2010 | Syntax: None | Size: 15.11 KB | Hits: 73 | Expires: Never
Copy text to clipboard
  1.  
  2.  
  3. on init
  4.  
  5.  
  6.  
  7. sysclktz 0
  8.  
  9.  
  10.  
  11. loglevel 3
  12.  
  13.  
  14.  
  15. # setup the global environment
  16.  
  17.     # add by Justin_Liu, :/system/framework/com.scalado.util.ScaladoUtil.jar
  18.  
  19.     export PATH /sbin:/system/sbin:/system/bin:/system/xbin
  20.  
  21.     export LD_LIBRARY_PATH /system/lib
  22.  
  23.     export ANDROID_BOOTLOGO 1
  24.  
  25.     export ANDROID_ROOT /system
  26.  
  27.     export ANDROID_ASSETS /system/app
  28.  
  29.     export ANDROID_DATA /data
  30.  
  31.     export EXTERNAL_STORAGE /sdcard
  32.  
  33.     export PHONE_STORAGE /emmc
  34.  
  35.     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
  36.  
  37.  
  38.  
  39. # Backward compatibility
  40.  
  41.     symlink /system/etc /etc
  42.  
  43.     symlink /sys/kernel/debug /d
  44.  
  45.  
  46.  
  47. # create mountpoints and mount tmpfs on sqlite_stmt_journals
  48.  
  49.     mkdir /sdcard 0000 system system
  50.  
  51.     mkdir /emmc 0000 system system
  52.  
  53.     mkdir /system
  54.  
  55.     mkdir /data 0771 system system
  56.  
  57.     mkdir /cache 0770 system cache
  58.  
  59.     mkdir /config 0500 root root
  60.  
  61.     mkdir /sqlite_stmt_journals 01777 root root
  62.  
  63.     mount tmpfs tmpfs /sqlite_stmt_journals size=4m
  64.  
  65.  
  66.  
  67.     mount rootfs rootfs / ro remount
  68.  
  69.  
  70.  
  71.     write /proc/sys/kernel/panic_on_oops 1
  72.  
  73.     write /proc/sys/kernel/hung_task_timeout_secs 0
  74.  
  75.     write /proc/cpu/alignment 4
  76.  
  77.     write /proc/sys/kernel/sched_latency_ns 5000000
  78.  
  79.     write /proc/sys/kernel/sched_wakeup_granularity_ns 100000
  80.  
  81.     write /proc/sys/kernel/sched_min_granularity_ns 100000
  82.  
  83.     write /proc/sys/kernel/sched_compat_yield 1
  84.  
  85.     write /proc/sys/kernel/sched_child_runs_first 0
  86.  
  87.  
  88.  
  89. # Create cgroup mount points for process groups
  90.  
  91.     mkdir /dev/cpuctl
  92.  
  93.     mount cgroup none /dev/cpuctl cpu
  94.  
  95.     chown sytem system /dev/cpuctl
  96.  
  97.     chown system system /dev/cpuctl/tasks
  98.  
  99.     chmod 0777 /dev/cpuctl/tasks
  100.  
  101.     write /dev/cpuctl/cpu.shares 1024
  102.  
  103.  
  104.  
  105.     mkdir /dev/cpuctl/fg_boost
  106.  
  107.     chown system system /dev/cpuctl/fg_boost/tasks
  108.  
  109.     chmod 0777 /dev/cpuctl/fg_boost/tasks
  110.  
  111.     write /dev/cpuctl/fg_boost/cpu.shares 1024
  112.  
  113.  
  114.  
  115.     mkdir /dev/cpuctl/bg_non_interactive
  116.  
  117.     chown system system /dev/cpuctl/bg_non_interactive/tasks
  118.  
  119.     chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  120.  
  121.     # 5.0 %
  122.  
  123.     write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  124.  
  125.  
  126.  
  127. # mount mtd partitions
  128.  
  129.     # Mount /system rw first to give the filesystem a chance to save a checkpoint
  130.  
  131.     mount yaffs2 mtd@system /system
  132.  
  133.     mount yaffs2 mtd@system /system ro remount
  134.  
  135.  
  136.  
  137.     # We chown/chmod /data again so because mount is run as root + defaults
  138.  
  139.     mount yaffs2:ext3 sel?mtd@userdata:mmcblk0p1 /data nosuid nodev
  140.  
  141.     chown system system /data
  142.  
  143.     chmod 0771 /data
  144.  
  145.  
  146.  
  147.     # Create dump dir and collect dumps.
  148.  
  149.     # Do this before we mount cache so eventually we can use cache for
  150.  
  151.     # storing dumps on platforms which do not have a dedicated dump partition.
  152.  
  153.    
  154.  
  155.     mkdir /data/dontpanic
  156.  
  157.     chown root log /data/dontpanic
  158.  
  159.     chmod 0750 /data/dontpanic
  160.  
  161.  
  162.  
  163.     # Collect apanic data, free resources and re-arm trigger
  164.  
  165.     copy /proc/apanic_console /data/dontpanic/apanic_console
  166.  
  167.     chown root log /data/dontpanic/apanic_console
  168.  
  169.     chmod 0640 /data/dontpanic/apanic_console
  170.  
  171.  
  172.  
  173.     copy /proc/apanic_threads /data/dontpanic/apanic_threads
  174.  
  175.     chown root log /data/dontpanic/apanic_threads
  176.  
  177.     chmod 0640 /data/dontpanic/apanic_threads
  178.  
  179.  
  180.  
  181.     write /proc/apanic_console 1
  182.  
  183.  
  184.  
  185.     # Same reason as /data above
  186.  
  187.     mount yaffs2 mtd@cache /cache nosuid nodev
  188.  
  189.     chown system cache /cache
  190.  
  191.     chmod 0770 /cache
  192.  
  193.  
  194.  
  195.     # This may have been created by the recovery system with odd permissions
  196.  
  197.     chown system system /cache/recovery
  198.  
  199.     chmod 0770 /cache/recovery
  200.  
  201.  
  202.  
  203.     #change permissions on vmallocinfo so we can grab it from bugreports
  204.  
  205.     chown root log /proc/vmallocinfo
  206.  
  207.     chmod 0440 /proc/vmallocinfo
  208.  
  209.  
  210.  
  211. # create basic filesystem structure
  212.  
  213.     mkdir /data/misc 01771 system misc
  214.  
  215.     mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  216.  
  217.     mkdir /data/misc/keystore 0700 keystore keystore
  218.  
  219.     mkdir /data/misc/vpn 0770 system system
  220.  
  221.     mkdir /data/misc/vpn/profiles 0770 system system
  222.  
  223.     # give system access to wpa_supplicant.conf for backup and restore
  224.  
  225.     mkdir /data/misc/wifi 0770 wifi wifi
  226.  
  227.     chmod 0770 /data/misc/wifi
  228.  
  229.     chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  230.  
  231.     mkdir /data/misc/wimax 0777 wimax wimax
  232.  
  233.     mkdir /data/misc/wimax/sockets 0777  wimax wimax
  234.  
  235.     mkdir /data/wimax/ 0777  wimax wimax
  236.  
  237.     mkdir /data/wimax/log 0777  wimax wimax
  238.  
  239.     mkdir /data/local 0771 shell shell
  240.  
  241.     mkdir /data/local/tmp 0771 shell shell
  242.  
  243.     mkdir /data/data 0771 system system
  244.  
  245.     mkdir /data/app-private 0771 system system
  246.  
  247.     mkdir /data/app 0771 system system
  248.  
  249.     mkdir /data/property 0700 root root
  250.  
  251.     # DRMv1 rights storage
  252.  
  253.     symlink /data/local /data/drm
  254.  
  255.     mkdir /data/local/rights 0777 shell shell
  256.  
  257.     chown shell shell /data/drm
  258.  
  259.     write /data/drm/rights/mid.txt 0
  260.  
  261.     chmod 0777 /data/drm/rights/mid.txt
  262.  
  263.  
  264.  
  265.  
  266.  
  267.     # create dalvik-cache and double-check the perms
  268.  
  269.     mkdir /data/dalvik-cache 0771 system system
  270.  
  271.     chown system system /data/dalvik-cache
  272.  
  273.     chmod 0771 /data/dalvik-cache
  274.  
  275.  
  276.  
  277.     # create the lost+found directories, so as to enforce our permissions
  278.  
  279.     mkdir /data/lost+found 0770
  280.  
  281.     mkdir /cache/lost+found 0770
  282.  
  283.  
  284.  
  285.     # double check the perms, in case lost+found already exists, and set owner
  286.  
  287.     chown root root /data/lost+found
  288.  
  289.     chmod 0770 /data/lost+found
  290.  
  291.     chown root root /cache/lost+found
  292.  
  293.     chmod 0770 /cache/lost+found
  294.  
  295.  
  296.  
  297.     # create DRM directories
  298.  
  299.     mkdir /data/DxDrm
  300.  
  301.     mkdir /data/DxDrm/fuse
  302.  
  303.     chmod 0777 /data/DxDrm
  304.  
  305.  
  306.  
  307.         # change the mode for dmdata
  308.  
  309.         chmod 0777 /data/local/dmdata
  310.  
  311.  
  312.  
  313. on boot
  314.  
  315. # basic network init
  316.  
  317.     ifup lo
  318.  
  319.     hostname localhost
  320.  
  321.     domainname localdomain
  322.  
  323.  
  324.  
  325. # set RLIMIT_NICE to allow priorities from 19 to -20
  326.  
  327.     setrlimit 13 40 40
  328.  
  329.  
  330.  
  331. # Define the oom_adj values for the classes of processes that can be
  332.  
  333. # killed by the kernel.  These are used in ActivityManagerService.
  334.  
  335.     setprop ro.FOREGROUND_APP_ADJ 0
  336.  
  337.     setprop ro.VISIBLE_APP_ADJ 1
  338.  
  339.     setprop ro.SECONDARY_SERVER_ADJ 2
  340.  
  341.     setprop ro.BACKUP_APP_ADJ 2
  342.  
  343.     setprop ro.HOME_APP_ADJ 4
  344.  
  345.     setprop ro.HIDDEN_APP_MIN_ADJ 7
  346.  
  347.     setprop ro.CONTENT_PROVIDER_ADJ 14
  348.  
  349.     setprop ro.EMPTY_APP_ADJ 15
  350.  
  351.  
  352.  
  353. # Define the memory thresholds at which the above process classes will
  354.  
  355. # be killed.  These numbers are in pages (4k).
  356.  
  357.     setprop ro.FOREGROUND_APP_MEM 1536
  358.  
  359.     setprop ro.VISIBLE_APP_MEM 2048
  360.  
  361.     setprop ro.SECONDARY_SERVER_MEM 4096
  362.  
  363.     setprop ro.BACKUP_APP_MEM 4096
  364.  
  365.     setprop ro.HOME_APP_MEM 4096
  366.  
  367.     setprop ro.HIDDEN_APP_MEM 5120
  368.  
  369.     setprop ro.CONTENT_PROVIDER_MEM 5632
  370.  
  371.     setprop ro.EMPTY_APP_MEM 6144
  372.  
  373.  
  374.  
  375. # Enable Anr history , it would output the debuginfo to data partition
  376.  
  377. #   1: on   0: off
  378.  
  379. #   setprop debugtool.anrhistory 1
  380.  
  381.  
  382.  
  383. #ruu  
  384.  
  385.     write /data/misc/screen_lock_status  0
  386.  
  387.     chown system system /data/misc/screen_lock_status
  388.  
  389.     chmod 644 /data/misc/screen_lock_status
  390.  
  391.  
  392.  
  393. # Write value must be consistent with the above properties.
  394.  
  395. # Note that the driver only supports 6 slots, so we have HOME_APP at the
  396.  
  397. # same memory level as services.
  398.  
  399.     write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
  400.  
  401.  
  402.  
  403.     write /proc/sys/vm/overcommit_memory 1
  404.  
  405.     write /proc/sys/vm/min_free_order_shift 4
  406.  
  407.     write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
  408.  
  409.  
  410.  
  411.     # Set init its forked children's oom_adj.
  412.  
  413.     write /proc/1/oom_adj -16
  414.  
  415.  
  416.  
  417.     # Tweak background writeout
  418.  
  419.     write /proc/sys/vm/dirty_expire_centisecs 200
  420.  
  421.     write /proc/sys/vm/dirty_background_ratio  5
  422.  
  423.  
  424.  
  425.     # Permissions for System Server and daemons.
  426.  
  427.     chown radio system /sys/android_power/state
  428.  
  429.     chown radio system /sys/android_power/request_state
  430.  
  431.     chown radio system /sys/android_power/acquire_full_wake_lock
  432.  
  433.     chown radio system /sys/android_power/acquire_partial_wake_lock
  434.  
  435.     chown radio system /sys/android_power/release_wake_lock
  436.  
  437.     chown radio system /sys/power/state
  438.  
  439.     chown radio system /sys/power/wake_lock
  440.  
  441.     chown radio system /sys/power/wake_unlock
  442.  
  443.     chown radio system /sys/camera_led_status/led_ril_status
  444.  
  445.     chown system system /sys/camera_led_status/led_wimax_status
  446.  
  447.     chmod 0660 /sys/power/state
  448.  
  449.     chmod 0660 /sys/power/wake_lock
  450.  
  451.     chmod 0660 /sys/power/wake_unlock
  452.  
  453.     chown system system /sys/class/timed_output/vibrator/enable
  454.  
  455.     chown system system /sys/class/leds/keyboard-backlight/brightness
  456.  
  457.     chown system system /sys/class/leds/lcd-backlight/brightness
  458.  
  459.     chown system system /sys/class/leds/button-backlight/brightness
  460.  
  461.     chown system system /sys/class/leds/jogball-backlight/brightness
  462.  
  463.     chown system system /sys/class/leds/vtkey-backlight/brightness
  464.  
  465.     chown system system /sys/class/leds/caps/brightness
  466.  
  467.     chown system system /sys/class/leds/func/brightness
  468.  
  469.     chown system system /sys/class/leds/red/brightness
  470.  
  471.     chown system system /sys/class/leds/green/brightness
  472.  
  473.     chown system system /sys/class/leds/blue/brightness
  474.  
  475.     chown system system /sys/class/leds/amber/brightness
  476.  
  477.     chown system system /sys/class/leds/red/device/grpfreq
  478.  
  479.     chown system system /sys/class/leds/red/device/grppwm
  480.  
  481.     chown system system /sys/class/leds/red/device/blink
  482.  
  483.     chown system system /sys/class/leds/red/brightness
  484.  
  485.     chown system system /sys/class/leds/green/brightness
  486.  
  487.     chown system system /sys/class/leds/blue/brightness
  488.  
  489.     chown system system /sys/class/leds/red/device/grpfreq
  490.  
  491.     chown system system /sys/class/leds/red/device/grppwm
  492.  
  493.     chown system system /sys/class/leds/red/device/blink
  494.  
  495.     chown system system /sys/class/leds/green/blink
  496.  
  497.     chown system system /sys/class/leds/green/off_timer
  498.  
  499.     chown system system /sys/class/leds/amber/blink
  500.  
  501.     chown system system /sys/class/leds/amber/off_timer
  502.  
  503.     chown system system /sys/class/timed_output/vibrator/enable
  504.  
  505.     chown system system /sys/module/sco/parameters/disable_esco
  506.  
  507.     chown system system /sys/kernel/ipv4/tcp_wmem_min
  508.  
  509.     chown system system /sys/kernel/ipv4/tcp_wmem_def
  510.  
  511.     chown system system /sys/kernel/ipv4/tcp_wmem_max
  512.  
  513.     chown system system /sys/kernel/ipv4/tcp_rmem_min
  514.  
  515.     chown system system /sys/kernel/ipv4/tcp_rmem_def
  516.  
  517.     chown system system /sys/kernel/ipv4/tcp_rmem_max
  518.  
  519.     chown root radio /proc/cmdline
  520.  
  521.  
  522.  
  523. # Define TCP buffer sizes for various networks
  524.  
  525. #   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  526.  
  527.     setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  528.  
  529.     setprop net.tcp.buffersize.wifi    4095,87380,110208,4096,16384,110208
  530.  
  531.     setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
  532.  
  533.     setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
  534.  
  535.     setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
  536.  
  537.     setprop net.tcp.buffersize.wimax   4096,87380,110208,4096,16384,110208
  538.  
  539.  
  540.  
  541.     class_start default
  542.  
  543.  
  544.  
  545. ## Daemon processes to be run by init.
  546.  
  547. ##
  548.  
  549. service console /system/bin/sh
  550.  
  551.     console
  552.  
  553.  
  554.  
  555. # adbd is controlled by the persist.service.adb.enable system property
  556.  
  557. service adbd /sbin/adbd
  558.  
  559.     disabled
  560.  
  561.  
  562.  
  563. # adbd on at boot in emulator
  564.  
  565. on property:ro.kernel.qemu=1
  566.  
  567.     start adbd
  568.  
  569.  
  570.  
  571. on property:persist.service.adb.enable=1
  572.  
  573.     start adbd
  574.  
  575.  
  576.  
  577. on property:persist.service.adb.enable=0
  578.  
  579.     stop adbd
  580.  
  581.  
  582.  
  583. service servicemanager /system/bin/servicemanager
  584.  
  585.     user system
  586.  
  587.     critical
  588.  
  589.     onrestart restart zygote
  590.  
  591.     onrestart restart media
  592.  
  593.  
  594.  
  595. service vold /system/bin/vold
  596.  
  597.     socket vold stream 0660 root mount
  598.  
  599.  
  600.  
  601. service nexus /system/bin/nexus
  602.  
  603.     socket nexus stream 0660 root system
  604.  
  605.     disabled
  606.  
  607.  
  608.  
  609. #service mountd /system/bin/mountd
  610.  
  611. #    socket mountd stream 0660 root mount
  612.  
  613.  
  614.  
  615. service debuggerd /system/bin/debuggerd
  616.  
  617.  
  618.  
  619. service ril-daemon /system/bin/rild
  620.  
  621.     socket rild stream 660 root radio
  622.  
  623.     socket rild-debug stream 660 radio system
  624.  
  625.     socket rild-htc stream 660 radio system
  626.  
  627.     user root
  628.  
  629.     group radio cache inet misc audio
  630.  
  631.  
  632.  
  633. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  634.  
  635.     socket zygote stream 666
  636.  
  637.     onrestart write /sys/android_power/request_state wake
  638.  
  639.     onrestart write /sys/power/state on
  640.  
  641.     onrestart restart media
  642.  
  643.  
  644.  
  645. service media /system/bin/mediaserver
  646.  
  647.     user media
  648.  
  649.     group system audio camera graphics inet net_bt net_bt_admin
  650.  
  651.  
  652.  
  653. service bootanim /system/bin/bootanimation
  654.  
  655.     user graphics
  656.  
  657.     group system audio graphics
  658.  
  659.     disabled
  660.  
  661.     oneshot
  662.  
  663.  
  664.  
  665. service dbus /system/bin/dbus-daemon --system --nofork
  666.  
  667.     socket dbus stream 666 bluetooth bluetooth
  668.  
  669.     user bluetooth
  670.  
  671.     group bluetooth net_bt_admin
  672.  
  673.  
  674.  
  675. service bluetoothd /system/bin/bluetoothd -n
  676.  
  677.     socket bluetooth stream 660 bluetooth bluetooth
  678.  
  679.     socket dbus_bluetooth stream 660 bluetooth bluetooth
  680.  
  681.     # init.rc does not yet support applying capabilities, so run as root and
  682.  
  683.     # let bluetoothd drop uid to bluetooth with the right linux capabilities
  684.  
  685.     group bluetooth net_bt_admin misc
  686.  
  687.     disabled
  688.  
  689.  
  690.  
  691. service sequansd /system/bin/sequansd /etc/wimax/sequansd/sequansd_app.xml
  692.  
  693.     user root
  694.  
  695.     group root inet
  696.  
  697.     socket sequansd_0 dgram 660 root root
  698.  
  699.     disabled
  700.  
  701.     oneshot
  702.  
  703.  
  704.  
  705. service hfag /system/bin/sdptool add --channel=10 HFAG
  706.  
  707.     user bluetooth
  708.  
  709.     group bluetooth net_bt_admin
  710.  
  711.     disabled
  712.  
  713.     oneshot
  714.  
  715.  
  716.  
  717. service hsag /system/bin/sdptool add --channel=11 HSAG
  718.  
  719.     user bluetooth
  720.  
  721.     group bluetooth net_bt_admin
  722.  
  723.     disabled
  724.  
  725.     oneshot
  726.  
  727.  
  728.  
  729. service opush /system/bin/sdptool add --channel=12 OPUSH
  730.  
  731.     user bluetooth
  732.  
  733.     group bluetooth net_bt_admin
  734.  
  735.     disabled
  736.  
  737.     oneshot
  738.  
  739.  
  740.  
  741. service pbap /system/bin/sdptool add --channel=19 PBAP
  742.  
  743.     user bluetooth
  744.  
  745.     group bluetooth net_bt_admin
  746.  
  747.     disabled
  748.  
  749.     oneshot
  750.  
  751.  
  752.  
  753. service installd /system/bin/installd
  754.  
  755.     socket installd stream 600 system system
  756.  
  757.  
  758.  
  759. service flash_recovery /system/etc/install-recovery.sh
  760.  
  761.     oneshot
  762.  
  763.  
  764.  
  765. service racoon /system/bin/racoon
  766.  
  767.     socket racoon stream 600 system system
  768.  
  769.     # racoon will setuid to vpn after getting necessary resources.
  770.  
  771.     group net_admin
  772.  
  773.     disabled
  774.  
  775.     oneshot
  776.  
  777.  
  778.  
  779. service mtpd /system/bin/mtpd
  780.  
  781.     socket mtpd stream 600 system system
  782.  
  783.     user vpn
  784.  
  785.     group vpn net_admin net_raw
  786.  
  787.     disabled
  788.  
  789.     oneshot
  790.  
  791.  
  792.  
  793. service keystore /system/bin/keystore /data/misc/keystore
  794.  
  795.     user keystore
  796.  
  797.     group keystore
  798.  
  799.     socket keystore stream 666
  800.  
  801.  
  802.  
  803. service dumpstate /system/bin/dumpstate -s
  804.  
  805.     socket dumpstate stream 0660 shell log
  806.  
  807.     disabled
  808.  
  809.     oneshot