goroh_kun

p-04d init.rc

Jun 12th, 2012
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 16.13 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:/vendorpa/bin
  12.     export LD_LIBRARY_PATH /vendor/lib:/system/lib:/vendorpa/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 0775 system system
  33.     mkdir /mnt/sdcard/safetybox 0000 system system
  34.  
  35. # Create cgroup mount point for cpu accounting
  36.     mkdir /acct
  37.     mount cgroup none /acct cpuacct
  38.     mkdir /acct/uid
  39.  
  40. # Backwards Compat - XXX: Going away in G*
  41.     symlink /mnt/sdcard /sdcard
  42.  
  43.     mkdir /system
  44.     mkdir /data 0771 system system
  45.     mkdir /cache 0770 system cache
  46.     mkdir /config 0500 root root
  47.  
  48.     # Directory for putting things only root should see.
  49.     mkdir /mnt/secure 0700 root root
  50.  
  51.     # Directory for staging bindmounts
  52.     mkdir /mnt/secure/staging 0700 root root
  53.  
  54.     # Directory-target for where the secure container
  55.     # imagefile directory will be bind-mounted
  56.     mkdir /mnt/secure/asec  0700 root root
  57.  
  58.     # Secure container public mount points.
  59.     mkdir /mnt/asec  0700 root system
  60.     mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  61.  
  62.     # Filesystem image public mount points.
  63.     mkdir /mnt/obb 0700 root system
  64.     mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
  65.  
  66.     write /proc/sys/kernel/panic_on_oops 1
  67.     write /proc/sys/kernel/hung_task_timeout_secs 0
  68.     write /proc/cpu/alignment 4
  69.     write /proc/sys/kernel/sched_latency_ns 10000000
  70.     write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  71.     write /proc/sys/kernel/sched_compat_yield 1
  72.     write /proc/sys/kernel/sched_child_runs_first 0
  73.  
  74. # Create cgroup mount points for process groups
  75.     mkdir /dev/cpuctl
  76.     mount cgroup none /dev/cpuctl cpu
  77.     chown system system /dev/cpuctl
  78.     chown system system /dev/cpuctl/tasks
  79.     chmod 0777 /dev/cpuctl/tasks
  80.     write /dev/cpuctl/cpu.shares 1024
  81.  
  82.     mkdir /dev/cpuctl/fg_boost
  83.     chown system system /dev/cpuctl/fg_boost/tasks
  84.     chmod 0777 /dev/cpuctl/fg_boost/tasks
  85.     write /dev/cpuctl/fg_boost/cpu.shares 1024
  86.  
  87.     mkdir /dev/cpuctl/bg_non_interactive
  88.     chown system system /dev/cpuctl/bg_non_interactive/tasks
  89.     chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  90.     # 5.0 %
  91.     write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  92.  
  93. on fs
  94. # mount mtd partitions
  95. # Mount /system ro first not to be changed mount area contents
  96.     mount ext4 /dev/block/platform/mmci-omap-hs.1/by-name/userdata /data wait noatime nosuid nodev
  97.     mount ext4 /dev/block/platform/mmci-omap-hs.1/by-name/cache /cache wait noatime nosuid nodev
  98. #    mount yaffs2 /dev/block/mtdblock11 /ccpu1 nosuid nodev
  99. #    mount yaffs2 /dev/block/mtdblock10 /ccpu nosuid nodev
  100.     mount ext4 /dev/block/platform/mmci-omap-hs.1/by-name/ccpu1 /ccpu1 nosuid nodev
  101.     mount ext4 /dev/block/platform/mmci-omap-hs.1/by-name/ccpu /ccpu nosuid nodev
  102.     mkdir /log
  103. #    mount yaffs2 mtd@log /log nosuid nodev
  104.     mount ext4 /dev/block/platform/mmci-omap-hs.1/by-name/log /log nosuid nodev
  105.     chown system system /log
  106.     chmod 0770 /log
  107.     mkdir /log/shutdownlog 0770 system system
  108. # zantei
  109.     mkdir /ccpu1/ste 0755 system system
  110.     mkdir /ccpu1/ste/modem 0755 system system
  111.     mkdir /ccpu1/ste/modem/sys 0777 system system
  112.     copy /ccpu/ste/modem/normal/sys.txt /ccpu1/ste/modem/sys/sys.txt
  113.     copy /ccpu/ste/modem/normal/gdfsdata.q /ccpu1/ste/modem/sys/gdfsdata.q
  114.     copy /ccpu/ste/modem/normal/gdfsdata.q /ccpu/ste/modem/normal/gdfsdata.q.save
  115.     service set_phone_fs /system/bin/set_1st_powon.sh
  116.         user root
  117.         oneshot
  118. # zantei
  119. #    start set_phone_fs
  120.  
  121. # STE modem fs setting   yamazaki
  122. #    service set_phone_fs /sbin/set_normal_phone_fs.sh
  123. #        user system
  124. #        oneshot
  125.  
  126. on post-fs
  127.     # once everything is setup, no need to modify /
  128.     mount rootfs rootfs / ro remount
  129.  
  130.     # We chown/chmod /data again so because mount is run as root + defaults
  131.     chown system system /data
  132.     chmod 0771 /data
  133.  
  134.     # Create dump dir and collect dumps.
  135.     # Do this before we mount cache so eventually we can use cache for
  136.     # storing dumps on platforms which do not have a dedicated dump partition.
  137.    
  138.     mkdir /data/dontpanic
  139.     chown root log /data/dontpanic
  140.     chmod 0750 /data/dontpanic
  141.  
  142.     # Create SRM-File dir.
  143.     mkdir /data/srm
  144.     chown media secureav /data/srm
  145.     chmod 0770 /data/srm
  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/system 0775 system system
  195.  
  196.     # create dalvik-cache and double-check the perms
  197.     mkdir /data/dalvik-cache 0771 system system
  198.     chown system system /data/dalvik-cache
  199.     chmod 0771 /data/dalvik-cache
  200.  
  201.     # create the lost+found directories, so as to enforce our permissions
  202.     mkdir /data/lost+found 0770
  203.     mkdir /cache/lost+found 0770
  204.  
  205.     # double check the perms, in case lost+found already exists, and set owner
  206.     chown root root /data/lost+found
  207.     chmod 0770 /data/lost+found
  208.     chown root root /cache/lost+found
  209.     chmod 0770 /cache/lost+found
  210.  
  211. on boot
  212. # basic network init
  213.     ifup lo
  214.     hostname localhost
  215.     domainname localdomain
  216.  
  217. # set RLIMIT_NICE to allow priorities from 19 to -20
  218.     setrlimit 13 40 40
  219.  
  220. # Define the oom_adj values for the classes of processes that can be
  221. # killed by the kernel.  These are used in ActivityManagerService.
  222.     setprop ro.FOREGROUND_APP_ADJ 0
  223.     setprop ro.VISIBLE_APP_ADJ 1
  224.     setprop ro.PERCEPTIBLE_APP_ADJ 2
  225.     setprop ro.HEAVY_WEIGHT_APP_ADJ 3
  226.     setprop ro.SECONDARY_SERVER_ADJ 4
  227.     setprop ro.BACKUP_APP_ADJ 5
  228.     setprop ro.HOME_APP_ADJ 6
  229.     setprop ro.HIDDEN_APP_MIN_ADJ 7
  230.     setprop ro.EMPTY_APP_ADJ 15
  231.  
  232. # Define the memory thresholds at which the above process classes will
  233. # be killed.  These numbers are in pages (4k).
  234.     setprop ro.FOREGROUND_APP_MEM 2048
  235.     setprop ro.VISIBLE_APP_MEM 3072
  236.     setprop ro.PERCEPTIBLE_APP_MEM 4096
  237.     setprop ro.HEAVY_WEIGHT_APP_MEM 4096
  238.     setprop ro.SECONDARY_SERVER_MEM 6144
  239.     setprop ro.BACKUP_APP_MEM 6144
  240.     setprop ro.HOME_APP_MEM 6144
  241.     setprop ro.HIDDEN_APP_MEM 7168
  242.     setprop ro.EMPTY_APP_MEM 8192
  243.  
  244. # Write value must be consistent with the above properties.
  245. # Note that the driver only supports 6 slots, so we have combined some of
  246. # the classes into the same memory level; the associated processes of higher
  247. # classes will still be killed first.
  248.     write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15
  249.  
  250.     write /proc/sys/vm/overcommit_memory 1
  251.     write /proc/sys/vm/min_free_order_shift 4
  252.     write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,4096,6144,7168,8192
  253.  
  254.     # Set init its forked children's oom_adj.
  255.     write /proc/1/oom_adj -16
  256.  
  257.     # Tweak background writeout
  258.     write /proc/sys/vm/dirty_expire_centisecs 200
  259.     write /proc/sys/vm/dirty_background_ratio  5
  260.  
  261.     # Permissions for System Server and daemons.
  262.     chown radio system /sys/android_power/state
  263.     chown radio system /sys/android_power/request_state
  264.     chown radio system /sys/android_power/acquire_full_wake_lock
  265.     chown radio system /sys/android_power/acquire_partial_wake_lock
  266.     chown radio system /sys/android_power/release_wake_lock
  267.     chown radio system /sys/power/state
  268.     chown radio system /sys/power/wake_lock
  269.     chown radio system /sys/power/wake_unlock
  270.     chmod 0660 /sys/power/state
  271.     chmod 0660 /sys/power/wake_lock
  272.     chmod 0660 /sys/power/wake_unlock
  273.     chown system system /sys/class/timed_output/vibrator/enable
  274.     chown system system /sys/class/leds/keyboard-backlight/brightness
  275.     chown system system /sys/class/leds/lcd-backlight/brightness
  276.     chown system system /sys/class/leds/button-backlight/brightness
  277.     chown system system /sys/class/leds/jogball-backlight/brightness
  278.     chown system system /sys/class/leds/red/brightness
  279.     chown system system /sys/class/leds/green/brightness
  280.     chown system system /sys/class/leds/blue/brightness
  281.     chown system system /sys/class/leds/red/device/grpfreq
  282.     chown system system /sys/class/leds/red/device/grppwm
  283.     chown system system /sys/class/leds/red/device/blink
  284.     chown system system /sys/class/leds/red/brightness
  285.     chown system system /sys/class/leds/green/brightness
  286.     chown system system /sys/class/leds/blue/brightness
  287.     chown system system /sys/class/leds/red/device/grpfreq
  288.     chown system system /sys/class/leds/red/device/grppwm
  289.     chown system system /sys/class/leds/red/device/blink
  290.     chown system system /sys/class/timed_output/vibrator/enable
  291.     chown system system /sys/module/sco/parameters/disable_esco
  292.     chown system system /sys/kernel/ipv4/tcp_wmem_min
  293.     chown system system /sys/kernel/ipv4/tcp_wmem_def
  294.     chown system system /sys/kernel/ipv4/tcp_wmem_max
  295.     chown system system /sys/kernel/ipv4/tcp_rmem_min
  296.     chown system system /sys/kernel/ipv4/tcp_rmem_def
  297.     chown system system /sys/kernel/ipv4/tcp_rmem_max
  298.     chown root radio /proc/cmdline
  299.  
  300. # Define TCP buffer sizes for various networks
  301. #   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  302.     setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  303.     setprop net.tcp.buffersize.wifi    4095,87380,110208,4096,16384,110208
  304.     setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
  305.     setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
  306.     setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
  307.     setprop net.tcp.buffersize.hsdpa   4096,87380,2097152,4096,16384,1048576
  308.     setprop net.tcp.buffersize.hsupa   4096,87380,2097152,4096,16384,1048576
  309.     write /proc/sys/net/core/rmem_max  2097152
  310.     write /proc/sys/net/core/wmem_max  1048576
  311.  
  312. # Define Emoji Library
  313.     setprop ro.config.libemoji libemoji_docomo.so
  314.  
  315. # wake up Secure OS
  316.     write /proc/nk/fw 1
  317.     write /proc/nk/resume 3
  318.  
  319. # Load SMC
  320.     exec /vendorpa/etc/load.smc.sh
  321.  
  322.     class_start default
  323.  
  324. ## Daemon processes to be run by init.
  325. ##
  326. service ueventd /sbin/ueventd
  327.     critical
  328.  
  329. ## add a nicer shell
  330. service console /system/xbin/ash
  331.     console
  332.     disabled
  333.     user root
  334.     group root
  335.  
  336. on property:ro.secure=0
  337.     start console
  338.  
  339. # adbd is controlled by the persist.service.adb.enable system property
  340. service adbd /sbin/adbd
  341.     disabled
  342.  
  343. # adbd on at boot in emulator
  344. on property:ro.kernel.qemu=1
  345.     start adbd
  346.  
  347. on property:persist.service.adb.enable=1
  348.     start adbd
  349.  
  350. on property:persist.service.adb.enable=0
  351.     stop adbd
  352.  
  353. service init_devadmin /system/vendor/bin/init_devadmin.sh
  354.     user system
  355.     group system
  356.     oneshot
  357.  
  358. service servicemanager /system/bin/servicemanager
  359.     user system
  360.     critical
  361.     onrestart restart zygote
  362.     onrestart restart media
  363.  
  364. service vold /system/bin/vold
  365.     socket vold stream 0660 root mount
  366.     ioprio be 2
  367.  
  368. service netd /system/bin/netd
  369.     socket netd stream 0660 root system
  370.  
  371. service debuggerd /system/bin/debuggerd
  372.  
  373. service ril-daemon /system/bin/rild
  374.     socket rild stream 660 root radio
  375.     socket rild-debug stream 660 radio system
  376.     user root
  377.     group radio cache inet misc audio sdcard_rw
  378.  
  379. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  380.     socket zygote stream 666
  381.     onrestart write /sys/android_power/request_state wake
  382.     onrestart write /sys/power/state on
  383.     onrestart restart media
  384.     onrestart restart netd
  385.  
  386. service media /system/bin/mediaserver
  387.     user media
  388.     group system audio camera graphics inet net_bt net_bt_admin net_raw bluetooth net_admin
  389.     ioprio rt 4
  390.  
  391. service bootanim /system/bin/bootanimation
  392.     user graphics
  393.     group graphics
  394.     disabled
  395.     oneshot
  396.  
  397. service dbus /system/bin/dbus-daemon --system --nofork
  398.     socket dbus stream 660 bluetooth bluetooth
  399.     user bluetooth
  400.     group bluetooth net_bt_admin
  401.  
  402. service bluetoothd /system/bin/bluetoothd -n
  403.     socket bluetooth stream 660 bluetooth bluetooth
  404.     socket dbus_bluetooth stream 660 bluetooth bluetooth
  405.     # init.rc does not yet support applying capabilities, so run as root and
  406.     # let bluetoothd drop uid to bluetooth with the right linux capabilities
  407.     group bluetooth net_bt_admin misc
  408.     disabled
  409.  
  410. service hfag /system/bin/sdptool add --channel=10 HFAG
  411.     user bluetooth
  412.     group bluetooth net_bt_admin
  413.     disabled
  414.     oneshot
  415.  
  416. service hsag /system/bin/sdptool add --channel=11 HSAG
  417.     user bluetooth
  418.     group bluetooth net_bt_admin
  419.     disabled
  420.     oneshot
  421.  
  422. service opush /system/bin/sdptool add --channel=12 OPUSH
  423.     user bluetooth
  424.     group bluetooth net_bt_admin
  425.     disabled
  426.     oneshot
  427.  
  428. service pbap /system/bin/sdptool add --channel=19 PBAP
  429.     user bluetooth
  430.     group bluetooth net_bt_admin
  431.     disabled
  432.     oneshot
  433.  
  434. service installd /system/bin/installd
  435.     socket installd stream 600 system system
  436.  
  437. service flash_recovery /system/etc/install-recovery.sh
  438.     oneshot
  439.  
  440. service racoon /system/bin/racoon
  441.     socket racoon stream 600 system system
  442.     # racoon will setuid to vpn after getting necessary resources.
  443.     group net_admin
  444.     disabled
  445.     oneshot
  446.  
  447. service mtpd /system/bin/mtpd
  448.     socket mtpd stream 600 system system
  449.     user vpn
  450.     group vpn net_admin net_raw
  451.     disabled
  452.     oneshot
  453.  
  454. service keystore /system/bin/keystore /data/misc/keystore
  455.     user keystore
  456.     group keystore
  457.     socket keystore stream 666
  458.  
  459. service dumpstate /system/bin/dumpstate -s
  460.     socket dumpstate stream 0660 shell log
  461.     disabled
  462.     oneshot
  463.  
  464. # fota service
  465. service fotaservice /system/bin/fotaservice
  466.     user root
  467.     group root
  468.     onrestart restart fotaservice
  469.  
  470. # vcryptd daemon
  471. service vcryptd /system/bin/vcryptd
  472.     user root
  473.     group root
  474.  
  475. # vasd daemon
  476. service vasd /system/bin/vasd
  477.     user root
  478.     group root
Add Comment
Please, Sign In to add comment