Public paste
bh21.6kernel
By: microhaxo | Date: Jul 2 2010 01:48 | Format: None | Expires: never | Size: 16.58 KB | Hits: 702

  1. # setup the global environment
  2.     export PATH /sbin:/system/sbin:/system/bin:/system/xbin
  3.     export LD_LIBRARY_PATH /system/lib
  4.     export ANDROID_BOOTLOGO 1
  5.     export ANDROID_ROOT /system
  6.     export ANDROID_ASSETS /system/app
  7.     export ANDROID_DATA /data
  8.     export EXTERNAL_STORAGE /sdcard
  9.     export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
  10.     export TMPDIR /data/local/tmp
  11.  
  12. # Backward compatibility
  13.     symlink /system/etc /etc
  14.  
  15. # create mountpoints and mount tmpfs on sqlite_stmt_journals
  16.     mkdir /sdcard 0000 system system
  17.     mkdir /system
  18.     mkdir /system/media
  19.     mkdir /data 0000 system system
  20.     mkdir /userdata 0000 system system
  21.     mkdir /cache 0770 system cache
  22.     mkdir /sqlite_stmt_journals 01777 root root
  23.     mount tmpfs tmpfs /sqlite_stmt_journals size=4m
  24.  
  25. #    mount rootfs rootfs / ro remount
  26.  
  27.     write /proc/sys/kernel/panic_on_oops 1
  28.     write /proc/sys/kernel/hung_task_timeout_secs 0
  29.     write /proc/cpu/alignment 4
  30.     write /proc/sys/kernel/sched_latency_ns 10000000
  31.     write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  32.     write /proc/sys/kernel/sched_compat_yield 1
  33.  
  34. # Create cgroup mount points for process groups
  35.     mkdir /dev/cpuctl
  36.     mount cgroup none /dev/cpuctl cpu
  37.     chown sytem system /dev/cpuctl
  38.     chown system system /dev/cpuctl/tasks
  39.     chmod 0777 /dev/cpuctl/tasks
  40.     write /dev/cpuctl/cpu.shares 1024
  41.  
  42.     mkdir /dev/cpuctl/fg_boost
  43.     chown system system /dev/cpuctl/fg_boost/tasks
  44.     chmod 0777 /dev/cpuctl/fg_boost/tasks
  45.     write /dev/cpuctl/fg_boost/cpu.shares 1024
  46.  
  47.     mkdir /dev/cpuctl/bg_non_interactive
  48.     chown system system /dev/cpuctl/bg_non_interactive/tasks
  49.     chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  50.     # 5.0 %
  51.     write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  52.  
  53. # mount mtd partitions
  54.     # Mount /system rw first to give the filesystem a chance to save a checkpoint
  55.     #mount yaffs2 mtd@system /system
  56.     #mount yaffs2 mtd@system /system ro remount
  57. # FEATURE_RFS
  58. # Note: below for RFS_3.0.0
  59.     #mount rfs /dev/stl9 /system check=no
  60. # Note: below for RFS_1.3.1
  61.     mount rfs /dev/stl9 /system xattr,check=no
  62.  
  63.     chmod 6777 /system/bin/wlservice
  64.     chmod 0777 /system/etc/
  65.     chmod 6777 /system/bin/brcm_dutMode
  66.  
  67.     #mount yaffs2 mtd@system /system ro remount
  68. # FEATURE_RFS
  69. # Note: below for both RFS_3.0.0 and RFS_1.3.1
  70.     mount rfs /dev/stl9 /system ro remount
  71.  
  72.     # We chown/chmod /data again so because mount is run as root + defaults
  73.     #mount yaffs2 mtd@userdata /data nosuid nodev
  74. # FEATURE_RFS
  75. # Note: below for RFS_3.0.0
  76.     #mount rfs /dev/stl14 /data nosuid nodev check=no
  77. # Note: below for RFS_1.3.1
  78.     mount rfs /dev/stl14 /data nosuid nodev xattr,check=no
  79.  
  80.     chown system system /data
  81.     chmod 0771 /data
  82.  
  83.     # Same reason as /data above
  84.     #mount yaffs2 mtd@cache /cache nosuid nodev
  85. # FEATURE_RFS
  86. # Note: below for RFS_3.0.0
  87.     #mount rfs /dev/stl12 /cache nosuid nodev check=no
  88. # Note: below for RFS_1.3.1
  89.     mount rfs /dev/stl12 /cache nosuid nodev xattr,check=no
  90.  
  91.     chown system cache /cache
  92.     chmod 0770 /cache
  93.  
  94.     # This may have been created by the recovery system with odd permissions
  95.     chown system system /cache/recovery
  96.     chmod 0770 /cache/recovery
  97.  
  98. # cpu frequency
  99.     chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  100.     chmod 0666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  101.  
  102.     #hsil for inserting modules dpram/multipdp
  103.     insmod /system/libmodules/dpram.ko
  104.     insmod /system/libmodules/multipdp.ko
  105.          
  106. #  for inserting modules VibeTonz
  107.         insmod /system/libmodules/vtmdrv.ko
  108.  
  109. # hsil Modification for requesting of RIL Team
  110.     chmod 0771 /data
  111.     mkdir /data/log 0777 system system
  112.     chmod 0666 /dev/log/radio
  113.     chmod 0666 /dev/log/events
  114.     chmod 0666 /dev/log/main
  115.  
  116.     # hsil for LCD on/off test
  117.     chmod 0666 /dev/graphics/fb0
  118.  
  119.     #PGH ADDEF FOR TEST PROGRAM ON RIL
  120.     chmod 0666 /dev/msm_camera0
  121.  
  122.  
  123. # for Sensor HAL
  124.     chown system system /dev/bma150
  125.     chown system system /dev/akm8973_daemon
  126.     chown system system /dev/akm8973_aot
  127. #   chown system system /dev/bma020
  128. #   chown system system /dev/proximity
  129.     chmod 0777 /dev/bma150
  130.     chmod 0777 /dev/akm8973_daemon
  131.     chmod 0777 /dev/akm8973_aot
  132. #   chmod 0777 /dev/bma020
  133. #   chmod 0777 /dev/proximity
  134.  
  135.  
  136. # create basic filesystem structure
  137.     mkdir /data/misc 01771 system misc
  138.     mkdir /data/misc/hcid 0770 bluetooth bluetooth
  139.     mkdir /data/misc/keystore 0770 keystore keystore
  140.     mkdir /data/misc/vpn 0770 system system
  141.     mkdir /data/misc/vpn/profiles 0770 system system
  142.     mkdir /data/local 0771 shell shell
  143.     mkdir /data/local/tmp 0771 shell shell
  144.     mkdir /data/data 0771 system system
  145.     mkdir /data/app-private 0771 system system
  146.     mkdir /data/app 0771 system system
  147.     mkdir /data/property 0700 root root
  148.  
  149. # to enable wifi
  150.     setprop wifi.interface "eth0"
  151.  
  152.     # create dalvik-cache and double-check the perms
  153.     mkdir /data/dalvik-cache 0771 system system
  154.     chown system system /data/dalvik-cache
  155.     chmod 0771 /data/dalvik-cache
  156.  
  157.     # create the lost+found directories, so as to enforce our permissions
  158.     mkdir /data/lost+found 0770
  159.     mkdir /cache/lost+found 0770
  160.  
  161.     # double check the perms, in case lost+found already exists, and set owner
  162.     chown root root /data/lost+found
  163.     chmod 0770 /data/lost+found
  164.     chown root root /cache/lost+found
  165.     chmod 0770 /cache/lost+found
  166.  
  167. # to enable wifi
  168.      # chmod 6777 /system/bin/wlservice
  169.      # chmod 0777 /system/etc/
  170.     mkdir /data/misc/wifi 0777 wifi wifi
  171.     mkdir /data/misc/dhcp 0777 dhcp dhcp
  172.     mkdir /data/misc/wifi/sockets 0777 wifi wifi
  173. # end of wifi
  174.  
  175. on boot
  176. # basic network init
  177.     ifup lo
  178.     hostname localhost
  179.     domainname localdomain
  180.  
  181. # set RLIMIT_NICE to allow priorities from 19 to -20
  182.     setrlimit 13 40 40
  183.  
  184. # Define the oom_adj values for the classes of processes that can be
  185. # killed by the kernel.  These are used in ActivityManagerService.
  186.     setprop ro.FOREGROUND_APP_ADJ 0
  187.     setprop ro.VISIBLE_APP_ADJ 1
  188.     setprop ro.SECONDARY_SERVER_ADJ 2
  189.     setprop ro.BACKUP_APP_ADJ 2
  190.     setprop ro.HOME_APP_ADJ 4
  191.     setprop ro.HIDDEN_APP_MIN_ADJ 7
  192.     setprop ro.CONTENT_PROVIDER_ADJ 14
  193.     setprop ro.EMPTY_APP_ADJ 15
  194.  
  195. # Define the memory thresholds at which the above process classes will
  196. # be killed.  These numbers are in pages (4k).
  197.     setprop ro.FOREGROUND_APP_MEM 1536
  198.     setprop ro.VISIBLE_APP_MEM 2048
  199.     setprop ro.SECONDARY_SERVER_MEM 4096
  200.     setprop ro.BACKUP_APP_MEM 4096
  201.     setprop ro.HOME_APP_MEM 4096
  202.     setprop ro.HIDDEN_APP_MEM 5120
  203.     setprop ro.CONTENT_PROVIDER_MEM 5632
  204.     setprop ro.EMPTY_APP_MEM 6144
  205.  
  206. # Write value must be consistent with the above properties.
  207. # Note that the driver only supports 6 slots, so we have HOME_APP at the
  208. # same memory level as services.
  209.     write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
  210.  
  211.     write /proc/sys/vm/overcommit_memory 1
  212.     write /proc/sys/vm/min_free_order_shift 4
  213.     write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
  214.  
  215.     # Set init its forked children's oom_adj.
  216.     write /proc/1/oom_adj -16
  217.  
  218.     # Permissions for System Server and daemons.
  219.     chown radio system /sys/android_power/state
  220.     chown radio system /sys/android_power/request_state
  221.     chown radio system /sys/android_power/acquire_full_wake_lock
  222.     chown radio system /sys/android_power/acquire_partial_wake_lock
  223.     chown radio system /sys/android_power/release_wake_lock
  224.     chown radio system /sys/power/state
  225.     chown radio system /sys/power/wake_lock
  226.     chown radio system /sys/power/wake_unlock
  227.     chmod 0660 /sys/power/state
  228.     chmod 0660 /sys/power/wake_lock
  229.     chmod 0660 /sys/power/wake_unlock
  230.     chown system system /sys/class/timed_output/vibrator/enable
  231.     chown system system /sys/class/leds/keyboard-backlight/brightness
  232.     chown system system /sys/class/leds/lcd-backlight/brightness
  233.     chown system system /sys/class/leds/button-backlight/brightness
  234.     chown system system /sys/class/leds/jogball-backlight/brightness
  235.     chown system system /sys/class/leds/red/brightness
  236.     chown system system /sys/class/leds/green/brightness
  237.     chown system system /sys/class/leds/blue/brightness
  238.     chown system system /sys/class/leds/red/device/grpfreq
  239.     chown system system /sys/class/leds/red/device/grppwm
  240.     chown system system /sys/class/leds/red/device/blink
  241.     chown system system /sys/class/leds/red/brightness
  242.     chown system system /sys/class/leds/green/brightness
  243.     chown system system /sys/class/leds/blue/brightness
  244.     chown system system /sys/class/leds/red/device/grpfreq
  245.     chown system system /sys/class/leds/red/device/grppwm
  246.     chown system system /sys/class/leds/red/device/blink
  247.     chown system system /sys/class/timed_output/vibrator/enable
  248.     chown system system /sys/module/sco/parameters/disable_esco
  249.     chown system system /sys/kernel/ipv4/tcp_wmem_min
  250.     chown system system /sys/kernel/ipv4/tcp_wmem_def
  251.     chown system system /sys/kernel/ipv4/tcp_wmem_max
  252.     chown system system /sys/kernel/ipv4/tcp_rmem_min
  253.     chown system system /sys/kernel/ipv4/tcp_rmem_def
  254.     chown system system /sys/kernel/ipv4/tcp_rmem_max
  255.     chown root radio /proc/cmdline
  256. #    chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
  257. #    chown bluetooth bluetooth /proc/bluetooth/sleep/proto
  258. #    chown system system /sys/module/sco/parameters/disable_esco
  259. #    chmod 0660 /sys/module/bluetooth_power/parameters/power
  260. #    chmod 0660 /proc/bluetooth/sleep/proto
  261.     chown bluetooth bluetooth /dev/ttyHS0
  262.     chown system system /dev/bma150
  263.     chown system system /dev/akm8973_daemon
  264.     chown system system /dev/akm8973_aot
  265.     chown system system /dev/proximity
  266.     chown system system /dev/melfas_fw_download
  267.     chmod 0777 /dev/melfas_fw_download
  268.     chmod 0777 /dev/bma150
  269.     chmod 0777 /dev/akm8973_daemon
  270.     chmod 0777 /dev/akm8973_aot
  271.     chmod 0777 /dev/proximity
  272. #chk:    chown system system /dev/smb380
  273. #chk:    chmod 0777 /dev/smb380
  274.  # Permissions for btld_testmode
  275.     chmod 0660 /dev/ttyHS0
  276.     chown bluetooth bluetooth /dev/uinput
  277.     chmod 0666 /dev/uinput
  278.     chmod 0777 /sys/class/rfkill/rfkill0/state
  279.     chmod 0777 /sys/class/rfkill/rfkill1/state
  280.     # chown root root /system/bin/btld_testmode
  281.     # chmod 6777 /system/bin/btld_testmode
  282.     # chmod 6777 /system/bin/brcm_dutMode
  283.     chmod 0666 /dev/msm_snd
  284. # Permissions for the drexe
  285.     chmod 0777 /sys/class/power_supply/battery/capacity
  286.     chmod 0777 /sys/power/state
  287.     chmod 0777 /sys/class/sec/param/download_mode
  288. # DM appl accesses fota partition
  289.     chmod 0777 /dev/bml10
  290.  
  291. # Permissions for the audioTuning
  292.     chmod 0666 /sys/etc/stream_speaker.txt
  293.     chmod 0666 /sys/etc/stream_headset.txt
  294.     chmod 0666 /sys/etc/situation.txt
  295.  
  296. # Permissions for the audioTuning
  297.     chmod 0777 /data/stream_speaker.txt
  298.     chmod 0777 /data/stream_headset.txt
  299.     chmod 0777 /data/situation.txt
  300.  
  301.  
  302. # Define TCP buffer sizes for various networks
  303. #   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  304.     setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  305.     setprop net.tcp.buffersize.wifi    4095,87380,110208,4096,16384,110208
  306.     setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
  307.     setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
  308.     setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
  309.  
  310. # Define property for disabling rfkill interface
  311.     setprop ro.rfkilldisabled 0 // enable rfkill  
  312. #   setprop ro.rfkilldisabled 1
  313.     class_start default
  314.  
  315. #    setprop ril.bt_vendor_contacts_db /data/data/com.tmobile.myfaves/databases/contacts.db
  316.     setprop ril.bt_vendor_contacts_db /data/data/com.android.providers.contacts/databases/contacts.db
  317.    
  318.     setprop service.brcm.bt.secure_mode true
  319.  
  320.     setprop ril.bt_host_wake_polarity "01"
  321.     setprop ril.bt_bt_wake_polarity "01"
  322.    
  323. service bootsound /system/bin/playmp3
  324.     user root
  325.     critical
  326.     group root
  327.     oneshot
  328. ## Daemon processes to be run by init.
  329. ##
  330. service console /system/bin/sh
  331.     console
  332.  
  333. # adbd is controlled by the persist.service.adb.enable system property
  334. service adbd /sbin/adbd
  335.     disabled
  336.  
  337. # adbd on at boot in emulator
  338. on property:ro.kernel.qemu=1
  339.     start adbd
  340.  
  341. on property:persist.service.adb.enable=1
  342.     start adbd
  343.  
  344. on property:persist.service.adb.enable=0
  345.     stop adbd
  346.  
  347.  
  348. #ln -s /dev/oncrpc/30000002:00010000 /dev/oncrpc/30000002:00010001
  349.  
  350. service playlogo /system/bin/playlogo
  351.         user root
  352. #       group root
  353.         oneshot
  354.        
  355. service servicemanager /system/bin/servicemanager
  356.     user system
  357.     critical
  358.     onrestart restart zygote
  359.     onrestart restart media
  360.  
  361. service vold /system/bin/vold
  362.     socket vold stream 0660 root mount
  363.  
  364.  
  365. # add 2009.12.01
  366. # akmd service
  367. service akmd2 /system/bin/akmd2
  368.     enabled
  369.     oneshot
  370.  
  371. service nexus /system/bin/nexus
  372.     socket nexus stream 0660 root system
  373.     disabled
  374.  
  375. #service mountd /system/bin/mountd
  376. #    socket mountd stream 0660 root mount
  377.  
  378. service debuggerd /system/bin/debuggerd
  379. service akmd2 /system/bin/akmd2
  380.    disabled
  381.    oneshot
  382.  
  383. # VibeTonz daemon
  384. service immvibed /system/bin/immvibed
  385.         oneshot
  386.  
  387. service ril-daemon /system/bin/rild
  388.     socket rild stream 660 root radio
  389.     socket rild-debug stream 660 radio system
  390.     user root
  391.     group radio cache inet misc
  392.  
  393. service DR-daemon /system/bin/drexe
  394.         user root
  395.        
  396. service mobex-daemon /system/bin/npsmobex
  397.         user root      
  398.  
  399. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  400.     socket zygote stream 666
  401.     onrestart write /sys/android_power/request_state wake
  402.     onrestart write /sys/power/state on
  403.  
  404. service media /system/bin/mediaserver
  405.     user root
  406.     group system media audio camera graphics inet net_bt net_bt_admin sdcard_rw
  407.  
  408. service bootanim /system/bin/bootanimation
  409.     user graphics
  410.     group graphics
  411.     disabled
  412.     oneshot
  413.  
  414. service dbus /system/bin/dbus-daemon --system --nofork
  415.     socket dbus stream 660 bluetooth bluetooth
  416.     user bluetooth
  417.     group bluetooth net_bt_admin
  418.  
  419. # Make sure we startup btld before hcid
  420. # -lpm 0 => Disable LPM (Default) , -lpm 1 => Enabled LPM
  421. service btld /system/bin/logwrapper /system/bin/btld -hb 3000000 -lpm 1
  422.     user root
  423.     group bluetooth net_bt_admin
  424.     disabled
  425.     oneshot
  426.  
  427. # Start DTUN HCID
  428. # service hcid /system/bin/hcid -s -n -f /etc/bluez/hcid.conf
  429. service hcid /system/bin/logwrapper /system/bin/hcid
  430.     socket bluetooth stream 660 bluetooth bluetooth
  431.     socket dbus_bluetooth stream 660 bluetooth bluetooth
  432.     # init.rc does not yet support applying capabilities, so run as root and
  433.     # let hcid drop uid to bluetooth with the right linux capabilities
  434.     group bluetooth net_bt_admin misc
  435.     disabled
  436.     oneshot
  437.  
  438. # Start DTUN OBEXD
  439. service obexd /system/bin/logwrapper /system/bin/obexd
  440.     #socket bluetooth stream 660 bluetooth bluetooth
  441.     #socket dbus_bluetooth stream 660 bluetooth bluetooth
  442.     # init.rc does not yet support applying capabilities, so run as root and
  443.     # let obexd drop uid to bluetooth with the right linux capabilities
  444.     user root
  445.     group bluetooth net_bt_admin
  446.     disabled
  447.     oneshot
  448.  
  449. service hfag /system/bin/sdptool add --channel=10 HFAG
  450.     user bluetooth
  451.     group bluetooth net_bt_admin
  452.     disabled
  453.     oneshot
  454.  
  455. service hsag /system/bin/sdptool add --channel=11 HSAG
  456.     user bluetooth
  457.     group bluetooth net_bt_admin
  458.     disabled
  459.     oneshot
  460.  
  461. # to enable wifi
  462. service wpa_supplicant /system/bin/wpa_supplicant -Dwext -ieth0 -c/data/misc/wifi/bcm_supp.conf
  463.     disabled
  464.     oneshot
  465.  
  466. service dhcpcd /system/bin/dhcpcd -BKL eth0
  467.     disabled
  468.     oneshot
  469.  
  470. service ifcfg_eth0 /system/bin/ifconfig eth0 up
  471.     disabled
  472.     oneshot
  473.  
  474. service wlservice /system/bin/wlservice
  475.     disabled
  476.     oneshot
  477. # end of wifi
  478.  
  479. service installd /system/bin/installd
  480.     socket installd stream 600 system system
  481.  
  482. service flash_recovery /system/etc/install-recovery.sh
  483.     oneshot
  484.  
  485. service racoon /system/bin/racoon
  486.     socket racoon stream 600 system system
  487.     # racoon will setuid to vpn after getting necessary resources.
  488.     group net_admin keystore
  489.     disabled
  490.     oneshot
  491.  
  492. service mtpd /system/bin/mtpd
  493.     socket mtpd stream 600 system system
  494.     user vpn
  495.     group vpn net_admin net_raw
  496.     disabled
  497.     oneshot
  498.  
  499. service keystore /system/bin/keystore
  500.     user keystore
  501.     group keystore
  502.     socket keystore stream 666
Latest pastes
13 hours ago
13 hours ago
19 hours ago
19 hours ago
2 days ago